def get_xy(self, xy, addr=True):
        """Get the agent with xy-coordinate in the grid. If *addr* is True,
        returns only the agent's address.

        If no such agent in the grid, returns None.

        :raises:
            :exc:`ValueError` if xy-coordinate is outside the environment's
            grid.
        """
        x = xy[0]
        y = xy[1]
        if x < self.origin[0] or x >= self.origin[0] + self.gs[0]:
            raise ValueError("x-coordinate inappropriate ({})".format(x))
        if y < self.origin[1] or y >= self.origin[1] + self.gs[1]:
            raise ValueError("y-coordinate inappropriate ({})".format(y))

        i = x - self.origin[0]
        j = y - self.origin[1]
        if addr:
            return self.grid[i][j].addr
        return self.grid[i][j]
Get the agent with xy-coordinate in the grid. If *addr* is True,
        returns only the agent's address.

        If no such agent in the grid, returns None.

        :raises:
            :exc:`ValueError` if xy-coordinate is outside the environment's
            grid.