

@spin_first
def resubmit(self, indices_or_msg_ids=None, subheader=None, block=None):
    'Resubmit one or more tasks.\n\n        in-flight tasks may not be resubmitted.\n\n        Parameters\n        ----------\n\n        indices_or_msg_ids : integer history index, str msg_id, or list of either\n            The indices or msg_ids of indices to be retrieved\n\n        block : bool\n            Whether to wait for the result to be done\n\n        Returns\n        -------\n\n        AsyncHubResult\n            A subclass of AsyncResult that retrieves results from the Hub\n\n        '
    block = (self.block if (block is None) else block)
    if (indices_or_msg_ids is None):
        indices_or_msg_ids = (- 1)
    if (not isinstance(indices_or_msg_ids, (list, tuple))):
        indices_or_msg_ids = [indices_or_msg_ids]
    theids = []
    for id in indices_or_msg_ids:
        if isinstance(id, int):
            id = self.history[id]
        if (not isinstance(id, str)):
            raise TypeError(('indices must be str or int, not %r' % id))
        theids.append(id)
    for msg_id in theids:
        self.outstanding.discard(msg_id)
        if (msg_id in self.history):
            self.history.remove(msg_id)
        self.results.pop(msg_id, None)
        self.metadata.pop(msg_id, None)
    content = dict(msg_ids=theids)
    self.session.send(self._query_socket, 'resubmit_request', content)
    zmq.select([self._query_socket], [], [])
    (idents, msg) = self.session.recv(self._query_socket, zmq.NOBLOCK)
    if self.debug:
        pprint(msg)
    content = msg['content']
    if (content['status'] != 'ok'):
        raise self._unwrap_exception(content)
    ar = AsyncHubResult(self, msg_ids=theids)
    if block:
        ar.wait()
    return ar

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