'Check the list of RPCs for one that is finished, or one that is running.
Args:
rpcs: Iterable collection of UserRPC instances.
Returns:
A pair (finished, running), as follows:
(UserRPC, None) indicating the first RPC found that is finished;
(None, UserRPC) indicating the first RPC found that is running;
(None, None) indicating no RPCs are finished or running.'

@classmethod
def __check_one(cls, rpcs):

    rpc = None
    for rpc in rpcs:
        assert isinstance(rpc, cls), repr(rpc)
        state = rpc.__rpc.state
        if (state == apiproxy_rpc.RPC.FINISHING):
            rpc.__call_user_callback()
            return (rpc, None)
        assert (state != apiproxy_rpc.RPC.IDLE), repr(rpc)
    return (None, rpc)
