'Purge this DatasetInstance and the dataset underlying it.'

def purge(self, dataset_assoc, flush=True):

    self.dataset_manager.error_unless_dataset_purge_allowed()
    super(DatasetAssociationManager, self).purge(dataset_assoc, flush=True)
    self.stop_creating_job(dataset_assoc)
    if dataset_assoc.dataset.user_can_purge:
        self.dataset_manager.purge(dataset_assoc.dataset)
    return dataset_assoc
