<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_listener(self, listener):
 """Unregister some listener; ignore if the listener was never registered. :type listener: :class:`SessionListener` """

        self.logger.debug('discarding listener %r', listener)
        with self._lock:
            self._listeners.discard(listener)