'Wait for all currently pending RPCs to complete.'

def wait_for_all_pending_rpcs(self):

    while self.__pending_rpcs:
        try:
            rpc = apiproxy_stub_map.UserRPC.wait_any(self.__pending_rpcs)
        except Exception:
            logging.info('wait_for_all_pending_rpcs():    exception    in    wait_any()', exc_info=True)
            continue
        if (rpc is None):
            logging.debug('wait_any()    returned    None')
            continue
        assert (rpc.state == apiproxy_rpc.RPC.FINISHING)
        if (rpc in self.__pending_rpcs):
            try:
                self.check_rpc_success(rpc)
            except Exception:
                logging.info('wait_for_all_pending_rpcs():    exception    in    check_rpc_success()', exc_info=True)
