/*
Expands all nodes by expanding all top most nodes top down with their descendants.
557987
function (nodes, applyFishEyeViewToEachNode) {
    if (nodes === undefined) {
      nodes = cy.nodes();
    }
    var orphans;
    orphans = elementUtilities.getTopMostNodes(nodes);
    var expandStack = [];
    for (var i = 0; i < orphans.length; i++) {
      var root = orphans[i];
      this.expandAllTopDown(root, expandStack, applyFishEyeViewToEachNode);
    }
    return expandStack;
  }
680256
private void addDescendantElements() throws NodeSelectorException {
        for (Node node : nodes) {
            List<Node> nl;
            if (node instanceof Document || node instanceof Element) {
                nl = DOMHelper.getElementsByTagName(node, selector.getTagName());
            } else {
                throw new NodeSelectorException("Only document and element nodes allowed!");
            }
            
            result.addAll(nl);
        }
    }
250859
function( node ) {
			this.optimizeBookmark();
			this.trim( false, true );

			var startContainer = this.startContainer;
			var startOffset = this.startOffset;

			var nextNode = startContainer.getChild( startOffset );

			if ( nextNode )
				node.insertBefore( nextNode );
			else
				startContainer.append( node );

			// Check if we need to update the end boundary.
			if ( node.getParent() && node.getParent().equals( this.endContainer ) )
				this.endOffset++;

			// Expand the range to embrace the new node.
			this.setStartBefore( node );
		}
1058929
private void fillNodeList(P parent) {
		P prt = parent;
		if ((prt != null) && (prt.isLeaf())) {
			return;
		}
		while (prt != null) {
			if (!prt.isLeaf()) {
				if (!this.expandedNodes.contains(prt)) {
					this.expandedNodes.add(prt);
					for (int i = prt.getChildCount() - 1; i >= 0; --i) {
						final C child = prt.getChildAt(i);
						if (child != null) {
							final P cn = toTraversableChild(prt, child);
							if (cn != null) {
								this.availableNodes.push(cn);
							}
						}
					}
				} else {
					return;
				}
			}
			prt = this.availableNodes.isEmpty() ? null : this.availableNodes.peek();
			if ((prt != null) && (prt.isLeaf())) {
				return;
			}
		}
	}
420262
function _expandParentsForNode(node) {
        // get the actual parent nodes in the editor
        var parents = [];
        $(node).parentsUntil('#tinymce').each(function(index, el) {
            parents.push(el.id);
        });
        parents.reverse();
        
        // TODO handling for readonly mode where only headings are in the tree
        
        // expand the corresponding nodes in the tree
        for (var i = 0; i < parents.length; i++) {
            var parentId = parents[i];
            var parentNode = $('[name="'+parentId+'"]', $tree);
            var isOpen = $tree.jstree('is_open', parentNode);
            if (!isOpen) {
                $tree.jstree('open_node', parentNode, null, false);
            }
        }
    }
593282
public static void expandAll(JTree tree)
    {
        int r = 0;
        while (r < tree.getRowCount())
        {
            tree.expandRow(r);
            r++;
        }
    }
414341
function (polygons) {
    // new polygons can only be added to root node; children can only be splitted polygons
    if (!this.isRootNode()) {
      throw new Error('Assertion failed')
    }
    let _this = this
    polygons.map(function (polygon) {
      _this.addChild(polygon)
    })
  }
305179
function nodeExpand(node: Node, actor) {
  return async ({ dispatch, getState }: ThunkArg) => {
    dispatch({ type: "NODE_EXPAND", data: { node } });
    dispatch(nodeLoadProperties(node, actor));
  };
}
794199
def expand(self, process, child_nodes):
        
        #print('TODO: process check = ', process)
        #print(self.name, ' expanded to ->', child_nodes)
        self.child_nodes = []  
        for n in child_nodes:
            self.child_nodes.append(CoreData(n, parent=self))
1076350
def expand_node_successors(universe, graph, node: BaseEntity) -> None:
    
    skip_predecessors = set()
    for predecessor in universe.predecessors(node):
        if predecessor in graph:
            skip_predecessors.add(predecessor)
            continue

        graph.add_node(predecessor, **universe.nodes[predecessor])

    graph.add_edges_from(
        (predecessor, target, key, data)
        for predecessor, target, key, data in universe.in_edges(node, data=True, keys=True)
        if predecessor not in skip_predecessors
    )

    update_node_helper(universe, graph)
    update_metadata(universe, graph)
885805
function endNode() {
            if (parent.children) {
                mergeChildren(parent.children);
                sortChildren(parent.children);
            }
            parent = parentsStack.pop();
        }
1118478
def mark_parents_expanded node
      # i am setting parents as expanded, but NOT firing handlers - XXX separate this into expand_parents
      _path = node.tree_path
      _path.each do |e| 
        # if already expanded parent then break we should break
        set_expanded_state(e, true) 
      end
    end
498974
private function addSiblings(Element $topNode): self {
        $baselineScoreForSiblingParagraphs = $this->getBaselineScoreForSiblings($topNode);

        $previousSiblings = $topNode->precedingAll(function($node) {
            return $node instanceof Element;
        });

        // Find all previous sibling element nodes
        foreach ($previousSiblings as $siblingNode) {
            $results = $this->getSiblingContent($siblingNode, $baselineScoreForSiblingParagraphs);

            foreach ($results as $result) {
                $topNode->insertBefore($result, $topNode->firstChild);
            }
        }

        return $this;
    }
832636
def expand_children node=:current_index
      $multiplier = 999 if !$multiplier || $multiplier == 0
      node = row_to_node if node == :current_index
      return if node.children.empty? # or node.is_leaf?
      #node.children.each do |e| 
        #expand_node e # this will keep expanding parents
        #expand_children e
      #end
      node.breadth_each($multiplier) do |e|
        expand_node e
      end
      $multiplier = 0
      _structure_changed true
    end
1139170
public static void expandAll(JTree tree, TreePath path, boolean expand)
	{
		TreeNode node = (TreeNode)path.getLastPathComponent();

		if (node.getChildCount() >= 0)
		{
			Enumeration<?> enumeration = node.children();
			while (enumeration.hasMoreElements())
			{
				TreeNode n = (TreeNode)enumeration.nextElement();
				TreePath p = path.pathByAddingChild(n);

				expandAll(tree, p, expand);
			}
		}

		if (expand)
		{
			tree.expandPath(path);
		}
		else
		{
			tree.collapsePath(path);
		}
	}
113107
function reindexNodes () {
  var child = this.node.firstChild;
  this._length = 0;
  
  while (child) {
    this[this._length++] = child;
    child = child.nextSibling;
  }
}
73288
function expandVertically() {
		var growWith = 0;
		for (var i = 0; i < this.virtualGridMatrix.length; i++) {
			if (this.virtualGridMatrix[i][0] !== 0) {
				growWith++;
			}
		}
		if (growWith > 0) {
			this.addEmptyRows(growWith);
		}
	}