having to know all the events ahead of time.
192171
public void writeToJsonGenerator(final JsonGenerator gen) throws IOException
    {
        // writes '{eventName:<name>,payload:{<data>}}' --it's kind of silly but ultimately inconsequential to nest them like this.
        gen.writeStartObject();
        gen.writeStringField("eventName", eventName);
        gen.writeFieldName("payload");
        /* Note: output format used depends completely on generator we are being passed
         * and NOT on which mapper we use -- mappers are format independent and rely
         * on underlying JsonParser/JsonGenerator for low-level handling.
         */
        getObjectMapper().writeTree(gen, root);
        gen.writeEndObject();
    }
1297554
def events(self):
        
        if not self.__events:
            self.__events = Events(self.__connection)
        return self.__events
535721
def has_prev(self):
        """"""
        if self._result_cache:
            return self._result_cache.has_prev

        return self.all().has_prev
209234
def timeline(self):
        
        raw = self._job_statistics().get("timeline", ())
        return [TimelineEntry.from_api_repr(entry) for entry in raw]
369215
def _previous(self):
        """"""
        self.summaries.rotate()
        current_summary = self.summaries[0]
        self._update_summary(current_summary)
527627
public function eventBeforeInsert()
    {
        $item = self::find()->where([
            'nav_container_id' => $this->nav_container_id,
            'parent_nav_id' => $this->parent_nav_id
        ])->orderBy('sort_index DESC')->limit(1)->asArray()->one();
        if (!$item) {
            $this->sort_index = 1;
        } else {
            $this->sort_index = $item['sort_index'] + 1;
        }
    }
961102
function getNow(context = {}) {
  const result = (context.ntlctx || {}).now;
  if (result instanceof Date) {
    return result;
  }
  return new Date();
}
214558
def getGroupUpcomingEvents(request, group):
    
    # Get events that are a child of a group page, or a postponement or extra
    # info a child of the recurring event child of the group
    rrEvents = RecurringEventPage.events(request).exclude(group_page=group) \
                                        .upcoming().child_of(group).this()
    qrys = [SimpleEventPage.events(request).exclude(group_page=group)
                                        .upcoming().child_of(group).this(),
            MultidayEventPage.events(request).exclude(group_page=group)
                                        .upcoming().child_of(group).this(),
            rrEvents]
    for rrEvent in rrEvents:
        qrys += [PostponementPage.events(request).child_of(rrEvent.page)
                                         .upcoming().this(),
                 ExtraInfoPage.events(request).exclude(extra_title="")
                                 .child_of(rrEvent.page).upcoming().this()]

    # Get events that are linked to a group page, or a postponement or extra
    # info a child of the recurring event linked to a group
    rrEvents = group.recurringeventpage_set(manager='events').auth(request)  \
                                                        .upcoming().this()
    qrys += [group.simpleeventpage_set(manager='events').auth(request)
                                                        .upcoming().this(),
             group.multidayeventpage_set(manager='events').auth(request)
                                                        .upcoming().this(),
             rrEvents]
    for rrEvent in rrEvents:
        qrys += [PostponementPage.events(request).child_of(rrEvent.page)
                                                       .upcoming().this(),
                 ExtraInfoPage.events(request).exclude(extra_title="")
                                 .child_of(rrEvent.page).upcoming().this()]
    events = sorted(chain.from_iterable(qrys),
                    key=attrgetter('page._upcoming_datetime_from'))
    return events
1136465
async def upcoming(self, details: bool = False) -> list:
        """"""
        endpoint = 'dailystats'
        key = 'DailyStats'
        if details:
            endpoint += '/details'
            key = 'DailyStatsDetails'
        data = await self._request('get', endpoint)
        return data[key]
828247
def timeline(self):
        """"""
        rev = int(self.db.get('site:rev'))
        if rev != self.revision:
            self.reload_site()

        return self._timeline
1101932
def _getEventsOnDay(self, request, day):
        """"""
        return getAllEventsByDay(request, day, day, home=self)[0]
539791
def on_any_event(self, event):
        """"""
        self.updated = True
        if self._changed:
            self._changed()
72030
def within_history(rev, windowdict):
    """"""
    if not windowdict:
        return False
    begin = windowdict._past[0][0] if windowdict._past else \
            windowdict._future[-1][0]
    end = windowdict._future[0][0] if windowdict._future else \
          windowdict._past[-1][0]
    return begin <= rev <= end
930286
def inFocus(self):
        """"""
        previous_flags = self.window.flags()
        self.window.setFlags(previous_flags |
                             QtCore.Qt.WindowStaysOnTopHint)
447280
function(historyinfo){
		this.allerase();
		
		this.initpos = this.position = historyinfo.current || 0;
		this.history = [];
		var datas = historyinfo.datas || [];
		for(var i=0,len=datas.length;i <len;i++){
			var opelist = new this.klass.OperationList();
			this.history.push(opelist);
			var array = datas[i];
			if(array.time!==void 0){
				opelist.time = array.time;
				array = array.ope;
			}
			for(var j=0,len2=array.length;j <len2;j++){
				var strs = array[j].split(/,/);
				var ope = null, List = this.operationlist;
				for(var k=0;k <List.length;k++){
					var ope1 = new List[k]();
					if(ope1.decode(strs)){ ope = ope1; break;}
				}
				if(!!ope){
					opelist.push(ope);
					this.lastope = ope;
				}
			}
		}
		
		this.checkexec();
		
		this.trialpos = historyinfo.trialpos || [];
		if(this.trialpos.length>0){
			this.resumeTrial();
			this.limitTrialUndo = true;
		}
	}
623256
function() {
		if (typeof(this.events) == "undefined" || typeof(this.events.length) == "undefined" || this.events.length == 0) {
			this.logError("Timeline configuration has no events.")
		}

		// make sure all eras have start and end dates
		for (var i = 0; i < this.eras.length; i++) {
			if (typeof(this.eras[i].start_date) == 'undefined' || typeof(this.eras[i].end_date) == 'undefined') {
				var era_identifier;
				if (this.eras[i].text && this.eras[i].text.headline) {
					era_identifier = this.eras[i].text.headline
				} else {
					era_identifier = "era " + (i+1);
				}
				this.logError("All eras must have start and end dates. [" + era_identifier + "]") // add internationalization (I18N) and context
			}
		};
	}
1122847
def events(self):
        
        if self._events is None:
            self._events = self.parent.calendar.events(
                calendarId="primary", singleEvents=True, orderBy="startTime",
                timeMin=self.since, timeMax=self.until)
        return self._events