code: def save(self):
          
          with NamedTemporaryFile(
              dir=os.path.dirname(self.storage_path), delete=False
          ) as f:
              # we use protocol=2 for python 2/3 compatibility
              dump(self.data, f, protocol=2)
              f.flush()
              os.fsync(f.fileno())
              tmppath = f.name
          os.rename(tmppath, self.storage_path)
docs: Save our data to disk. We want to always have a valid file.