code: def testAverageReturnMultiMetric(
      self, run_mode, num_trajectories, reward_spec, expected_result
  ):
      with run_mode():
          trajectories = self._create_trajectories()
          multi_trajectories = []
          for traj in trajectories:
              if isinstance(reward_spec, list):
                  new_reward = [traj.reward, traj.reward]
              elif isinstance(reward_spec, dict):
                  new_reward = {"a": traj.reward, "b": traj.reward}
              else:
                  new_reward = tf.stack(
                      [traj.reward, traj.reward], axis=1
                  )
              new_traj = trajectory.Trajectory(
                  step_type=traj.step_type,
                  observation=traj.observation,
                  action=traj.action,
                  policy_info=traj.policy_info,
                  next_step_type=traj.next_step_type,
                  reward=new_reward,
                  discount=traj.discount,
              )
              multi_trajectories.append(new_traj)
  
          metric = tf_metrics.AverageReturnMultiMetric(
              reward_spec, batch_size=2
          )
          self.evaluate(tf.compat.v1.global_variables_initializer())
          self.evaluate(metric.init_variables())
          for i in range(num_trajectories):
              self.evaluate(metric(multi_trajectories[i]))
  
          self.assertAllClose(
              expected_result, self.evaluate(metric.result())
          )
          metric.reset()
          self.evaluate_last_func_if_graph_mode()
          reset_result = self.evaluate(
              tf.nest.map_structure(tf.zeros_like, expected_result)
          )
          self.assertAllClose(
              reset_result, self.evaluate(metric.result())
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import tensorflow
  from tf_agents.metrics import tf_metrics
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import trajectory
  from tensorflow.python.eager import context
label_desc: Use image node_id 7 for calling the TFMetricsTest obj's underlying member method code with example usage: obj.testAverageReturnMultiMetric(run_mode, num_trajectories, reward_spec, expected_result) without return types