this attempts to recursively insert into a row, seeing that any stuff exceeding is pushed down further.
 Yes, it should check for a para end and insert. Currently it could add to next para.
483782
def insert_wrap lineno, pos, lastchars
       _maxlen = @maxlen || @width - @internal_width
      @list[lineno].insert pos, lastchars 
      len = @list[lineno].length 
      if len > _maxlen
          push_last_word lineno #- sometime i may push down 10 chars but the last word is less
        end
    end
933191
def insert_data(self, node, data, start, end):
        """"""
        for item in data:
            self.recursive_insert(node, [item[0], item[1]], item[-1], start, end)
298395
function(row, tmpRowDepth) {
                tmpRowDepth = tmpRowDepth || 1;

                for(var n=0; n<row.length; n++) {
                    var col = row[n];
                    // Column has children, so keep counting
                    if(YAHOO.lang.isArray(col.children)) {
                        tmpRowDepth++;
                        countMaxRowDepth(col.children, tmpRowDepth);
                        tmpRowDepth--;
                    }
                    // No children, is it the max depth?
                    else {
                        if(tmpRowDepth > maxRowDepth) {
                            maxRowDepth = tmpRowDepth;
                        }
                    }

                }
            }
454672
function insert(root, nextTag, isVirtual) {
      if (isVirtual)
        { makeVirtual.apply(this, [root, nextTag]); }
      else
        { safeInsert(root, this.root, nextTag.root); }
    }
1098903
private static void insertionSort(final int off, final int len, int[] order, IndirectComparator intComparator) {
    for (int i = off + 1; i < off + len; i++) {
      final int v = order[i];
      int j = i, t;
      while (j > off && intComparator.compare(t = order[j - 1], v) > 0) {
        order[j--] = t;
      }
      order[j] = v;
    }
  }
988792
function insertQueueStep(step, index) {
  if (index && index < currentSteps.length) {
    return currentSteps.splice(index, 0, step);
  }

  return currentSteps.push(step);
}
1318217
synchronized void insertRowInTable(final VoltBulkLoaderRow nextRow) throws InterruptedException {
        m_partitionRowQueue.put(nextRow);
        if (m_partitionRowQueue.size() == m_minBatchTriggerSize) {
            m_es.execute(new Runnable() {
                @Override
                public void run() {
                    try {
                        while (m_partitionRowQueue.size() >= m_minBatchTriggerSize) {
                            loadTable(buildTable(), m_table);
                        }
                    } catch (Exception e) {
                        loaderLog.error("Failed to load batch", e);
                    }
                }
            });
        }
    }
627707
def insert(self, row):
        
        data = self._convert_value(row)
        self._service.InsertRow(data, self._ss.id, self.id)
883019
public void forModelSave(Table table, Map<String, Object> attrs, StringBuilder sql, List<Object> paras) {
		sql.append("insert into ").append(table.getName()).append('(');
		StringBuilder temp = new StringBuilder(") values(");
		String[] pKeys = table.getPrimaryKey();
		int count = 0;
		for (Entry<String, Object> e: attrs.entrySet()) {
			String colName = e.getKey();
			if (table.hasColumnLabel(colName)) {
				if (count++ > 0) {
					sql.append(", ");
					temp.append(", ");
				}
				sql.append(colName);
				Object value = e.getValue();
				if (value instanceof String && isPrimaryKey(colName, pKeys) && ((String)value).endsWith(".nextval")) {
				    temp.append(value);
				} else {
				    temp.append('?');
				    paras.add(value);
				}
			}
		}
		sql.append(temp.toString()).append(')');
	}
50472
def aux_insertTree(childTree, parentTree):
	""""""
	if childTree.x1 != None and childTree.x2 != None :
		parentTree.insert(childTree.x1, childTree.x2, childTree.name, childTree.referedObject)

	for c in childTree.children:
		aux_insertTree(c, parentTree)
967091
def nested_insert(self, item_list):
        
        if len(item_list) == 1:
            self[item_list[0]] = LIVVDict()
        elif len(item_list) > 1:
            if item_list[0] not in self:
                self[item_list[0]] = LIVVDict()
            self[item_list[0]].nested_insert(item_list[1:])
