trees.py
def move(self, name: str, direction: str, steps: int) -> \
            Optional[Tuple[int, int]]:
        """
        Return the new location of the player named <name> after moving it
        in the given <direction> by <steps> steps.

        Raise an OutOfBoundsError if this would move the player named
        <name> out of bounds (before moving the player).
        Raise an OutOfBoundsError if moving the player would place the player at
        exactly the same coordinates of another player in the Tree (before
        moving the player).

        if a player with that name does not exist in the tree, the method
        fail silently without making any changes to the tree.

        Runtime: O(n)

        === precondition ===
        direction in ['N', 'S', 'E', 'W']

        >>> tree = TwoDTree((0, 0), (500, 500))
        >>> tree.insert('a', (250, 250))
        >>> tree.insert('b', (200, 150))
        >>> tree.insert('c', (300, 300))
        >>> 'a' in tree
        True
        >>> tree.move('a', 'W', 100)
        (150, 250)
        >>> 'a' in tree
        True
        >>> tree.contains_point((150, 250))
        True
        >>> tree.__getattribute__('_point')
        (200, 150)
        >>> tree.__getattribute__('_name')
        'b'
        >>> tree1 = tree.__getattribute__('_lt')
        >>> tree1.__getattribute__('_point')
        (150, 250)
        >>> tree1.__getattribute__('_name')
        'a'
        """
        if name in self:
            x0, y0 = self._find_point(name)
            if steps == 0:
                return x0, y0
            if direction == 'N':
                y0 -= steps
            elif direction == 'S':
                y0 += steps
            elif direction == 'E':
                x0 += steps
            else:
                x0 -= steps
            if x0 < self._nw[0] or x0 > self._se[0] or y0 < self._nw[1] or \
                    y0 > self._se[1] or self.contains_point((x0, y0)):
                raise OutOfBoundsError
            self.remove(name)
            self.insert(name, (x0, y0))
            return x0, y0

        Return the new location of the player named <name> after moving it
        in the given <direction> by <steps> steps.

        Raise an OutOfBoundsError if this would move the player named
        <name> out of bounds (before moving the player).
        Raise an OutOfBoundsError if moving the player would place the player at
        exactly the same coordinates of another player in the Tree (before
        moving the player).

        if a player with that name does not exist in the tree, the method
        fail silently without making any changes to the tree.

        Runtime: O(n)

        === precondition ===
        direction in ['N', 'S', 'E', 'W']

        >>> tree = TwoDTree((0, 0), (500, 500))
        >>> tree.insert('a', (250, 250))
        >>> tree.insert('b', (200, 150))
        >>> tree.insert('c', (300, 300))
        >>> 'a' in tree
        True
        >>> tree.move('a', 'W', 100)
        (150, 250)
        >>> 'a' in tree
        True
        >>> tree.contains_point((150, 250))
        True
        >>> tree.__getattribute__('_point')
        (200, 150)
        >>> tree.__getattribute__('_name')
        'b'
        >>> tree1 = tree.__getattribute__('_lt')
        >>> tree1.__getattribute__('_point')
        (150, 250)
        >>> tree1.__getattribute__('_name')
        'a'
        
Return the new location of the player named  after moving it
in the given  by  steps.

Raise an OutOfBoundsError if this would move the player named
 out of bounds (before moving the player).
Raise an OutOfBoundsError if moving the player would place the player at
exactly the same coordinates of another player in the Tree (before
moving the player).

if a player with that name does not exist in the tree, the method
fail silently without making any changes to the tree.






Return the new location of the player named after moving it in the given by steps . Raise an OutOfBoundsError if this would move the player named out of bounds ( before moving the player ) . Raise an OutOfBoundsError if moving the player would place the player at exactly the same coordinates of another player in the Tree ( before moving the player ) . if a player with that name does not exist in the tree the method fail silently without making any changes to the tree .
def move(self, name: str, direction: str, steps: int) -> \
            Optional[Tuple[int, int]]:
        if name in self:
            x0, y0 = self._find_point(name)
            if steps == 0:
                return x0, y0
            if direction == 'N':
                y0 -= steps
            elif direction == 'S':
                y0 += steps
            elif direction == 'E':
                x0 += steps
            else:
                x0 -= steps
            if x0 < self._nw[0] or x0 > self._se[0] or y0 < self._nw[1] or \
                    y0 > self._se[1] or self.contains_point((x0, y0)):
                raise OutOfBoundsError
            self.remove(name)
            self.insert(name, (x0, y0))
            return x0, y0
def move ( self , name : str , direction : str , steps : int ) -> Optional [ Tuple [ int , int ] ] : if name in self : x0 , y0 = self . _find_point ( name ) if steps == 0 : return x0 , y0 if direction == 'N' : y0 -= steps elif direction == 'S' : y0 += steps elif direction == 'E' : x0 += steps else : x0 -= steps if x0 < self . _nw [ 0 ] or x0 > self . _se [ 0 ] or y0 < self . _nw [ 1 ] or y0 > self . _se [ 1 ] or self . contains_point ( ( x0 , y0 ) ) : raise OutOfBoundsError self . remove ( name ) self . insert ( name , ( x0 , y0 ) ) return x0 , y0
Return the new location of the player named <name> after moving it
in the given <direction> by <steps> steps.
Return the new location of the player named <name > after moving it in the given <direction > by <steps > steps .
"""
        Return the new location of the player named <name> after moving it
        in the given <direction> by <steps> steps.

        Raise an OutOfBoundsError if this would move the player named
        <name> out of bounds (before moving the player).
        Raise an OutOfBoundsError if moving the player would place the player at
        exactly the same coordinates of another player in the Tree (before
        moving the player).

        if a player with that name does not exist in the tree, the method
        fail silently without making any changes to the tree.

        Runtime: O(n)

        === precondition ===
        direction in ['N', 'S', 'E', 'W']

        >>> tree = TwoDTree((0, 0), (500, 500))
        >>> tree.insert('a', (250, 250))
        >>> tree.insert('b', (200, 150))
        >>> tree.insert('c', (300, 300))
        >>> 'a' in tree
        True
        >>> tree.move('a', 'W', 100)
        (150, 250)
        >>> 'a' in tree
        True
        >>> tree.contains_point((150, 250))
        True
        >>> tree.__getattribute__('_point')
        (200, 150)
        >>> tree.__getattribute__('_name')
        'b'
        >>> tree1 = tree.__getattribute__('_lt')
        >>> tree1.__getattribute__('_point')
        (150, 250)
        >>> tree1.__getattribute__('_name')
        'a'
        """
self
name
str
direction
str
steps
int