def METHOD_NAME(idx, method, params):
    obj = { 'version' : '1.1',
        'method' : method,
        'id' : idx }
    if params is None:
        obj['params'] = []
    else:
        obj['params'] = params
    return obj