keras/src/saving/serialization_lib.py/ObjectSharingScope/__exit__
class ObjectSharingScope:    def __exit__(self, *args, **kwargs):
        global_state.set_global_attribute("shared_objects/id_to_obj_map", None)
        global_state.set_global_attribute(
            "shared_objects/id_to_config_map", None
        )