trees.py
def _help_insert(self, name: str, point: Tuple[int, int]) -> None:
        """
        Insert a player named <name> into this tree at point <point>.

        === Precondition ===
        - The point <point> is in bound
        - The point <point> is not in this tree before insert.
        """
        x1, y1 = point
        if self.is_empty():
            self._name, self._point = name, point
        else:
            x, y = self._point
            if self._split_type == 'x':
                if x1 <= x:
                    if not self._lt:
                        self._lt = TwoDTree(None, None)
                        self._lt._name, self._lt._point = name, point
                        self._lt._split_type = 'y'
                    else:
                        self._lt._help_insert(name, point)
                else:
                    if not self._gt:
                        self._gt = TwoDTree(None, None)
                        self._gt._name, self._gt._point = name, point
                        self._gt._split_type = 'y'
                    else:
                        self._gt._help_insert(name, point)
            else:
                if y1 <= y:
                    if not self._lt:
                        self._lt = TwoDTree(None, None)
                        self._lt._name, self._lt._point = name, point
                        self._lt._split_type = 'x'
                    else:
                        self._lt._help_insert(name, point)
                else:
                    if not self._gt:
                        self._gt = TwoDTree(None, None)
                        self._gt._name, self._gt._point = name, point
                        self._gt._split_type = 'x'
                    else:
                        self._gt._help_insert(name, point)

        Insert a player named <name> into this tree at point <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 .
Precondition
The point  is in bound
The point  is not in this tree before insert.
Insert a player named into this tree at point . Precondition The point is in bound The point is not in this tree before insert .
def _help_insert(self, name: str, point: Tuple[int, int]) -> None:
        x1, y1 = point
        if self.is_empty():
            self._name, self._point = name, point
        else:
            x, y = self._point
            if self._split_type == 'x':
                if x1 <= x:
                    if not self._lt:
                        self._lt = TwoDTree(None, None)
                        self._lt._name, self._lt._point = name, point
                        self._lt._split_type = 'y'
                    else:
                        self._lt._help_insert(name, point)
                else:
                    if not self._gt:
                        self._gt = TwoDTree(None, None)
                        self._gt._name, self._gt._point = name, point
                        self._gt._split_type = 'y'
                    else:
                        self._gt._help_insert(name, point)
            else:
                if y1 <= y:
                    if not self._lt:
                        self._lt = TwoDTree(None, None)
                        self._lt._name, self._lt._point = name, point
                        self._lt._split_type = 'x'
                    else:
                        self._lt._help_insert(name, point)
                else:
                    if not self._gt:
                        self._gt = TwoDTree(None, None)
                        self._gt._name, self._gt._point = name, point
                        self._gt._split_type = 'x'
                    else:
                        self._gt._help_insert(name, point)
def _help_insert ( self , name : str , point : Tuple [ int , int ] ) -> None : x1 , y1 = point if self . is_empty ( ) : self . _name , self . _point = name , point else : x , y = self . _point if self . _split_type == 'x' : if x1 <= x : if not self . _lt : self . _lt = TwoDTree ( None , None ) self . _lt . _name , self . _lt . _point = name , point self . _lt . _split_type = 'y' else : self . _lt . _help_insert ( name , point ) else : if not self . _gt : self . _gt = TwoDTree ( None , None ) self . _gt . _name , self . _gt . _point = name , point self . _gt . _split_type = 'y' else : self . _gt . _help_insert ( name , point ) else : if y1 <= y : if not self . _lt : self . _lt = TwoDTree ( None , None ) self . _lt . _name , self . _lt . _point = name , point self . _lt . _split_type = 'x' else : self . _lt . _help_insert ( name , point ) else : if not self . _gt : self . _gt = TwoDTree ( None , None ) self . _gt . _name , self . _gt . _point = name , point self . _gt . _split_type = 'x' else : self . _gt . _help_insert ( name , point )
Insert a player named <name> into this tree at point <point>.
Insert a player named <name > into this tree at point <point > .
"""
        Insert a player named <name> into this tree at point <point>.

        === Precondition ===
        - The point <point> is in bound
        - The point <point> is not in this tree before insert.
        """
self
name
str
point
Tuple[int, int]