trees.py
def _check_one_child(self) -> None:
        """
        Check if self only has one leaf subtree, and promote the name and point
        of this subtree to the parent node, then change this subtree to None.
        """
        if self._nw and self._nw.is_leaf() and not self._sw and not self._ne \
                and not self._se:
            self._name, self._point = self._nw._name, self._nw._point
            self._nw = None
        elif self._sw and self._sw.is_leaf() and not self._nw and not self._ne \
                and not self._se:
            self._name, self._point = self._sw._name, self._sw._point
            self._sw = None
        elif self._ne and self._ne.is_leaf() and not self._sw and not self._nw \
                and not self._se:
            self._name, self._point = self._ne._name, self._ne._point
            self._ne = None
        else:
            if self._se and self._se.is_leaf() and not self._sw and not \
                    self._ne and not self._nw:
                self._name, self._point = self._se._name, self._se._point
                self._se = None

        Check if self only has one leaf subtree, and promote the name and point
        of this subtree to the parent node, then change this subtree to None.
        
Check if self only has one leaf subtree, and promote the name and point
of this subtree to the parent node, then change this subtree to None.
Check if self only has one leaf subtree and promote the name and point of this subtree to the parent node then change this subtree to None .
def _check_one_child(self) -> None:
        if self._nw and self._nw.is_leaf() and not self._sw and not self._ne \
                and not self._se:
            self._name, self._point = self._nw._name, self._nw._point
            self._nw = None
        elif self._sw and self._sw.is_leaf() and not self._nw and not self._ne \
                and not self._se:
            self._name, self._point = self._sw._name, self._sw._point
            self._sw = None
        elif self._ne and self._ne.is_leaf() and not self._sw and not self._nw \
                and not self._se:
            self._name, self._point = self._ne._name, self._ne._point
            self._ne = None
        else:
            if self._se and self._se.is_leaf() and not self._sw and not \
                    self._ne and not self._nw:
                self._name, self._point = self._se._name, self._se._point
                self._se = None
def _check_one_child ( self ) -> None : if self . _nw and self . _nw . is_leaf ( ) and not self . _sw and not self . _ne and not self . _se : self . _name , self . _point = self . _nw . _name , self . _nw . _point self . _nw = None elif self . _sw and self . _sw . is_leaf ( ) and not self . _nw and not self . _ne and not self . _se : self . _name , self . _point = self . _sw . _name , self . _sw . _point self . _sw = None elif self . _ne and self . _ne . is_leaf ( ) and not self . _sw and not self . _nw and not self . _se : self . _name , self . _point = self . _ne . _name , self . _ne . _point self . _ne = None else : if self . _se and self . _se . is_leaf ( ) and not self . _sw and not self . _ne and not self . _nw : self . _name , self . _point = self . _se . _name , self . _se . _point self . _se = None
Check if self only has one leaf subtree, and promote the name and point
of this subtree to the parent node, then change this subtree to None.
Check if self only has one leaf subtree and promote the name and point of this subtree to the parent node then change this subtree to None .
"""
        Check if self only has one leaf subtree, and promote the name and point
        of this subtree to the parent node, then change this subtree to None.
        """
self