Create a module item.

        Create and return a new module item
171921
def create_module_item(self, course_id, module_id, module_item_type, module_item_content_id, module_item_completion_requirement_min_score=None, module_item_completion_requirement_type=None, module_item_external_url=None, module_item_indent=None, module_item_new_tab=None, module_item_page_url=None, module_item_position=None, module_item_title=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # REQUIRED - PATH - module_id
        """ID"""
        path["module_id"] = module_id

        # OPTIONAL - module_item[title]
        """The name of the module item and associated content"""
        if module_item_title is not None:
            data["module_item[title]"] = module_item_title

        # REQUIRED - module_item[type]
        """The type of content linked to the item"""
        self._validate_enum(module_item_type, ["File", "Page", "Discussion", "Assignment", "Quiz", "SubHeader", "ExternalUrl", "ExternalTool"])
        data["module_item[type]"] = module_item_type

        # REQUIRED - module_item[content_id]
        """The id of the content to link to the module item. Required, except for
        'ExternalUrl', 'Page', and 'SubHeader' types."""
        data["module_item[content_id]"] = module_item_content_id

        # OPTIONAL - module_item[position]
        """The position of this item in the module (1-based)."""
        if module_item_position is not None:
            data["module_item[position]"] = module_item_position

        # OPTIONAL - module_item[indent]
        """0-based indent level; module items may be indented to show a hierarchy"""
        if module_item_indent is not None:
            data["module_item[indent]"] = module_item_indent

        # OPTIONAL - module_item[page_url]
        """Suffix for the linked wiki page (e.g. 'front-page'). Required for 'Page'
        type."""
        if module_item_page_url is not None:
            data["module_item[page_url]"] = module_item_page_url

        # OPTIONAL - module_item[external_url]
        """External url that the item points to. [Required for 'ExternalUrl' and
        'ExternalTool' types."""
        if module_item_external_url is not None:
            data["module_item[external_url]"] = module_item_external_url

        # OPTIONAL - module_item[new_tab]
        """Whether the external tool opens in a new tab. Only applies to
        'ExternalTool' type."""
        if module_item_new_tab is not None:
            data["module_item[new_tab]"] = module_item_new_tab

        # OPTIONAL - module_item[completion_requirement][type]
        """Completion requirement for this module item.
        "must_view": Applies to all item types
        "must_contribute": Only applies to "Assignment", "Discussion", and "Page" types
        "must_submit", "min_score": Only apply to "Assignment" and "Quiz" types
        Inapplicable types will be ignored"""
        if module_item_completion_requirement_type is not None:
            self._validate_enum(module_item_completion_requirement_type, ["must_view", "must_contribute", "must_submit"])
            data["module_item[completion_requirement][type]"] = module_item_completion_requirement_type

        # OPTIONAL - module_item[completion_requirement][min_score]
        """Minimum score required to complete. Required for completion_requirement
        type 'min_score'."""
        if module_item_completion_requirement_min_score is not None:
            data["module_item[completion_requirement][min_score]"] = module_item_completion_requirement_min_score

        self.logger.debug("POST /api/v1/courses/{course_id}/modules/{module_id}/items with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/courses/{course_id}/modules/{module_id}/items".format(**path), data=data, params=params, single_item=True)
229560
def create(self, name, description, **attrs):
        
        attrs.update({'name': name, 'description': description})
        return self._new_resource(payload=attrs)
142149
def create(handler, item_document):
    """"""
    data = {'operation': 'create',
            'item': json.load(item_document)}
    handler.invoke(data)
1172498
function(item, ItemViewType, itemViewOptions){
    var options = _.extend({model: item}, itemViewOptions);
    return new ItemViewType(options);
  }
286152
async def create(self, model_, **data):
        
        inst = model_(**data)
        query = model_.insert(**dict(inst.__data__))

        pk = await self.execute(query)
        if inst._pk is None:
            inst._pk = pk
        return inst
1135008
def create(self, **kwargs):
        
        obj = self.model(**kwargs)
        obj.save(force_insert=True, using=self._using)
        return obj
705812
def add(self, attr, item):
        
        return self.set(attr, operation.Add([item]))
1187769
def create(self, module_name, class_name,
               args=None, kwargs=None, factory_method=None,
               factory_args=None, factory_kwargs=None, static=False,
               calls=None):
        
        if args is None:
            args = []
        if kwargs is None:
            kwargs = {}
        if factory_args is None:
            factory_args = []
        if factory_kwargs is None:
            factory_kwargs = {}
        if static is None:
            static = False

        # Verify
        _verify_create_args(module_name, class_name, static)

        # Import
        module = _import_module(module_name)

        # Instantiate
        service_obj = self._instantiate(module, class_name,
                                        args, kwargs, static)
        # Factory?
        if factory_method is not None:
            service_obj = self._handle_factory_method(service_obj,
                                                      factory_method,
                                                      factory_args,
                                                      factory_kwargs)
        # Extra Calls
        if calls is not None and isinstance(calls, list):
            self._handle_calls(service_obj, calls)

        # Return
        return service_obj
139786
def createItem( self ):
        
        if not self.isEditable():
            return None
        
        if self._createItem is None:
            self.blockSignals(True)
            
            self._createItem = XMultiTagCreateItem(self)
            self.addItem(self._createItem)
            
            self.blockSignals(False)
        
        return self._createItem
95622
function createModule(filename) {
  const mod = new Module(filename)
  mod.filename = filename
  mod.paths = Module._nodeModulePaths(path.dirname(filename))
  return mod
}
1253884
function create(item, model, data) {
    var serverProps = serverProperties(item, model, data).properties;
    return utils.socketPut(model.io, model.url + '/create/', serverProps).then(function(response) {
        _.merge(serverProps, response);
        return update(item, model, serverProps);
    }).then(function() {
        // Refresh all items that were referenced - some of their properties might change
        return Promise.all(_.map(serverProps.refresh, function(item) {
            return item.refresh();
        }));
    });
}
793309
def add_item(self, path, name, icon=None, url=None, order=None, permission=None, active_regex=None):
        
        if self.root_item is None:
            self.root_item = MenuItem('ROOT', 'ROOT')

        root_item = self.root_item
        current_path = ''
        for node in path.split('/')[:-1]:
            if not node:
                continue

            current_path = '/' + '{}/{}'.format(current_path, node).strip('/')
            new_root = root_item.child_by_code(node)
            if not new_root:  # Create menu item if not exists
                new_root = MenuItem(current_path, name=str(node).capitalize())
                root_item.add_child(new_root)
            root_item = new_root

        new_item = MenuItem(path, name, icon, url, order, permission, active_regex)

        current_item = root_item.child_by_code(path.split('/')[-1])
        if current_item:
            current_item.merge(new_item)
        else:
            root_item.add_child(new_item)
1069045
def create_and_add(self, key, value=None, cas=0, **options):
        
        itm = Item(key, value)
        itm.cas = cas
        return self.add(itm, **options)
1042345
def create(self, name, data=None):
        
        return createPacket(self[name], data) if name in self else None
1013189
def create_item(self, **kwargs):
        
        item, created = self.queryset.model.objects.get_or_create(**kwargs)
        return item
706700
def _insert_item(self, key, new_item, instance, is_after):
        """"""
        index = self._get_index_for_insert(key, instance)
        index = index + 1 if is_after else index
        self.__items = self.__items[:index] + new_item + self.__items[index:]
        # Make sure indexing works with new items
        for new_key, new_value in new_item:
            if new_key in self:
                value_list = [val for k, val in self.__items if k == new_key]
                dict_setitem(self, new_key, value_list)
            else:
                dict_setitem(self, new_key, [new_value])
746270
def _construct_module(info, target):
    """"""

    for path in paths:
        real_path = os.path.abspath(os.path.join(target, path.format(**info)))
        log("Making directory '%s'" % real_path)
        os.makedirs(real_path)

    # pprint(info)
    for item in templates.values():
        source = os.path.join('dev/templates', item[0])
        filename = os.path.abspath(
            os.path.join(target, item[1].format(**info)))
        log("Creating file from template '%s'" % filename,
            emitter='MANAGE')
        write_template_file(source, filename, info)