code: def run_dynamic_bandit_env(
      num_unique_batches: int,
      batch_size: int,
      num_arms_per_episode: int,
      feature_dim: int,
      max_epochs: int,
      num_obs: int,
      gpus: int = 0,
      rand_seed: int = 937162211,
  ) -> Tuple[DynamicBanditAgent, List[float], List[float]]:
      seed_everything(rand_seed)
      pl_trainer = pl.Trainer(
          max_epochs=max_epochs,
          gpus=int(gpus),
          default_root_dir=f"lightning_log_{str(uuid.uuid4())}",
      )
  
      agent = DynamicBanditAgent.make_agent(feature_dim=feature_dim)
      env = DynamicBanditEnv(
          num_unique_batches=num_unique_batches,
          batch_size=batch_size,
          num_arms_per_episode=num_arms_per_episode,
          feature_dim=feature_dim,
      )
  
      dataset = BanditDataset(env=env, agent=agent, num_obs=num_obs)
      data_loader = torch.utils.data.DataLoader(
          dataset, collate_fn=identity_collate
      )
      pl_trainer.fit(agent.trainer, data_loader)
      return agent, env.accumulated_rewards, env.accumulated_regrets
  
file_path: ReAgent/reagent/evaluation/cb/run_synthetic_bandit.py
imports: import uuid
  from typing import List, Tuple
  import pytorch_lightning
  import torch
  from pytorch_lightning import seed_everything
  from reagent.evaluation.cb.synthetic_contextual_bandit_data import DynamicBanditAgent, DynamicBanditEnv
label_desc: Use image node_id 2 for calling a global function with example usage: run_dynamic_bandit_env(num_unique_batches, batch_size, num_arms_per_episode, feature_dim, max_epochs, num_obs, gpus, rand_seed) and returns: agent,  env,  env