Recursively converts a bindable tree node to a hierarchical model tree node
@param {object} oHierarchy The module hierarchy node with selected state
@param {object} oTree The tree node to be filled with the hierarchy information
350132
function (oHierarchy, oTree) {
			if (oTree.selected) {
				oHierarchy[""] = true;
			}

			for (var i = 0; i < oTree.nodes.length; i++) {
				oHierarchy[oTree.nodes[i].text] = {};
				if (oTree.nodes[i].nodes.length) {
					this.setHierarchyNode(oHierarchy[oTree.nodes[i].text], oTree.nodes[i]);
				} else  {
					oHierarchy[oTree.nodes[i].text] = oTree.nodes[i].selected;
				}
			}
		}
751705
ParseTree toParseTree() {
    List<ParseTree> children = new ArrayList<ParseTree>();
    for (TreeNode child = latestChild; child != null; child = child.previous) {
      children.add(child.toParseTree());
    }
    Collections.reverse(children);
    return new ParseTree(name, beginIndex, endIndex, result, children);
  }
923916
function(oTable, oRow) {
			var oDomRefs = oRow.getDomRefs(true);

			oDomRefs.row.removeAttr("data-sap-ui-level");
			oDomRefs.row.removeData("sap-ui-level");

			if (TableGrouping.isGroupMode(oTable)) {
				oDomRefs.row.removeClass("sapUiTableGroupHeader sapUiAnalyticalTableSum sapUiAnalyticalTableDummy");
				TableGrouping.setIndent(oTable, oDomRefs.row, oDomRefs.rowSelector, 0);
			}

			var $TreeIcon = null;
			if (TableGrouping.isTreeMode(oTable)) {
				$TreeIcon = oDomRefs.row.find(".sapUiTableTreeIcon");
				$TreeIcon.removeClass("sapUiTableTreeIconLeaf")
						 .removeClass("sapUiTableTreeIconNodeOpen")
						 .removeClass("sapUiTableTreeIconNodeClosed")
						 .css(this._bRtlMode ? "margin-right" : "margin-left", "");
			}

			oTable._getAccExtension()
				  .updateAriaExpandAndLevelState(oRow, oDomRefs.rowScrollPart, oDomRefs.rowSelector, oDomRefs.rowFixedPart, oDomRefs.rowAction, false,
					  false, -1, $TreeIcon);
		}
1334194
function addToTree (elem, callback) {
    const pathElems = toPathComponents(elem.path || '')
    let parent = tree
    const lastIndex = pathElems.length - 1

    let currentPath = ''
    eachOfSeries(pathElems, (pathElem, index, callback) => {
      if (currentPath) {
        currentPath += '/'
      }
      currentPath += pathElem
      const last = (index === lastIndex)
      parent.dirty = true
      parent.multihash = null
      parent.size = null

      if (last) {
        waterfall([
          (callback) => parent.put(pathElem, elem, callback),
          (callback) => flatToShard(null, parent, options.shardSplitThreshold, options, callback),
          (newRoot, callback) => {
            tree = newRoot
            callback()
          }
        ], callback)
      } else {
        parent.get(pathElem, (err, treeNode) => {
          if (err) {
            callback(err)
            return // early
          }
          let dir = treeNode
          if (!dir || !(dir instanceof Dir)) {
            dir = DirFlat({
              dir: true,
              parent: parent,
              parentKey: pathElem,
              path: currentPath,
              dirty: true,
              flat: true
            }, options)
          }
          const parentDir = parent
          parent = dir
          parentDir.put(pathElem, dir, callback)
        })
      }
    }, callback)
  }
304241
def expand_heirarchy(levels)
      result = levels.clone
      
      levels.each do |name, level|
        # only need to expand on loggers since outputter already in list
        if  Log4r::Outputter[name].nil?
          logger = Lumber.find_or_create_logger(name)
          while logger
            logger_name = logger.fullname
            break if logger_name.nil?
            result[logger_name] ||= level
            logger.outputters.each do |o|
              result[o.name] ||= level
            end
            logger = logger.parent
          end
        end
      end
      
      return result
    end
315101
public void create(MappingNode tree, List<Module> modules) {
        addRoot(tree, modules);
        check(tree, tree, "");
    }
772238
def add_tree(self, tree, parent=None):
        
        if tree.path in self.path_db:
            self.remove_tree_by_path(tree.path)

        # index all indexable attributes
        for index in tree.indexes:
            if not getattr(tree, index):
                continue

            self._add_to(
                getattr(self, index + "_db"),
                getattr(tree, index),
                tree,
            )

        if parent:
            self._add_to(self.parent_db, tree.path, parent)

        # make sure, that all sub-trees starts with path of parent tree
        for sub_tree in tree.sub_trees:
            assert sub_tree.path.startswith(tree.path)

        for sub_tree in tree.sub_trees:
            self.add_tree(sub_tree, parent=tree)
