code: def test_custom_object_scope(self):
      def custom_fn():
          pass
  
      class CustomClass:
          pass
  
      def check_get_in_thread():
          with object_registration.custom_object_scope(
              {"CustomClass": CustomClass, "custom_fn": custom_fn}
          ):
              actual_custom_fn = keras.activations.get("custom_fn")
              self.assertEqual(actual_custom_fn, custom_fn)
              actual_custom_class = keras.regularizers.get(
                  "CustomClass"
              )
              self.assertEqual(
                  actual_custom_class.__class__, CustomClass
              )
  
          with object_registration.custom_object_scope(
              {"CustomClass": CustomClass, "custom_fn": custom_fn}
          ):
              actual_custom_fn = keras.activations.get("custom_fn")
              self.assertEqual(actual_custom_fn, custom_fn)
              actual_custom_class = keras.regularizers.get(
                  "CustomClass"
              )
              self.assertEqual(
                  actual_custom_class.__class__, CustomClass
              )
              checked_thread = self.checkedThread(check_get_in_thread)
              checked_thread.start()
              checked_thread.join()
  
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 1 for calling the TestObjectRegistration obj's underlying member method code with example usage: obj.test_custom_object_scope() without return types