def local_response(self, result):
        id = result.in_response_to
        if result.delivered == MessageResponse.REFUSED:
            self.retry(id)
        elif result.delivered == MessageResponse.ACCEPTED:
            if id in self.pending:
                del self.pending[id]
        elif result.delivered == MessageResponse.FINISHED:
            if id in self.rpc_waits:
                q = self.rpc_waits.pop(id)
                if result.result == MessageResponse.EXCEPTION:
                    resp = ConvoyRemoteException(result.error_message)
                elif result.result == MessageResponse.NULL:
                    resp = ConvoyRemoteNull()
                elif result.result == MessageResponse.RESULT:
                    res = [self.classes[m.type](m.body) 
                            for m in result.responses]
                    resp = ConvoyRemoteResult(res)
                else:
                    assert 0
                q.put(resp)
dataset/ETHPy150Open dieseldev/diesel/diesel/convoy/__init__.py/Convoy.local_response/original