def has_request_arg(fn):
    sig = inspect.signature(fn)
    params = sig.parameters
    found = False
    for (name, param) in params.items():
        if (name == 'request'):
            found = True
            continue
        if (found and ((param.kind != inspect.Parameter.VAR_POSITIONAL) and (param.kind != inspect.Parameter.KEYWORD_ONLY) and (param.kind != inspect.Parameter.VAR_KEYWORD))):
            raise ValueError(('request parameter must be the last named parameter in function: %s%s' % (fn.__name__, str(sig))))
    return found
def has_request_arg(fn):
    sig = inspect.signature(fn)
    params = sig.parameters
    found = False
    for (name, param) in params.items():
        if (name == 'request'):
            found = True
            continue
        if (found and ((param.kind != inspect.Parameter.VAR_POSITIONAL) and (param.kind != inspect.Parameter.KEYWORD_ONLY) and (param.kind != inspect.Parameter.VAR_KEYWORD))):
            raise ValueError(('request parameter must be the last named parameter in function: %s%s' % (fn.__name__, str(sig))))
    return found