code: def run_evaluate_episodes(agent, env, render=False):
      eval_reward = []
      for i in range(5):
          obs = env.reset()
          total_reward = 0
          steps = 0
          while True:
              batch_obs = np.expand_dims(obs, axis=0)
              action = agent.predict(batch_obs.astype("float32"))
              action = action[0]  # ContinuousCartPoleE输入的action为一个实数
  
              steps += 1
              next_obs, reward, done, info = env.step(action)
  
              obs = next_obs
              total_reward += reward
  
              if render:
                  env.render()
              if done or steps >= 200:
                  break
          eval_reward.append(total_reward)
      return np.mean(eval_reward)
  
file_path: PARL/examples/tutorials/parl2_dygraph/lesson5/ddpg/train.py
imports: import gym
  import parl
  import paddle
  import numpy
  from parl.utils import logger
  from agent import Agent
  from model import Model
  from algorithm import DDPG
  from env import ContinuousCartPoleEnv
  from replay_memory import ReplayMemory
label_desc: Use image node_id 2 for calling a global function with example usage: run_evaluate_episodes(agent, env, render) and returns: np