def reset(self, **kwargs):
    'Reset only when lives are exhausted.\n        This way all states are still reachable even though lives are episodic,\n        and the learner need not know about any of this behind-the-scenes.\n        '
    if self.was_real_done:
        obs = self.env.reset(**kwargs)
    else:
        (obs, _, _, _) = self.env.step(0)
    self.lives = self.env.unwrapped.ale.lives()
    return obs
Reset only when lives are exhausted.
This way all states are still reachable even though lives are episodic,
and the learner need not know about any of this behind-the-scenes.
def reset(self, **kwargs):
    'Reset only when lives are exhausted.\n        This way all states are still reachable even though lives are episodic,\n        and the learner need not know about any of this behind-the-scenes.\n        '
    if self.was_real_done:
        obs = self.env.reset(**kwargs)
    else:
        (obs, _, _, _) = self.env.step(0)
    self.lives = self.env.unwrapped.ale.lives()
    return obs