code: def run_train_episode(agent, env, rpm):
      action_dim = env.action_space.shape[0]
      obs = env.reset()
      done = False
      episode_reward = 0
      episode_steps = 0
  
      while not done:
          episode_steps += 1
          # Select action use optimistic exploration or according to policy
          if rpm.size() < WARMUP_STEPS:
              action = np.random.uniform(-1, 1, size=action_dim)
          else:
              action = agent.sample(obs)
  
          # Perform action
          next_obs, reward, done, _ = env.step(action)
          terminal = (
              float(done)
              if episode_steps < env._max_episode_steps
              else 0
          )
  
          # Store data in replay memory
          rpm.append(obs, action, reward, next_obs, terminal)
  
          obs = next_obs
          episode_reward += reward
          # Train agent after collecting sufficient data
          if rpm.size() >= WARMUP_STEPS:
              (
                  batch_obs,
                  batch_action,
                  batch_reward,
                  batch_next_obs,
                  batch_terminal,
              ) = rpm.sample_batch(BATCH_SIZE)
              agent.learn(
                  batch_obs,
                  batch_action,
                  batch_reward,
                  batch_next_obs,
                  batch_terminal,
              )
  
      return episode_reward, episode_steps
  
file_path: PARL/benchmark/torch/oac/train.py
imports: import numpy
  import gym
  import argparse
  from parl.utils import logger, summary, ReplayMemory
  from parl.env import ActionMappingWrapper, CompatWrapper
  from mujoco_model import MujocoModel
  from mujoco_agent import MujocoAgent
  from parl.algorithms import OAC
label_desc: Use image node_id 1 for calling a global function with example usage: run_train_episode(agent, env, rpm) and returns: episode_reward,  episode_steps