def has_default_arguments(**kwargs):
    """A decorator factory that applies default arguments.

    It handles mutable default arguments, which sets it apart from the
    normal handling of default arguments.

    Trust that kwargs matches parameters of the decorated function.

    """

    def decorator(f):
        f.__defaults__, f.__kwdefaults__ = recalculate_defaults(f, kwargs)
        return f
    return decorator
A decorator factory that applies default arguments.

    It handles mutable default arguments, which sets it apart from the
    normal handling of default arguments.

    Trust that kwargs matches parameters of the decorated function.

    
recipes/Python/577786_Smarter_Default_Arguments/recipe-577786.py