add a new Item class object
173836
def addItem(self, item, message=None):
        """"""
        if message is None:
            message = 'Adding item %s' % item.path
        try:
            v = Version.new(repo=self)
            v.addItem(item)
            v.save(message)
        except VersionError, e:
            raise RepoError(e)
780418
def addItem(self, itemType, itemContents, itemID=None):
        

        if itemType not in self.noteDB.collection_names():
            fields = [(ii, pymongo.TEXT) for ii in itemContents]
            self.noteDB[itemType].ensure_index(fields)

        collection = self.noteDB[itemType]

        if itemID is None:
            itemContents['timestamps'] = [time.time()]
            itemID = self.getNewID()
            itemContents["ID"] = itemID
            collection.insert(itemContents)
        else:
            _id = collection.find_one({"ID": itemID})["_id"]
            timestamps = collection.find_one({"ID": itemID})["timestamps"]
            timestamps.append(time.time())
            itemContents["timestamps"] = timestamps
            itemContents["ID"] = itemID
            collection.update({"_id": _id}, itemContents)

        return itemID
1331005
def _add_item_manager(self, key, item_class, **paths):
        '''
        
        '''
        updated_paths = {}
        for path_type, path_value in paths.iteritems():
            updated_paths[path_type] = path_value.format(**self.__dict__)

        manager = Redmine_Items_Manager(self._redmine, item_class,
                                        **updated_paths)
        self.__dict__[key] = manager
639105
def add(self, item):
        
        if self._is_stringable(item) or self._is_qstring(item):
            self.items.append(PlainText(item))
        elif isinstance(item, MessageElement):
            self.items.append(item)
        elif item is None or (hasattr(item, 'isNull') and item.isNull()):
            self.items.append(PlainText(
                tr('Null (None) found from the data.')))
        elif isinstance(item, tuple) or isinstance(item, list):
            for i in item:
                # Recursive call
                self.add(i)
        else:
            raise InvalidMessageItemError(item, item.__class__)
640728
def addChild(self, item):
        
        super(XGanttWidgetItem, self).addChild(item)
        
        item.sync()
209415
def add_to_class(self, cls, name):
        '''
        
        '''
        self.model_class = cls
        setattr(cls, name, PhoneNumberDescriptor(self))
        self._bound = True
523289
def add(self, item):
        ""
        for pos in self._hashes(item):
            self.hash |= (2 ** pos)
337519
def <<(item)
    if(item.kind_of? Zyps::GameObject)
      self.add_object(item)
    elsif(item.kind_of? Zyps::EnvironmentalFactor)
      self.add_environmental_factor(item)
    else
      raise "Invalid item: #{item.class}" 
    end
    self
  end
1047724
private <T extends NameBearer> void addItem(T item, Map<String, T> items, String typeName) {
		String itemName = item.getName();
		if (items.containsKey(itemName)) {
			throw new FuzzerException(name + ": '" + itemName + "' already present in " + typeName);
		}
		items.put(itemName, item);
	}
1159296
def refresh(self, item):
        
        client = self._clients[item].get_client()
        self[item] = val = self.item_class(client)
        return val
444615
def create_items(sender, instance, **kwargs):
    
    if instance.item_id is None and instance.item is None:
        item = Item()
        if hasattr(instance, 'active'):
            item.active = getattr(instance, 'active')
        item.save()
        instance.item = item
388802
def append_item(self, item):
        """"""
        if not isinstance(item, LR0Item):
            raise TypeError
        self.itemlist.append(item)
579625
def extend(self, item):
        """"""
        if not isinstance(item, list):
            raise TypeError(
                'You can only extend lists with lists. '
                'You supplied \"%s\"' % type(item))
        for entry in item:
            if not isinstance(entry, str):
                raise TypeError(
                    'Members of this object must be strings. '
                    'You supplied \"%s\"' % type(entry))
            list.append(self, entry)
652947
def append(self, item):
        
        if isinstance(item, list):
            self.extend(item)
        elif not self:
            list.append(self, item)
        elif item.__class__ == self[0].__class__:
            list.append(self, item)
        else:
            raise exceptions.WrongListItemType(item.__class__.__name__,
                                               self[0].__class__.__name__)
446929
def create(self, item, dry_run=None):
        """"""
        logger.debug('Creating new item. Item: {item} Path: {data_file}'.format(
            item=item,
            data_file=self.data_file
        ))

        items = load_file(self.client, self.bucket_name, self.data_file)
        items = append_item(self.namespace, self.version, item, items)
        save_file(self.client, self.bucket_name, self.data_file, items, dry_run=dry_run)

        return item
870220
def add_class(cls, *args):
        
        for cls2 in args:
            cls.classes[cls2.__name__] = cls2
291448
def add_child(self, item):
        """"""
        item.depth = self.depth + 1
        self.childs.append(item)
        self.childs = sorted(self.childs, key=lambda item: item.order if item.order else 999)