docstr: Record episodes stats prior to EpisodicLifeEnv, etc.
docstr_tok: ["Record","episodes","stats","prior","to","EpisodicLifeEnv",",","etc","."]
code: def __init__(self, env=None):
      """Record episodes stats prior to EpisodicLifeEnv, etc."""
      gym.Wrapper.__init__(self, env)
      self._current_reward = None
      self._num_steps = None
      self._total_steps = None
      self._episode_rewards = []
      self._episode_lengths = []
      self._num_episodes = 0
      self._num_returned = 0
      self.tstart = time.time()
  
imports: import time
  import numpy
  from collections import deque
  import gym
  from gym import spaces
  from parl.env.compat_wrappers import CompatWrapper, is_gym_version_ge, V_NPRANDOM_CHANGED
  import cv2
label_desc: Use image node_id 1 to create a new MonitorEnv object from inherited base classes: gym with example: obj = MonitorEnv(env)