code: def create_simulated_env(
      output_dir,
      grayscale,
      resize_width_factor,
      resize_height_factor,
      frame_stack_size,
      generative_model,
      generative_model_params,
      random_starts=True,
      which_epoch_data="last",
      **other_hparams,
  ):
      """ "Create SimulatedEnv with minimal subset of hparams."""
      # We need these, to initialize T2TGymEnv, but these values (hopefully) have
      # no effect on player.
      a_bit_risky_defaults = {
          "game": "pong",  # assumes that T2TGymEnv has always reward_range (-1,1)
          "real_batch_size": 1,
          "rl_env_max_episode_steps": -1,
          "max_num_noops": 0,
      }
  
      for key in a_bit_risky_defaults:
          if key not in other_hparams:
              other_hparams[key] = a_bit_risky_defaults[key]
  
      hparams = hparam.HParams(
          grayscale=grayscale,
          resize_width_factor=resize_width_factor,
          resize_height_factor=resize_height_factor,
          frame_stack_size=frame_stack_size,
          generative_model=generative_model,
          generative_model_params=generative_model_params,
          **other_hparams,
      )
      return load_data_and_make_simulated_env(
          output_dir,
          wm_dir=None,
          hparams=hparams,
          which_epoch_data=which_epoch_data,
          random_starts=random_starts,
      )
  
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 6 for calling a global function with example usage: create_simulated_env(output_dir, grayscale, resize_width_factor, resize_height_factor, frame_stack_size, generative_model, generative_model_params, random_starts, which_epoch_data) and returns: load_data_and_make_simulated_env