def sdk_get_replies(looper, sdk_req_resp: Sequence, timeout=None):
    resp_tasks = [resp for (_, resp) in sdk_req_resp]
    if (timeout is None):
        timeout = waits.expectedTransactionExecutionTime(7)

    def get_res(task, done_list):
        if (task in done_list):
            try:
                resp = json.loads(task.result())
            except IndyError as e:
                resp = e.error_code
        else:
            resp = ErrorCode.PoolLedgerTimeout
        return resp
    (done, pending) = looper.run(asyncio.wait(resp_tasks, timeout=timeout))
    if pending:
        for task in pending:
            task.cancel()
    ret = [(req, get_res(resp, done)) for (req, resp) in sdk_req_resp]
    return ret
def sdk_get_replies(looper, sdk_req_resp: Sequence, timeout=None):
    resp_tasks = [resp for (_, resp) in sdk_req_resp]
    if (timeout is None):
        timeout = waits.expectedTransactionExecutionTime(7)

    def get_res(task, done_list):
        if (task in done_list):
            try:
                resp = json.loads(task.result())
            except IndyError as e:
                resp = e.error_code
        else:
            resp = ErrorCode.PoolLedgerTimeout
        return resp
    (done, pending) = looper.run(asyncio.wait(resp_tasks, timeout=timeout))
    if pending:
        for task in pending:
            task.cancel()
    ret = [(req, get_res(resp, done)) for (req, resp) in sdk_req_resp]
    return ret