def kw_map(**kws):
def decorator(func):<EOL><INDENT>@functools.wraps(func)<EOL>def wrapper(*args, **kwargs):<EOL><INDENT>for actual_name, kwarg_rename in kws.items():<EOL><INDENT>if kwarg_rename in kwargs:<EOL><INDENT>kwargs[actual_name] = kwargs[kwarg_rename]<EOL>del kwargs[kwarg_rename]<EOL><DEDENT><DEDENT>return func(*args, **kwargs)<EOL><DEDENT>return wrapper<EOL><DEDENT>return decorator<EOL>
Decorator for renamed keyword arguments, given a keyword argument
mapping "actual_name: kwarg_rename" for each keyword parameter to
be renamed.