register events using the event id: remove some warnings in PyCharm
catch KeyError exception when using self.console.getGroupLevel(): raised if an invalid level/keyword is supplied
reformat sql code