Push an ``element`` into the datastrucutre together with its value
           and only save it if it currently is one of the top n elements.

           Drop elements if necessary.
177983
def push(self, element, value):
        
        insert_pos = 0
        for index, el in enumerate(self.tops):
            if not self.find_min and el[1] >= value:
                insert_pos = index+1
            elif self.find_min and el[1] <= value:
                insert_pos = index+1
        self.tops.insert(insert_pos, [element, value])
        self.tops = self.tops[:self.n]
1000271
function push(element) {
    /* jshint validthis:true */
    var i;

    if (arguments.length === 1) {
        pushSingle(this, element);
    } else {
        for (i = 0; i < arguments.length; i++) {
            pushSingle(this, arguments[i]);
        }
    }

    return this.length;
}
380945
public void push(T val)
    {
        backChunk.values[backPos] = val;
        backChunk = endChunk;
        backPos = endPos;

        if (++endPos != size) {
            return;
        }

        Chunk<T> sc = spareChunk;
        if (sc != beginChunk) {
            spareChunk = spareChunk.next;
            endChunk.next = sc;
            sc.prev = endChunk;
        }
        else {
            endChunk.next = new Chunk<>(size, memoryPtr);
            memoryPtr += size;
            endChunk.next.prev = endChunk;
        }
        endChunk = endChunk.next;
        endPos = 0;
    }
662315
public boolean pushWithLimit(E d, int maxSize) {
        StackNode<E> oldTop, newTop;

        newTop = new StackNode<E>(d);

        while (true) {
            oldTop = top.get();

            newTop.next = oldTop;
            if (oldTop != null) {
                newTop.index = oldTop.index + 1;
                if (newTop.index >= maxSize)
                    return false;
            } else {
                if (maxSize == 0)
                    return false;
                newTop.index = 0;
            }

            if (top.compareAndSet(oldTop, newTop))
                return true;
        }
    }
739984
public void insertInOrder(int value)
  {

    for (int i = 0; i < m_firstFree; i++)
    {
      if (value < m_map[i])
      {
        insertElementAt(value, i);

        return;
      }
    }

    addElement(value);
  }
1121080
public void push(final V value) throws IndexOutOfBoundsException {
        if (top + locals >= values.length) {
            throw new IndexOutOfBoundsException(
                    "Insufficient maximum stack size.");
        }
        values[top++ + locals] = value;
    }
758180
public void put (int key, int value)
    {
        _modCount++;

        // check to see if we've passed our load factor, if so: resize
        ensureCapacity(_size + 1);

        int index = Math.abs(key)%_buckets.length;
        Record rec = _buckets[index];

        // either we start a new chain
        if (rec == null) {
            _buckets[index] = new Record(key, value);
            _size++; // we're bigger
            return;
        }

        // or we replace an element in an existing chain
        Record prev = rec;
        for (; rec != null; rec = rec.next) {
            if (rec.key == key) {
                rec.value = value; // we're not bigger
                return;
            }
            prev = rec;
        }

        // or we append it to this chain
        prev.next = new Record(key, value);
        _size++; // we're bigger
    }
343225
function addToDataset(element, key, value, forceCompat) {
  // Use dataset property or a fallback if unsupported.
  if (forceCompat || !element.dataset) {
    element.setAttribute('data-' + key, value);
  }
  else {
    element.dataset[key] = value;
  }

  return;
}
1047317
public void push(KType[] elements, int start, int len) {
    assert start >= 0 && len >= 0;

    ensureBufferSpace(len);
    System.arraycopy(elements, start, buffer, elementsCount, len);
    elementsCount += len;
  }
894122
public V put(final int key, final V value) {
		int index = (key & 0x7FFFFFFF) % elementData.length;

		IntEntry<V> entry = elementData[index];
		while (entry != null && key != entry.key) {
			entry = entry.nextInSlot;
		}

		if (entry == null) {
			if (++elementCount > threshold) {
				rehash();
				index = (key & 0x7FFFFFFF) % elementData.length;
			}
			entry = createHashedEntry(key, index);
		}

		V result = entry.value;
		entry.value = value;
		return result;
	}
1200001
function decorateElement(element) {
  const hasMissingTabIndex = Boolean(!element.getAttribute('tabindex') && element.tabIndex === -1);

  if (hasMissingTabIndex) {
    elementsWithMissingTabIndex.push(element);
    element.tabIndex = 0;
  }
}
1086467
function (e) {
                var element = e.target;
                var sortableElement = element.isSortable === true ? element : findSortable(element);
                element = findDragElement(sortableElement, element);
                if (!dragging || !_listsConnected(sortableElement, dragging.parentElement) || addData(sortableElement, '_disabled') === 'true') {
                    return;
                }
                var options = addData(sortableElement, 'opts');
                if (parseInt(options.maxItems) && _filter(sortableElement.children, addData(sortableElement, 'items')).length >= parseInt(options.maxItems) && dragging.parentElement !== sortableElement) {
                    return;
                }
                e.preventDefault();
                e.stopPropagation();
                e.dataTransfer.dropEffect = store(sortableElement).getConfig('copy') === true ? 'copy' : 'move';
                debouncedDragOverEnter(sortableElement, element, e.pageY);
            }
