Inserts items in front of array.
rough method: unset and then set, think of better.
556890
public static function insertLast(array $array, array $items)
    {
        foreach ($items as $k => $v) {
            unset($array[$k]);
        }
        foreach ($items as $k => $v) {
            $array[$k] = $v;
        }

        return $array;
    }
69661
@NonNull
    @Override
    public MutableArray insertArray(int index, Array value) {
        return insertValue(index, value);
    }
885092
def insert(self, index, item):
        # type: (int, Any) -> None
        
        return list.insert(self, index, self.ref(item))
1282952
def insert(self, key, value):
        ''''''

        # Add to history and catch expectorate
        if len(self.history) == self.maxsize:
            expectorate = self.history[0]
        else:
            expectorate = None

        self.history.append((key, value))

        # Add to the appropriate list of values
        if key in self:
            super().__getitem__(key).append(value)
        else:
            super().__setitem__(key, [value])

        # Clean up old values
        if expectorate is not None:
            old_key, old_value = expectorate
            super().__getitem__(old_key).pop(0)
            if len(super().__getitem__(old_key)) == 0:
                super().__delitem__(old_key)

            return (old_key, old_value)
1113538
function add(items) {
    var self = this;
    var children = self.get('children');
    if (Util.isArray(items)) {
      Util.each(items, function (item) {
        var parent = item.get('parent');
        if (parent) {
          parent.removeChild(item, false);
        }
        self._setCfgProperty(item);
      });
      self._cfg.children = children.concat(items);
    } else {
      var item = items;
      var parent = item.get('parent');
      if (parent) {
        parent.removeChild(item, false);
      }
      self._setCfgProperty(item);
      children.push(item);
    }
    return self;
  }
1347205
function( array, newItem, nextSiblingId, recurse, nullIfNotFound ) {
			if ( nextSiblingId ) {
				for ( var i = 0, item;
				( item = array[ i ] ); i++ ) {
					if ( item.id == nextSiblingId ) {
						array.splice( i, 0, newItem );
						return newItem;
					}

					if ( recurse && item[ recurse ] ) {
						var retval = addById( item[ recurse ], newItem, nextSiblingId, recurse, true );
						if ( retval )
							return retval;
					}
				}

				if ( nullIfNotFound )
					return null;
			}

			array.push( newItem );
			return newItem;
		}
74907
def insert_before(self, value: Union[RawValue, Value],
                      raw: bool = False) -> "ArrayEntry":
        
        return ArrayEntry(self.index, self.before, self.after.cons(self.value),
                          self._cook_value(value, raw), self.parinst,
                          self.schema_node, datetime.now())
1134378
def insert(self, index, key):
    
    if key in self.map:
        return
    # compute the right index
    size = len(self.items)
    if index < 0:
        index = size + index if size + index > 0 else 0
    else:
        index = index if index < size else size
    # insert the value
    self.items.insert(index, key)
    for k, v in self.map.items():
        if v >= index:
            self.map[k] = v + 1
    self.map[key] = index
217065
function insert (getValue, item, list) {
    var index = binaryIndexBy(getValue, getValue(item), list);

    list.splice(index, 0, item);
    return item;
  }
935775
def insert(self, index, value):
        """"""
        return super(Collection, self).insert(
            index, self._ensure_value_is_valid(value))
728151
private function array_insert(mixed $object, string $key, int $position) : void
    {
        if (0 == count($this->members)) {
            // The array is empty so just add the item
            $this->members[$key] = $object;
        } elseif ($position == count($this->members)) {
            // The item goes at the end of the array
            $this->members[$key] = $object;
        } else {
            $this->members = array_slice($this->members, 0, $position,
                    true) + array($key => $object) + array_slice($this->members, $position, null, true);
        }
    }
747006
function insert(values, returning) {
    this._method = 'insert';
    if (!isEmpty(returning)) {
      this.returning(returning);
    }
    this._single.insert = values;
    return this;
  }
975216
function(items) {
            items = $.makeArray(items);

            for (var i = 0; i < items.length; i++) {
                var item = items[i];

                // Make sure we actually know about this item
                var index = $.inArray(item, this.$items);
                if (index !== -1) {
                    this._deinitItem(item);
                    this.$items.splice(index, 1);
                }
            }
        }
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)
1279828
function(items) {
            if(!items) return;
            if(!this.settings.items) this.settings.items = [];
            if(!$.isArray(items)) items = [items];
            this.settings.items = this.settings.items.concat(items);

            this.destroy();
            this.init();
        }
394887
def append(self, item):
        
        if item in self:
            self.items[item[0]].append(item[1])
        else:
            self.items[item[0]] = [item[1]]
793485
function(items){
      var delta = this.set(items) || {};
      var deleted = delta.deleted;

      Dataset.setAccumulateState(true);
      if (deleted)
        for (var i = 0, object; object = deleted[i]; i++)
          object.destroy();
      Dataset.setAccumulateState(false);

      return delta.inserted;
    }