trees.py
def _name_in_range(self, left: int, top: int, right: int,
                       bottom: int) -> List[str]:
        """ Return a list of names that is within the frame constructed by the
        four boundaries <left>, <top>, <right>, <bottom>. Only check the
        subtrees which the frame included.

        === Precondition ===
        - This function is only to be called on the root QuadTree.
        """
        lst = []
        if self.is_leaf():
            if left <= self._point[0] <= right and \
                    top <= self._point[1] <= bottom:
                return [self._name]
        else:
            a, b = self._centre
            if a >= left and b >= top and self._nw:
                lst.extend(self._nw._name_in_range(left, top, right, bottom))
            if a <= right and b >= top and self._ne:
                lst.extend(self._ne._name_in_range(left, top, right, bottom))
            if a >= left and b <= bottom and self._sw:
                lst.extend(self._sw._name_in_range(left, top, right, bottom))
            if a <= right and b <= bottom and self._se:
                lst.extend(self._se._name_in_range(left, top, right, bottom))
        return lst
 Return a list of names that is within the frame constructed by the
        four boundaries <left>, <top>, <right>, <bottom>. Only check the
        subtrees which the frame included.

        === Precondition ===
        - This function is only to be called on the root QuadTree.
        
Return a list of names that is within the frame constructed by the
four boundaries , , , . Only check the
subtrees which the frame included.

Precondition
This function is only to be called on the root QuadTree.
Return a list of names that is within the frame constructed by the four boundaries . Only check the subtrees which the frame included . Precondition This function is only to be called on the root QuadTree .
def _name_in_range(self, left: int, top: int, right: int,
                       bottom: int) -> List[str]:
        lst = []
        if self.is_leaf():
            if left <= self._point[0] <= right and \
                    top <= self._point[1] <= bottom:
                return [self._name]
        else:
            a, b = self._centre
            if a >= left and b >= top and self._nw:
                lst.extend(self._nw._name_in_range(left, top, right, bottom))
            if a <= right and b >= top and self._ne:
                lst.extend(self._ne._name_in_range(left, top, right, bottom))
            if a >= left and b <= bottom and self._sw:
                lst.extend(self._sw._name_in_range(left, top, right, bottom))
            if a <= right and b <= bottom and self._se:
                lst.extend(self._se._name_in_range(left, top, right, bottom))
        return lst
def _name_in_range ( self , left : int , top : int , right : int , bottom : int ) -> List [ str ] : lst = [ ] if self . is_leaf ( ) : if left <= self . _point [ 0 ] <= right and top <= self . _point [ 1 ] <= bottom : return [ self . _name ] else : a , b = self . _centre if a >= left and b >= top and self . _nw : lst . extend ( self . _nw . _name_in_range ( left , top , right , bottom ) ) if a <= right and b >= top and self . _ne : lst . extend ( self . _ne . _name_in_range ( left , top , right , bottom ) ) if a >= left and b <= bottom and self . _sw : lst . extend ( self . _sw . _name_in_range ( left , top , right , bottom ) ) if a <= right and b <= bottom and self . _se : lst . extend ( self . _se . _name_in_range ( left , top , right , bottom ) ) return lst
Return a list of names that is within the frame constructed by the
four boundaries <left>, <top>, <right>, <bottom>.
Return a list of names that is within the frame constructed by the four boundaries <left > <top > <right > <bottom > .
""" Return a list of names that is within the frame constructed by the
        four boundaries <left>, <top>, <right>, <bottom>. Only check the
        subtrees which the frame included.

        === Precondition ===
        - This function is only to be called on the root QuadTree.
        """
self
left
int
top
int
right
int
bottom
int