code: def run_evaluate_episodes(agent, env, eval_episodes):
      avg_reward = 0.0
      for k in range(eval_episodes):
          obs = env.reset()
          done = False
          steps = 0
          while not done and steps < env._max_episode_steps:
              steps += 1
              action = agent.predict(obs)
              obs, reward, done, _ = env.step(action)
              avg_reward += reward
      avg_reward /= eval_episodes
      return avg_reward
  
file_path: PARL/examples/CARLA_SAC/train.py
imports: import numpy
  import parl
  import argparse
  from env_utils import ParallelEnv, LocalEnv
  from parl.utils import logger, summary, ReplayMemory
  from carla_model import CarlaModel
  from carla_agent import CarlaAgent
  from parl.algorithms import SAC
  from env_config import EnvConfig
label_desc: Use image node_id 1 for calling a global function with example usage: run_evaluate_episodes(agent, env, eval_episodes) and returns: avg_reward