code: def _make_mirrored(distribution=None):
      v = []
      if distribution:
          devices = distribution.extended.worker_devices
      else:
          devices = ["/device:GPU:0", "/device:CPU:0"]
      for d, n, init in zip(devices, ["v", "v/replica"], [1.0, 2.0]):
          with ops.device(d):
              v.append(
                  variable_scope.get_variable(
                      name=n, initializer=init, use_resource=True
                  )
              )
  
      if (
          distribution is not None
      ) and strategy_test_lib.is_tpu_strategy(distribution):
          var_cls = tpu_values.TPUMirroredVariable
      else:
          var_cls = values_lib.MirroredVariable
      mirrored = var_cls(
          distribution, v, variable_scope.VariableAggregation.SUM
      )
      return mirrored
  
imports: import os
  from absl.testing import parameterized
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import strategy_combinations
  from tensorflow.python.distribute import strategy_test_lib
  from tensorflow.python.distribute import test_util
  from tensorflow.python.distribute import tpu_values
  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 ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.training import saver
label_desc: Use image node_id 1 for calling a global function with example usage: _make_mirrored(distribution) and returns: mirrored