code: def run_episode(env, agent, train_or_test="train"):
      obs_list, action_list, reward_list = [], [], []
      obs = env.reset()
      while True:
          obs_list.append(obs)
          if train_or_test == "train":
              action = agent.sample(obs)
          else:
              action = agent.predict(obs)
          action_list.append(action)
  
          obs, reward, done, info = env.step(action)
          reward_list.append(reward)
  
          if done:
              break
      return obs_list, action_list, reward_list
  
file_path: PARL/benchmark/fluid/QuickStart/train.py
imports: from parl.utils import check_version_for_fluid
  import gym
  import numpy
  import parl
  import os.path
  from cartpole_agent import CartpoleAgent
  from cartpole_model import CartpoleModel
  from parl.utils import logger
label_desc: Use image node_id 1 for calling a global function with example usage: run_episode(env, agent, train_or_test) and returns: obs_list,  action_list,  reward_list