environment/lib/python2.7/site-packages/IPython/parallel/client/client.py
def purge_results(self, jobs=[], targets=[]):
        """Tell the Hub to forget results.

        Individual results can be purged by msg_id, or the entire
        history of specific targets can be purged.

        Use `purge_results('all')` to scrub everything from the Hub's db.

        Parameters
        ----------

        jobs : str or list of str or AsyncResult objects
                the msg_ids whose results should be forgotten.
        targets : int/str/list of ints/strs
                The targets, by int_id, whose entire history is to be purged.

                default : None
        """
        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]

        # construct msg_ids from jobs
        if jobs == 'all':
            msg_ids = jobs
        else:
            msg_ids = []
            if isinstance(jobs, (basestring,AsyncResult)):
                jobs = [jobs]
            bad_ids = filter(lambda obj: not isinstance(obj, (basestring, AsyncResult)), jobs)
            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)
def purge_results(self, jobs=[], targets=[]):
        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]

        # construct msg_ids from jobs
        if jobs == 'all':
            msg_ids = jobs
        else:
            msg_ids = []
            if isinstance(jobs, (basestring,AsyncResult)):
                jobs = [jobs]
            bad_ids = filter(lambda obj: not isinstance(obj, (basestring, AsyncResult)), jobs)
            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)
def purge_results ( self , jobs = [ ] , targets = [ ] ) : 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 ] # construct msg_ids from jobs if jobs == 'all' : msg_ids = jobs else : msg_ids = [ ] if isinstance ( jobs , ( basestring , AsyncResult ) ) : jobs = [ jobs ] bad_ids = filter ( lambda obj : not isinstance ( obj , ( basestring , AsyncResult ) ) , jobs ) 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 )
Tell the Hub to forget results.

        Individual results can be purged by msg_id, or the entire
        history of specific targets can be purged.

        Use `purge_results('all')` to scrub everything from the Hub's db.

        Parameters
        ----------

        jobs : str or list of str or AsyncResult objects
                the msg_ids whose results should be forgotten.
        targets : int/str/list of ints/strs
                The targets, by int_id, whose entire history is to be purged.

                default : None
Tell the Hub to forget results .