def METHOD_NAME(self, dataset: Dataset) -> Dataset:
    tempfile, unpersisted = self._persisted_locations.pop(dataset, (None, None))
    if tempfile is None:
        return dataset
    tempfile.__exit__(None, None, None)
    return unpersisted