class_docstr: Object that is responsible for evaluating a given agent.
  
  Args:
      agent (Agent): Agent to evaluate.
      env (Env): Env to evaluate the agent on.
      n_steps (int): Number of timesteps used in each evaluation.
      n_episodes (int): Number of episodes used in each evaluation.
      eval_interval (int): Interval of evaluations in steps.
      outdir (str): Path to a directory to save things.
      max_episode_len (int): Maximum length of episodes used in evaluations.
      step_offset (int): Offset of steps used to schedule evaluations.
      evaluation_hooks (Sequence): Sequence of
          pfrl.experiments.evaluation_hooks.EvaluationHook objects. They are
          called after each evaluation.
      save_best_so_far_agent (bool): If set to True, after each evaluation,
          if the score (= mean of returns in evaluation episodes) exceeds
          the best-so-far score, the current agent is saved.
      use_tensorboard (bool): Additionally log eval stats to tensorboard
code: def __init__(
      self,
      agent,
      env,
      n_steps,
      n_episodes,
      eval_interval,
      outdir,
      max_episode_len=None,
      step_offset=0,
      evaluation_hooks=(),
      save_best_so_far_agent=True,
      logger=None,
      use_tensorboard=False,
  ):
      assert (n_steps is None) != (n_episodes is None), (
          "One of n_steps or n_episodes must be None. "
          + "Either we evaluate for a specified number "
          + "of episodes or for a specified number of timesteps."
      )
      self.agent = agent
      self.env = env
      self.max_score = np.finfo(np.float32).min
      self.start_time = time.time()
      self.n_steps = n_steps
      self.n_episodes = n_episodes
      self.eval_interval = eval_interval
      self.outdir = outdir
      self.use_tensorboard = use_tensorboard
      self.max_episode_len = max_episode_len
      self.step_offset = step_offset
      self.prev_eval_t = (
          self.step_offset - self.step_offset % self.eval_interval
      )
      self.evaluation_hooks = evaluation_hooks
      self.save_best_so_far_agent = save_best_so_far_agent
      self.logger = logger or logging.getLogger(__name__)
      self.env_get_stats = getattr(
          self.env, "get_statistics", lambda: []
      )
      self.env_clear_stats = getattr(
          self.env, "clear_statistics", lambda: None
      )
      assert callable(self.env_get_stats)
      assert callable(self.env_clear_stats)
  
      # Write a header line first
      write_header(self.outdir, self.agent, self.env)
  
      if use_tensorboard:
          self.tb_writer = create_tb_writer(outdir)
  
imports: import logging
  import multiprocessing
  import os
  import statistics
  import time
  import numpy
  import pfrl
label_desc: Use image node_id 1 to create a new Evaluator object from inherited base classes: object with example: obj = Evaluator(agent, env, n_steps, n_episodes, eval_interval, outdir, max_episode_len, step_offset, evaluation_hooks, save_best_so_far_agent, logger, use_tensorboard)