Fetch new RTM events from the API.
974288
def fetch_events(self) -> List[dict]:
        
        try:
            return self.inner.rtm_read()

        # TODO: The TimeoutError could be more elegantly resolved by making
        # a PR to the websocket-client library and letting them coerce that
        # exception to a WebSocketTimeoutException that could be caught by
        # the slackclient library and then we could just use auto_reconnect.
        except TimeoutError:
            log.debug('Lost connection to the Slack API, attempting to '
                      'reconnect')
            self.connect_with_retry()
            return []
563409
public static event[] get(nitro_service client) throws Exception
	{
		event resource = new event();
		resource.validate("get");
		return (event[]) resource.get_resources(client);
	}
1145581
def fetch_event(urls):
    
    rs = (grequests.get(u) for u in urls)
    return [content.json() for content in grequests.map(rs)]
1262806
async def handler(event):
    """"""
    rtd = RTFD if event.pattern_match.group(1) else RTD
    await asyncio.wait([
        event.delete(),
        event.respond(rtd, reply_to=event.reply_to_msg_id)
    ])
1274470
def get_run_events(cls, crawler, run_id, start, end, level=None):
        """"""
        key = make_key(crawler, "events", run_id, level)
        return cls.event_list(key, start, end)
599120
def refresh_events(self):
        
        now = datetime.datetime.now(tz=pytz.UTC)
        try:
            now, later = self.get_timerange_formatted(now)
            events_result = self.service.events().list(
                calendarId='primary',
                timeMin=now,
                timeMax=later,
                maxResults=10,
                singleEvents=True,
                orderBy='startTime',
                timeZone='utc'
            ).execute()
            self.events.clear()
            for event in events_result.get('items', []):
                self.events.append(GoogleCalendarEvent(event))
        except HttpError as e:
            if e.resp.status in (500, 503):
                self.logger.warn("GoogleCalendar received %s while retrieving events" % e.resp.status)
            else:
                raise
1129781
def getAllUpcomingEvents(request, *, home=None):
    
    qrys = [SimpleEventPage.events(request).upcoming().this(),
            MultidayEventPage.events(request).upcoming().this(),
            RecurringEventPage.events(request).upcoming().this(),
            PostponementPage.events(request).upcoming().this(),
            ExtraInfoPage.events(request).exclude(extra_title="").upcoming()
                                         .this()]
    if home is not None:
        qrys = [qry.descendant_of(home) for qry in qrys]
    events = sorted(chain.from_iterable(qrys),
                    key=attrgetter('page._upcoming_datetime_from'))
    return events
1079833
def get_upcoming_events(self):
        
        mask = "mask[id, subject, startDate, endDate, statusCode, acknowledgedFlag, impactedResourceCount, updateCount]"
        _filter = {
            'endDate': {
                'operation': '> sysdate'
            },
            'startDate': {
                'operation': 'orderBy',
                'options': [{
                    'name': 'sort',
                    'value': ['ASC']
                }]
            }
        }
        return self.client.call('Notification_Occurrence_Event', 'getAllObjects', filter=_filter, mask=mask, iter=True)
1267919
def get_events(self):
        '''
        
        '''
        ret = []
        while True:
            event = self.event.get_event(wait=1, full=True)
            if event is None:
                return ret
            ret.append(event)
1330286
def events(self, from_dt=None, to_dt=None):
        
        self.refresh_client(from_dt, to_dt)
        return self.response['Event']
8275
def get_all_client_events(self, client):
        
        data = self._request('GET', '/events/{}'.format(client))
        return data.json()
306056
def get_events(self):
        
        res = copy.copy(self.events)
        del self.events[:]
        return res
1297554
def events(self):
        
        if not self.__events:
            self.__events = Events(self.__connection)
        return self.__events
221867
def get_and_project_events(self, entity_id, gt=None, gte=None, lt=None, lte=None, limit=None, initial_state=None,
                               query_descending=False):
        
        # Decide if query is in ascending order.
        #  - A "speed up" for when events are stored in descending order (e.g.
        #  in Cassandra) and it is faster to get them in that order.
        #  - This isn't useful when 'until' or 'after' or 'limit' are set,
        #    because the inclusiveness or exclusiveness of until and after
        #    and the end of the stream that is truncated by limit both depend on
        #    the direction of the query. Also paging backwards isn't useful, because
        #    all the events are needed eventually, so it would probably slow things
        #    down. Paging is intended to support replaying longer event streams, and
        #    only makes sense to work in ascending order.
        if gt is None and gte is None and lt is None and lte is None and self.__page_size__ is None:
            is_ascending = False
        else:
            is_ascending = not query_descending

        # Get entity's domain events from the event store.
        domain_events = self.event_store.get_domain_events(
            originator_id=entity_id,
            gt=gt,
            gte=gte,
            lt=lt,
            lte=lte,
            limit=limit,
            is_ascending=is_ascending,
            page_size=self.__page_size__
        )

        # The events will be replayed in ascending order.
        if not is_ascending:
            domain_events = list(reversed(list(domain_events)))

        # Project the domain events onto the initial state.
        return self.project_events(initial_state, domain_events)
1293305
def _getEventsByWeek(self, request, year, month):
        """"""
        return getAllEventsByWeek(request, year, month, home=self)
866128
def get_rich_events(self, item):
        
        module = item['data']
        if not item['data']['releases']:
            return []

        for release in item['data']['releases']:
            event = self.get_rich_item(item)
            # Update specific fields for this release
            event["uuid"] += "_" + release['slug']
            event["author_url"] = 'https://forge.puppet.com/' + release['module']['owner']['username']
            event["gravatar_id"] = release['module']['owner']['gravatar_id']
            event["downloads"] = release['downloads']
            event["slug"] = release['slug']
            event["version"] = release['version']
            event["uri"] = release['uri']
            event["validation_score"] = release['validation_score']
            event["homepage_url"] = None
            if 'project_page' in release['metadata']:
                event["homepage_url"] = release['metadata']['project_page']
            event["issues_url"] = None
            if "issues_url" in release['metadata']:
                event["issues_url"] = release['metadata']['issues_url']
            event["tags"] = release['tags']
            event["license"] = release['metadata']['license']
            event["source_url"] = release['metadata']['source']
            event["summary"] = release['metadata']['summary']

            event["metadata__updated_on"] = parser.parse(release['updated_at']).isoformat()

            if self.sortinghat:
                release["metadata__updated_on"] = event["metadata__updated_on"]  # Needed in get_item_sh logic
                event.update(self.get_item_sh(release))

            if self.prjs_map:
                event.update(self.get_item_project(event))

            event.update(self.get_grimoire_fields(release["created_at"], "release"))

            yield event
1129801
def next_on(context, rrevent=None):
    
    request = context['request']
    if rrevent is None:
        rrevent = context.get('page')
    eventNextOn = getattr(rrevent, '_nextOn', lambda _:None)
    return eventNextOn(request)