'Filter sequence of receivers to get resolved, live receivers.
This checks for weak references and resolves them, then returning only
live receivers.'

def _live_receivers(self, sender):

    receivers = None
    if (self.use_caching and (not self._dead_receivers)):
        receivers = self.sender_receivers_cache.get(sender)
        if (receivers is NO_RECEIVERS):
            return []
    if (receivers is None):
        with self.lock:
            self._clear_dead_receivers()
            senderkey = _make_id(sender)
            receivers = []
            for ((receiverkey, r_senderkey), receiver) in self.receivers:
                if ((r_senderkey == NONE_ID) or (r_senderkey == senderkey)):
                    receivers.append(receiver)
            if self.use_caching:
                if (not receivers):
                    self.sender_receivers_cache[sender] = NO_RECEIVERS
                else:
                    self.sender_receivers_cache[sender] = receivers
    non_weak_receivers = []
    for receiver in receivers:
        if isinstance(receiver, weakref.ReferenceType):
            receiver = receiver()
            if (receiver is not None):
                non_weak_receivers.append(receiver)
        else:
            non_weak_receivers.append(receiver)
    return non_weak_receivers
