code: def evaluate(agent, env, render=False):
      # test part, run 5 episodes and average
      eval_reward = []
      for i in range(5):
          obs = env.reset()
          episode_reward = 0
          isOver = False
          while not isOver:
              action = agent.predict(obs)
              if render:
                  env.render()
              obs, reward, isOver, _ = env.step(action)
              episode_reward += reward
          eval_reward.append(episode_reward)
      return np.mean(eval_reward)
  
file_path: PARL/benchmark/fluid/DQN/train.py
imports: from parl.utils import check_version_for_fluid
  import gym
  import numpy
  import parl
  from parl.utils import logger
  from cartpole_model import CartpoleModel
  from cartpole_agent import CartpoleAgent
  from replay_memory import ReplayMemory
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate(agent, env, render) and returns: np