Removes a single listener from an event.

If the listener couldn't be found, returns FALSE, else TRUE if
it was removed.

@param $event_name
@param callable $listener
@return bool
496195
public function removeListener($event_name, callable $listener)
    {
        // Read in our config/events file so that we have them all!
        if (! $this->have_read_from_file)
        {
            $this->readConfigFile();
        }

        if (! isset($this->listeners[$event_name]))
        {
            return false;
        }

        foreach ($this->listeners[$event_name][2] as $index => $check)
        {
            if ($check === $listener)
            {
                unset($this->listeners[$event_name][1][$index]);
                unset($this->listeners[$event_name][2][$index]);

                return true;
            }
        }

        return false;
    }
349923
public function removeEventListener($name, AnObjectHandlable $listener)
    {
        if (is_object($listener)) {
            if (isset($this->_listeners[$name])) {
                $this->_listeners[$name]->dequeue($listener);
            }
        }
        
        return $this;
    }
402724
def remove_listener(self, listener):
        
        internal_listener = self._internal_listeners.pop(listener)
        return self._client.remove_listener(internal_listener)
26686
public function on($event_name, $listener, $data = null)
    {
        if ($this->isSingle()) {
            BaseObserver::on($event_name, $listener, $data);
        }
    }
640982
public void removeEventListener(EventType eventType, Consumer<PrimitiveEvent> listener) {
    executor.execute(() -> eventListeners.computeIfAbsent(eventType.canonicalize(), e -> Sets.newLinkedHashSet()).remove(listener));
  }
413272
public function removeListener($event, $listener)
    {
        // listenersCallback
        if( $event instanceof \Closure ) {
            foreach( $this->listenersCallback as $key => $value ) {
                // does the event and listener match?
                if( $value[0] === $event && $value[1] === $listener ) {
                    unset( $this->listenersCallback[$key] );
                }
            }
        // standard listeners
        } else {

            // listeners
            if (isset($this->listeners[$event])) {
                if (false !== ($key = array_search($listener, $this->listeners[$event]))) {
                    unset($this->listeners[$event][$key]);
                }
                if( !$this->listeners[$event] ) {
                    unset( $this->listeners[$event] );
                }
            }
            // listeners once
            if (isset($this->listenersOnce[$event])) {
                if (false !== ($key = array_search($listener, $this->listenersOnce[$event]))) {
                    unset($this->listenersOnce[$event][$key]);
                }
                if( !$this->listenersOnce[$event] ) {
                    unset( $this->listenersOnce[$event] );
                }
            }
        }
        return $this;
    }
641488
public function removeEventListener(string $name, callable $listener): self
    {
        if (isset($this->internalEventListenersData[$name])) {
            foreach ($this->internalEventListenersData[$name] as $i => $value) {
                if ($value === $listener) {
                    unset($this->internalEventListenersData[$name][$i]);
                    if (empty($this->internalEventListenersData[$name])) {
                        unset($this->internalEventListenersData[$name]);
                    }
                    break;
                }
            }
        }
        return $this;
    }
980918
public synchronized void removeEventListener(EventListener listener)
    {
        _contextListeners= LazyList.remove(_contextListeners, listener);
        super.removeEventListener(listener);
    }
187362
private static function remove(
        array &$event,
        string $name,
        string $class,
        ? callable $handler
    ): bool {
        $removed = false;
        if (isset($event[$name][$class])) {
            foreach ($event[$name][$class] as $i => $item) {
                if ($item[0] === $handler) {
                    unset($event[$name][$class][$i]);
                    $removed = true;
                }
            }
            if ($removed) {
                $event[$name][$class] = array_values($event[$name][$class]);
                if (empty($event[$name][$class])) {
                    unset($event[$name][$class]);
                    if (empty($event[$name])) {
                        unset($event[$name]);
                    }
                }
            }
        }
        return $removed;
    }
1019365
public function removeListener($event, $listener)
    {
        // shortcut to only remove a listener if they exist
        // having this allows us to simplify calling code
        if( !isset($listener) ) {
            return $this;
        }

        // listeners
        if (isset($this->listeners[$event])) {
            if (false !== ($key = array_search($listener, $this->listeners[$event]))) {
                unset($this->listeners[$event][$key]);
            }
            if( !$this->listeners[$event] ) {
                unset( $this->listeners[$event] );
            }
        }
        // listeners once
        if (isset($this->listenersOnce[$event])) {
            if (false !== ($key = array_search($listener, $this->listenersOnce[$event]))) {
                unset($this->listenersOnce[$event][$key]);
            }
            if( !$this->listenersOnce[$event] ) {
                unset( $this->listenersOnce[$event] );
            }
        }
        return $this;
    }
1290191
public function removeListener( $eventName, IListener $listener )
    {
        if ( !isset( $this->listeners[ $eventName ] ) )
        {
            return $this;
        }

        foreach ( $this->listeners[ $eventName ] as $priority => $listeners )
        {
            if ( FALSE !== ( $key = array_search( $listener, $listeners, TRUE ) ) )
            {
                unset( $this->listeners[ $eventName ][ $priority ][ $key ], $this->_sorted[ $eventName ] );
            }
        }

        return $this;
    }
536760
function removeEventListener (event, listener) {
    if (hasDOM()) {
      eventEmitter.removeEventListener(event, listener);
    } else if (hasEventEmitter()) {
      eventEmitter.removeListener(event, listener);
    }
  }
379465
function deleteListener(event, id) {
    if (hasListener(event, id)) {
      delete context._events[event][id];

      if (_.keys(getListeners(event)).length === 0)
        deleteEvent(event);
      
      return true;
    }

    return false;
  }
616339
public boolean removeConnectedEventListener(PeerConnectedEventListener listener) {
        boolean result = ListenerRegistration.removeFromList(listener, peerConnectedEventListeners);
        for (Peer peer : getConnectedPeers())
            peer.removeConnectedEventListener(listener);
        for (Peer peer : getPendingPeers())
            peer.removeConnectedEventListener(listener);
        return result;
    }
913138
public function hasListener($event): bool
    {
        $name = $this->getEventName($event);

        if (isset($this->listeners[$name])) {
            foreach ($this->listeners[$name] as $listeners) {
                if (count($listeners) > 0) {
                    return true;
                }
            }
        }

        unset($name);

        return false;
    }
730284
public boolean removeDisconnectedEventListener(PeerDisconnectedEventListener listener) {
        boolean result = ListenerRegistration.removeFromList(listener, peerDisconnectedEventListeners);
        for (Peer peer : getConnectedPeers())
            peer.removeDisconnectedEventListener(listener);
        for (Peer peer : getPendingPeers())
            peer.removeDisconnectedEventListener(listener);
        return result;
    }
52201
public function removeListener($name)
    {
        $listeners = $this->getConfig('listeners');
        if (!array_key_exists($name, $listeners)) {
            return false;
        }

        if (isset($this->_listenerInstances[$name])) {
            $this->_eventManager->off($this->_listenerInstances[$name]);
            unset($this->_listenerInstances[$name]);
        }

        unset($listeners[$name]);
        $this->_config['listeners'] = $listeners;
    }