code: def _assert_mirrored_equal(
      self, left_list, right_list, sess=None, run_options=None
  ):
      if not isinstance(left_list, list):
          left_list, right_list = [left_list], [right_list]
  
      for left, right in zip(left_list, right_list):
          self.assertEqual(type(left), type(right))
  
          # Convert Mirrored to a list since sess.run(Mirrored) only returns one
          # value.
          if isinstance(left, value_lib.Mirrored):
              left, right = left.values, right.values
          else:
              # When there's only one replica Mirrored is automatically unwrapped.
              left, right = [left], [right]
  
          for left_value, right_value in zip(left, right):
              self.assertEqual(
                  device_util.resolve(left_value.device),
                  device_util.resolve(right_value.device),
              )
  
          # Densify IndexedSlices.
          left = [ops.convert_to_tensor(v) for v in left]
          right = [ops.convert_to_tensor(v) for v in right]
          if not context.executing_eagerly():
              left, right = sess.run((left, right), options=run_options)
          for left_value, right_value in zip(left, right):
              self.assertAllEqual(left_value, right_value)
  
imports: import itertools
  import os
  import threading
  import time
  from absl.testing import parameterized
  import numpy
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.distribute import cluster_resolver
  from tensorflow.python.distribute import collective_all_reduce_strategy
  from tensorflow.python.distribute import collective_util
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import cross_device_ops
  from tensorflow.python.distribute import cross_device_utils
  from tensorflow.python.distribute import device_util
  from tensorflow.python.distribute import distribute_utils
  from tensorflow.python.distribute import multi_worker_test_base
  from tensorflow.python.distribute import multi_worker_util
  from tensorflow.python.distribute import reduce_util
  from tensorflow.python.distribute import strategy_combinations
  from tensorflow.python.distribute import values
  from tensorflow.python.eager import context
  from tensorflow.python.eager import test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import kernels
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import collective_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
label_desc: Use image node_id 2 for calling the CrossDeviceOpsTestBase obj's underlying member method code with example usage: obj._assert_mirrored_equal(left_list, right_list, sess, run_options) without return types