docstr: Calculates the episode statistics
  
  :param n_steps: (int) The number of steps to run for each environment
  :param n_envs: (int) The number of environments
docstr_tok: ["Calculates","the","episode","statistics",":","param","n_steps",":","(","int",")","The","number","of","steps","to","run","for","each","environment",":","param","n_envs",":","(","int",")","The","number","of","environments"]
code: def __init__(self, n_steps, n_envs):
      """
      Calculates the episode statistics
  
      :param n_steps: (int) The number of steps to run for each environment
      :param n_envs: (int) The number of environments
      """
      self.episode_rewards = []
      for _ in range(n_envs):
          self.episode_rewards.append([])
      self.len_buffer = deque(
          maxlen=40
      )  # rolling buffer for episode lengths
      self.rewbuffer = deque(
          maxlen=40
      )  # rolling buffer for episode rewards
      self.n_steps = n_steps
      self.n_envs = n_envs
  
imports: import time
  import warnings
  import numpy
  import tensorflow
  from gym.spaces import Discrete, Box
  from collections import deque
  from stable_baselines import logger
  from stable_baselines.common.schedules import Scheduler
  from stable_baselines.common.tf_util import batch_to_seq, seq_to_batch, check_shape, avg_norm, gradient_add, q_explained_variance, total_episode_reward_logger
  from stable_baselines.acer.buffer import Buffer
  from stable_baselines.common import ActorCriticRLModel, tf_util, SetVerbosity, TensorboardWriter
  from stable_baselines.common.runners import AbstractEnvRunner
  from stable_baselines.common.policies import ActorCriticPolicy, RecurrentActorCriticPolicy
label_desc: Use image node_id 1 to create a new EpisodeStats object  with example: obj = EpisodeStats(n_steps, n_envs)