def legal_moves(self, position):
        """ Obtain legal moves and where they lead.

        Parameters
        ----------
        position : tuple of int (x, y)
            the position to start at

        Returns
        -------
        legal_moves_dict : dict mapping strings (moves) to positions (x, y)
            the legal moves and where they would lead.

        """
        legal_moves_dict = {}
        for move, new_pos in self.neighbourhood(position).items():
            try:
                if not self.maze[new_pos]:
                    legal_moves_dict[move] = new_pos
            except __HOLE__:
                # If we’re outside the maze, it is not a legal move.
                pass
        return legal_moves_dict
dataset/ETHPy150Open ASPP/pelita/pelita/datamodel.py/CTFUniverse.legal_moves