Expose each event to a block of code as it comes in.
335331
def each
      begin
        loop do
          event = read
          next unless event.type == 1
          next unless event.value == 1
          yield event
        end
      rescue Errno::ENODEV
      end
    end
1061400
def paintEvent(self, e):
        
        self._update_visible_blocks(e)
        super(CodeEdit, self).paintEvent(e)
        self.painted.emit(e)
374798
function(event) {
            var state = self.state();

            for ( var i in self._callbacks ) {
                self._callbacks[i].call(self._doc, event, state);
            }
        }
750194
function () {
            for (var i = 0, l = methods.length; i < l; i++) {
                this.evented(methods[i])
            }
        }
257259
def handle_new_events(self, events):
        """"""
        for event in events:
            self.events.append(
                self.create_event_object(
                    event[0],
                    event[1],
                    int(event[2])))
1130936
function (eventName, args)
  {
    var e = this._events[eventName];
    if (e) {
      args = args || [];
      e.forEach (function (handler)
      {
        handler.apply (this, args);
      });
    }
  }
304350
def attach_events(self, *events, **kwargs):
        """"""
        reg = self.registry
        insert = 'insert' in kwargs
        for e in events:
            cregexp = e.compile(self.config)
            regexp = getattr(e.regexp, 're', e.regexp)
            if regexp not in reg.events[e.iotype]:
                if insert:
                    reg.events_re[e.iotype].insert(0, (regexp, cregexp))
                else:
                    reg.events_re[e.iotype].append((regexp, cregexp))
            if insert:
                reg.events[e.iotype][regexp].insert(0, e)
            else:
                reg.events[e.iotype][regexp].append(e)
232010
function decorateEvents(comp) {
    const prototype = /** @type {!Function} */(comp.constructor).prototype;

    if (prototype.__events) return;

    let events = {};

    if (prototype.events) {
        events = prototype.events;
    }

    Object.getOwnPropertyNames(prototype)
        .map(propertyName => handlerMethodPattern.exec(propertyName))
        .filter(x => x)
        .forEach(([methodName, eventType, eventTarget]) => {
            events[eventType] = events[eventType] || {};

            /** @suppress {checkTypes} */
            events[eventType][eventTarget] = comp[methodName];
        })

    prototype.__events = events;
}
1281790
function() {

      this.input = this.$("#new-todo");
      this.allCheckbox = this.$("#toggle-all")[0];

      this.listenTo(Todos, 'add', this.addOne);
      this.listenTo(Todos, 'reset', this.addAll);
      this.listenTo(Todos, 'all', this.render);

      this.footer = this.$('footer');
      this.main = $('#main');

      Todos.fetch();
    }
501378
def main():
    """"""
    while 1:
        events = get_key()
        if events:
            for event in events:
                print(event.ev_type, event.code, event.state)
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);
    });
  }
1038745
function(code)
        {
            if (code === null)
                code = '';

            this.code = code;

            var div = this.create('div');

            // create main HTML
            div.innerHTML = this.getHtml(code);

            // set up click handlers
            if (this.getParam('toolbar'))
                attachEvent(findElement(div, '.toolbar'), 'click', sh.toolbar.handler);

            if (this.getParam('quick-code'))
                attachEvent(findElement(div, '.code'), 'dblclick', quickCodeHandler);

            return div;
        }
338532
function writeAndRunCodeBlocks(codeBlocks) {
  var dir = '.runnable-markdown-' + rand.generateKey(7);
  return makeTempDir(dir)
  .then(function() {
    return new Promise(function(fulfill, reject) {
      async.mapSeries(codeBlocks, function(codeBlock, callback) {
        appendCodeBlockToFile(codeBlock, dir)
          .then(runCodeBlock)
          .then(function(codeBlock) {
            callback(null, codeBlock);
          })
          .catch(function(err) {
            callback(err, null);
          });
      }, convertAsyncResultToPromise(fulfill, reject));
    });
  })
  .then(function(codeBlocks) {
    return removeOldDir(dir)
      .then(function() {
        return codeBlocks;
      });
  });
}
700157
def on_any_event(self, event):
        """"""
        if os.path.isfile(event.src_path):
            self.callback(event.src_path, **self.kwargs)
995139
def filter_callbacks(cls, client, event_data):
        """"""

        for event in cls.filter_events(client, event_data):
            for cb in event.callbacks:
                yield cb
21820
def events(self, argv):
        """"""
        opts = cmdline(argv, FLAGS_EVENTS)
        self.foreach(opts.args, lambda job: 
            output(job.events(**opts.kwargs)))
215219
function(params) {
    var success = function(result) {
      if (!EventHandlers.hasOwnProperty(result.eventName)) {
        return;
      }

      for (var index in EventHandlers[result.eventName]) {
        EventHandlers[result.eventName][index].apply(undefined, [result.value]);
      }
    };

    exec(success, null, PLUGIN_NAME, "init", [params]);
  }