keras/src/saving/serialization_lib.py/SafeModeScope/__enter__
class SafeModeScope:    def __enter__(self):
        self.original_value = in_safe_mode()
        global_state.set_global_attribute("safe_mode_saving", self.safe_mode)