class_docstr: A monitor wrapper for Gym environments, it is used to know the episode reward, length, time and other data.
  
  :param env: (gym.Env) The environment
  :param filename: (Optional[str]) the location to save a log file, can be None for no log
  :param allow_early_resets: (bool) allows the reset of the environment before it is done
  :param reset_keywords: (tuple) extra keywords for the reset call, if extra parameters are needed at reset
  :param info_keywords: (tuple) extra information to log, from the information return of environment.step
docstr: Step the environment with the given action
  
  :param action: (np.ndarray) the action
  :return: (Tuple[np.ndarray, float, bool, Dict[Any, Any]]) observation, reward, done, information
docstr_tok: ["Step","the","environment","with","the","given","action",":","param","action",":","(","np.ndarray",")","the","action",":","return",":","(","Tuple","[","np.ndarray",",","float",",","bool",",","Dict","[","Any",",","Any","]","]",")","observation",",","reward",",","done",",","information"]
code: def step(
      self, action: np.ndarray
  ) -> Tuple[np.ndarray, float, bool, Dict[Any, Any]]:
      """
      Step the environment with the given action
  
      :param action: (np.ndarray) the action
      :return: (Tuple[np.ndarray, float, bool, Dict[Any, Any]]) observation, reward, done, information
      """
      if self.needs_reset:
          raise RuntimeError(
              "Tried to step environment that needs reset"
          )
      observation, reward, done, info = self.env.step(action)
      self.rewards.append(reward)
      if done:
          self.needs_reset = True
          ep_rew = sum(self.rewards)
          eplen = len(self.rewards)
          ep_info = {
              "r": round(ep_rew, 6),
              "l": eplen,
              "t": round(time.time() - self.t_start, 6),
          }
          for key in self.info_keywords:
              ep_info[key] = info[key]
          self.episode_rewards.append(ep_rew)
          self.episode_lengths.append(eplen)
          self.episode_times.append(time.time() - self.t_start)
          ep_info.update(self.current_reset_info)
          if self.logger:
              self.logger.writerow(ep_info)
              self.file_handler.flush()
          info["episode"] = ep_info
      self.total_steps += 1
      return observation, reward, done, info
  
imports: import csv
  import json
  import os
  import time
  from glob import glob
  from typing import Tuple, Dict, Any, List, Optional
  import gym
  import pandas
  import numpy
label_desc: Use image node_id 3 for calling the Monitor obj's underlying member method code with example usage: obj.step(action) and returns: observation,  reward,  done,  info