code: def run_train_episode(env, agent, rpm):
      obs = env.reset()
      total_reward = 0
      steps = 0
      while True:
          steps += 1
          batch_obs = np.expand_dims(obs, axis=0)
  
          if rpm.size() < WARMUP_SIZE:
              action = env.action_space.sample()
          else:
              action = agent.sample(batch_obs.astype("float32"))
              action = np.squeeze(action)
  
          next_obs, reward, done, info = env.step(action)
  
          rpm.append(obs, action, reward, next_obs, done)
  
          if rpm.size() > WARMUP_SIZE:
              (
                  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,
              )
  
          obs = next_obs
          total_reward += reward
  
          if done:
              break
      return total_reward, steps
  
file_path: PARL/benchmark/fluid/SAC/train.py
imports: from parl.utils import check_version_for_fluid
  import argparse
  import gym
  import numpy
  import time
  import parl
  from mujoco_agent import MujocoAgent
  from mujoco_model import ActorModel, CriticModel
  from parl.utils import logger, summary, ReplayMemory
label_desc: Use image node_id 1 for calling a global function with example usage: run_train_episode(env, agent, rpm) and returns: total_reward,  steps