code: def load_data_and_make_simulated_env(
      data_dir,
      wm_dir,
      hparams,
      which_epoch_data="last",
      random_starts=True,
      setable_initial_frames=False,
  ):
      hparams = copy.deepcopy(hparams)
      t2t_env = setup_and_load_epoch(
          hparams, data_dir=data_dir, which_epoch_data=which_epoch_data
      )
      return SimulatedGymEnv(
          t2t_env,
          world_model_dir=wm_dir,
          hparams=hparams,
          random_starts=random_starts,
          setable_initial_frames=setable_initial_frames,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import os
  import re
  import gym
  import numpy
  import six
  from tensor2tensor.models.research.rl import get_policy
  from tensor2tensor.models.research.rl import make_simulated_env_fn_from_hparams
  from tensor2tensor.rl import rl_utils
  from tensor2tensor.rl.envs.simulated_batch_gym_env import FlatBatchEnv
  from tensor2tensor.utils import hparam
  from tensor2tensor.utils import trainer_lib
  from tensor2tensor.utils.misc_utils import camelcase_to_snakecase
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling a global function with example usage: load_data_and_make_simulated_env(data_dir, wm_dir, hparams, which_epoch_data, random_starts, setable_initial_frames) and returns: SimulatedGymEnv