def get_event(self, *etypes, timeout=None):
self._validate_etypes(*etypes)<EOL>start = time.time()<EOL>e = self._eventq.get(timeout=timeout)<EOL>if isinstance(e, Exception):<EOL><INDENT>raise e<EOL><DEDENT>self._stats['<STR_LIT>'] += <NUM_LIT:1><EOL>if etypes and e.type not in etypes:<EOL><INDENT>if timeout:<EOL><INDENT>timeout -= time.time() - start<EOL><DEDENT>log.debug('<STR_LIT>'.format(e.json))<EOL>self._stats['<STR_LIT>'] += <NUM_LIT:1><EOL>return self.get_event(*etypes, timeout=timeout)<EOL><DEDENT>return e<EOL>
Return a single event object or block until an event is
received and return it.
 - etypes(str): If defined, Slack event type(s) not matching
   the filter will be ignored. See https://api.slack.com/events for
   a listing of valid event types.
 - timeout(int): Max time, in seconds, to block waiting for new event