Returns dict of supported events.
        Key = Event Type
        List = Channels that have that event activated
334135
def get_event_triggers(self):
        
        events = {}
        nvrflag = False
        event_xml = []

        url = '%s/ISAPI/Event/triggers' % self.root_url

        try:
            response = self.hik_request.get(url, timeout=CONNECT_TIMEOUT)
            if response.status_code == requests.codes.not_found:
                # Try alternate URL for triggers
                _LOGGING.debug('Using alternate triggers URL.')
                url = '%s/Event/triggers' % self.root_url
                response = self.hik_request.get(url)

        except (requests.exceptions.RequestException,
                requests.exceptions.ConnectionError) as err:
            _LOGGING.error('Unable to fetch events, error: %s', err)
            return None

        if response.status_code != 200:
            # If we didn't recieve 200, abort
            return None

        # pylint: disable=too-many-nested-blocks
        try:
            content = ET.fromstring(response.text)

            if content[0].find(self.element_query('EventTrigger')):
                event_xml = content[0].findall(
                    self.element_query('EventTrigger'))
            elif content.find(self.element_query('EventTrigger')):
                # This is either an NVR or a rebadged camera
                event_xml = content.findall(
                    self.element_query('EventTrigger'))

            for eventtrigger in event_xml:
                ettype = eventtrigger.find(self.element_query('eventType'))
                # Catch empty xml defintions
                if ettype is None:
                    break
                etnotify = eventtrigger.find(
                    self.element_query('EventTriggerNotificationList'))

                etchannel = None
                etchannel_num = 0

                for node_name in CHANNEL_NAMES:
                    etchannel = eventtrigger.find(
                        self.element_query(node_name))
                    if etchannel is not None:
                        try:
                            # Need to make sure this is actually a number
                            etchannel_num = int(etchannel.text)
                            if etchannel_num > 1:
                                # Must be an nvr
                                nvrflag = True
                            break
                        except ValueError:
                            # Field must not be an integer
                            pass

                if etnotify:
                    for notifytrigger in etnotify:
                        ntype = notifytrigger.find(
                            self.element_query('notificationMethod'))
                        if ntype.text == 'center' or ntype.text == 'HTTP':
                            """
                            If we got this far we found an event that we want
                            to track.
                            """
                            events.setdefault(ettype.text, []) \
                                .append(etchannel_num)

        except (AttributeError, ET.ParseError) as err:
            _LOGGING.error(
                'There was a problem finding an element: %s', err)
            return None

        if nvrflag:
            self.device_type = NVR_DEVICE
        else:
            self.device_type = CAM_DEVICE
        _LOGGING.debug('Processed %s as %s Device.',
                       self.cam_id, self.device_type)

        _LOGGING.debug('Found events: %s', events)
        self.hik_request.close()
        return events
207102
def events(self, *events):
        
        return self.send_events(self.create_event(e) for e in events)
989687
def invites(self):
        
        if self._invites is None:
            self._invites = InviteList(
                self._version,
                service_sid=self._solution['service_sid'],
                channel_sid=self._solution['sid'],
            )
        return self._invites
907782
def _get_initialized_channels_for_service(self, org_id, service_id):
        ''''''
        channels_dict = self._get_initialized_channels_dict_for_service(org_id, service_id)
        return list(channels_dict.values())
276973
def support_event_list_simple(fn):
    
    @wraps(fn)
    def _wrapped(self, event, *args, **kwargs):
        if _is_event_list(event):
            result = []
            for e in event:
                ret = fn(self, e, *args, **kwargs)

                if ret is None:
                    continue

                if isinstance(ret, (tuple, list)):
                    result.extend(ret)
                else:
                    result.append(ret)

            if result:
                if len(result) == 1:
                    return result[0]
                return result
            return None
        else:
            return fn(self, event, *args, **kwargs)

    return _wrapped
1357197
def events(self):
        
        if self._events is None:
            self._events = EventList(self)
        return self._events
687968
def events_list(self):
        
        evt = []
        evt.extend(events.NEPALI_EVENTS[self.month, self.day])
        evt.extend(events.ENGLISH_EVENTS[self.en_date.month, self.en_date.day])
        return evt
694400
def fetch_attributes(self, event, channel):
        """"""
        try:
            for sensor in self.event_states[event]:
                if sensor[1] == int(channel):
                    return sensor
        except KeyError:
            return None
601504
def _event_funcs(self, event: str) -> Iterable[Callable]:
        
        for func in self._events[event]:
            yield func
874633
def get_events(conn, stackname):
    """"""
    next = None
    event_list = []
    while 1:
        events = conn.describe_stack_events(stackname, next)
        event_list.append(events)
        if events.next_token is None:
            break
        next = events.next_token
        time.sleep(1)
    return reversed(sum(event_list, []))
253858
def get_events(object_key: str) -> List[Event]:
    """"""
    events_data = _get_events_data(object_key)
    return [Event.from_config(event_dict) for event_dict in events_data]
152915
def get_received_events(self):
        
        return github.PaginatedList.PaginatedList(
            github.Event.Event,
            self._requester,
            self.url + "/received_events",
            None
        )
356910
def event_return(events):
    '''
    
    '''

    for event in events:
        ret = event.get('data', False)

        if ret:
            returner(ret)
787366
def _detect_available_configs():
        
        with channels_lock:
            available_channels = list(channels.keys())

        # find a currently unused channel
        get_extra = lambda: "channel-{}".format(randint(0, 9999))
        extra = get_extra()
        while extra in available_channels:
            extra = get_extra()

        available_channels += [extra]

        return [
            {'interface': 'virtual', 'channel': channel}
            for channel in available_channels
        ]
1243527
def find_handlers(event_name, registry=HANDLER_REGISTRY):
    
    handlers = []

    # event_name can be a BaseEvent or the string representation
    if isinstance(event_name, basestring):
        matched_events = [event for event in registry.keys()
            if fnmatch.fnmatchcase(event_name, event)]
        for matched_event in matched_events:
            handlers.extend(registry.get(matched_event))
    else:
        handlers = registry.get(find_event(event_name), [])

    return handlers
900223
def events(self):
		

		while True:
			events = self._selector.select()
			for nevent in range(len(events) + 1):
				self._libinput.libinput_dispatch(self._li)
				hevent = self._libinput.libinput_get_event(self._li)
				if hevent:
					type_ = self._libinput.libinput_event_get_type(hevent)
					self._libinput.libinput_dispatch(self._li)
					if type_.is_pointer():
						yield PointerEvent(hevent, self._libinput)
					elif type_.is_keyboard():
						yield KeyboardEvent(hevent, self._libinput)
					elif type_.is_touch():
						yield TouchEvent(hevent, self._libinput)
					elif type_.is_gesture():
						yield GestureEvent(hevent, self._libinput)
					elif type_.is_tablet_tool():
						yield TabletToolEvent(hevent, self._libinput)
					elif type_.is_tablet_pad():
						yield TabletPadEvent(hevent, self._libinput)
					elif type_.is_switch():
						yield SwitchEvent(hevent, self._libinput)
					elif type_.is_device():
						yield DeviceNotifyEvent(hevent, self._libinput)
1024260
def user_view_events(self) -> List[str]:
        """"""
        return [event_type for event_type, event in self.items if event.get_event_action()
                == event_actions.VIEWED]