432704
int insertElement(int list, int beforeNode, int data) {
		int node = newNode_();
		int prev = -1;
		if (beforeNode != nullNode()) {
			prev = getPrev(beforeNode);
			setPrev_(beforeNode, node);
		}

		setNext_(node, beforeNode);
		if (prev != nullNode())
			setNext_(prev, node);

		int head = m_lists.getField(list, 0);

		if (beforeNode == head)
			m_lists.setField(list, 0, node);
		if (beforeNode == nullNode()) {
			int tail = m_lists.getField(list, 1);
			setPrev_(node, tail);
			if (tail != -1)
				setNext_(tail, node);

			m_lists.setField(list, 1, node);
		}

		setData(node, data);
		setListSize_(list, getListSize(list) + 1);

		if (m_b_store_list_index_with_node)
			setList_(node, list);

		return node;
	}
239955
def _setInsertFromTable(self, value):
        """"""
        self._insertFromTable = value
        if value:
            self.insertElement = self.insertElementTable
        else:
            self.insertElement = self.insertElementNormal
905102
public int addElementAtPosition(int prevNode, int nextNode, int element,
			boolean bUnique, boolean bCallCompare, int treap) {
		int treap_ = treap;
		if (treap_ == -1) {
			if (m_defaultTreap == nullNode())
				m_defaultTreap = createTreap(-1);
			treap_ = m_defaultTreap;
		}

		// dbg_check_(m_root);
		if (getRoot_(treap_) == nullNode()) {
			assert (nextNode == nullNode() && prevNode == nullNode());
			int root = newNode_(element);
			setRoot_(root, treap_);
			addToList_(-1, root, treap_);
			return root;
		}

		int cmpNext;
		int cmpPrev;
		if (bCallCompare) {
			cmpNext = nextNode != nullNode() ? m_comparator.compare(this,
					element, nextNode) : -1;
			assert (cmpNext <= 0);
			cmpPrev = prevNode != nullNode() ? m_comparator.compare(this,
					element, prevNode) : 1;
			// cmpPrev can be negative in plane sweep when intersection is
			// detected.
		} else {
			cmpNext = -1;
			cmpPrev = 1;
		}

		if (bUnique && (cmpNext == 0 || cmpPrev == 0)) {
			m_comparator.onAddUniqueElementFailedImpl_(element);
			int cur = cmpNext == 0 ? nextNode : prevNode;
			setDuplicateElement_(cur, treap_);
			return -1;// return negative value.
		}

		int cur;
		int cmp;
		boolean bNext;
		if (nextNode != nullNode() && prevNode != nullNode()) {
			// randomize the the cost to insert a node.
			bNext = m_random > NumberUtils.nextRand(m_random) >> 1;
		} else
			bNext = nextNode != nullNode();

		if (bNext) {
			cmp = cmpNext;
			cur = nextNode;
		} else {
			cmp = cmpPrev;
			cur = prevNode;
		}

		int newNode = -1;
		int before = -1;
		boolean b_first = true;
		for (;;) {
			if (cmp < 0) {
				int left = getLeft(cur);
				if (left != nullNode())
					cur = left;
				else {
					before = cur;
					newNode = newNode_(element);
					setLeft_(cur, newNode);
					setParent_(newNode, cur);
					break;
				}
			} else {
				int right = getRight(cur);
				if (right != nullNode())
					cur = right;
				else {
					before = getNext(cur);
					newNode = newNode_(element);
					setRight_(cur, newNode);
					setParent_(newNode, cur);
					break;
				}
			}

			if (b_first) {
				cmp *= -1;
				b_first = false;
			}
		}

		bubbleUp_(newNode);
		if (getParent(newNode) == nullNode())
			setRoot_(newNode, treap_);

		addToList_(before, newNode, treap_);
		// dbg_check_(m_root);
		return newNode;
	}
339621
public ElementReference pushFront(E element) {
        T entry = makeEntry(element);
        pushFrontEntry(entry);
        return entry;
    }
9738
def add_element(self, element, col, row, cols=1, rows=1):
        """"""

        # Update the number of rows and colums
        self.rows = max(self.rows, row+rows)
        self.cols = max(self.cols, col+cols)

        # Add the raw element record
        self.elements.append((col, row, cols, rows, element))