code: def play_env_problem_randomly(env_problem, num_steps):
      """Plays the env problem by randomly sampling actions for `num_steps`."""
      # Reset all environments.
      env_problem.reset()
  
      # Play all environments, sampling random actions each time.
      for _ in range(num_steps):
          # Sample batch_size actions from the action space and stack them.
          actions = np.stack(
              [
                  env_problem.action_space.sample()
                  for _ in range(env_problem.batch_size)
              ]
          )
  
          # Execute actions, observations are stored in `env_problem`.
          _, _, dones, _ = env_problem.step(actions)
  
          # Get the indices where we are done and reset those.
          env_problem.reset(indices=done_indices(dones))
  
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 2 for calling a global function with example usage: play_env_problem_randomly(env_problem, num_steps) without return types