Inner version of emit which passes the given document as the
        primary argument to handler functions.
341601
def _emit(self, event, document, *args, **kwargs):
        
        self.handler_registrar().apply(event, document, *args, **kwargs)
512715
function emit(string $event, ...$arguments) {
        $errorEmpty = ($event === 'error');
        
        if(!empty($this->listeners[$event])) {
            $errorEmpty = false;
            
            foreach($this->listeners[$event] as $listener) {
                $listener(...$arguments);
            }
        }
        
        if(!empty($this->onceListeners[$event])) {
            $errorEmpty = false;
            
            $listeners = $this->onceListeners[$event];
            unset($this->onceListeners[$event]);
            
            foreach($listeners as $listener) {
                $listener(...$arguments);
            }
        }
        
        if($errorEmpty) {
            throw new \CharlotteDunois\Events\UnhandledErrorException('Unhandled error event', 0, (($arguments[0] ?? null) instanceof \Throwable ? $arguments[0] : null));
        }
    }
1268512
def emit(self, record):
        """"""
        try:
            self._callback(self.prepare(record))
        except Exception:
            self.handleError(record)
400152
function docPreEventFunction(event, socket) {
				// send update info to global log 
				live.emit('log:doc', event);			
				/* send the users change events */
				socket.emit('doc:pre', event);
				socket.emit('doc:pre:' + event.type, event);
			}
293987
public void go(DocListener document, InputSource is) {
        try {
            parser.parse(is, new SAXiTextHandler(document));
        }
        catch(SAXException se) {
            throw new ExceptionConverter(se);
        }
        catch(IOException ioe) {
            throw new ExceptionConverter(ioe);
        }
    }
589856
def _function_handler(function, args, kwargs, pipe):
    """"""
    signal.signal(signal.SIGINT, signal.SIG_IGN)

    result = process_execute(function, *args, **kwargs)

    send_result(pipe, result)
934569
function(name, handler) {
		if (typeof handler === 'string')
			handler = listenerParser.parseListener(handler);
		return this.exec('on', [name, handler]);
	}
856215
function emitAndFire(widget, eventName, eventArg) {
    const originalEmit = widget.emit;
    let event;
    if ('CustomEvent' in window && typeof window.CustomEvent === 'function') {
        event = new CustomEvent(eventName, { detail: eventArg });
    } else {
        event = document.createEvent('CustomEvent');
        event.initCustomEvent(eventName, true, true, eventArg);
    }
    widget.el.dispatchEvent(event);
    originalEmit.call(widget, eventName, eventArg);
}
1105831
function proxyEvent (emitter, event, optionalCallback) {
    emitter.on(event, function () {
      if (optionalCallback) {
        optionalCallback.apply(client, arguments)
      }
      client.emit(event)
    })
  }
288746
public function invokeLifecycleCallbacks(string $event, object $document, ?array $arguments = null) : void
    {
        if (! $document instanceof $this->name) {
            throw new InvalidArgumentException(sprintf('Expected document class "%s"; found: "%s"', $this->name, get_class($document)));
        }

        if (empty($this->lifecycleCallbacks[$event])) {
            return;
        }

        foreach ($this->lifecycleCallbacks[$event] as $callback) {
            if ($arguments !== null) {
                $document->$callback(...$arguments);
            } else {
                $document->$callback();
            }
        }
    }
30985
function applyBroadcast () {
                var args = Array.prototype.slice.call(arguments);
                scope.$apply(function () {
                    scope.$emit.apply(scope, args);
                });
            }
1353370
function emit(event) {
  if (typeof EVENTS[event] === 'undefined') return;
  var args = Array.prototype.slice.call(arguments);
  args.splice(0, 1);
  for (var i = 0; i < EVENTS[event].length; i++) {
    EVENTS[event][i].apply(loglet, args);
  }
}
720637
def trigger(self, event, filter=None, update=None, documents=None, ids=None, replacements=None):
        

        if not self.has_trigger(event):
            return

        if documents is not None:
            pass
        elif ids is not None:
            documents = self.find_by_ids(ids, read_use="primary")
        elif filter is not None:
            documents = self.find(filter, read_use="primary")
        else:
            raise Exception("Trigger couldn't filter documents")

        for doc in documents:
            getattr(doc, event)(update=update, replacements=replacements)
378455
function emit(evt) {
            for (var _len5 = arguments.length, args = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
                args[_key5 - 1] = arguments[_key5];
            }

            this.emitSyncFlag(evt, args, true);
        }
1282709
function emit() {
  if (arguments.length) this.emitted.push(arguments);
  while (!this.paused && this.emitted.length && this.readable) {
    var emitArgs = this.emitted.shift();
    this.emit.apply(this, emitArgs);
    if (emitArgs[0] == 'end') {
      this.readable = false;
    }
  }
}
131717
def emit(events, stream=None, Dumper=Dumper,
        canonical=None, indent=None, width=None,
        allow_unicode=None, line_break=None):
    
    getvalue = None
    if stream is None:
        from StringIO import StringIO
        stream = StringIO()
        getvalue = stream.getvalue
    dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,
            allow_unicode=allow_unicode, line_break=line_break)
    try:
        for event in events:
            dumper.emit(event)
    finally:
        dumper.dispose()
    if getvalue:
        return getvalue()
739968
def _emit(options = {}, &block)
      @_block   = block if block
      @_parent  = options[:parent]  || parent
      @_helpers = options[:helpers] || parent
      if options[:output]
        # todo: document that either :buffer or :output can be used to specify an output buffer, and deprecate :output
        if options[:output].is_a? Output
          @_output = options[:output]
        else
          @_output = Output.new({:buffer => options[:output]}.merge(options))
        end
      else
        @_output = Output.new(options)
      end

      output.widgets << self.class
      send(options[:content_method_name] || :content)
      output
    end