code: def test_duplicate_registration(self):
      @registration.register_serializable()
      class Duplicate(base.Trackable):
          pass
  
      dup = Duplicate()
      self.assertEqual(
          registration.get_registered_class_name(dup),
          "Custom.Duplicate",
      )
      # Registrations with different names are ok.
      registration.register_serializable(package="duplicate")(Duplicate)
      # Registrations are checked in reverse order.
      self.assertEqual(
          registration.get_registered_class_name(dup),
          "duplicate.Duplicate",
      )
      # Both names should resolve to the same class.
      self.assertIs(
          registration.get_registered_class("Custom.Duplicate"),
          Duplicate,
      )
      self.assertIs(
          registration.get_registered_class("duplicate.Duplicate"),
          Duplicate,
      )
  
      # Registrations of the same name fails
      with self.assertRaisesRegex(
          ValueError, "already been registered"
      ):
          registration.register_serializable(
              package="testing", name="CustomPackage"
          )(Duplicate)
  
imports: from absl.testing import parameterized
  from tensorflow.python.eager import test
  from tensorflow.python.saved_model import registration
  from tensorflow.python.trackable import base
label_desc: Use image node_id 4 for calling the SerializableRegistrationTest obj's underlying member method code with example usage: obj.test_duplicate_registration() without return types