import gym.envs.mujoco.hopper as hopper
import numpy as np


class HopperEnv(hopper.HopperEnv):
    def _get_obs(self):
        return np.concatenate([
            self.sim.data.qpos.flat[1:],
            self.sim.data.qvel.flat,
        ])

    def reset_obs(self, obs):
        state = np.insert(obs, 0, 0.)
        qpos = state[:self.model.nq]
        qvel = state[self.model.nq:]
        self.set_state(qpos, qvel)
        return self._get_obs()

[((7, 15, 10, 10), 'numpy.concatenate', 'np.concatenate', ({(7, 30, 10, 9): '[self.sim.data.qpos.flat[1:], self.sim.data.qvel.flat]'}, {}), '([self.sim.data.qpos.flat[1:], self.sim.data.qvel.flat])', True, 'import numpy as np\n'), ((13, 16, 13, 37), 'numpy.insert', 'np.insert', ({(13, 26, 13, 29): 'obs', (13, 31, 13, 32): '0', (13, 34, 13, 36): '0.0'}, {}), '(obs, 0, 0.0)', True, 'import numpy as np\n')]