Using inheritance up to the root, get the complete Options
        object for the given node and the specified group.
540275
def options(self, group, target=None, defaults=True):
        
        if target is None:
            target = self.path
        if self.groups.get(group, None) is None:
            return None
        if self.parent is None and target and (self is not Store.options()) and defaults:
            root_name = self.__class__.__name__
            replacement = root_name + ('' if len(target) == len(root_name) else '.')
            option_key = target.replace(replacement,'')
            match = Store.options().find(option_key)
            if match is not Store.options():
                return match.options(group)
            else:
                return Options()
        elif self.parent is None:
            return self.groups[group]

        parent_opts = self.parent.options(group,target, defaults)
        return Options(**dict(parent_opts.kwargs, **self.groups[group].kwargs))
1093339
private static ItemGroup<?> getBaseGroup(BlueOrganization org) {
        ItemGroup<?> group = null;
        if (org != null && org instanceof AbstractOrganization) {
            group = ((AbstractOrganization) org).getGroup();
        }
        return group;
    }
327183
def RootGroup(self):
		

		return(clc.v2.Group(id=self.root_group_id,alias=self.alias,session=self.session))
383078
def get_descendants(self):
        
        return self.__class__.get_tree(self).exclude(pk=self.pk)
916455
function Node(tree, options) {
		this.tree = tree;
		if (options && options.parent) {this.parent = options.parent;}
		if (options && options.hasOwnProperty('key')) { this.key = options.key; }
		this.data = options && options.hasOwnProperty('value') ? [options.value] : [];
	}
580987
public static <T extends HierarchyEntity<T, ?>> List<T> getRoots(final List<T> nodes) {
    List<T> roots = CollectUtils.newArrayList();
    for (T m : nodes)
      if (null == m.getParent() || !nodes.contains(m.getParent())) roots.add(m);
    return roots;
  }
1089714
public static OrganigramNode findTreeNode(OrganigramNode searchRoot, OrganigramNode selection) {
        if (selection == null || searchRoot == null) {
            return null;
        }

        if (searchRoot.equals(selection)) {
            return searchRoot;
        }

        if (searchRoot.getChildren() != null) {
            for (OrganigramNode child : searchRoot.getChildren()) {
                OrganigramNode childResult = findTreeNode(child, selection);
                if (childResult != null) {
                    return childResult;
                }
            }
        }

        return null;
    }
542202
def is_descendant_of(self, node):
        
        return self.pk in [obj.pk for obj in node.get_descendants()]
548108
private void buildGroupedRoot(Map<?,?> groupedItems, RecursiveTreeItem parent, int groupIndex) {
        boolean setRoot = false;
        if (parent == null) {
            parent = new RecursiveTreeItem<>(new RecursiveTreeObject(), RecursiveTreeObject::getChildren);
            setRoot = true;
        }

        for (Map.Entry<?, ?> entry : groupedItems.entrySet()) {
            Object key = entry.getKey();
            RecursiveTreeObject groupItem = new RecursiveTreeObject<>();
            groupItem.setGroupedValue(key);
            groupItem.setGroupedColumn(groupOrder.get(groupIndex));

            RecursiveTreeItem node = new RecursiveTreeItem<>(groupItem, RecursiveTreeObject::getChildren);
            // TODO: need to be removed once the selection issue is fixed
            node.expandedProperty().addListener((o, oldVal, newVal) -> {
                getSelectionModel().clearSelection();
            });

            parent.originalItems.add(node);
            parent.getChildren().add(node);

            Object children = entry.getValue();
            if (children instanceof List) {
                node.originalItems.addAll((List) children);
                node.getChildren().addAll((List) children);
            } else if (children instanceof Map) {
                buildGroupedRoot((Map) children, node, groupIndex + 1);
            }
        }

        // update ui
        if (setRoot) {
            final RecursiveTreeItem<S> newParent = parent;
            JFXUtilities.runInFX(() -> {
                ArrayList<TreeTableColumn<S, ?>> sortOrder = new ArrayList<>();
                sortOrder.addAll(getSortOrder());
                internalSetRoot = true;
                setRoot(newParent);
                internalSetRoot = false;
                getSortOrder().addAll(sortOrder);
                getSelectionModel().select(0);
            });
        }
    }
