'Stops a listener from being notified of further tor events.
:param stem.control.EventListener listener: listener to be removed
:raises: :class:`stem.ProtocolError` if unable to set the events'

def remove_event_listener(self, listener):

    with self._event_listeners_lock:
        event_types_changed = False
        for (event_type, event_listeners) in list(self._event_listeners.items()):
            if (listener in event_listeners):
                event_listeners.remove(listener)
                if (len(event_listeners) == 0):
                    event_types_changed = True
                    del self._event_listeners[event_type]
        if event_types_changed:
            response = self.msg(('SETEVENTS    %s' % '    '.join(self._event_listeners.keys())))
            if (not response.is_ok()):
                raise stem.ProtocolError(('SETEVENTS    received    unexpected    response\n%s' % response))
