Factory for dopamine environment initialization function.

  Args:
    batch_env_fn: function(in_graph: bool) -> batch environment.
    time_limit: time steps limit for environment.

  Returns:
    function (with optional, unused parameters) initializing environment.

def get_create_batch_env_fun(batch_env_fn, time_limit):
  """Factory for dopamine environment initialization function.

  Args:
    batch_env_fn: function(in_graph: bool) -> batch environment.
    time_limit: time steps limit for environment.

  Returns:
    function (with optional, unused parameters) initializing environment.
  """

  def create_env_fun(game_name=None, sticky_actions=None):
    del game_name, sticky_actions
    batch_env = batch_env_fn(in_graph=False)
    batch_env = ResizeBatchObservation(batch_env)  # pylint: disable=redefined-variable-type
    batch_env = DopamineBatchEnv(batch_env, max_episode_steps=time_limit)
    return batch_env

  return create_env_fun