code: def __init__(self, logdir):
      self.summary = Summary(logdir=logdir)
  
      self.max_shaping_reward = 0
      self.max_x_offset_reward = 0
      self.max_r2_reward = 0
  
      self.critic_loss_counter = StatCounter(max_size=500)
  
      self.r2_reward_counter = StatCounter(max_size=500)
      self.nofall_r2_reward_counter = StatCounter(max_size=500)
      self.falldown_counter100 = StatCounter(max_size=100)
  
      self.vel_keys = [
          "scalar_vel",
          "first_stage_vel",
          "second_stage_vel",
          "third_stage_vel",
      ]
      self.vel_counter = {}
      for key in self.vel_keys:
          self.vel_counter[key] = StatCounter(max_size=500)
      self.reward_loss_keys = [
          "start_loss",
          "first_change_loss",
          "second_change_loss",
          "third_change_loss",
          "start_other_loss",
          "first_change_other_loss",
          "second_change_other_loss",
          "third_change_other_loss",
          "other_loss",
      ]
      self.reward_loss_counter = {}
      for key in self.reward_loss_keys:
          self.reward_loss_counter[key] = StatCounter(max_size=500)
  
imports: import csv
  import numpy
  import tensorflow
  import os
  import six
label_desc: Use image node_id 1 to create a new ScalarsManager object from inherited base classes: object with example: obj = ScalarsManager(logdir)