:type lex_input_event: LexInputEvent
        :return: None
6480
def update_slots(self, event):
        
        if isinstance(event, LexInputEvent):
            event_slots = event.currentIntent.slots
        elif isinstance(event, basestring) or isinstance(event, unicode) or isinstance(event, str):
            event_slots = deepcopy(json.loads(event)['currentIntent']['slots'])
        else:
            event_slots = deepcopy(event['currentIntent']['slots'])

        for key, val in event_slots.items():
            if key not in self.dialogAction.slots._schema.fields:
                field = Field(key, types.StringType())
                self.dialogAction.slots._schema.append_field(field)
            self.dialogAction.slots[key] = val
829163
def visitNonRefValueType(self, ctx: jsgParser.NonRefValueTypeContext):
        
        if ctx.LEXER_ID_REF():                  # Reference to a lexer token
            self._lexeridref = as_token(ctx)
        elif ctx.STRING():                      # Anonymous lexer token
            from pyjsg.parser_impl.jsg_lexerruleblock_parser import JSGLexerRuleBlock
            lrb = JSGLexerRuleBlock(self._context)
            lrb.add_string(ctx.getText()[1:-1], False)
            self._lexeridref = self._context.anon_id()
            self._context.grammarelts[self._lexeridref] = lrb
        else:
            self.visitChildren(ctx)
1291975
def trigger_event(event=None, **kwargs):
    '''
    
    '''

    res = {'result': False, 'message': 'Something went wrong'}

    data = {}
    for value in ('value1', 'value2', 'value3',
                  'Value1', 'Value2', 'Value3'):
        if value in kwargs:
            data[value.lower()] = kwargs[value]
    data['occurredat'] = time.strftime("%B %d, %Y %I:%M%p", time.localtime())
    result = _query(event=event,
                    method='POST',
                    data=salt.utils.json.dumps(data)
                    )
    if 'status' in result:
        if result['status'] == 200:
            res['result'] = True
            res['message'] = result['text']
        else:
            if 'error' in result:
                res['message'] = result['error']
    return res
57308
def _FlushEvents(self):
    """"""
    try:
      # pylint: disable=unexpected-keyword-arg
      # pylint does not recognizes request_timeout as a valid kwarg. According
      # to http://elasticsearch-py.readthedocs.io/en/master/api.html#timeout
      # it should be supported.
      self._client.bulk(
          body=self._event_documents, doc_type=self._document_type,
          index=self._index_name, request_timeout=self._DEFAULT_REQUEST_TIMEOUT)

    except ValueError as exception:
      # Ignore problematic events
      logger.warning('Unable to bulk insert with error: {0!s}'.format(
          exception))

    logger.debug('Inserted {0:d} events into Elasticsearch'.format(
        self._number_of_buffered_events))

    self._event_documents = []
    self._number_of_buffered_events = 0
682156
def pick_event(self):
        
        logger.debug("checking event queue")
        event = snap7.snap7types.SrvEvent()
        ready = ctypes.c_int32()
        code = self.library.Srv_PickEvent(self.pointer, ctypes.byref(event),
                                          ctypes.byref(ready))
        check_error(code)
        if ready:
            logger.debug("one event ready: %s" % event)
            return event
        logger.debug("no events ready")
130748
def lex(code, lexer):
    
    try:
        return lexer.get_tokens(code)
    except TypeError as err:
        if (isinstance(err.args[0], str) and
            ('unbound method get_tokens' in err.args[0] or
             'missing 1 required positional argument' in err.args[0])):
            raise TypeError('lex() argument must be a lexer instance, '
                            'not a class')
        raise
37562
def input(self, file_data, **kwargs):
        
        self.lex = lex.lex(module=self, **kwargs)
        self.tokens_queue = []
        self.cur_indent = 0
        # Hack to avoid tokenization bugs caused by files that do not end in a
        # new line.
        self.lex.input(file_data + '\n')
1307669
def _expect_token(lexer, types):
    """"""
    tok = next(lexer)
    if any(isinstance(tok, t) for t in types):
        return tok
    else:
        raise Error("unexpected token: " + str(tok))
133035
def keyPressEvent( self, event ):
        
        if ( event.key() == Qt.Key_Backtab ):
            self.unindentSelection()
        else:
            super(XScintillaEdit, self).keyPressEvent(event)
829245
def focusInEvent(self, event):
        
        self._changedRecord = -1
        super(XOrbRecordBox, self).focusInEvent(event)
425129
def event(self, event):
        
        if event.type() == QEvent.KeyPress:
            if (event.key() == Qt.Key_Tab or event.key() == Qt.Key_Space):
                text = self.text()
                cursor = self.cursorPosition()
                # fix to include in "undo/redo" history
                if cursor != 0 and text[cursor-1] == ' ':
                    text = text[:cursor-1] + ROW_SEPARATOR + ' ' +\
                        text[cursor:]
                else:
                    text = text[:cursor] + ' ' + text[cursor:]
                self.setCursorPosition(cursor)
                self.setText(text)
                self.setCursorPosition(cursor + 1)
                return False
        return QWidget.event(self, event)
743952
function(type, event, handler) {
        _.parsers.forEach(function(parser) {
            type = type.replace(parser[0], function() {
                var args = _.slice(arguments, 1);
                args.unshift(event, handler);
                return parser[1].apply(event, args) || '';
            });
        });
        return type ? event.type = type : type;
    }
619774
def keyPressEvent(self, event):
        
        # reject on a cancel
        if event.key() == Qt.Key_Escape:
            self.reject()
        
        super(XSnapshotWidget, self).keyPressEvent(event)
860105
def parse(self, input, **kwargs):
        
        return self._parser.parse(input, lexer=self._lexer, **kwargs)
731422
def keyPressEvent( self, event ):
        
        if ( event.key() == Qt.Key_Escape ):
            self.reject()
            event.accept()
            return
        
        elif ( event.key() in (Qt.Key_Return, Qt.Key_Enter) ):
            if self._autoDefault:
                self.accept()
                event.accept()
            return
        
        super(XPopupWidget, self).keyPressEvent(event)
34145
def _unhandled_event_default(event):
        
        if isinstance(event, KeyboardEvent):
            c = event.key_code
            if c in (ord("X"), ord("x"), ord("Q"), ord("q")):
                raise StopApplication("User terminated app")
            if c in (ord(" "), ord("\n"), ord("\r")):
                raise NextScene()
1094377
def _keygen(self, event, ts=None):
        
        return "%s:%s" % (self.namespace(ts or time.time()), event)