keras/src/saving/serialization_lib.py/SafeModeScope/__exit__
class SafeModeScope:    def __exit__(self, *args, **kwargs):
        global_state.set_global_attribute(
            "safe_mode_saving", self.original_value
        )