code: def __init__(self, venv, filename=None, keep_buf=0, info_keywords=()):
      VecEnvWrapper.__init__(self, venv)
      self.eprets = None
      self.eplens = None
      self.epcount = 0
      self.tstart = time.time()
      if filename:
          self.results_writer = ResultsWriter(
              filename,
              header={"t_start": self.tstart},
              extra_keys=info_keywords,
          )
      else:
          self.results_writer = None
      self.info_keywords = info_keywords
      self.keep_buf = keep_buf
      if self.keep_buf:
          self.epret_buf = deque([], maxlen=keep_buf)
          self.eplen_buf = deque([], maxlen=keep_buf)
  
file_path: baselines/baselines/common/vec_env/vec_monitor.py
imports: from .None import VecEnvWrapper
  from baselines.bench.monitor import ResultsWriter
  import numpy
  import time
  from collections import deque
label_desc: Use image node_id 1 to create a new VecMonitor object from inherited base classes: VecEnvWrapper with example: obj = VecMonitor(venv, filename, keep_buf, info_keywords)