'Check whether an RPC object is currently pending.
Note that \'pending\' in this context refers to an RPC associated
with this connection for which _remove_pending() hasn\'t been
called yet; normally this is called by check_rpc_success() which
itself is called by the various result hooks.  A pending RPC may
be in the RUNNING or FINISHING state.
If the argument is a MultiRpc object, this returns true if at least
one of its wrapped RPCs is pending.'

def is_pending(self, rpc):

    if isinstance(rpc, MultiRpc):
        for wrapped_rpc in rpc._MultiRpc__rpcs:
            if self.is_pending(wrapped_rpc):
                return True
        return False
    else:
        return (rpc in self.__pending_rpcs)
