code: def make_env(
      batch_size=1,
      env_problem_name="",
      resize=True,
      resize_dims=(105, 80),
      max_timestep="None",
      clip_rewards=True,
      parallelism=1,
      use_tpu=False,
      num_actions=None,
      rendered_env=True,
      **env_kwargs,
  ):
      """Creates the env."""
  
      if clip_rewards:
          env_kwargs.update(
              {"reward_range": (-1, 1), "discrete_rewards": True}
          )
      else:
          env_kwargs.update({"discrete_rewards": False})
  
      # TODO(henrykm) - below someone linked "resize" with "abnormality"
      # Probably we need more nuanced concept of "abnormality"
      # decoupled from "resize". Currently the resize flag implies
      # that we switch from a generic env to a wrapped env.
      # Overall this file and gym_utils.py look like good candidates
      # for a refactor.
  
      # No resizing needed, so let's be on the normal EnvProblem.
      if not resize:  # None or False
          return gym_env_problem.GymEnvProblem(
              base_env_name=env_problem_name,
              batch_size=batch_size,
              parallelism=parallelism,
              **env_kwargs,
          )
  
      try:
          max_timestep = int(max_timestep)
      except Exception:  # pylint: disable=broad-except
          max_timestep = None
  
      wrapper_fn = functools.partial(
          gym_utils.gym_env_wrapper,
          **{
              "rl_env_max_episode_steps": max_timestep,
              "maxskip_env": True,
              "rendered_env": rendered_env,
              "rendered_env_resize_to": resize_dims,
              "sticky_actions": False,
              "output_dtype": np.int32 if use_tpu else None,
              "num_actions": num_actions,
          },
      )
  
      return rendered_env_problem.RenderedEnvProblem(
          base_env_name=env_problem_name,
          batch_size=batch_size,
          parallelism=parallelism,
          rendered_env=rendered_env,
          env_wrapper_fn=wrapper_fn,
          **env_kwargs,
      )
  
file_path: tensor2tensor/tensor2tensor/envs/env_problem_utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import time
  import gym
  import numpy
  from tensor2tensor.envs import gym_env_problem
  from tensor2tensor.envs import rendered_env_problem
  from tensor2tensor.rl import gym_utils
label_desc: Use image node_id 5 for calling a global function with example usage: make_env(batch_size, env_problem_name, resize, resize_dims, max_timestep, clip_rewards, parallelism, use_tpu, num_actions, rendered_env) and returns: rendered_env_problem, gym_env_problem