environment/lib/python2.7/site-packages/IPython/parallel/client/client.py
def abort(self, jobs=None, targets=None, block=None):
        """Abort specific jobs from the execution queues of target(s).

        This is a mechanism to prevent jobs that have already been submitted
        from executing.

        Parameters
        ----------

        jobs : msg_id, list of msg_ids, or AsyncResult
            The jobs to be aborted
            
            If unspecified/None: abort all outstanding jobs.

        """
        block = self.block if block is None else block
        jobs = jobs if jobs is not None else list(self.outstanding)
        targets = self._build_targets(targets)[0]
        
        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(msg_ids=msg_ids)
        for t in targets:
            self.session.send(self._control_socket, 'abort_request',
                    content=content, ident=t)
        error = False
        if block:
            self._flush_ignored_control()
            for i in range(len(targets)):
                idents,msg = self.session.recv(self._control_socket,0)
                if self.debug:
                    pprint(msg)
                if msg['content']['status'] != 'ok':
                    error = self._unwrap_exception(msg['content'])
        else:
            self._ignored_control_replies += len(targets)
        if error:
            raise error
def abort(self, jobs=None, targets=None, block=None):
        """Abort specific jobs from the execution queues of target(s).

        This is a mechanism to prevent jobs that have already been submitted
        from executing.

        Parameters
        ----------

        jobs : msg_id, list of msg_ids, or AsyncResult
            The jobs to be aborted
            
            If unspecified/None: abort all outstanding jobs.

        """
        block = self.block if block is None else block
        jobs = jobs if jobs is not None else list(self.outstanding)
        targets = self._build_targets(targets)[0]
        
        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(msg_ids=msg_ids)
        for t in targets:
            self.session.send(self._control_socket, 'abort_request',
                    content=content, ident=t)
        error = False
        if block:
            self._flush_ignored_control()
            for i in range(len(targets)):
                idents,msg = self.session.recv(self._control_socket,0)
                if self.debug:
                    pprint(msg)
                if msg['content']['status'] != 'ok':
                    error = self._unwrap_exception(msg['content'])
        else:
            self._ignored_control_replies += len(targets)
        if error:
            raise error
def abort ( self , jobs = None , targets = None , block = None ) : block = self . block if block is None else block jobs = jobs if jobs is not None else list ( self . outstanding ) targets = self . _build_targets ( targets ) [ 0 ] 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 ( msg_ids = msg_ids ) for t in targets : self . session . send ( self . _control_socket , 'abort_request' , content = content , ident = t ) error = False if block : self . _flush_ignored_control ( ) for i in range ( len ( targets ) ) : idents , msg = self . session . recv ( self . _control_socket , 0 ) if self . debug : pprint ( msg ) if msg [ 'content' ] [ 'status' ] != 'ok' : error = self . _unwrap_exception ( msg [ 'content' ] ) else : self . _ignored_control_replies += len ( targets ) if error : raise error
Abort specific jobs from the execution queues of target(s).

        This is a mechanism to prevent jobs that have already been submitted
        from executing.

        Parameters
        ----------

        jobs : msg_id, list of msg_ids, or AsyncResult
            The jobs to be aborted
            
            If unspecified/None: abort all outstanding jobs.
Abort specific jobs from the execution queues of target ( s ) .