code: def test_unsupported_methods(self):
      strategy = mirrored_strategy.MirroredStrategy(mesh=self.mesh)
      replica_context = dtensor_util.DTensorReplicaContext(strategy)
  
      expected_error = replica_context._UNSUPPORTED_ERROR_MSG
  
      self.assertEqual(replica_context.num_replicas_in_sync, 2)
  
      self.assertEqual(replica_context.replica_id_in_sync_group, 0)
  
      with self.assertRaisesRegex(NotImplementedError, expected_error):
          replica_context.merge_call(None)
  
      with self.assertRaisesRegex(NotImplementedError, expected_error):
          replica_context.all_reduce(reduce_util.ReduceOp.SUM, None)
  
      with self.assertRaisesRegex(NotImplementedError, expected_error):
          replica_context.all_gather([], 0)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.dtensor.python import api
  from tensorflow.dtensor.python import layout
  from tensorflow.dtensor.python.tests import test_util
  from tensorflow.python.distribute import reduce_util
  from tensorflow.python.distribute import values
  from tensorflow.python.distribute.experimental import dtensor_util
  from tensorflow.python.distribute.experimental import mirrored_strategy
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import test
  from tensorflow.python.framework import constant_op
label_desc: Use image node_id 2 for calling the DTensorReplicaContextTest obj's underlying member method code with example usage: obj.test_unsupported_methods() without return types