420983
def complete_options(node)

      return [:keyword] + [:prefix_op] if tokens.empty?

      #prefix operator
      return [:keyword] if last_token_is(PREFIX_OPERATORS)

      # left hand
      if is_left_hand(node)
        if (tokens.size == 1 || last_token_is(PREFIX_OPERATORS + LOGICAL_INFIX_OPERATORS) ||
            last_token_is(PREFIX_OPERATORS + LOGICAL_INFIX_OPERATORS, 2))
          options = [:keyword]
          options += [:prefix_op]  unless last_token_is(PREFIX_OPERATORS)
        else
          options = [:logical_op]
        end
        return options
      end

      if is_right_hand
        # right hand
        return [:value]
      else
        # comparison operator completer
        return [:infix_op]
      end
    end
798485
def get_tree(cls, parent=None):
        
        cls = get_result_class(cls)

        if parent is None:
            # return the entire tree
            return cls.objects.all()
        if parent.is_leaf():
            return cls.objects.filter(pk=parent.pk)
        return cls.objects.filter(
            path__startswith=parent.path,
            depth__gte=parent.depth
        ).order_by(
            'path'
        )
783048
def getRootNode(nodes):
    ''''''
    max = 0
    root = None
    for i in nodes:
        if len(i.children) > max:
            max = len(i.children)
            root = i
    return root
139468
private Group readGroup(Node groupNode) throws Exception
   {
      String groupName = groupNode.getName();
      String desc = utils.readString(groupNode, GroupProperties.JOS_DESCRIPTION);
      String label = utils.readString(groupNode, GroupProperties.JOS_LABEL);
      String parentId = utils.getGroupIds(groupNode).parentId;

      GroupImpl group = new GroupImpl(groupName, parentId);
      group.setInternalId(groupNode.getUUID());
      group.setDescription(desc);
      group.setLabel(label);

      return group;
   }
139511
def _choice_getter(self):
        
        def get_group_member_element(obj):
            return obj.first_child_found_in(*self._member_nsptagnames)
        get_group_member_element.__doc__ = (
            'Return the child element belonging to this element group, or '
            '|None| if no member child is present.'
        )
        return get_group_member_element
1143511
def inherited_meths(opts = {})
      inheritance_tree[1..-1].inject([]) do |list, superclass|
        if superclass.is_a?(Proxy)
          list
        else
          list += superclass.meths(opts).reject do |o|
            next(false) if opts[:all]
            child(:name => o.name, :scope => o.scope) ||
              list.find {|o2| o2.name == o.name && o2.scope == o.scope }
          end
        end
      end
    end
413163
private Map<String, String> getStrategyOptionsFromTree(Tree options)
    {
        //Check for old [{}] syntax
        if (options.getText().equalsIgnoreCase("ARRAY"))
        {
            System.err.println("WARNING: [{}] strategy_options syntax is deprecated, please use {}");

            if (options.getChildCount() == 0)
                return Collections.EMPTY_MAP;

            return getStrategyOptionsFromTree(options.getChild(0));
        }

        // this map will be returned
        Map<String, String> strategyOptions = new HashMap<String, String>();

        // each child node is ^(PAIR $key $value)
        for (int j = 0; j < options.getChildCount(); j++)
        {
            Tree optionPair = options.getChild(j);

            // current $key
            String key = CliUtils.unescapeSQLString(optionPair.getChild(0).getText());
            // current $value
            String val = CliUtils.unescapeSQLString(optionPair.getChild(1).getText());

            strategyOptions.put(key, val);
        }

        return strategyOptions;
    }
11086
def _inherit_context(self, node):
        ''''''

        # Collect the initial list of xml:foo attributes.
        xmlattrs = filter(_IN_XML_NS, _attrs(node))

        # Walk up and get all xml:XXX attributes we inherit.
        inherited, parent = [], node.parentNode
        while parent and parent.nodeType == Node.ELEMENT_NODE:
            for a in filter(_IN_XML_NS, _attrs(parent)):
                n = a.localName
                if n not in xmlattrs:
                    xmlattrs.append(n)
                    inherited.append(a)
            parent = parent.parentNode
        return inherited