code: def run_evaluation_episodes(
      env, agent, n_steps, n_episodes, max_episode_len=None, logger=None
  ):
      """Run multiple evaluation episodes and return returns.
  
      Args:
          env (Environment): Environment used for evaluation
          agent (Agent): Agent to evaluate.
          n_steps (int): Number of timesteps to evaluate for.
          n_episodes (int): Number of evaluation runs.
          max_episode_len (int or None): If specified, episodes longer than this
              value will be truncated.
          logger (Logger or None): If specified, the given Logger object will be
              used for logging results. If not specified, the default logger of
              this module will be used.
      Returns:
          List of returns of evaluation runs.
      """
      assert (n_steps is None) != (n_episodes is None)
  
      logger = logger or logging.getLogger(__name__)
      scores = []
      terminate = False
      timestep = 0
  
      reset = True
      while not terminate:
          if reset:
              obs = env.reset()
              done = False
              test_r = 0
              episode_len = 0
              info = {}
          a = agent.act(obs)
          obs, r, done, info = env.step(a)
          test_r += r
          episode_len += 1
          timestep += 1
          reset = (
              done
              or episode_len == max_episode_len
              or info.get("needs_reset", False)
          )
          if reset:
              logger.info(
                  "evaluation episode %s length:%s R:%s",
                  len(scores),
                  episode_len,
                  test_r,
              )
              # As mixing float and numpy float causes errors in statistics
              # functions, here every score is cast to float.
              scores.append(float(test_r))
          if n_steps is None:
              terminate = len(scores) >= n_episodes
          else:
              terminate = timestep >= n_steps
          if reset or terminate:
              agent.stop_episode()
      # If all steps were used for a single unfinished episode
      if len(scores) == 0:
          scores.append(float(test_r))
          logger.info(
              "evaluation episode %s length:%s R:%s",
              len(scores),
              episode_len,
              test_r,
          )
      return scores
  
imports: import logging
  import multiprocessing
  import os
  import statistics
  import time
  import numpy
  import chainerrl
label_desc: Use image node_id 1 for calling a global function with example usage: run_evaluation_episodes(env, agent, n_steps, n_episodes, max_episode_len, logger) and returns: scores