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.
        """
        if self.is_empty():
            return []
        elif self.is_leaf():
            if left <= self._point[0] <= right and \
                    top <= self._point[1] <= bottom:
                return [self._name]
            else:
                return []
        else:
            result = []
            x, y = self._point
            if left <= x <= right and top <= y <= bottom:
                result.append(self._name)
            if self._split_type == 'x':
                if x < right and self._gt:
                    result.extend(self._gt._name_in_range(left, top, right,
                                                          bottom))
                if x >= left and self._lt:
                    result.extend(self._lt._name_in_range(left, top, right,
                                                          bottom))
            else:
                if y < bottom and self._gt:
                    result.extend(self._gt._name_in_range(left, top, right,
                                                          bottom))
                if y >= top and self._lt:
                    result.extend(self._lt._name_in_range(left, top, right,
                                                          bottom))
            return result

        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]:
        if self.is_empty():
            return []
        elif self.is_leaf():
            if left <= self._point[0] <= right and \
                    top <= self._point[1] <= bottom:
                return [self._name]
            else:
                return []
        else:
            result = []
            x, y = self._point
            if left <= x <= right and top <= y <= bottom:
                result.append(self._name)
            if self._split_type == 'x':
                if x < right and self._gt:
                    result.extend(self._gt._name_in_range(left, top, right,
                                                          bottom))
                if x >= left and self._lt:
                    result.extend(self._lt._name_in_range(left, top, right,
                                                          bottom))
            else:
                if y < bottom and self._gt:
                    result.extend(self._gt._name_in_range(left, top, right,
                                                          bottom))
                if y >= top and self._lt:
                    result.extend(self._lt._name_in_range(left, top, right,
                                                          bottom))
            return result
def _name_in_range ( self , left : int , top : int , right : int , bottom : int ) -> List [ str ] : if self . is_empty ( ) : return [ ] elif self . is_leaf ( ) : if left <= self . _point [ 0 ] <= right and top <= self . _point [ 1 ] <= bottom : return [ self . _name ] else : return [ ] else : result = [ ] x , y = self . _point if left <= x <= right and top <= y <= bottom : result . append ( self . _name ) if self . _split_type == 'x' : if x < right and self . _gt : result . extend ( self . _gt . _name_in_range ( left , top , right , bottom ) ) if x >= left and self . _lt : result . extend ( self . _lt . _name_in_range ( left , top , right , bottom ) ) else : if y < bottom and self . _gt : result . extend ( self . _gt . _name_in_range ( left , top , right , bottom ) ) if y >= top and self . _lt : result . extend ( self . _lt . _name_in_range ( left , top , right , bottom ) ) return result
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