def process(self, cmd):
    if ('type' not in cmd):
        raise RewriterException('Command has no key "type"')
    if (cmd['type'] not in self.functions):
        raise RewriterException('Unknown command "{}". Supported commands are: {}'.format(cmd['type'], list(self.functions.keys())))
    self.functions[cmd['type']](cmd)
def process(self, cmd):
    if ('type' not in cmd):
        raise RewriterException('Command has no key "type"')
    if (cmd['type'] not in self.functions):
        raise RewriterException('Unknown command "{}". Supported commands are: {}'.format(cmd['type'], list(self.functions.keys())))
    self.functions[cmd['type']](cmd)