code: def __init__(
      self,
      env,
      filename,
      allow_early_resets=False,
      reset_keywords=(),
      info_keywords=(),
  ):
      Wrapper.__init__(self, env=env)
      self.tstart = time.time()
      if filename:
          self.results_writer = ResultsWriter(
              filename,
              header={
                  "t_start": time.time(),
                  "env_id": env.spec and env.spec.id,
              },
              extra_keys=reset_keywords + info_keywords,
          )
      else:
          self.results_writer = None
      self.reset_keywords = reset_keywords
      self.info_keywords = info_keywords
      self.allow_early_resets = allow_early_resets
      self.rewards = None
      self.needs_reset = True
      self.episode_rewards = []
      self.episode_lengths = []
      self.episode_times = []
      self.total_steps = 0
      self.current_reset_info = {}
  
imports: from gym.core import Wrapper
  import time
  from glob import glob
  import csv
  import os.path
  import json
label_desc: Use image node_id 1 to create a new Monitor object from inherited base classes: Wrapper with example: obj = Monitor(env, filename, allow_early_resets, reset_keywords, info_keywords)