docstr: 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
  
imports: from collections import deque
  import gymnasium
  from gymnasium import spaces
  import numpy
  from typing import Union
  from ray.rllib.utils.annotations import PublicAPI
  from ray.rllib.utils.images import rgb2gray, resize
label_desc: Use image node_id 1 to create a new MonitorEnv object from inherited base classes: gym with example: obj = MonitorEnv(env)