code: def testRegister(self):
      sub_expected = registry.register(Base)(ValidSub)
      sub_registered = registry.lookup("ValidSub", Base)
      self.assertEqual(sub_registered, sub_expected)
  
      alias_expected = registry.register(Base, lookup_name="alias")(
          ValidSub
      )
      alias_registered = registry.lookup("alias", Base)
      self.assertEqual(alias_registered, alias_expected)
  
      sub_method_expected = registry.register(base_method)(
          valid_sub_method
      )
      sub_method_registered = registry.lookup(
          "valid_sub_method", base_method
      )
      self.assertEqual(sub_method_registered, sub_method_expected)
  
      self.assertRaises(ValueError, registry.register(Base), InvalidSub)
      self.assertRaises(
          ValueError, registry.register(base_method), invalid_sub_method
      )
  
      # Cannot register the same class / method twice.
      self.assertRaises(ValueError, registry.register(Base), ValidSub)
      self.assertRaises(
          ValueError, registry.register(base_method), valid_sub_method
      )
  
      # Both base and the subclass / method should be of the right type.
      self.assertRaises(ValueError, registry.register, "foo")
      self.assertRaises(ValueError, registry.register(Base), "foo")
      self.assertRaises(
          ValueError, registry.register(base_method), "foo"
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  from model_search import registry
label_desc: Use image node_id 1 for calling the RegisterTest obj's underlying member method code with example usage: obj.testRegister() without return types