Insert an element at the end of this list. When a reference member specified via second parameter is found, the
member is inserted at an index before the reference member.

@param {PropertyList.Type} item
@param {PropertyList.Type|String} [before]
764427
function (item, before) {
        if (!_.isObject(item)) { return; } // do not proceed on empty param

        var duplicate = this.indexOf(item),
            index;

        // remove from previous list
        PropertyList.isPropertyList(item[__PARENT]) && (item[__PARENT] !== this) && item[__PARENT].remove(item);
        // inject the parent reference
        _.assignHidden(item, __PARENT, this);

        // ensure that we do not double insert things into member array
        (duplicate > -1) && this.members.splice(duplicate, 1);
        // find the position of the reference element
        before && (before = this.indexOf(before));

        // inject to the members array ata position or at the end in case no item is there for reference
        (before > -1) ? this.members.splice(before, 0, item) : this.members.push(item);

        // store reference by id, so create the index string. we first ensure that the index value is truthy and then
        // recheck that the string conversion of the same is truthy as well.
        if ((index = item[this._postman_listIndexKey]) && (index = String(index))) {
            // desensitise case, if the property needs it to be
            this._postman_listIndexCaseInsensitive && (index = index.toLowerCase());

            // if multiple values are allowed, the reference may contain an array of items, mapped to an index.
            if (this._postman_listAllowsMultipleValues && this.reference.hasOwnProperty(index)) {

                // if the value is not an array, convert it to an array.
                !_.isArray(this.reference[index]) && (this.reference[index] = [this.reference[index]]);

                // add the item to the array of items corresponding to this index
                this.reference[index].push(item);
            }
            else {
                this.reference[index] = item;
            }
        }
    }
885092
def insert(self, index, item):
        # type: (int, Any) -> None
        
        return list.insert(self, index, self.ref(item))
943475
function insertProperty (fixer, node, propertyText) {
      if (node.properties.length === 0) {
        return fixer.replaceText(node, `{\n${propertyText}\n}`);
      }
      return fixer.insertTextAfter(
        sourceCode.getLastToken(node.properties[node.properties.length - 1]),
        `,\n${propertyText}`
      );
    }
111374
public static void insertBefore(Element newElement, Element before) {
        before.parentNode.insertBefore(newElement, before);
    }
579855
function insertOrAppend(container, pos, el) {
    var childs = container.childNodes;
    if (pos < childs.length) {
      var refNode = childs[pos];
      container.insertBefore(el, refNode);
    } else {
      container.appendChild(el);
    }
  }
250695
function(item) {
		 	var itemToSelect = item || this.getItems()[0];
		 	if (itemToSelect) {
		 		if (this._selectedItem) {
		 			this._selectedItem.classList.remove("dropdownMenuItemSelected"); //$NON-NLS-0$
			 	}
			 	this._selectedItem = itemToSelect;
			 	this._selectedItem.classList.add("dropdownMenuItemSelected"); //$NON-NLS-0$	
			 	this._selectedItem.focus();
			 	if (this._buttonsAdded) {
			 		var itemBounds = this._selectedItem.getBoundingClientRect();
			 		var menuBounds = this._dropdownNode.getBoundingClientRect();
			 		if (this._selectedItem.offsetTop < this._dropdownNode.scrollTop) {
		 				this._selectedItem.scrollIntoView(true);
		 				if (this._dropdownNode.scrollTop < 5) {
		 					this._dropdownNode.scrollTop = 0;
		 				}
		 			}
		 			else if (itemBounds.bottom > menuBounds.bottom) {
		 				this._selectedItem.scrollIntoView(false);
		 				if ((this._dropdownNode.scrollHeight - this._dropdownNode.scrollTop - this._dropdownNode.clientHeight) < 5) {
		 					this._dropdownNode.scrollTop = this._dropdownNode.scrollHeight - this._dropdownNode.clientHeight;
		 				}
		 			}
		 			updateScrollButtonVisibility.call(this);
				}
		 	}
		 }
21893
function(element, before) {
        element = element.get ? element.get('element') : element;
        before = (before && before.get) ? before.get('element') : before;
        
        return this.get('element').insertBefore(element, before);
    }
1058917
public void add(Item item)
    {
        Item innerItem = trie.get(item.key);
        if (innerItem == null)
        {
            innerItem = item;
            trie.put(innerItem.key, innerItem);
        }
        else
        {
            innerItem.combine(item);
        }
    }
240821
function(item) {

      if (this.maxItems && this.items.length >= this.maxItems){
				this.maxItemsAlert ? this.maxItemsAlert.call() : alert("You're limited to "+this.maxItems+" items");
			  return;	
			}
			
      var label = (typeof item == "object") ? item.label : item	;
      var li = inputEx.cn('li', {className: 'inputEx-DDList-item'});
      var span = inputEx.cn('span', null, null, label)

      if(this.listSelectOptions){
        var select = new inputEx.SelectField(this.listSelectOptions); 
        this.selects.push(select);
        li.appendChild(select.el);
        item.getValue = function(){
				  return {select: select.getValue(), label: this.label, value: this.value};
				}
				item.setValue = function(obj){
				  span.innerHTML = obj.label;
				  this.label = obj.label;
				  this.value = obj.value;
				  select.setValue(obj.select);
				}
		  } else {
			  item.getValue = function(){
					result = {};
					if(this.value) result.value = this.value;
					if(this.label) result.label = this.label;
					return result;
				}				
			  item.setValue = function(obj){
				  span.innerHTML = obj.label;
				  this.label = obj.label;
				  this.value = obj.value;
				}
			}
      li.appendChild(span);
 

      // Option for the "remove" link (default: true)
		if(!!this.options.allowDelete){
			var removeLink = inputEx.cn('div', {className:"removeButton"}, null, ""); 
	      li.appendChild( removeLink );
	      Event.addListener(removeLink, 'click', function(e) {
	         var a = Event.getTarget(e);
	         var li = a.parentNode;
	         this.removeItem( inputEx.indexOf(li,this.ul.childNodes) );
	      }, this, true);
      }
      // Don't want any drag and drop
      //var dditem = new inputEx.widget.DDListItem(li);
      //
      
      this.items.push( item );

      this.ul.appendChild(li);
   }
1041153
private void updateSingeItemIterator(SelectItem item) {

        if (singleItemIterator == null) {
            singleItemIterator = new SingleElementIterator();
        }
        singleItemIterator.updateItem(item);

    }
342928
public static void lazyInsertBefore(Element newElement, Element before) {
        if (!before.parentNode.contains(newElement)) {
            before.parentNode.insertBefore(newElement, before);
        }
    }
769763
function ( child, index ) {
            var el = this.element();
            if ( typeof index === 'number' ) {
                var children = el.children,
                    childNum = children.length;
    
                if ( childNum > 0 && index < childNum ) {
                    el.insertBefore( child, children[index] );
                    return;
                }
            }
            el.appendChild( child );
        }
729301
def insertBefore(self, node: AbstractNode,
                     ref_node: AbstractNode) -> AbstractNode:
        """"""
        return self._insert_before(node, ref_node)
631075
public synchronized T addItem(V item) {
        if(item == null) {
            return self();
        }

        items.add(item);
        if(selectedIndex == -1) {
            selectedIndex = 0;
        }
        invalidate();
        return self();
    }
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)
54495
function (ele) {
            var node = this[0];
            //(ele string ??)
            if (node.parentNode) {
                node.parentNode.insertBefore(ele, node.nextSibling);
            }
            return this;
        }
886036
def insert_before(self, key, new_item, instance=0):
        """"""
        self._insert_item(key, new_item, instance, False)