Check if an event has an handler.
557600
def isHandlerPresent(self, event_name):
        """"""
        if event_name not in self.handlers:
            raise ValueError('{} is not a valid event'.format(event_name))
        return self.handlers[event_name] is not None
727370
function (eventName,handler) {
			var event;
			if (event = this.getEvent(eventName))
			{
				if (!event.once(handler,true))
					this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			} else
				this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			return this;
		}
561866
public function hasEventHandlers($name)
    {
        $this->ensureBehaviors();
        return !empty($this->__events__[$name]) || Event::hasHandlers($this, $name);
    }
660925
function(eventName, eventHandler) {
      var stack = this.actual.data("events")[eventName];
      var i;
      for (i = 0; i < stack.length; i++) {
        if (stack[i].handler == eventHandler) {
          return true;
        }
      }
      return false;
    }
398102
function( type, handler ) {

      if( handler === void 0 || handler === null )
        throw new Error( 'Missing argument "handler"' )

      if( typeof handler !== 'function' && typeof handler.handleEvent !== 'function' )
        throw new TypeError( 'Handler must be a function.' )

      function wrapper() {
        this.removeListener( type, wrapper )
        typeof handler !== 'function'
          ? handler.handleEvent.apply( handler, arguments )
          : handler.apply( this, arguments )
      }

      this._events[ type ] ?
        this._events[ type ].push( wrapper ) :
        this._events[ type ] = [ wrapper ]

      return this

    }
578497
async def handler(event):
    """"""
    await asyncio.wait([
        event.delete(),
        event.respond(
            LEARN_PYTHON, reply_to=event.reply_to_msg_id, link_preview=False)
    ])
1366571
function (type, handler) {

            // Validate arguments
            if (typeof type !== 'undefined' && typeof type !== 'string') {
                throw new Error('Type must be a string or undefined');
            }
            if (typeof handler !== 'undefined' && typeof handler !== 'function') {
                throw new Error('Handler must be a function or undefined');
            }

            // If no type is given, remove all handlers
            if (!type) {
                return delete this._events;
            }

            // Check for presence of event store
            if (!this._events || !this._events[type]) {
                return;
            }

            // If no handler is given, remove all handlers for this type
            if (!handler) {
                return delete this._events[type];
            }

            // Do we have a matching handler?
            var handlers = this._events[type];
            var i = arrayIndexOf(handlers, handler);
            if (i === -1) {
                return;
            }

            // Remove handler
            handlers.splice(i, 1);

        }
1047904
def event(self, event):
        """"""
        if event.type() in (QEvent.Shortcut, QEvent.ShortcutOverride):
            return True
        else:
            return super(ShortcutEditor, self).event(event)
651911
function callAllEventHandlers(...fns) {
  return (event, ...args) =>
    fns.some(fn => {
      if (fn) {
        fn(event, ...args)
      }
      return (
        event.preventDownshiftDefault ||
        (event.hasOwnProperty('nativeEvent') &&
          event.nativeEvent.preventDownshiftDefault)
      )
    })
}
578899
function (event) {
                for (var i = 0; i < this.events.length; i++) {
                    if (event === this.events[i]) {
                        return true;
                    }
                }
                return false;
            }
477946
def is_registered(self, event: str, handler: T.Callable) -> bool:
        """"""

        return handler in self._events.get(event, [])
678128
function (eventName, handler)
  {
    if (!this._events[eventName])
      this._events[eventName] = [];
    this._events[eventName].push (handler);
  }
441952
async def handler(event):
    """"""
    query = urllib.parse.quote(event.pattern_match.group(1))
    await asyncio.wait([
        event.delete(),
        event.respond(SEARCH.format(query), reply_to=event.reply_to_msg_id)
    ])
709301
function (event, query, handler, context) {
        return on(this, event, query, handler, context, false);
    }
1191598
async def _trigger_event(self, event, namespace, *args):
        """"""
        # first see if we have an explicit handler for the event
        if namespace in self.handlers and event in self.handlers[namespace]:
            if asyncio.iscoroutinefunction(self.handlers[namespace][event]) \
                    is True:
                try:
                    ret = await self.handlers[namespace][event](*args)
                except asyncio.CancelledError:  # pragma: no cover
                    ret = None
            else:
                ret = self.handlers[namespace][event](*args)
            return ret

        # or else, forward the event to a namepsace handler if one exists
        elif namespace in self.namespace_handlers:
            return await self.namespace_handlers[namespace].trigger_event(
                event, *args)
588403
function(eventName, fn) {
    if (!fn) {
      delete apos.handlers[eventName];
      return;
    }
    apos.handlers[eventName] = _.filter(apos.handlers[eventName], function(_fn) {
      return fn !== _fn;
    });
  }
323078
function( type, handler ) {

      if( handler === void 0 || handler === null )
        throw new Error( 'Missing argument "handler"' )

      if( typeof handler !== 'function' && typeof handler.handleEvent !== 'function' )
        throw new TypeError( 'Handler must be a function.' )

      this._events[ type ] ?
        this._events[ type ].push( handler ) :
        this._events[ type ] = [ handler ]

      if( Emitter.warn && this._events[ type ].length > this._maxListeners ) {
        if( this._maxListeners > 0 && !this._memLeakDetected ) {
          this._memLeakDetected = true
          console.warn(
            'WARNING: Possible event emitter memory leak detected.',
            this._events[ type ].length, 'event handlers added.',
            'Use emitter.setMaxListeners() to increase the threshold.'
          )
          console.trace()
        }
      }

      return this

    }