Iterates over the event handler registry and execute each found
    handler.

    It takes the event name and its its `data`, passing the return of
    `ejson.loads(data)` to the found handlers.
548047
def process(event_name, data):
    
    deserialized = loads(data)
    event_cls = find_event(event_name)
    event = event_cls(event_name, deserialized)
    try:
        event.clean()
    except ValidationError as exc:
        if os.environ.get('EVENTLIB_RAISE_ERRORS'):
            raise
        else:
            logger.warning(
                "The event system just got an exception while cleaning "
                "data for the event '{}'\ndata: {}\nexc: {}".format(
                    event_name, data, str(exc)))
            return

    for handler in find_handlers(event_name):
        try:
            handler(deserialized)
        except Exception as exc:
            logger.warning(
                (u'One of the handlers for the event "{}" has failed with the '
                 u'following exception: {}').format(event_name, str(exc)))
            if getsetting('DEBUG'):
                raise exc
    event._broadcast()
517765
function (name, data, options) {
            var _listeners = this.__handlers__[name],
                _listener,
                _result = null;
            if (_listeners) {
                for (var i = 0, length = _listeners.length; i < length; i++) {
                    _listener = _listeners[i];
                    if (_listener && _listener.handler) {
                        if(options && options.method=='apply'){
                            _result = _listener.handler.apply(_listener.context || _listener.owner, data);
                        } else {
                            _result = _listener.handler.call(_listener.context || _listener.owner, _listener.owner, data, options);
                        }
                        if (false === _result) {
                            return false;
                        }
                    }
                }
            }

            return this;
        }
946919
function(element,eventName,callback){
			// Prepare
			var uid = history.Adapter.uid(element);

			// Apply Listener
			history.Adapter.handlers[uid] = history.Adapter.handlers[uid] || {};
			history.Adapter.handlers[uid][eventName] = history.Adapter.handlers[uid][eventName] || [];
			history.Adapter.handlers[uid][eventName].push(callback);

			// Bind Global Listener
			element['on'+eventName] = (function(element,eventName){
				return function(event){
					history.Adapter.trigger(element,eventName,event);
				};
			})(element,eventName);
		}
52406
function ( eventName, handler ) {
        var events = this.events[ eventName ],
            handlers = [],
            i;
        if ( !events ) {
            return;
        }
        if ( $.isArray( events ) ) {
            for ( i = 0; i < events.length; i++ ) {
                if ( events[i].handler !== handler ) {
                    handlers.push( events[ i ] );
                }
            }
            this.events[ eventName ] = handlers;
        }
    }
1051507
function (evt) {
      var evh = this.evtHandlers, et = evt.type;
      if (evh) {
          for (var i = 0, sz = evh.length; sz > i; i++) {
              if (evh[i].evtType === et) {
                  evh[i].executeCb(evt, this.eh, this.parent.vscope);
                  break;
              }
          }
      }
  }
204403
def process_external(event_name, data):
    
    for handler in find_external_handlers(event_name):
        try:
            handler(data)
        except Exception as exc:
            logger.warning(
                (u'One of the handlers for the event "{}" has failed with the '
                 u'following exception: {}').format(event_name, str(exc)))
            if getsetting('DEBUG'):
                raise exc
1139639
def trigger_events(events, loop):
    
    for event in events:
        result = event(loop)
        if isawaitable(result):
            loop.run_until_complete(result)
135073
def inject_event_handlers
      states = @stm.instance_variable_get(:@states)
      states.each { |k, st|
        prev = st.entry_action
        st.entry_action = proc { |*args|
          on_entry_state(st.id, *args)
        }
        prev = st.exit_action
        st.exit_action = proc { |*args|
          on_exit_state(st.id, *args)
        }
      }
    end
678128
function (eventName, handler)
  {
    if (!this._events[eventName])
      this._events[eventName] = [];
    this._events[eventName].push (handler);
  }
808326
function(events, name, callback, context, ctx) {
  if (callback) {
    var handlers = events[name] || (events[name] = []);
    handlers.push({callback: callback, context: context, ctx: context || ctx});
  }
  return events;
}
1325912
def _gather_event_handlers(self):
        
        self._extract_event_handlers_from_container(self)
        for module in self.modules:
            self._extract_event_handlers_from_container(module)
1008797
private function runHandlers($event, $data = null)
    {
        foreach ($this->handlers[$event] as $handler) {
            if (!is_callable($handler)) {
                return false;
            }

            if (!$handler($data)) {
                return false;
            }
        }
        return true;
    }
657543
function globalEventHandler(event) {
    if (listeners[event.type]) {
      listeners[event.type].forEach(function(currentHandler) {
        currentHandler.call(this, event);
      }, this);
    }
  }
924272
function iterator(since) {
    if (stop) {
      return;
    }

    var attr = [];
    attr.push({ key: 'since', val: since });
    attr.push({ key: 'events', val: events });

    req({ method: 'events', endpoint: false, attr: attr }).then(function (eventArr) {

      //Check for event count on first request iteration
      if (since != 0) {
        eventArr.forEach(function (e) {
          _this.emit(lowerCaseFirst(e.type), e.data);
        });
      }

      //Update event count
      if (eventArr.length > 0) {
        since = eventArr[eventArr.length - 1].id;
      }

      //Reset tries
      tries = 0;

      setTimeout(function () {
        return iterator(since);
      }, 100);
    }).catch(function (err) {
      _this.emit('error', err);

      //Try to regain connection & reset event counter
      if (tries < retries) {
        tries++;
        setTimeout(function () {
          return iterator(0);
        }, 500);
      }
    });
  }
77939
function(e, data) {
		mfp.ev.triggerHandler(NS + e, data);

		if(mfp.st.callbacks) {
			// converts "mfpEventName" to "eventName" callback and triggers it if it's present
			e = e.charAt(0).toLowerCase() + e.slice(1);
			if(mfp.st.callbacks[e]) {
				mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
			}
		}
	}
980717
function handleEvent(namespace, attributeName, eventHandlerRegistry, event) {
    var target = event.target;
    var handlers = getHandlers(attributeName, eventHandlerRegistry, target);
    executeHandlers(handlers, event, namespace);
}
673406
def trigger(self, event, *args):
        """"""
        for handler in self._event_handlers[event]:
            handler(*args)