def _root ( self ) : _n = self while _n . parent : _n = _n . parent return _n
python mya save root node as self varibale
Attribute referencing the root node of the tree .
def _root(self):
        """Attribute referencing the root node of the tree.

        :returns: the root node of the tree containing this instance.
        :rtype: Node
        """
        _n = self
        while _n.parent:
            _n = _n.parent
        return _n