Get the set of recent and upcoming events to which this list applies.
17980
def recentEvents(self):
        '''
        
        '''
        return Event.objects.filter(
            Q(pk__in=self.individualEvents.values_list('pk',flat=True)) |
            Q(session__in=self.eventSessions.all()) |
            Q(publicevent__category__in=self.eventCategories.all()) |
            Q(series__category__in=self.seriesCategories.all())
        ).filter(
            Q(startTime__lte=timezone.now() + timedelta(days=60)) &
            Q(endTime__gte=timezone.now() - timedelta(days=60))
        )
642448
public synchronized EventData[] getEvents(int event_type) {
        ArrayList<EventData> v = new ArrayList<EventData>();
        for (EventData event : events)
            if (event.event_type == event_type)
                v.add(event);
        EventData[] periodic = new EventData[v.size()];
        for (int i = 0; i < v.size(); i++) {
            periodic[i] = v.get(i);
            events.remove(v.get(i));
        }
        return periodic;
    }
1051924
def recentProgress(self):
        
        return [json.loads(p.json()) for p in self._jsq.recentProgress()]
360436
def events(self, all_instances=None, instance_ids=None, filters=None):
        """"""
        params = {}
        if filters:
            params["filters"] = make_filters(filters)
        if instance_ids:
            params['InstanceIds'] = instance_ids
        statuses = self.status(all_instances, **params)
        event_list = []
        for status in statuses:
            if status.get("Events"):
                for event in status.get("Events"):
                    event[u"InstanceId"] = status.get('InstanceId')
                    event_list.append(event)
        return event_list
1025286
def recent(self):
        '''
        
        '''
        kwd = {
            'pager': '',
            'title': 'Recent Pages',
        }
        self.render('wiki_page/wiki_list.html',
                    view=MWiki.query_recent(),
                    format_date=tools.format_date,
                    kwd=kwd,
                    userinfo=self.userinfo)
693804
def get_events(self, stack_name, chronological=True):
        """"""
        next_token = None
        event_list = []
        while True:
            if next_token is not None:
                events = self.cloudformation.describe_stack_events(
                    StackName=stack_name, NextToken=next_token
                )
            else:
                events = self.cloudformation.describe_stack_events(
                    StackName=stack_name
                )
            event_list.append(events['StackEvents'])
            next_token = events.get('NextToken', None)
            if next_token is None:
                break
            time.sleep(GET_EVENTS_SLEEP)
        if chronological:
            return reversed(sum(event_list, []))
        else:
            return sum(event_list, [])
87178
def list_events_view(request):
    '''  '''
    page_name = "Upcoming Events"
    profile = UserProfile.objects.get(user=request.user)
    event_form = EventForm(
        request.POST if 'post_event' in request.POST else None,
        profile=profile,
    )
    if event_form.is_valid():
        event_form.save()
        return HttpResponseRedirect(reverse('events:list'))

    # a pseudo-dictionary, actually a list with items of form (event, ongoing,
    # rsvpd, rsvp_form), where ongoing is a boolean of whether the event is
    # currently ongoing, rsvpd is a boolean of whether the user has rsvp'd to
    # the event
    events_dict = list()
    for event in Event.objects.filter(end_time__gte=now()):
        rsvp_form = RsvpForm(
            request.POST if "rsvp-{0}".format(event.pk) in request.POST else None,
            instance=event,
            profile=profile,
        )
        if rsvp_form.is_valid():
            rsvpd = rsvp_form.save()
            if rsvpd:
                message = MESSAGES['RSVP_ADD'].format(event=event.title)
            else:
                message = MESSAGES['RSVP_REMOVE'].format(event=event.title)
            messages.add_message(request, messages.SUCCESS, message)
            return HttpResponseRedirect(reverse('events:list'))

        ongoing = ((event.start_time <= now()) and (event.end_time >= now()))
        rsvpd = (profile in event.rsvps.all())
        events_dict.append((event, ongoing, rsvpd, rsvp_form))

    if request.method == "POST":
        messages.add_message(request, messages.ERROR, MESSAGES["EVENT_ERROR"])

    return render_to_response('list_events.html', {
        'page_name': page_name,
        'events_dict': events_dict,
        'now': now(),
        'event_form': event_form,
    }, context_instance=RequestContext(request))
1341597
def events(self):
        ''''''
        ret = []
        while True:
            e = self.poll()
            if e is None:
                break
            ret.append(e)
        return ret
991048
def get_times(self):
        
        if not self.n:
            return list()

        ret = list()

        for item in self._event_times:
            ret += list(self.__dict__[item])

        return ret + list(matrix(ret) - 1e-6)
55642
def getDueDate(self):
        """"""
        due_dates = map(lambda an: an.getDueDate, self.getAnalyses())
        return due_dates and min(due_dates) or None
553687
public java.util.List<EventSubscription> getEventSubscriptionsList() {
        if (eventSubscriptionsList == null) {
            eventSubscriptionsList = new com.amazonaws.internal.SdkInternalList<EventSubscription>();
        }
        return eventSubscriptionsList;
    }
103667
def upcoming_viewings(self):
        
        upcoming_viewings = []
        try:
            if self._data_from_search:
                viewings = self._data_from_search.find_all(
                    'div', {'class': 'smi-onview-text'})
            else:
                viewings = []
        except Exception as e:
            if self._debug:
                logging.error(
                    "Error getting upcoming_viewings. Error message: " + e.args[0])
            return
        for viewing in viewings:
            upcoming_viewings.append(viewing.text.strip())
        return upcoming_viewings
1238045
def events(cls, filters):
        """"""
        current = filters.pop('current', False)
        current_params = []
        if current:
            current_params = [('current', 'true')]

        filter_url = uparse.urlencode(sorted(list(filters.items())) + current_params)  # noqa
        events = cls.json_get('%s/events?%s' % (cls.api_url, filter_url),
                              empty_key=True, send_key=False)
        return events
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
1174776
def listing(self):
        

        now = Environment.get_instance().calendar_dt
        return self.listed_date <= now <= self.de_listed_date
567127
def get_upcoming(self, count: int) -> List[ScheduledTransaction]:
        
        # load all enabled scheduled transactions
        all_tx = self.query.filter(ScheduledTransaction.enabled == 1).all()

        # calculate next occurrence date
        for tx in all_tx:
            next_date = get_next_occurrence(tx)
            tx["next_date"] = next_date

        # order by next occurrence date
        all_tx.sort(key=lambda tx: tx["next_date"].value)
        # get upcoming (top) 10
        top_n = all_tx[:count]
        return top_n
1293305
def _getEventsByWeek(self, request, year, month):
        """"""
        return getAllEventsByWeek(request, year, month, home=self)