def deprecated_arg_names(arg_mapping: Mapping[(str, str)]):
    '\n    Decorator which marks a functions keyword arguments as deprecated. It will\n    result in a warning being emitted when the deprecated keyword argument is\n    used, and the function being called with the new argument.\n\n    Parameters\n    ----------\n    arg_mapping\n        Mapping from deprecated argument name to current argument name.\n    '

    def decorator(func):

        @wraps(func)
        def func_wrapper(*args, **kwargs):
            warnings.simplefilter('always', DeprecationWarning)
            for (old, new) in arg_mapping.items():
                if (old in kwargs):
                    warnings.warn(f"Keyword argument '{old}' has been deprecated in favour of '{new}'. '{old}' will be removed in a future version.", category=DeprecationWarning, stacklevel=2)
                    val = kwargs.pop(old)
                    kwargs[new] = val
            warnings.simplefilter('default', DeprecationWarning)
            return func(*args, **kwargs)
        return func_wrapper
    return decorator
Decorator which marks a functions keyword arguments as deprecated. It will
result in a warning being emitted when the deprecated keyword argument is
used, and the function being called with the new argument.

Parameters
----------
arg_mapping
    Mapping from deprecated argument name to current argument name.
def deprecated_arg_names(arg_mapping: Mapping[(str, str)]):
    '\n    Decorator which marks a functions keyword arguments as deprecated. It will\n    result in a warning being emitted when the deprecated keyword argument is\n    used, and the function being called with the new argument.\n\n    Parameters\n    ----------\n    arg_mapping\n        Mapping from deprecated argument name to current argument name.\n    '

    def decorator(func):

        @wraps(func)
        def func_wrapper(*args, **kwargs):
            warnings.simplefilter('always', DeprecationWarning)
            for (old, new) in arg_mapping.items():
                if (old in kwargs):
                    warnings.warn(f"Keyword argument '{old}' has been deprecated in favour of '{new}'. '{old}' will be removed in a future version.", category=DeprecationWarning, stacklevel=2)
                    val = kwargs.pop(old)
                    kwargs[new] = val
            warnings.simplefilter('default', DeprecationWarning)
            return func(*args, **kwargs)
        return func_wrapper
    return decorator