:returns: the root node for the current node object.
321010
def get_root(self):
        """"""
        if self.lft == 1:
            return self
        return get_result_class(self.__class__).objects.get(
            tree_id=self.tree_id, lft=1)
769056
public function getRoot()
    {
        if (!$this->root) {
            $this->root = $this->active->getContext()->getCurrentSiteNode();
        }

        return $this->root;
    }
674027
@SuppressWarnings( "unchecked" )
    public <V> Key<V> getRoot() {
        if ( this.getParent() == null ) {
            return (Key<V>) this;
        } else {
            return this.getParent().getRoot();
        }
    }
63573
def top_parent(self):
        
        parent = self.parent
        while parent is not None:
            if parent.parent is None:
                return parent
            else:
                parent = parent.parent
        return self
636688
def get_node(self, index):
        

        if not index.isValid():
            return self.__root_node
        return index.internalPointer() or self.__root_node
68332
def update(self):
        
        diff = self._diff()
        if not diff:
            # Nothing to do!
            return
        self.parent.update_node(self, diff)
738517
def root(self):
        
        ret = self
        while hasattr(ret, 'parent') and ret.parent:
            ret = ret.parent
        return ret if isinstance(ret, SchemaABC) else None
953107
def CurrentNode(self):
        
        ret = libxml2mod.xmlTextReaderCurrentNode(self._o)
        if ret is None:raise treeError('xmlTextReaderCurrentNode() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
686989
def tree(self):
        
        bs = self.model.branchScale
        for node in self._tree.find_clades():
            if node != self._tree.root:
                node.branch_length = self.t[self.name_to_nodeindex[node]] * bs
        return self._tree
385861
def root(self):
        
        root = self
        while root.parent is not None:
            root = root.parent
        return root
639353
def root(self) -> "GameNode":
        """"""
        node = self

        while node.parent:
            node = node.parent

        return node
90457
def _get_ancestors(self, current=None):
        
        if not current:
            current = []
        current.insert(0, self)
        if self.is_root:
            if current:
                return current
        else:
            return self.parent._get_ancestors(current)
1215920
def nodes(self):
        
        if self._nodes is None:
            self._nodes = layout_nodes(self, only_nodes=True)
        return self._nodes
160375
public AstRoot getAstRoot() {
        AstNode parent = this;  // this node could be the AstRoot
        while (parent != null && !(parent instanceof AstRoot)) {
            parent = parent.getParent();
        }
        return (AstRoot)parent;
    }
862022
def find_root(self):
        """"""
        node = self
        while node.parent is not None:
            node = node.parent
        return node
771405
def value(self):
        
        if self.root.stale:
            self.root.update(self.root.now, None)
        return self._value
295484
def find_root(self):
        """"""
        self.find_parents()
        index = 0
        while len(self.vertices[index].parents)>0:
            index = self.vertices[index].parents[0]
        return index