1074433
function push_(item, a)
{
	// Handle resursion stop at leaf level.
	if (a.height === 0)
	{
		if (a.table.length < M)
		{
			var newA = {
				ctor: '_Array',
				height: 0,
				table: a.table.slice()
			};
			newA.table.push(item);
			return newA;
		}
		else
		{
		  return null;
		}
	}

	// Recursively push
	var pushed = push_(item, botRight(a));

	// There was space in the bottom right tree, so the slot will
	// be updated.
	if (pushed !== null)
	{
		var newA = nodeCopy(a);
		newA.table[newA.table.length - 1] = pushed;
		newA.lengths[newA.lengths.length - 1]++;
		return newA;
	}

	// When there was no space left, check if there is space left
	// for a new slot with a tree which contains only the item
	// at the bottom.
	if (a.table.length < M)
	{
		var newSlot = create(item, a.height - 1);
		var newA = nodeCopy(a);
		newA.table.push(newSlot);
		newA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot));
		return newA;
	}
	else
	{
		return null;
	}
}
240256
public void insertRow(Object rowHandle, Object... fieldList)  throws InterruptedException {
        int partitionId = 0;
        //Find partition to send this row to and put on correct PerPartitionTable.
        if (fieldList == null || fieldList.length <= 0) {
            String errMsg;
            if (rowHandle == null)
                errMsg = "Error: insertRow received empty fieldList";
            else
                errMsg = "Error: insertRow received empty fieldList for row: " + rowHandle.toString();
            generateError(rowHandle, fieldList, errMsg);
            return;
        }
        if (fieldList.length != m_columnCnt) {
            String errMsg;
            if (rowHandle == null)
                errMsg = "Error: insertRow received incorrect number of columns; " + fieldList.length +
                        " found, " + m_columnCnt + " expected";
            else
                errMsg = "Error: insertRow received incorrect number of columns; " + fieldList.length +
                        " found, " + m_columnCnt + " expected for row: " + rowHandle.toString();
            generateError(rowHandle, fieldList, errMsg);
            return;
        }
        VoltBulkLoaderRow newRow = new VoltBulkLoaderRow(this, rowHandle, fieldList);
        if (m_isMP) {
            m_partitionTable[m_firstPartitionTable].insertRowInTable(newRow);
        }
        else {
            try {
                partitionId = (int)m_clientImpl.getPartitionForParameter(
                        m_partitionColumnType.getValue(), fieldList[m_partitionedColumnIndex]);
                m_partitionTable[partitionId].insertRowInTable(newRow);
            } catch (VoltTypeException e) {
                generateError(rowHandle, fieldList, e.getMessage());
                return;
            }
        }
        m_outstandingRowCount.incrementAndGet();
    }
71317
private void findInsert(
                           InsertNodes       point,
                           InsertStack       stack,
                           Object            new1)
    {
        java.util.Comparator comp = insertComparator();
        NodeInsertPoint ip = stack.nodeInsertPoint();
        GBSNode       p;               /* P is used to march down the tree      */
        int           xcc;             /* Compare result                        */
        GBSNode       l_last = null;   /* Node from which we last departed by   */
                                       /*  turning left (logical successor)     */
        GBSNode       r_last = null;   /* Node from which we last departed by   */
                                       /*  turning right (logical predecessor)  */
        p = root();                    /* Root of tree                          */
                                       /* Remember father of root               */
        stack.start(dummyTopNode(), "GBSTree.findInsert");

        for (;;)                        /* Through the whole tree                */
        {
            xcc = comp.compare(new1, p.middleKey());
            if ( !(xcc > 0) )              /* New key <= node key                   */
            {
                GBSNode leftChild = p.leftChild();
                if (leftChild != null)     /* Have a left child                     */
                {
                    l_last = p;            /* Remember node from which we           */
                                           /*  last moved left (successor)          */
                    stack.balancedPush(NodeStack.PROCESS_CURRENT, p);
                    p = leftChild;         /* Move left                             */
                }
                else                       /* Have no left child                    */
                {
                    leftAdd(               /* Add a left child                      */
                                           p,             /* Current node                          */
                                           r_last,        /* Node from which we last turned right  */
                                           new1,          /* Key to add                            */
                                           ip,            /* NodeInsertPoint                       */
                                           point);        /* Returned InsertNodes                  */
                    break;
                }
            }
            else                           /* New key > node key                    */
            {
                GBSNode rightChild = p.rightChild();
                if (rightChild != null)    /* There is a right child                */
                {
                    r_last = p;            /* Remember node from which we           */
                                           /*  last moved right (predecessor)       */
                    stack.balancedPush(NodeStack.DONE_VISITS, p);
                    p = rightChild;        /* Move right                            */
                }
                else                       /* There is no right child               */
                {
                    rightAdd(              /* Add a right child                     */
                                           p,           /* Current node                          */
                                           l_last,      /* Node from which we last turned left   */
                                           new1,        /* Key to add                            */
                                           ip,          /* NodeInsertPoint                       */
                                           point);      /* Returned InsertNodes                  */
                    break;
                }
            }
        } // for
    }
278520
private void processInsert(Row row) {
		// limit the materialized table
		if (materializedTable.size() - validRowPosition >= maxRowCount) {
			cleanUp();
		}
		materializedTable.add(row);
		rowPositionCache.put(row, materializedTable.size() - 1);
	}
753677
private static void insertionSort(ArrayModifiableDBIDs data, Comparator<? super DBIDRef> comparator, int start, int end, DBIDArrayIter iter1, DBIDArrayIter iter2) {
    for(int i = start + 1; i < end; i++) {
      for(int j = i; j > start; j--) {
        if(comparator.compare(iter1.seek(j - 1), iter2.seek(j)) <= 0) {
          break;
        }
        data.swap(j, j - 1);
      }
    }
  }
323287
def insert(self, value):
        
        side = '_lesser' if value < self.value else '_greater'
        child = getattr(self, side)
        if child is None:
            setattr(self, side, _BinarySearchTree(value))
        else:
            child.insert(value)