1026222
public static void enableAutoExpansion(final JTree tree) {

    tree.getModel().addTreeModelListener(new TreeModelListener() {

      public void treeNodesChanged(TreeModelEvent e) {
        // nothing to do
      }

      public void treeNodesInserted(TreeModelEvent e) {
        tree.expandPath(e.getTreePath());
      }

      public void treeNodesRemoved(TreeModelEvent e) {
        // nothing to do
      }

      public void treeStructureChanged(TreeModelEvent e) {
        // nothing to do
      }

    });

  }
954849
function(oTable) {
			if (TableGrouping.isGroupMode(oTable) || TableGrouping.isTreeMode(oTable)) {
				var oBinding = oTable.getBinding("rows");
				var oRowBindingInfo = oTable.getBindingInfo("rows");
				var aRows = oTable.getRows();
				var iCount = aRows.length;
				var iRow;

				if (oBinding) {
					for (iRow = 0; iRow < iCount; iRow++) {
						var oRowGroupInfo = TableGrouping.getRowGroupInfo(oTable, aRows[iRow], oBinding, oRowBindingInfo);
						TableGrouping.updateTableRowForGrouping(oTable, aRows[iRow], oRowGroupInfo.isHeader, oRowGroupInfo.expanded,
							oRowGroupInfo.hidden, false, oRowGroupInfo.level, oRowGroupInfo.title);
					}
				} else {
					for (iRow = 0; iRow < iCount; iRow++) {
						TableGrouping.cleanupTableRowForGrouping(oTable, aRows[iRow]);
					}
				}
			}
		}
1027097
def index(parent_tree)
      parent_tree = make_object_id(parent_tree)
      if not subtree_of?(parent_tree)
        raise ArgumentError, "#{self.to_s} not a subtree of #{parent_tree.to_s}"
      elsif self.length == parent_tree.length
        raise ArgumentError, "OIDs are the same"
      else
        ObjectId.new(self[parent_tree.length..-1])
      end
    end
252719
private void addModuleToTree(final DbModule module, final TreeNode tree) {
        final TreeNode subTree = new TreeNode();
        subTree.setName(module.getName());
        tree.addChild(subTree);

        // Add SubsubModules
        for (final DbModule subsubmodule : module.getSubmodules()) {
            addModuleToTree(subsubmodule, subTree);
        }
    }
1107867
private function buildTreeFromArray(
        array $treeStructure,
        \Tx_Oelib_Visibility_Node $parentNode
    ) {
        foreach ($treeStructure as $nodeKey => $nodeContents) {
            /** @var \Tx_Oelib_Visibility_Node $childNode */
            $childNode = GeneralUtility::makeInstance(\Tx_Oelib_Visibility_Node::class);
            $parentNode->addChild($childNode);

            if (is_array($nodeContents)) {
                $this->buildTreeFromArray($nodeContents, $childNode);
            } elseif ($nodeContents === true) {
                $childNode->markAsVisible();
            }

            $this->nodes[$nodeKey] = $childNode;
        }
    }
897808
function nsModelCallHelper(updateTree, modelName, methodName, p1, p2, p3, p4, p5) {
        var tree = yr.nodeset2data(updateTree);
        /** @type ns.View */
        var view = tree.bosphorus;

        var model = view.getModel(modelName);
        if (!model) {
            throw new Error('[ns-bosphorus] ' +
                'Model "' + modelName + '" in not defined for View "' + [view.id, view.key].join('#') + '"'
            );
        }

        var result = model[methodName](p1, p2, p3, p4, p5);
        return result2nodeset(result);
    }
1248680
public static void applyToHierarchy (Component comp, ComponentOp op)
    {
        applyToHierarchy(comp, Integer.MAX_VALUE, op);
    }
1003815
def build_full_toctree(builder, docname, prune, collapse):
    
    env = builder.env
    doctree = env.get_doctree(env.config.master_doc)
    toctrees = []
    for toctreenode in doctree.traverse(addnodes.toctree):
        toctree = env.resolve_toctree(docname, builder, toctreenode,
                                      collapse=collapse,
                                      prune=prune,
                                      )
        toctrees.append(toctree)
    if not toctrees:
        return None
    result = toctrees[0]
    for toctree in toctrees[1:]:
        if toctree:
            result.extend(toctree.children)
    env.resolve_references(result, docname, builder)
    return result
520265
public void updateChildrenTypes(ModelNode address, List<ModelNode> modelNodes) {

        TreeItem  rootItem = findTreeItem(tree, address);
        addChildrenTypes((ModelTreeItem) rootItem, modelNodes);

    }
899119
function toHast(tree, options) {
  var h = factory(tree, options)
  var node = one(h, tree)
  var footnotes = footer(h)

  if (node && node.children && footnotes) {
    node.children = node.children.concat(u('text', '\n'), footnotes)
  }

  return node
}