code: def testBatch(self, metric_class, expected_result):
      metric = metric_class()
  
      metric(
          nest_utils.stack_nested_arrays(
              [
                  trajectory.boundary((), (), (), 0.0, 1.0),
                  trajectory.boundary((), (), (), 0.0, 1.0),
              ]
          )
      )
      metric(
          nest_utils.stack_nested_arrays(
              [
                  trajectory.first((), (), (), 1.0, 1.0),
                  trajectory.first((), (), (), 1.0, 1.0),
              ]
          )
      )
      metric(
          nest_utils.stack_nested_arrays(
              [
                  trajectory.mid((), (), (), 2.0, 1.0),
                  trajectory.last((), (), (), 3.0, 0.0),
              ]
          )
      )
      metric(
          nest_utils.stack_nested_arrays(
              [
                  trajectory.last((), (), (), 3.0, 0.0),
                  trajectory.boundary((), (), (), 0.0, 1.0),
              ]
          )
      )
      metric(
          nest_utils.stack_nested_arrays(
              [
                  trajectory.boundary((), (), (), 0.0, 1.0),
                  trajectory.first((), (), (), 1.0, 1.0),
              ]
          )
      )
      self.assertEqual(expected_result, metric.result(), 5.0)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tf_agents.metrics import py_metrics
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 7 for calling the PyMetricsTest obj's underlying member method code with example usage: obj.testBatch(metric_class, expected_result) without return types