trees.py
def depth(self, tree: Tree) -> Optional[int]:
        """ Return the depth of the subtree <tree> relative to <self>. Return
        None if <tree> is not a descendant of <self> and if <tree> is <self>.

        Runtime: O(log(n))
        >>> tree = TwoDTree((0, 0), (500, 500))
        >>> tree.insert('a', (250, 250))
        >>> tree.insert('b', (150, 150))
        >>> tree1 = tree.__getattribute__('_lt')
        >>> tree.depth(tree1)
        1
        """
        if isinstance(tree, TwoDTree):
            if self is tree or self.is_leaf() or tree.is_empty():
                return None
            else:
                subtree = self._point_position(tree._point)
                if subtree:
                    dep = subtree._help_depth(tree)
                    if dep is not None:
                        return dep + 1
 Return the depth of the subtree <tree> relative to <self>. Return
        None if <tree> is not a descendant of <self> and if <tree> is <self>.

        Runtime: O(log(n))
        >>> tree = TwoDTree((0, 0), (500, 500))
        >>> tree.insert('a', (250, 250))
        >>> tree.insert('b', (150, 150))
        >>> tree1 = tree.__getattribute__('_lt')
        >>> tree.depth(tree1)
        1
        
Return the depth of the subtree  relative to . Return
None if  is not a descendant of  and if  is .


Return the depth of the subtree relative to . Return None if is not a descendant of and if is .
def depth(self, tree: Tree) -> Optional[int]:
        if isinstance(tree, TwoDTree):
            if self is tree or self.is_leaf() or tree.is_empty():
                return None
            else:
                subtree = self._point_position(tree._point)
                if subtree:
                    dep = subtree._help_depth(tree)
                    if dep is not None:
                        return dep + 1
def depth ( self , tree : Tree ) -> Optional [ int ] : if isinstance ( tree , TwoDTree ) : if self is tree or self . is_leaf ( ) or tree . is_empty ( ) : return None else : subtree = self . _point_position ( tree . _point ) if subtree : dep = subtree . _help_depth ( tree ) if dep is not None : return dep + 1
Return the depth of the subtree <tree> relative to <self>.
Return the depth of the subtree <tree > relative to <self > .
""" Return the depth of the subtree <tree> relative to <self>. Return
        None if <tree> is not a descendant of <self> and if <tree> is <self>.

        Runtime: O(log(n))
        >>> tree = TwoDTree((0, 0), (500, 500))
        >>> tree.insert('a', (250, 250))
        >>> tree.insert('b', (150, 150))
        >>> tree1 = tree.__getattribute__('_lt')
        >>> tree.depth(tree1)
        1
        """
self
tree
Tree