Trigger event on object

@param {string} name of event
@param {array} array of arguments
@return {this}
179115
function(evname) {
    var fns = this._events && this._events[evname] || [],
    args = __slice.call(arguments, 1);
    for (var i = 0, ii = fns.length; i < ii; i++) {
      fns[i].cb.apply(fns[i].ctxt, args);
    }
  }
344348
function(element, name) {
		var event = this.document.createEvent("UIEvents");
		event.initEvent(name, true, true);
		return element.dispatchEvent(event);
	}
909445
public function trigger($name, ...$args)
    {
        //we should deal with strings
        //then callables respectively
        //to allow overriding
        if (is_string($name)) {
            //is it a protocol?
            if (strpos($name, '://') !== false) {
                return $this->triggerProtocol($name, ...$args);
            }

            //they can call a class
            if (strpos($name, '@') !== false) {
                return $this->triggerController($name, ...$args);
            }

            //unless it's a static call
            if (strpos($name, '::') !== false && is_callable($name)) {
                call_user_func_array($name, $args);
                return $this;
            }

            return $this->triggerEvent($name, ...$args);
        }

        if (is_callable($name)) {
            if ($name instanceof Closure) {
                $name = $this->bindCallback($name);
            }

            call_user_func_array($name, $args);
        }

        //we can only deal with callable and strings
        //we don't want to throw an error
        //because it could just be a pseudo
        //placeholder
        return $this;
    }
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;
}
85787
public function triggerEvent($event, $args = [])
    {
        if (!($event instanceof EventInterface)) {
            if (isset($this->events[$event])) {
                $event = $this->events[$event];
            } else {
                $event = new Event($event);
            }
        }

        $event->mergeArguments($args);

        if (isset($this->listeners[$event->getName()])) {
            foreach ($this->listeners[$event->getName()] as $listener) {
                if ($event->isStopped()) {
                    return $event;
                }

                if (is_callable($listener)) {
                    call_user_func($listener, $event);
                } else {
                    call_user_func([$listener, $event->getName()], $event);
                }
            }
        }

        return $event;
    }
693077
function prepArgs(args, name, event, defaults) {
  args = Array.from(args);

  var namespace = [name];
  if (!Array.isArray(event)) {
    event = event.split(delimiter);
  }

  namespace = namespace.concat(event);

  args.shift();//remove the event

  args.unshift(namespace);
  if (defaults) {
    args.push(defaults);
  }
  return args;
}
1275011
public function emit(string $name, array $arguments = [])
    {
        try {
            $this->trigger($name, $arguments);
        } catch (StopPropagation $e) {
            return $this;
        }

        return $this;
    }
225805
function (name, fn, ctx) {
        assert(isString(name), 'EventEmitter#on: name is not a string');
        assert(isFunction(fn), 'EventEmitter#on: fn is not a function');

        // If the context is not passed, use `this`.
        ctx = ctx || this;

        // Push to private lists of listeners.
        this._listeners.push({
            name: name,
            fn: fn,
            ctx: ctx
        });

        return this;
    }
422414
function addEvent(eventName, {
    onElement,
    withCallback,
    avoidDuplicate = true,
    once = false,
    useCapture = false} = { }, thisArg) {
    let element = onElement || []
    if (utils.isString(element)) {
        element =  document.querySelectorAll(element)
    }
    function handler(event) {
        if (utils.isFunction(withCallback)) {
            withCallback.call(thisArg, event, this)
        }
        if (once) {
            handler.destroy();
        }
    }
    handler.destroy = function() {
        each(element, (el) => {
            const events = getNodeEvents(el, eventName, handler);
            if (events.found) { events.all.splice(events.evt, 1); }
            if (el.removeEventListener) el.removeEventListener(eventName, handler, useCapture)
        })
    }
    each(element, (el) => {
        const events = getNodeEvents(el, eventName, handler);
        if (el.addEventListener && (avoidDuplicate && !events.found) || !avoidDuplicate) {
            el.addEventListener(eventName, handler, useCapture)
            events.all.push({ eventName: eventName, fn: handler});
        }
    })
    return handler
}
375569
def fire_event(self, evt_name, *args, **kwargs):
        
        listeners = self.__get_listeners(evt_name)
        evt = self.generate_event(evt_name)
        for listener in listeners:
            listener(evt, *args, **kwargs)
1211825
public function trigger($event_name, array $arguments = [])
    {
        // Read in our config/events file so that we have them all!
        if (! $this->have_read_from_file)
        {
            $this->readConfigFile();
        }

        foreach ($this->listeners($event_name) as $listener)
        {
            if (! is_callable($listener)) continue;

            $result = call_user_func_array($listener, $arguments);

            if ($result === false)
            {
                return false;
            }
        }

        return true;
    }
345918
function(event_name, event_args) {

		if (Lava.schema.DEBUG && typeof(event_name) == "undefined") Lava.t();

		if (this._listeners[event_name] != null) {

			this._callListeners(this._listeners[event_name], event_args);

		}

	}
467978
function( eventName ) {
			if ( eventName.length > 5 && 'change' === eventName.substr( 0, 6 ) ) {
				var dit = this, args = arguments;
				Backbone.Relational.eventQueue.add( function() {
						Backbone.Model.prototype.trigger.apply( dit, args );
					});
			}
			else {
				Backbone.Model.prototype.trigger.apply( this, arguments );
			}
			
			return this;
		}
661899
public static function trigger(string $name, ?array $args = null)
  {
    if (!isset(self::$events[$name])) return false;

    foreach (self::$events[$name] as $event => $callback) {
      if (is_callable($callback)) {
        return call_user_func_array($callback, isset($args) ? $args : []);
      }
      else if (is_array($callback)) {
        (new Events)->triggerGroup($callback, $args);
      }
      else if (is_string($callback)) {
        $call = new $callback;
        return call_user_func_array([$call, 'persist'], $args ?? []);
      }
    }
  }
217489
function(events, name, callback, options) {
    if (callback) {
      var handlers = events[name] || (events[name] = []);
      var context = options.context, ctx = options.ctx, listening = options.listening;
      if (listening) listening.count++;

      handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});
    }
    return events;
  }
335376
function triggerListeners(listeners, event, args)
  {
    if (listeners && event in listeners)
    {
      var eventListeners = listeners[ event ];
      var triggerGroup = ++triggerId;
      var next, node = eventListeners.next;

      while (node !== eventListeners)
      {
        next = node.next;
        node.trigger( triggerGroup, args, false );
        node = next;
      }

      node = eventListeners.next;

      while (node !== eventListeners)
      {
        next = node.next;
        node.trigger( triggerGroup, args, true );
        node = next;
      }
    }
  }
120793
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]:
            return self.handlers[namespace][event](*args)

        # or else, forward the event to a namespace handler if one exists
        elif namespace in self.namespace_handlers:
            return self.namespace_handlers[namespace].trigger_event(
                event, *args)