Events -------------------------------------------------------------
559150
function(name, callback, scope, once) {

            var events = null;
            if (!(events = this._events[name])) {
                events = this._events[name] = [];
            }

            events.push({
                callback: callback,
                scope: scope || this,
                once: once,
                fired: false
            });

            return callback;

        }
1247974
public function handleEvent()
    {
        while ($this->socket !== null)
        {
            $events = $this->socket->getSockOpt(ZMQ::SOCKOPT_EVENTS);

            $hasEvents = ($events & ZMQ::POLL_IN) || ($events & ZMQ::POLL_OUT && $this->buffer->listening);
            if (!$hasEvents)
            {
                break;
            }

            if ($events & ZMQ::POLL_IN)
            {
                $this->handleReadEvent();
            }

            if ($events & ZMQ::POLL_OUT && $this->buffer->listening)
            {
                $this->buffer->handleWriteEvent();
            }
        }
    }
1130067
public function registerEvents()
    {
        $job = & $this->job;

        Event::listen(Event::JOB_PERFORM, function ($event, $_job) use (&$job) {
            $job = $_job;
        });
    }
432299
public function event()
    {
        $options = array(
            'limit' => array(0, $this->config->get('dashboard_limit', 10))
        );

        $events = (array) $this->report->getList($options);

        foreach ($events as &$event) {
            $variables = empty($event['data']['variables']) ? array() : (array) $event['data']['variables'];
            $message = empty($event['translatable']) ? $event['text'] : $this->translation->text($event['text'], $variables);
            $event['message'] = strip_tags($message);
        }

        return $events;
    }
360704
function(object, events) {
        if (!object.__isInterfaceImplemented('events')) {
            object.__implementInterface('events', this.interface);
        }

        object.__initEvents();

        _.each(events, function(eventListeners, eventName) {
            _.each(eventListeners, function(listener, listenerName) {
                object.__addEventListener(eventName, listenerName, listener);
            });
        });
    }
907852
protected function dumpEvents()
    {
        if ($this->config->events === true && version_compare($this->version, '5.1.12') >= 0) {
            $events = $this->pdo->prepare('SHOW EVENTS');
            $events->execute();

            foreach ($events->fetchAll(\PDO::FETCH_ASSOC) as $a) {
                $event = $a['Name'];

                if (in_array($event, (array) $this->config->ignore, true)) {
                    continue;
                }

                if ((string) $this->config->prefix !== '' && strpos($event, $this->config->prefix) !== 0) {
                    continue;
                }

                $structure = $this->pdo->query('SHOW CREATE EVENT `'.$event.'`');

                if ($structure = $structure->fetch(\PDO::FETCH_ASSOC)) {
                    if (isset($structure['Create Event'])) {
                        $query = $structure['Create Event'];
                        $delimiter = $this->getDelimiter('//', $query);
                        $this->write("\n-- Structure for event `{$event}`\n", false);
                        $this->write('DROP EVENT IF EXISTS `'.$event.'`');
                        $this->write("DELIMITER {$delimiter}\n{$query}\n{$delimiter}\nDELIMITER ;", false);
                    }
                }
            }
        }
    }
1297554
def events(self):
        
        if not self.__events:
            self.__events = Events(self.__connection)
        return self.__events
329892
public static function initEvent()
    {
        if (!self::$supported) {
            return;
        }
        self::updateConfig();
        self::$fd = eio_get_event_stream();
        self::$ev = EventLoop::$instance->event(self::$fd,
            \Event::READ | \Event::PERSIST,
            function ($fd, $events, $arg) {
                while (eio_nreqs()) {
                    eio_poll();
                }
            }
        );
        self::$ev->add();
    }
652975
function addEventListener(event, listener) {
    this._eventListeners[event] = this._eventListeners[event] || [];
    this._eventListeners[event].push(listener);
  }
1042696
public function events()
    {
        $events[ActiveRecord::EVENT_AFTER_DELETE] = 'eventAfterDelete';
        $events[ActiveRecord::EVENT_AFTER_INSERT] = 'save';
        $events[ActiveRecord::EVENT_AFTER_UPDATE] = 'save';
        return $events;
    }
900041
function applyEvents(context, child, data) {
        var events = context.events[child.name];
        if (events !== undefined && child.el !== undefined && child.data.type !== 'cp') {
            events.forEach((event)=> {
                context._events.push(child.on(event.name, event.action, context, data));
            });
        }
    }
1322172
public function registerEvents()
    {
        if (!empty($this->clientEvents)) {
            $js = [];
            foreach ($this->clientEvents as $event => $handle) {
                $js[] = "jQuery('#{$this->options['id']}').on('{$event}',{$handle});";
            }
            $this->getView()->registerJs(implode(PHP_EOL, $js));
        }
    }
916035
public function getEvent($event) : Event {
        return isset($this->registeredEvents[$event]) ? $this->registeredEvents[$event] : null;
    }
1049548
function(events) {
    if (!_.isArray(events)) {
      var errEvtsArrMsg = 'events should be an array!';
      debug(errEvtsArrMsg);
      throw new Error(errEvtsArrMsg);
    }
    var self = this;
    _.each(events, function(evt) {
      self.addEvent(evt);
    });
  }
94596
protected function registerEventListeners()
    {
        foreach ($this->events as $event => $listener) {
            Event::listen($event, $listener);
        }

        return $this;
    }
671731
public function getEvent() : ?int 
    {
        if ( ! $this->hasEvent()) {
            $this->setEvent($this->getDefaultEvent());
        }
        return $this->event;
    }
366045
def bind_events(self, events):
        '''
        '''
        evs = self._events
        if evs and events:
            for event in evs.values():
                if event.name in events:
                    event.bind(events[event.name])