def execute(self, method, args, ref):
response = {'<STR_LIT:result>': None, '<STR_LIT:error>': None, '<STR_LIT>': ref}<EOL>fun = self.methods.get(method)<EOL>if not fun:<EOL><INDENT>response['<STR_LIT:error>'] = '<STR_LIT>'.format(method)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>response['<STR_LIT:result>'] = fun(*args)<EOL><DEDENT>except Exception as exception:<EOL><INDENT>logging.error(exception, exc_info=<NUM_LIT:1>)<EOL>response['<STR_LIT:error>'] = str(exception)<EOL><DEDENT><DEDENT>return response<EOL>
Execute the method with args