trees.py
def _help_insert(self, point: Tuple[int, int], o_point: Tuple[int, int],
                     name: str) -> None:
        """
        Insert a player named <name> into this tree at point <point>, and this
        tree has original point at <o_point>.
        === Precondition ===
        - The point <point> is in bound
        - The point <point> is not in this tree before insert.
        """
        x0, y0 = o_point
        x, y = self._centre
        if self.is_empty():
            self._name, self._point = name, point
        elif self.is_leaf():
            self._help_insert1(self._point, (x0, y0), self._name)
            self._name, self._point = None, None
            self._help_insert(point, (x0, y0), name)
        else:
            subtree, pos = self._point_position(point)
            if subtree:
                if pos == 'nw':
                    subtree._help_insert(point, (x0, y0), name)
                elif pos == 'ne':
                    subtree._help_insert(point, (x, y0), name)
                elif pos == 'sw':
                    subtree._help_insert(point, (x0, y), name)
                else:
                    subtree._help_insert(point, (x, y), name)
            else:
                self._help_insert1(point, (x0, y0), name)

        Insert a player named <name> into this tree at point <point>, and this
        tree has original point at <o_point>.
        === Precondition ===
        - The point <point> is in bound
        - The point <point> is not in this tree before insert.
        
Insert a player named  into this tree at point , and this
tree has original point at .
Precondition
The point  is in bound
The point  is not in this tree before insert.
Insert a player named into this tree at point and this tree has original point at . Precondition The point is in bound The point is not in this tree before insert .
def _help_insert(self, point: Tuple[int, int], o_point: Tuple[int, int],
                     name: str) -> None:
        x0, y0 = o_point
        x, y = self._centre
        if self.is_empty():
            self._name, self._point = name, point
        elif self.is_leaf():
            self._help_insert1(self._point, (x0, y0), self._name)
            self._name, self._point = None, None
            self._help_insert(point, (x0, y0), name)
        else:
            subtree, pos = self._point_position(point)
            if subtree:
                if pos == 'nw':
                    subtree._help_insert(point, (x0, y0), name)
                elif pos == 'ne':
                    subtree._help_insert(point, (x, y0), name)
                elif pos == 'sw':
                    subtree._help_insert(point, (x0, y), name)
                else:
                    subtree._help_insert(point, (x, y), name)
            else:
                self._help_insert1(point, (x0, y0), name)
def _help_insert ( self , point : Tuple [ int , int ] , o_point : Tuple [ int , int ] , name : str ) -> None : x0 , y0 = o_point x , y = self . _centre if self . is_empty ( ) : self . _name , self . _point = name , point elif self . is_leaf ( ) : self . _help_insert1 ( self . _point , ( x0 , y0 ) , self . _name ) self . _name , self . _point = None , None self . _help_insert ( point , ( x0 , y0 ) , name ) else : subtree , pos = self . _point_position ( point ) if subtree : if pos == 'nw' : subtree . _help_insert ( point , ( x0 , y0 ) , name ) elif pos == 'ne' : subtree . _help_insert ( point , ( x , y0 ) , name ) elif pos == 'sw' : subtree . _help_insert ( point , ( x0 , y ) , name ) else : subtree . _help_insert ( point , ( x , y ) , name ) else : self . _help_insert1 ( point , ( x0 , y0 ) , name )
Insert a player named <name> into this tree at point <point>, and this
tree has original point at <o_point>.
Insert a player named <name > into this tree at point <point > and this tree has original point at <o_point > .
"""
        Insert a player named <name> into this tree at point <point>, and this
        tree has original point at <o_point>.
        === Precondition ===
        - The point <point> is in bound
        - The point <point> is not in this tree before insert.
        """
self
point
Tuple[int, int]
o_point
Tuple[int, int]
name
str