complex events *
516500
function findCenter( elem ) {
	var offset,
		document = $( elem.ownerDocument );
	elem = $( elem );
	offset = elem.offset();

	return {
		x: offset.left + elem.outerWidth() / 2 - document.scrollLeft(),
		y: offset.top + elem.outerHeight() / 2 - document.scrollTop()
	};
}
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])))
834877
public void addPossiblesEventsComplex() {
        Set<Scenario> scenarios = this.getScenarios();
        for (Scenario s : scenarios) {
            for (Class<? extends Event> c : s.getPossibleEventsOfNE().keySet()) {
                if (!this.getPossibleEventsOfNE().containsKey(c)) {
                    this.addPossibleEventsOfNE(c, s.getPossibleEventsOfNE()
                            .get(c));
                } else {
                    List<Set<NetworkElement>> elements = this
                            .getPossibleEventsOfNE().get(c);
                    // elements.addAll(s.getPossibleEventsOfNE().get(c));
                    for (Set<NetworkElement> sne : s.getPossibleEventsOfNE()
                            .get(c)) {
                        if (!elements.contains(sne))
                            elements.add(sne);
                    }
                    this.addPossibleEventsOfNE(c, elements);
                }
            }
            for (Class<? extends Event> c : s.getPossibleEventsOfScenario()
                    .keySet()) {
                if (!this.getPossibleEventsOfScenario().containsKey(c)) {
                    this.addPossibleEventsOfScenario(c, s
                            .getPossibleEventsOfScenario().get(c));
                } else {
                    List<Set<Scenario>> elements = this
                            .getPossibleEventsOfScenario().get(c);
                    // elements.addAll(s.getPossibleEventsOfScenario().get(c));
                    for (Set<Scenario> sne : s.getPossibleEventsOfScenario()
                            .get(c)) {
                        if (!elements.contains(sne))
                            elements.add(sne);
                    }
                    this.addPossibleEventsOfScenario(c, elements);
                }
            }
        }

    }
843036
def process_events(self, data):
        
        events = bridge.loads(data)
        if self.debug:
            print("======== Py <-- Native ======")
            for event in events:
                print(event)
            print("===========================")
        for event in events:
            if event[0] == 'event':
                self.handle_event(event)
979395
def events(self, **kwargs):
        
        events_result = self.service.events().list(**kwargs).execute()
        return [Event(event) for event in events_result.get("items", [])]
1156862
def disasters(value=disasters_array,
              early_mean=early_mean,
              late_mean=late_mean,
              switchpoint=switchpoint):
    """"""
    return pm.poisson_like(
        value[:switchpoint], early_mean) + pm.poisson_like(value[switchpoint:], late_mean)
1341597
def events(self):
        ''''''
        ret = []
        while True:
            e = self.poll()
            if e is None:
                break
            ret.append(e)
        return ret
672031
public void addEvents(Matrix events) {
		int seriesCount = getSeriesCount();
		for (int r = 0; r < events.getRowCount(); r++) {
			long timestamp = events.getAsLong(r, 0);
			for (int c = 1; c < events.getColumnCount(); c++) {
				double value = events.getAsDouble(r, c);
				addEvent(timestamp, seriesCount + c - 1, value);
			}
		}
	}
1288198
def summarize_events():
    """"""

    for ev in event.events:
        if ev.callbacks:
            LOG.info("subscribed to %s by %s", ev, ', '.join(imap(repr, ev.callbacks)))
142431
def __analizar_evento(self, ret):
        ""
        evt = ret.get('evento')
        if evt:
            self.Eventos = [evt]
            self.Evento = "%(codigo)s: %(descripcion)s" % evt
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));
            });
        }
    }
429043
function (events) {
        "use strict";
    
        var loaded = {};
        this.loaded = loaded;
    
        var items = {};
        var keys = [];
        Object.defineProperty(this, 'items', {
            'get': function () {
                return items;
            }
        });
        Object.defineProperty(this, 'keys', {
            'get': function () {
                return keys;
            }
        });
        Object.defineProperty(this, 'length', {
            'get': function () {
                return keys.length;
            }
        });
    
        // List of modules that are multilanguage
        var multilanguage = new Map();
        Object.defineProperty(this, 'multilanguage', {
            'get': function () {
                return multilanguage;
            }
        });
    
        this.get = function (moduleID, extendedID) {
    
            var done = function () {
    
                events.trigger(moduleID + ':done');
                events.trigger('done', moduleID);
    
                loaded[moduleID] = true;
    
            };
    
            var extended;
            if (extendedID) {
                extended = items[extendedID];
                if (!extended) {
                    extended = new Module(moduleID, events);
                    items[extendedID] = extended;
                    keys.push(extendedID);
                }
            }
    
            var module = items[moduleID];
            if (!module) {
                module = new Module(moduleID, events);
                items[moduleID] = module;
                keys.push(moduleID);
            }
    
    
            if (extended) return [module, extended];
            else return [module, done];
    
        };
    
    }
825382
function anomaly() {
	var id = this instanceof events.EventEmitter && this.id ? String(this.id) : '' // first argument must be string, otherwise console.log does inspect
	var body = getBody(id, Array.prototype.slice.call(arguments))
	log(id, body)
	if (!isShutdown && isEmailOn() && emailer.hasSendMail()) enqueueEmail(body)
}
139317
def occurs_on?(date)
      date = TimeUtil.ensure_date(date)
      begin_time = TimeUtil.beginning_of_date(date, start_time)
      closing_time = TimeUtil.end_of_date(date, start_time)
      occurs_between?(begin_time, closing_time)
    end
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;
}
278518
def process_events(self):
        """"""
        for event, args in iter_except(self.event_queue.popleft, IndexError):
            for callback in self.event_callbacks[event]:
                callback(*args)
677399
function dispatchEvent (event, data) {
    if (hasDOM()) {
      eventEmitter.dispatchEvent(new CustomEvent(event, data));
    } else if (hasEventEmitter()) {
      eventEmitter.emit(event, data);
    }
  }