code: def test_serialize_custom_function(self):
      @object_registration.register_keras_serializable()
      def my_fn():
          return 42
  
      serialized_name = "Custom>my_fn"
      class_name = object_registration.GLOBAL_CUSTOM_NAMES[my_fn]
      self.assertEqual(serialized_name, class_name)
      fn_class_name = object_registration.get_registered_name(my_fn)
      self.assertEqual(fn_class_name, class_name)
  
      config = keras.saving.serialize_keras_object(my_fn)
      fn = keras.saving.deserialize_keras_object(config)
      self.assertEqual(42, fn())
  
      fn_2 = object_registration.get_registered_object(fn_class_name)
      self.assertEqual(42, fn_2())
  
file_path: keras/keras/saving/object_registration_test.py
imports: import keras
  from keras import testing
  from keras.saving import object_registration
  from keras.saving import serialization_lib
label_desc: Use image node_id 4 for calling the TestObjectRegistration obj's underlying member method code with example usage: obj.test_serialize_custom_function() and returns: int