<commit_before>import gym
from gym import error, spaces, utils
from gym.utils import seeding
import numpy as np
import os
from gym_maze.envs.maze_view_2d import MazeView2D


class MazeEnv(gym.Env):
    metadata = {
        "render.modes": ["human"],
        "video.frames_per_second": 60
    }

    ACTION = ["N", "S", "E", "W"]

    def __init__(self):

        self.maze_view = MazeView2D("maze2d.npy")
        self.maze_size = self.maze_view.maze_size

        # forward or backward in each dimension
        self.action_space = spaces.Discrete(2*len(self.maze_size))

        # observation is the x, y coordinate of the grid
        low = np.zeros(len(self.maze_size))
        high =  np.array(self.maze_size) - np.ones(len(self.maze_size))
        self.observation_space = spaces.Box(low, high)

        # initial condition
        self.state = None
        self.steps_beyond_done = None

        # Simulation related variables.
        self._seed()
        self.reset()

        # Just need to initialize the relevant attributes
        self._configure()

    def _configure(self, display=None):
        self.display = display

    def _seed(self, seed=None):
        self.np_random, seed = seeding.np_random(seed)
        return [seed]

    def _step(self, action):<commit_msg>Fixed a bug that it always chooses the maze_001<commit_after>import gym
from gym import error, spaces, utils
from gym.utils import seeding
import numpy as np
import os
from gym_maze.envs.maze_view_2d import MazeView2D


class MazeEnv(gym.Env):
    metadata = {
        "render.modes": ["human"],
    }

    ACTION = ["N", "S", "E", "W"]

    def __init__(self):

        self.maze_view = MazeView2D(maze_file_path="maze2d_002.npy")
        self.maze_size = self.maze_view.maze_size

        # forward or backward in each dimension
        self.action_space = spaces.Discrete(2*len(self.maze_size))

        # observation is the x, y coordinate of the grid
        low = np.zeros(len(self.maze_size))
        high =  np.array(self.maze_size) - np.ones(len(self.maze_size))
        self.observation_space = spaces.Box(low, high)

        # initial condition
        self.state = None
        self.steps_beyond_done = None

        # Simulation related variables.
        self._seed()
        self.reset()

        # Just need to initialize the relevant attributes
        self._configure()

    def _configure(self, display=None):
        self.display = display

    def _seed(self, seed=None):
        self.np_random, seed = seeding.np_random(seed)
        return [seed]

    def _step(self, action):
{'fraction_non_alphanumeric': 0.10259388308168796, 'fraction_numerical': 0.006968641114982578, 'mean_word_length': 2.588888888888889, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '503798', 'n_tokens_mistral': 850, 'n_tokens_neox': 815, 'n_words': 205}