code: def test_metric_results_equal_with_batched_env(self):
      env_ctor = lambda: random_py_environment.RandomPyEnvironment(  # pylint: disable=g-long-lambda
          self._time_step_spec.observation, self._action_spec
      )
      batch_size = 5
      env = batched_py_environment.BatchedPyEnvironment(
          [env_ctor() for _ in range(batch_size)]
      )
      tf_env = tf_py_environment.TFPyEnvironment(env)
  
      python_metrics, tensorflow_metrics = self._build_metrics(
          batch_size=batch_size
      )
      observers = python_metrics + tensorflow_metrics
      driver = dynamic_step_driver.DynamicStepDriver(
          tf_env, self._policy, observers=observers, num_steps=1000
      )
  
      self.evaluate(tf.compat.v1.global_variables_initializer())
      self.evaluate(driver.run())
  
      for python_metric, tensorflow_metric in zip(
          python_metrics, tensorflow_metrics
      ):
          python_result = self.evaluate(python_metric.result())
          tensorflow_result = self.evaluate(tensorflow_metric.result())
          self.assertEqual(python_result, tensorflow_result)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from six.moves import range
  from six.moves import zip
  import tensorflow
  from tf_agents.drivers import dynamic_step_driver
  from tf_agents.environments import batched_py_environment
  from tf_agents.environments import random_py_environment
  from tf_agents.environments import tf_py_environment
  from tf_agents.metrics import py_metrics
  from tf_agents.metrics import tf_metrics
  from tf_agents.metrics import tf_py_metric
  from tf_agents.policies import random_tf_policy
  from tf_agents.specs import array_spec
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.utils import test_utils
label_desc: Use image node_id 4 for calling the MetricEqualityTest obj's underlying member method code with example usage: obj.test_metric_results_equal_with_batched_env() without return types