code: def _test_env(self, env):
      acc_rws = []
      num_test_episodes = 200
  
      for e in range(num_test_episodes):
          start_time = time.time()
          env.reset()
          acc_rw = 0
          for i in range(1, env.max_steps + 1):
              env.print_internal_state()
              action = env.random_action()
              ob, rw, done, info = env.step(action)
              logger.debug(
                  "After action {}: reward {}, observation {} ({})".format(
                      env.print_action(action), rw, ob, env.print_ob(ob)
                  )
              )
              acc_rw += rw
              if done:
                  env.print_internal_state()
                  logger.debug(
                      "Epoch {} done in {} step {} seconds, accumulated reward {}\n\n".format(
                          e, i, time.time() - start_time, acc_rw
                      )
                  )
                  break
          acc_rws.append(acc_rw)
  
      mean_acc_rw = np.mean(acc_rws)
      logger.debug("Average accumulated reward {}".format(mean_acc_rw))
      return mean_acc_rw
  
file_path: ReAgent/reagent/gym/tests/test_pomdp.py
imports: import logging
  import time
  import unittest
  import numpy
  from reagent.gym.envs import Gym
label_desc: Use image node_id 5 for calling the TestPOMDPEnvironment obj's underlying member method code with example usage: obj._test_env(env) and returns: mean_acc_rw