def _persist_metadata(self):
serializable_data = self.get_serializable()<EOL>try:<EOL><INDENT>self._try_persist_metadata(serializable_data)<EOL><DEDENT>except TypeError:<EOL><INDENT>cleaned_data = Script._remove_non_serializable_store_entries(serializable_data["<STR_LIT:store>"])<EOL>self._try_persist_metadata(cleaned_data)<EOL><DEDENT>
Write all script meta-data, including the persistent script Store.
The Store instance might contain arbitrary user data, like function objects, OpenCL contexts, or whatever other
non-serializable objects, both as keys or values.
Try to serialize the data, and if it fails, fall back to checking the store and removing all non-serializable
data.