def run(req):
    # tell the client helper the current taskid
    stackhut.req_id = req['req_id']

    iface_name, func_name = req['method'].split('.')
    params = req['params']

    if iface_name in SERVICES:
        iface_impl = SERVICES[iface_name]

        try:
            func = getattr(iface_impl, func_name)
        except __HOLE__:
            return gen_error(-32601)

        # iface_impl.preRequest()
        # result = func(*params) if params else func()
        # iface_impl.postRequest()

        try:
            result = func(*params) if params else func()
        except stackhut.ServiceError as e:
            return gen_error(-32002, e.msg, e.data)

        return dict(result=result)
    else:
        return gen_error(-32601)
dataset/ETHPy150Open StackHut/stackhut/stackhut_toolkit/res/shims/python/runner.py/run