def METHOD_NAME():
    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(METHOD_NAME)
        checked_thread.start()
        checked_thread.join()