def validate(**vkargs):
depr('<STR_LIT>')<EOL>def decorator(func):<EOL><INDENT>@functools.wraps(func)<EOL>def wrapper(*args, **kargs):<EOL><INDENT>for key, value in vkargs.items():<EOL><INDENT>if key not in kargs:<EOL><INDENT>abort(<NUM_LIT>, '<STR_LIT>' % key)<EOL><DEDENT>try:<EOL><INDENT>kargs[key] = value(kargs[key])<EOL><DEDENT>except ValueError:<EOL><INDENT>abort(<NUM_LIT>, '<STR_LIT>' % key)<EOL><DEDENT><DEDENT>return func(*args, **kargs)<EOL><DEDENT>return wrapper<EOL><DEDENT>return decorator<EOL>
Validates and manipulates keyword arguments by user defined callables.
Handles ValueError and missing arguments by raising HTTPError(403).