def METHOD_NAME(func: F) -> F:
    @wraps(func)
    def wrapper(*args, **kwargs) -> t.Callable[..., t.Any]:
        if old_name in kwargs and new_name in kwargs:
            raise TypeError(
                f'Can only specify {repr(old_name)} '
                f'or {repr(new_name)}, not both'
            )
        elif old_name in kwargs and new_name is None:
            get_logger().warning(
                'the %s keyword is deprecated and '
                'will be removed in a future version. Please take '
                'steps to stop the use of %s',
                repr(old_name),
                repr(old_name)
            )
        elif old_name in kwargs and new_name is not None:
            get_logger().warning(
                'the %s keyword is deprecated, '
                'use %s instead',
                repr(old_name),
                repr(new_name)
            )
            kwargs[new_name] = kwargs.pop(old_name)
        return func(*args, **kwargs)
    return t.cast(F, wrapper)