code: def remove_listener(self, listener):
          
          self.logger.debug('discarding listener %r', listener)
          with self._lock:
              self._listeners.discard(listener)
docs: Unregister some listener; ignore if the listener was never
          registered.
  
          :type listener: :class:`SessionListener`