human
Complete the below
def deprecate_settings(**depr_args):

    ''''The purpose of this decorator is to allow passing old settings names to
    bears due to the heavy changes in their names.
    >>> @deprecate_settings(new=\'old\')
    ... def run(new):
    ...     print(new)
    Now we can simply call the bear with the deprecated setting, we\'ll get a
    warning - but it still works!
    >>> import sys
    >>> logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
    >>> run(old="Hello world!")
    WARNING:root:The setting `old` is deprecated. Please use `new` instead.
    Hello world!
    >>> run(new="Hello world!")
    Hello world!
    This example represents the case where the old setting name needs to be
    modified to match the new one.
    >>> @deprecate_settings(new=(\'old\', lambda a: a + \'coala!\'))
    ... def func(new):
    ...     print(new)
    >>> func(old="Welcome to ")
    WARNING:root:The setting `old` is deprecated. Please use `new` instead.
    Welcome to coala!
    >>> func(new=\'coala!\')
    coala!
    This example represents the case where the old and new settings are
    provided to the function.
    >>> @deprecate_settings(new=\'old\')
    ... def run(new):
    ...     print(new)
    >>> # doctest: +ELLIPSIS
    ... run(old="Hello!", new=\'coala is always written with lowercase `c`.\')
    WARNING:root:The setting `old` is deprecated. Please use `new` instead.
    WARNING:root:The value of `old` and `new` are conflicting. `new` will...
    coala is always written with lowercase `c`.
    >>> @deprecate_settings(new=\'old\')
    ... def run(new):
    ...     print(new)
    >>> run(old=\'Hello!\', new=\'Hello!\')
    WARNING:root:The setting `old` is deprecated. Please use `new` instead.
    Hello!
    Note that messages are cached. So the same message won\'t be printed twice:
    >>> run(old=\'Hello!\', new=\'Hello!\')
    Hello!
    Multiple deprecations can be provided for the same setting. The modifier
    function for each deprecated setting can be given as a value in a dict
    where the deprecated setting is the key. A default modifier...'''

=====
Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    def _deprecate_decorator(func):
        logged_deprecated_args = set()
        @wraps(func)
        def wrapping_function(*args, **kwargs):
            for (arg, depr_value) in wrapping_function.__metadata__.depr_values:
                deprecated_arg = depr_value[0]
                _func = depr_value[1]
                if (deprecated_arg in kwargs):
                    if (deprecated_arg not in logged_deprecated_args):
                        logging.warning('The    setting    `{}`    is    deprecated.    Please    use    `{}`    instead.'.format(deprecated_arg, arg))
                        logged_deprecated_args.add(deprecated_arg)
                    depr_arg_value = _func.__call__(kwargs[deprecated_arg])
                    if ((arg in kwargs) and (depr_arg_value != kwargs[arg])):
                        logging.warning('The    value    of    `{}`    and    `{}`    are    conflicting.    `{}`    will    be    used    instead.'.format(deprecated_arg, arg, arg))
                    else:
                        kwargs[arg] = depr_arg_value
                    del kwargs[deprecated_arg]
            return func(*args, **kwargs)
        new_metadata = FunctionMetadata.from_function(func)
        new_metadata.depr_values = []
        for (arg, depr_values) in depr_args.items():
            if (not isinstance(depr_values, tuple)):
                depr_values = (depr_values,)
            if callable(depr_values[(-1)]):
                deprecated_args = depr_values[:(-1)]
                default_modifier = depr_values[(-1)]
            else:
                deprecated_args = depr_values
                default_modifier = _do_nothing
            for depr_value in deprecated_args:
                if isinstance(depr_value, dict):
                    deprecated_arg = list(depr_value.keys())[0]
                    modifier = depr_value[deprecated_arg]
                    new_metadata.depr_values.append((arg, (deprecated_arg, modifier)))
                else:
                    deprecated_arg = depr_value
        ...