Call `get_event(timeout, block)` returning :attr:`Event.data` of the
        first available event.
516015
def get(self, timeout=None, block=True):
        
        return self.get_event(timeout, block).data
1280869
def get_events(self):
        
        res = self.con.get('_events', wait=False)
        logger.debug("Got events from %s: %s", self.name, res)
        return unserialize(res, True)
674166
def watch_one_event(event_filter, callback, timeout_callback, timeout, args,
                        start_time=None):
        
        if timeout and not start_time:
            start_time = int(datetime.now().timestamp())

        if not args:
            args = []

        while True:
            try:
                events = event_filter.get_all_entries()
                if events:
                    callback(events[0], *args)
                    return

            except (ValueError, Exception) as err:
                # ignore error, but log it
                logger.debug(f'Got error grabbing keeper events: {str(err)}')

            time.sleep(0.1)
            if timeout:
                elapsed = int(datetime.now().timestamp()) - start_time
                if elapsed > timeout:
                    if timeout_callback:
                        timeout_callback(*args)
                    else:
                        callback(None, *args)
                    break
1121263
def get_event(self):
        ''''''
        if self.event_queue.qsize() == 0:
            return None
        evt = self.event_queue.get()
        while isinstance(evt, win_layout.WinLayout):
            win_layout.set_layout(evt, self.set_layout)
            if self.event_queue.qsize() == 0:
                return None
            evt = self.event_queue.get()
        return evt
725516
def getEvent(self, dev_id, starttime, endtime):
        """"""
        path = 'device/%s/event?startTime=%s&endTime=%s' % \
            (dev_id, starttime, endtime)
        return self.rachio.get(path)
1262130
def event_first_of(*events: _AbstractLinkable) -> Event:
    
    first_finished = Event()

    if not all(isinstance(e, _AbstractLinkable) for e in events):
        raise ValueError('all events must be linkable')

    for event in events:
        event.rawlink(lambda _: first_finished.set())

    return first_finished
1353460
def GetNewEventId(self, event_time=None):
    """"""
    if event_time is None:
      event_time = int(time.time() * 1e6)

    return "%s:%s:%s" % (event_time, socket.gethostname(), os.getpid())
847213
def get_event_from_name(self, event_name):
        
        return next((e for e in self.events if e.name == event_name), None)
1097138
def event_loop(self):
        
        if not self._event_loop:
            self._event_loop = asyncio.get_event_loop()
        return self._event_loop
140682
def _get_timeout(self, timeout):
        '''
        
        '''
        if timeout is None:
            return self.opts['timeout']
        if isinstance(timeout, int):
            return timeout
        if isinstance(timeout, six.string_types):
            try:
                return int(timeout)
            except ValueError:
                return self.opts['timeout']
        # Looks like the timeout is invalid, use config
        return self.opts['timeout']
172549
def get_event(self):
        

        if not self.is_event_message:
            return None

        # select a dummy field (eg. subject) to avoid pull unneccesary data
        query = self.q().select('subject').expand('event')

        url = self.build_url(self._endpoints.get('get_message').format(id=self.object_id))

        response = self.con.get(url, params=query.as_params())

        if not response:
            return None

        data = response.json()
        event_data = data.get(self._cc('event'))

        return Event(parent=self, **{self._cloud_data_key: event_data})
699703
def GetEvents(self):
    
    for event in self._GetAttributeContainers('event'):
      if hasattr(event, 'event_data_row_identifier'):
        event_data_identifier = identifiers.SQLTableIdentifier(
            'event_data', event.event_data_row_identifier)
        event.SetEventDataIdentifier(event_data_identifier)

        del event.event_data_row_identifier

      yield event
832544
def get(self, block=1, delay=None):
        """"""
        if _debug: IOQueue._debug("get block=%r delay=%r", block, delay)

        # if the queue is empty and we do not block return None
        if not block and not self.notempty.isSet():
            if _debug: IOQueue._debug("    - not blocking and empty")
            return None

        # wait for something to be in the queue
        if delay:
            self.notempty.wait(delay)
            if not self.notempty.isSet():
                return None
        else:
            self.notempty.wait()

        # extract the first element
        priority, iocb = self.queue[0]
        del self.queue[0]
        iocb.ioQueue = None

        # if the queue is empty, clear the event
        qlen = len(self.queue)
        if not qlen:
            self.notempty.clear()

        # return the request
        return iocb
406939
def get(self, timeout=None):
        # type: (float) -> T
        """"""
        self.wait(timeout)
        if isinstance(self._result, Exception):
            raise self._result
        return self._result
1095342
def getNextTimeout(self):
        
        timeval = libusb1.timeval()
        result = libusb1.libusb_get_next_timeout(
            self.__context_p, byref(timeval))
        if result == 0:
            return None
        elif result == 1:
            return timeval.tv_sec + (timeval.tv_usec * 0.000001)
        raiseUSBError(result)
633544
def wait(self, timeout):
        ''''''
        logger.debug('Waiting for %fs', timeout)
        return self._event.wait(timeout)
443138
def pop_event(self):
        """"""
        if len(self.event_list) > 0:
            evt = self.event_list.pop(0)
            return evt
        return None