def create_object(container, portal_type, **data):
if "<STR_LIT:id>" in data:<EOL><INDENT>id = data.pop("<STR_LIT:id>")<EOL>logger.warn("<STR_LIT>"<EOL>"<STR_LIT>" .format(id))<EOL><DEDENT>try:<EOL><INDENT>if portal_type == "<STR_LIT>":<EOL><INDENT>obj = create_analysisrequest(container, **data)<EOL>data = u.omit(data, "<STR_LIT>", "<STR_LIT>")<EOL>data["<STR_LIT>"] = container<EOL><DEDENT>else:<EOL><INDENT>obj = api.create(container, portal_type)<EOL><DEDENT><DEDENT>except Unauthorized:<EOL><INDENT>fail(<NUM_LIT>, "<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>update_object_with_data(obj, data)<EOL><DEDENT>except APIError:<EOL><INDENT>container.manage_delObjects(obj.id)<EOL>raise<EOL><DEDENT>return obj<EOL>
Creates an object slug

    :returns: The new created content object
    :rtype: object