'Purge this HDA and the dataset underlying it.'

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

    user = (hda.history.user or None)
    quota_amount_reduction = 0
    if user:
        quota_amount_reduction = hda.quota_amount(user)
    super(HDAManager, self).purge(hda, flush=flush)
    if quota_amount_reduction:
        user.adjust_total_disk_usage((- quota_amount_reduction))
    return hda
