keras/src/saving/object_registration.py/CustomObjectScope/__exit__
class CustomObjectScope:    def __exit__(self, *args, **kwargs):
        global_state.set_global_attribute(
            "custom_objects_scope_dict", self.backup.copy()
        )