

@spin_first
def purge_results(self, jobs=[], targets=[]):
    "Tell the Hub to forget results.\n        \n        Individual results can be purged by msg_id, or the entire\n        history of specific targets can be purged.\n        \n        Use `purge_results('all')` to scrub everything from the Hub's db.\n        \n        Parameters\n        ----------\n        \n        jobs : str or list of str or AsyncResult objects\n                the msg_ids whose results should be forgotten.\n        targets : int/str/list of ints/strs\n                The targets, by int_id, whose entire history is to be purged.\n                \n                default : None\n        "
    if ((not targets) and (not jobs)):
        raise ValueError('Must specify at least one of `targets` and `jobs`')
    if targets:
        targets = self._build_targets(targets)[1]
    if (jobs == 'all'):
        msg_ids = jobs
    else:
        msg_ids = []
        if isinstance(jobs, (str, AsyncResult)):
            jobs = [jobs]
        bad_ids = [obj for obj in jobs if (not isinstance(obj, (str, AsyncResult)))]
        if bad_ids:
            raise TypeError(('Invalid msg_id type %r, expected str or AsyncResult' % bad_ids[0]))
        for j in jobs:
            if isinstance(j, AsyncResult):
                msg_ids.extend(j.msg_ids)
            else:
                msg_ids.append(j)
    content = dict(engine_ids=targets, msg_ids=msg_ids)
    self.session.send(self._query_socket, 'purge_request', content=content)
    (idents, msg) = self.session.recv(self._query_socket, 0)
    if self.debug:
        pprint(msg)
    content = msg['content']
    if (content['status'] != 'ok'):
        raise self._unwrap_exception(content)

dataset/ETHPy150Open ipython/ipython-py3k/IPython/parallel/client/client.py Client.purge_results/original