Insert an item at the specified position in the list.

        :param position: The position to insert the item at
        :param item: The item to be added
        :param select: Whether the item should be selected after adding
549772
def insert(self, position, item, select=False):
        
        if item in self:
            raise ValueError("item %s already in list" % item)
        modeliter = self.model.insert(position, (item,))
        self._id_to_iter[id(item)] = modeliter
        if select:
            self.selected_item = item
        self.emit('item-inserted', item, position)
437464
def insert(self, index, key, value):
        """"""
        if key in self.keyOrder:
            n = self.keyOrder.index(key)
            del self.keyOrder[n]
            if n < index:
                index -= 1
        self.keyOrder.insert(index, key)
        super(SortedDict, self).__setitem__(key, value)
349186
function insertAt(items, item, index) {
  var copy = items.slice();
  copy.splice(index, 0, item);
  return copy;
}
589632
public FastAdapterDialog<Item> add(int position, List<Item> items) {
        mItemAdapter.add(position, items);
        return this;
    }
1078840
def add_select(self, *column):
        
        if not column:
            column = []

        self.columns += list(column)

        return self
1084932
def put(self, item):
        ''' 
        '''
        if isinstance(item, self._item_class):
            self._put_one(item)
        elif isinstance(item, (list, tuple)):
            self._put_many(item)
        else:
            raise RuntimeError('Unknown item(s) type, %s' % type(item))
993042
def insert_after(self, key, new_item, instance=0):
        """"""
        self._insert_item(key, new_item, instance, True)
1220386
def insert_at(position = 1)
      list_class.transaction do
        ids = lock_list!
        position = [[1, position].max, ids.size].min

        if persisted?
          current_position = ids.index(id) + 1

          sql = <<-SQL
            #{quoted_position_column} = CASE
            WHEN #{quoted_position_column} = #{current_position} THEN #{position}
            WHEN #{quoted_position_column} > #{current_position}
            AND #{quoted_position_column} <= #{position} THEN #{quoted_position_column} - 1
            WHEN #{quoted_position_column} < #{current_position}
            AND #{quoted_position_column} >= #{position} THEN #{quoted_position_column} + 1
            ELSE #{quoted_position_column}
            END
          SQL

          list_scope.update_all(sql)
          update_position(position)
        else
          save!

          sql = <<-SQL
            #{quoted_position_column} = CASE
            WHEN #{quoted_position_column} >= #{position} THEN #{quoted_position_column} + 1
            ELSE #{quoted_position_column}
            END
          SQL

          list_scope.update_all(sql)
          update_position(position)
        end
      end
    end
993232
def select_option(self, option):
        
        items_list = self.get_options()
        for item in items_list:
            if item.get_attribute("value") == option:
                item.click()
                break
520372
def insertItem(self, childItem, position=None, parentIndex=None):
        
        if parentIndex is None:
            parentIndex=QtCore.QModelIndex()

        parentItem = self.getItem(parentIndex, altItem=self.invisibleRootItem)

        nChildren = parentItem.nChildren()
        if position is None:
            position = nChildren

        assert 0 <= position <= nChildren, \
            "position should be 0 < {} <= {}".format(position, nChildren)

        self.beginInsertRows(parentIndex, position, position)
        try:
            parentItem.insertChild(childItem, position)
        finally:
            self.endInsertRows()

        childIndex = self.index(position, 0, parentIndex)
        assert childIndex.isValid(), "Sanity check failed: childIndex not valid"
        return childIndex
394887
def append(self, item):
        
        if item in self:
            self.items[item[0]].append(item[1])
        else:
            self.items[item[0]] = [item[1]]
1343911
def _select_position(self, width, height):
        
        positions = self._generate_placements(width, height)
        if self.rot and width != height:
            positions += self._generate_placements(height, width)
        if not positions:
            return None, None
        return min(((p[0], self._rect_fitness(*p))for p in positions), 
                key=operator.itemgetter(1))
1029173
public static function array_insert(&$array, $item, $position) {
        if ($position == 0) {
            /* Prepend the item */
            array_unshift($array, $item);
        } else {
            if (count($array) == $position) {
                $array[] = $item;
            } else {
                array_splice($array, $position, 0, array($item));
            }
        }
    }
240781
public FastItemAdapter<Item> set(int position, Item item) {
        getItemAdapter().set(position, item);
        return this;
    }
668260
@SafeVarargs
    public final FastItemAdapter<Item> add(int position, Item... items) {
        getItemAdapter().add(position, items);
        return this;
    }
1261611
def append(self, item):
        
        with self.lock:
            with self._closeable_cursor() as cursor:
                cursor.execute('''INSERT INTO list (list_index, value) VALUES ((SELECT MAX(list_index) FROM list) + 1, ?)''', (self._coder(item), ) )
            self._do_write()
355823
def add_item(self, item):
        
        self.items.append(item)
        self.last_updated = datetime.datetime.now()