

def _handle_apply_reply(self, msg):
    'Save the reply to an apply_request into our results.'
    parent = msg['parent_header']
    msg_id = parent['msg_id']
    if (msg_id not in self.outstanding):
        if (msg_id in self.history):
            print(('got stale result: %s' % msg_id))
            print(self.results[msg_id])
            print(msg)
        else:
            print(('got unknown result: %s' % msg_id))
    else:
        self.outstanding.remove(msg_id)
    content = msg['content']
    header = msg['header']
    md = self.metadata[msg_id]
    md.update(self._extract_metadata(header, parent, content))
    self.metadata[msg_id] = md
    e_outstanding = self._outstanding_dict[md['engine_uuid']]
    if (msg_id in e_outstanding):
        e_outstanding.remove(msg_id)
    if (content['status'] == 'ok'):
        self.results[msg_id] = util.unserialize_object(msg['buffers'])[0]
    elif (content['status'] == 'aborted'):
        self.results[msg_id] = error.TaskAborted(content)
    elif (content['status'] == 'resubmitted'):
        pass
    else:
        self.results[msg_id] = self._unwrap_exception(content)

dataset/ETHPy150Open ipython/ipython-py3k/IPython/parallel/client/client.py Client._handle_apply_reply/VarMisuse@238/366 `msg_id`->`content`