code: def run_test_offline(
      env_name: str,
      model: ModelManager__Union,
      replay_memory_size: int,
      num_batches_per_epoch: int,
      num_train_epochs: int,
      passing_score_bar: float,
      num_eval_episodes: int,
      minibatch_size: int,
      use_gpu: bool,
  ):
      env = Gym(env_name=env_name)
      env.seed(SEED)
      env.action_space.seed(SEED)
      normalization = build_normalizer(env)
      logger.info(
          f"Normalization is: \n{pprint.pformat(normalization)}"
      )
  
      manager = model.value
      trainer = manager.build_trainer(
          use_gpu=use_gpu,
          reward_options=RewardOptions(),
          normalization_data_map=normalization,
      )
  
      # first fill the replay buffer to burn_in
      replay_buffer = ReplayBuffer(
          replay_capacity=replay_memory_size, batch_size=minibatch_size
      )
      # always fill full RB
      random_policy = make_random_policy_for_env(env)
      agent = Agent.create_for_env(env, policy=random_policy)
      fill_replay_buffer(
          env=env,
          replay_buffer=replay_buffer,
          desired_size=replay_memory_size,
          agent=agent,
      )
  
      device = torch.device("cuda") if use_gpu else None
      dataset = OfflineReplayBufferDataset.create_for_trainer(
          trainer,
          env,
          replay_buffer,
          batch_size=minibatch_size,
          num_batches=num_batches_per_epoch,
          device=device,
      )
      data_loader = torch.utils.data.DataLoader(
          dataset, collate_fn=identity_collate
      )
      pl_trainer = pl.Trainer(
          max_epochs=num_train_epochs,
          gpus=int(use_gpu),
          deterministic=True,
          default_root_dir=f"lightning_log_{str(uuid.uuid4())}",
      )
      pl_trainer.fit(trainer, data_loader)
  
      logger.info(
          f"Evaluating after training for {num_train_epochs} epochs: "
      )
      eval_rewards = evaluate_cem(
          env, manager, trainer, num_eval_episodes
      )
      mean_rewards = np.mean(eval_rewards)
      assert (
          mean_rewards >= passing_score_bar
      ), f"{mean_rewards} doesn't pass the bar {passing_score_bar}."
  
imports: import logging
  import os
  import pprint
  import unittest
  import uuid
  import numpy
  import pytest
  import pytorch_lightning
  import torch
  from parameterized import parameterized
  from reagent.gym.agents.agent import Agent
  from reagent.gym.datasets.replay_buffer_dataset import OfflineReplayBufferDataset
  from reagent.gym.envs import Gym
  from reagent.gym.policies.random_policies import make_random_policy_for_env
  from reagent.gym.runners.gymrunner import evaluate_for_n_episodes
  from reagent.gym.utils import build_normalizer, fill_replay_buffer
  from reagent.model_managers.union import ModelManager__Union
  from reagent.replay_memory.circular_replay_buffer import ReplayBuffer
  from reagent.test.base.horizon_test_base import HorizonTestBase
  from reagent.workflow.types import RewardOptions
label_desc: Use image node_id 3 for calling a global function with example usage: run_test_offline(env_name, model, replay_memory_size, num_batches_per_epoch, num_train_epochs, passing_score_bar, num_eval_episodes, minibatch_size, use_gpu) without return types