code: def eval_performance(
      env, agent, n_steps, n_episodes, max_episode_len=None, logger=None
  ):
      """Run multiple evaluation episodes and return statistics.
  
      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 episodes.
          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:
          Dict of statistics.
      """
  
      assert (n_steps is None) != (n_episodes is None)
  
      if isinstance(env, chainerrl.env.VectorEnv):
          scores = batch_run_evaluation_episodes(
              env,
              agent,
              n_steps,
              n_episodes,
              max_episode_len=max_episode_len,
              logger=logger,
          )
      else:
          scores = run_evaluation_episodes(
              env,
              agent,
              n_steps,
              n_episodes,
              max_episode_len=max_episode_len,
              logger=logger,
          )
      stats = dict(
          episodes=len(scores),
          mean=statistics.mean(scores),
          median=statistics.median(scores),
          stdev=statistics.stdev(scores) if len(scores) >= 2 else 0.0,
          max=np.max(scores),
          min=np.min(scores),
      )
      return stats
  
imports: import logging
  import multiprocessing
  import os
  import statistics
  import time
  import numpy
  import chainerrl
label_desc: Use image node_id 3 for calling a global function with example usage: eval_performance(env, agent, n_steps, n_episodes, max_episode_len, logger) and returns: stats