def _live_receivers(self, sender):
receivers = None<EOL>if self.use_caching and not self._dead_receivers:<EOL><INDENT>receivers = self.sender_receivers_cache.get(sender)<EOL>if receivers is NO_RECEIVERS:<EOL><INDENT>return []<EOL><DEDENT><DEDENT>if receivers is None:<EOL><INDENT>with self.lock:<EOL><INDENT>self._clear_dead_receivers()<EOL>senderkey = _make_id(sender)<EOL>receivers = []<EOL>for (receiverkey, r_senderkey), receiver in self.receivers:<EOL><INDENT>if r_senderkey == NONE_ID or r_senderkey == senderkey:<EOL><INDENT>receivers.append(receiver)<EOL><DEDENT><DEDENT>if self.use_caching:<EOL><INDENT>if not receivers:<EOL><INDENT>self.sender_receivers_cache[sender] = NO_RECEIVERS<EOL><DEDENT>else:<EOL><INDENT>self.sender_receivers_cache[sender] = receivers<EOL><DEDENT><DEDENT><DEDENT><DEDENT>non_weak_receivers = []<EOL>for receiver in receivers:<EOL><INDENT>if isinstance(receiver, weakref.ReferenceType):<EOL><INDENT>receiver = receiver()<EOL>if receiver is not None:<EOL><INDENT>non_weak_receivers.append(receiver)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>non_weak_receivers.append(receiver)<EOL><DEDENT><DEDENT>return non_weak_receivers<EOL>
Filter sequence of receivers to get resolved, live receivers.

This checks for weak references and resolves them, then returning only
live receivers.