Sort all children of an element
170757
@Override
    public void manipulateChildElements(List<HierarchyWrapper> children) {
        for (int i = 0; i < children.size(); i++) {
            HierarchyWrapper wrapperImpl = children.get(i);
            final Wrapper<Element> wrapper = wrapperImpl.getElementContent();

            if (wrapper != null && wrapper.isSortable()) {
                insertChildInSortedOrder(children, i, wrapperImpl, wrapper);
            }
        }

    }
530104
def children_to_list(node):
    """"""
    if node['type'] == 'item' and len(node['children']) == 0:
        del node['children']
    else:
        node['type'] = 'folder'
        node['children'] = list(node['children'].values())
        node['children'].sort(key=lambda x: x['name'])
        node['children'] = map(children_to_list, node['children'])
    return node
699307
def get_ordered_children(self):
        
        ordered_keys = self.element.ordered_children if self.element.ordered_children is not None else []
        children = [self.indexes.get(k, None) for k in ordered_keys]
        return children
885805
function endNode() {
            if (parent.children) {
                mergeChildren(parent.children);
                sortChildren(parent.children);
            }
            parent = parentsStack.pop();
        }
256963
function ListNode (children) {
    for(var i = 0; i < children.length; i++)
        this[i] = children[i];
    this.length = children.length;
}
109037
function getAllChildRowIndex(row) {
    // if(row.allChildRowIndex && row.allChildRowIndex.length > 0){
    // 	return row.allChildRowIndex;
    // }
    row.allChildRowIndex = new Array();
    this.getAllChildRowIndexFun(row, row.allChildRowIndex);
    return row.allChildRowIndex;
}
444573
function () {
		var element = this.element,
			childNodes = element.childNodes,
			i = childNodes.length;

		while (i--) {
			element.removeChild(childNodes[i]);
		}
	}
457102
def transformChildrenToNative(self):
        
        for childArray in (self.contents[k] for k in self.sortChildKeys()):
            for child in childArray:
                child = child.transformToNative()
                child.transformChildrenToNative()
289066
public void sortChildrenByNode(Comparator<TreeNode<T>> comparator) {
		Collections.sort(children, comparator);
		for (TreeNode<T> child : children) {
			child.sortChildrenByNode(comparator);
		}
	}
2123
function children(selector) {
  var arr = [], slice = this.slice, nodes, matches;
  this.each(function(el) {
    nodes = slice.call(el.childNodes);
    // only include elements
    nodes = nodes.filter(function(n) {
      if(n instanceof Element) { return n;}
    })
    // filter direct descendants by selector
    if(selector) {
      matches = slice.call(el.querySelectorAll(selector));
      for(var i = 0;i < nodes.length;i++) {
        if(~matches.indexOf(nodes[i])) {
          arr.push(nodes[i]);
        }
      }
    // get all direct descendants
    }else{
      arr = arr.concat(nodes);
    }
  });
  return this.air(arr);
}
1274824
function appendChildren(children, el) {
	ensureArray(children)
		.forEach(append.bind(el));
	return el;
}
1276215
function ( selector ) {
            var el = this.element(),
                children = el.children;
    
            if ( typeof selector === 'string' ) {
                var elNum = children.length, result = [], i;
    
                for ( i = 0; i < elNum; ++i ) {
                    var child = children[i],
                        match = $B.selector.match( child, selector );
    
                    if ( match ) result.push( child );
                }
                return result;
            } else {
                //this.element().childNodes;
                return $B( children ).toArray();
            }
        }
1326000
def move_last_element_of_predecessor_to_child(child_index)
      pred = @children[child_index - 1]
      child = @children[child_index]

      if child.is_leaf?
        # Adjust offset for the predecessor node
        @offsets[child_index] -= 1
        # Move the value
        child.values.unshift(pred.values.pop)
      else
        # Before:
        #
        # Root Node             +--------------------------------+
        # Offsets               | 0                           13 |
        # Children                |                            |
        #              pred       v                      child v
        # Level 1    +---------------------------------++-------------------+
        # Offsets    | 0         4         7        11 ||       0         3 |
        # Children     |         |         |         |          |         |
        #              v         v         v         v          v         v
        # Leaves  +---------++-------++----------++-------++----------++-------+
        # Values  | A B C D || E F G || H I J K  || L  M  || N  O  P  || Q  R  |
        #
        # Index     0 1 2 3    4 5 6    7 8 9 10    11 12    13 14 15    16 17
        #
        # After:
        #
        # Root Node             +--------------------------------+
        # Offsets               | 0                           11 |
        # Children                |                            |
        #              prepd      v                child       v
        # Level 1    +--------------------------++--------------------------+
        # Offsets    | 0         4         7    ||   0          2         5 |
        # Children     |         |         |         |          |         |
        #              v         v         v         v          v         v
        # Leaves  +---------++-------++----------++-------++----------++-------+
        # Values  | A B C D || E F G || H I J K  || L  M  || N  O  P  || Q  R  |
        #
        # Index     0 1 2 3    4 5 6    7 8 9 10    11 12    13 14 15    16 17
        #
        # Remove the last predecessor offset and update the child offset with
        # it
        delta = @offsets[child_index] - pred.offsets.last
        @offsets[child_index] = pred.offsets.pop
        # Adjust all the offsets of the child
        child.offsets.map! { |o| o += delta }
        # And prepend the 0 offset
        child.offsets.unshift(0)
        # Move the child reference
        child.children.unshift(pred.children.pop)
        child.children.first.parent = child
      end
    end
11353
function sortGroups(selector) {
  selector.each((subSelector) => {
    subSelector.nodes.sort((a, b) => {
      // different types cannot be sorted
      if (a.type !== b.type) {
        return 0;
      }

      // sort alphabetically
      return a.value < b.value ? -1 : 1;
    });
  });

  selector.sort((a, b) => (a.nodes.join('') < b.nodes.join('') ? -1 : 1));
}
334235
function childrenByClass(element, name) {
  var filtered = [];

  for (var i = 0; i < element.children.length; i++) {
    var child = element.children[i];
    var classNames = child.className.split(' ');
    if (classNames.indexOf(name) !== -1) {
      filtered.push(child);
    }
  }

  return filtered;
}
80952
function all(h, parent) {
  const nodes = parent.children || []
  const { length } = nodes
  const values = []
  let index = -1

  while (++index < length) {
    const result = one(h, nodes[index], parent)
    values.push(result)
  }

  return values.filter(node => node)
}
449734
function sortitem()
{
  var self = this;
  
  /* ATTRIBUTES */
  
  /* passed html title binding */
  this.title = "";
  
  /* passed active item binding */
  this.active = false;
  
  /* passed onsort method to be used when clicked */
  this.onSort = function(){};
  
  /* toggles class based on this.active */
  this.filters.activeText = function(v)
  {
    return (v ? 'active' : 'inactive');
  }
  
  /* the actual click event */
  this.sortClick = function(e)
  {
    self.onSort(self.title);
  };
}