Inserts the key, value pair before the item with the given index.
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)
846222
def insert(self, var, value, index=None):
        
        current = self.__get(var)
        if not isinstance(current, list):
            raise KeyError("%s: is not a list" % var)
        if index is None:
            current.append(value)
        else:
            current.insert(index, value)
        if self.auto_save:
            self.save()
1247459
private void onKeyUpdated(final int index, final Map.Entry<String, String> object, final String value) {
        final HashMap<String, String> _m = new LinkedHashMap<String, String>(getValue());
        final String lastKeyValue = object.getKey();
        String mapValue = "";
        if (lastKeyValue != null) {
            mapValue = _m.remove(lastKeyValue);
        }
        _m.put(value, mapValue);
        setValue(_m, true);
    }
531683
def insert_before(old, new):
    
    parent = old.getparent()
    parent.insert(parent.index(old), new)
1224757
@SuppressWarnings("unchecked")
    public V put(Integer key, V value) {

	int k = checkKey(key);
	int index = Arrays.binarySearch(keyIndices, k);

	if (index >= 0) {
	    V old = (V)(values[index]);
	    values[index] = value;
	    return old;
	}
	else {
	    int newIndex = 0 - (index + 1);	    
	    Object[] newValues = Arrays.copyOf(values, values.length + 1);
	    int[] newIndices = Arrays.copyOf(keyIndices, values.length + 1);

	    // shift the elements down to make room for the new value
	    for (int i = newIndex; i < values.length; ++i) {
		newValues[i+1] = values[i];
		newIndices[i+1] = keyIndices[i];
	    }

	    // insert the new value
	    newValues[newIndex] = value;
	    newIndices[newIndex] = k;

	    // switch the arrays with the lengthed versions
	    values = newValues;
	    keyIndices = newIndices;
	    
	    return null;
	}
    }
1077723
def insert_ordered(value, array):
    

    index = 0

    # search for the last array item that value is larger than
    for n in range(0,len(array)):
        if value >= array[n]: index = n+1

    array.insert(index, value)
    return index
307213
public void insert(StringBuilder buffer, Object value, int index) {
        if (buffer == null) {
            throw new NullPointerException("buffer");
        }

        buffer.insert(index, value);
    }
448559
def insert(self, index, item):
        
        if not is_any(item):
            raise MemberTypeError(self, item, member=len(self))
        self._data.insert(index, item)
1108181
def insert(index, value)
      node = self
      cidx = nil

      # Traverse the tree to find the right node to add or replace the value.
      while node do
        # All nodes that we find on the way that are full will be split into
        # two half-full nodes.
        if node.size >= @tree.node_size
          # Re-add the index from the last parent node since we will descent
          # into one of the split nodes.
          index += node.parent.offsets[cidx] if node.parent
          node = node.split_node
        end

        # Once we have reached a leaf node we can insert or replace the value.
        if node.is_leaf?
          node.values.insert(index, value)
          node.parent.adjust_offsets(node, 1) if node.parent
          return
        else
          # Descend into the right child node to add the value to.
          cidx = node.search_child_index(index)
          if (index -= node.offsets[cidx]) < 0
            node.fatal "Index (#{index}) became negative"
          end
          node = node.children[cidx]
        end
      end

      node.fatal "Could not find proper node to insert the value while " +
        "looking for index #{index}"
    end
95415
def insert(index, middleware, *args, &block)
      index = self.index(index) unless index.is_a?(Integer)
      raise "no such middleware to insert before: #{index.inspect}" unless index
      stack.insert(index, [middleware, args, block])
    end
1353568
def insert_data_item(self, before_index, data_item, auto_display: bool = True) -> None:
        
        assert data_item is not None
        assert data_item not in self.data_items
        assert before_index <= len(self.data_items) and before_index >= 0
        assert data_item.uuid not in self.__uuid_to_data_item
        # update the session
        data_item.session_id = self.session_id
        # insert in internal list
        self.__insert_data_item(before_index, data_item, do_write=True)
        # automatically add a display
        if auto_display:
            display_item = DisplayItem.DisplayItem(data_item=data_item)
            self.append_display_item(display_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)
349186
function insertAt(items, item, index) {
  var copy = items.slice();
  copy.splice(index, 0, item);
  return copy;
}
226615
public StrBuilder insert(int index, char c) {
		moveDataAfterIndex(index, 1);
		value[index] = c;
		this.position = Math.max(this.position, index) + 1;
		return this;
	}
305523
public StrBuilder insert(final int index, final char value) {
        validateIndex(index);
        ensureCapacity(size + 1);
        System.arraycopy(buffer, index, buffer, index + 1, size - index);
        buffer[index] = value;
        size++;
        return this;
    }
247971
@SuppressWarnings("unchecked")
    public V put(final int key, final V value) {
        checkNotNull(value, "Value cannot be null");
        V oldValue = null;
        int index = intHash(key, mask);
        while (null != values[index]) {
            if (key == keys[index]) {
                oldValue = (V) values[index];
                break;
            }
            index = ++index & mask;
        }
        if (null == oldValue) {
            ++size;
            keys[index] = key;
        }
        values[index] = value;
        if (size > resizeThreshold) {
            increaseCapacity();
        }
        return oldValue;
    }
685415
function(key, value)
  {
    if ( key in this.indices )
    {
      this.values[ this.indices[ key ] ] = value;
    }
    else
    {
      this.indices[ key ] = this.values.length;
      AP.push.call( this.values, value );
      AP.push.call( this.keys, key );
    }

    return this;
  }