def _remove_receiver(self, receiver):

        self.lock.acquire()
        try:
            to_remove = []
            for key, connected_receiver in self.receivers:
                if connected_receiver == receiver:
                    to_remove.append(key)
            for key in to_remove:
                last_idx = len(self.receivers) - 1
                # enumerate in reverse order so that indexes are valid even
                # after we delete some items
                for idx, (r_key, _) in enumerate(reversed(self.receivers)):
                    if r_key == key:
                        del self.receivers[last_idx-idx]
        finally:
            self.lock.release()
Remove dead receivers from connections.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/dispatch/dispatcher.py/Signal._remove_receiver