code: def test_play_env_problem_randomly(self):
      batch_size = 5
      num_steps = 100
  
      ep = tic_tac_toe_env_problem.TicTacToeEnvProblem()
      ep.initialize(batch_size=batch_size)
  
      env_problem_utils.play_env_problem_randomly(ep, num_steps)
  
      # We've played num_steps * batch_size steps + everytime we get 'done' we
      # create another step + batch_size number of pending steps.
      self.assertEqual(
          num_steps * batch_size
          + len(ep.trajectories.completed_trajectories)
          + batch_size,
          ep.trajectories.num_time_steps,
      )
  
file_path: tensor2tensor/tensor2tensor/envs/env_problem_utils_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.envs import env_problem_utils
  from tensor2tensor.envs import gym_env_problem
  from tensor2tensor.envs import tic_tac_toe_env
  from tensor2tensor.envs import tic_tac_toe_env_problem
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the EnvProblemUtilsTest obj's underlying member method code with example usage: obj.test_play_env_problem_randomly() without return types