Add additional item to the book. If not defined, media type and chapter id will be defined
        for the item.

        :Args:
          - item: Item instance
13723
def add_item(self, item):
        
        if item.media_type == '':
            (has_guessed, media_type) = guess_type(item.get_name().lower())

            if has_guessed:
                if media_type is not None:
                    item.media_type = media_type
                else:
                    item.media_type = has_guessed
            else:
                item.media_type = 'application/octet-stream'

        if not item.get_id():
            # make chapter_, image_ and static_ configurable
            if isinstance(item, EpubHtml):
                item.id = 'chapter_%d' % self._id_html
                self._id_html += 1
                # If there's a page list, append it to the book's page list
                self.pages += item.pages
            elif isinstance(item, EpubImage):
                item.id = 'image_%d' % self._id_image
                self._id_image += 1
            else:
                item.id = 'static_%d' % self._id_image
                self._id_image += 1

        item.book = self
        self.items.append(item)

        return item
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)
179069
def add(self, item):
        
        check_not_none(item, "item can't be none")
        return self._encode_invoke(transactional_list_add_codec, item=self._to_data(item))
515052
def extend(self, *args, **kwargs):
        
        self._extend(args, kwargs, 'extend', self._extend_items)
674415
def add_to_shelf(book_id, shelf_name, options = {})
      options = options.merge(book_id: book_id, name: shelf_name, v: 2)
      data = oauth_request_method(:post, "/shelf/add_to_shelf.xml", options)

      # when a book is on a single shelf it is a single hash
      shelves = data["my_review"]["shelves"]["shelf"]
      shelves = [shelves] unless shelves.instance_of?(Array)
      shelves = shelves.map do |s|
        Hashie::Mash.new({
          id:             s["id"].to_i,
          name:           s["name"],
          exclusive:      s["exclusive"] == "true",
          sortable:       s["sortable"] == "true",
        })
      end

      Hashie::Mash.new(
        id: data["my_review"]["id"].to_i,
        book_id: data["my_review"]["book_id"].to_i,

        rating: data["my_review"]["rating"].to_i,
        body: data["my_review"]["body"],
        body_raw: data["my_review"]["body_raw"],
        spoiler: data["my_review"]["spoiler_flag"] == "true",

        shelves: shelves,

        read_at: data["my_review"]["read_at"],
        started_at: data["my_review"]["started_at"],
        date_added: data["my_review"]["date_added"],
        updated_at: data["my_review"]["updated_at"],
      )
    end
398507
def add_item(xml, item, index)
      xml.tag! 'Item', :num => index do
        xml.tag! 'Code', item[:sku]
        xml.tag! 'Quantity', item[:quantity]
      end
    end
433103
def add_chapter(self, title):
        '''
        
        '''
        chap_id = 'chap%s' % self.chap_counter
        self.chap_counter += 1
        self.sidebar += '<a href="#%s" class="list-group-item">%s</a>\n' % (
            chap_id, title)
        self.body += '<h1 id="%s">%s</h1>\n' % (chap_id, title)
929762
def append(self, item):
    
    if self.should_flush():
      self.flush()
    self.items.append(item)
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__)
1287113
public void addItem (int index, T item)
    {
        if (_items == null) {
            return;
        }
        _items.add(index, item);
    }
868853
def add_item(self, title, link, description, author_email=None,
        author_name=None, author_link=None, pubdate=None, comments=None,
        unique_id=None, enclosure=None, categories=(), item_copyright=None,
        ttl=None, **kwargs):
        
        to_unicode = lambda s: force_text(s, strings_only=True)
        if categories:
            categories = [to_unicode(c) for c in categories]
        if ttl is not None:
            # Force ints to unicode
            ttl = force_text(ttl)
        item = {
            'title': to_unicode(title),
            'link': iri_to_uri(link),
            'description': to_unicode(description),
            'author_email': to_unicode(author_email),
            'author_name': to_unicode(author_name),
            'author_link': iri_to_uri(author_link),
            'pubdate': pubdate,
            'comments': comments,
            'unique_id': to_unicode(unique_id),
            'enclosure': enclosure,
            'categories': categories or (),
            'item_copyright': to_unicode(item_copyright),
            'ttl': ttl,
        }
        item.update(kwargs)
        self.items.append(item)
77804
def add_data_item(self, data_item: DataItem) -> None:
        
        display_item = data_item._data_item.container.get_display_item_for_data_item(data_item._data_item) if data_item._data_item.container else None
        if display_item:
            self.__data_group.append_display_item(display_item)
341518
def append(self, item):
        
        if isinstance(item, Composite):
            self._content += item.get_content()
        elif isinstance(item, list):
            self._content += item
        elif isinstance(item, dict):
            self._content.append(item)
        elif isinstance(item, basestring):
            self._content.append({"full_text": item})
        else:
            msg = "{!r} not suitable to append to Composite"
            raise Exception(msg.format(item))
507389
def updateItemIcon(self, item):
        
        # update the column width
        self.setUpdatesEnabled(False)
        colwidth = self.columnWidth(0)
        self.resizeColumnToContents(0)
        new_colwidth = self.columnWidth(0)
        
        if new_colwidth < colwidth:
            self.setColumnWidth(0, colwidth)
        self.setUpdatesEnabled(True)
56468
def add_book(self, body, doc_type='book'):
        '''
        
        '''
        body = validate_book(body)
        body['_insertion_date'] = current_time_millisec()
        return self.es.index(index=self.index_name, doc_type=doc_type, body=body)
148454
def add_item(self, item, field_name=None):
        
        field_name = self._choose_field_name(field_name)
        related_manager = getattr(item, field_name)
        related_manager.add(self)
727851
def _make_item(model):
    
    item = Item(model.id, model.content, model.media_type)
    return item