# Path: librosa/_cache.py
# def _decorator_apply(dec, func):
#     def __init__(self, *args, **kwargs):
#     def __call__(self, level):
#         def wrapper(function):
#     def clear(self, *args, **kwargs):
#     def eval(self, *args, **kwargs):
#     def format(self, *args, **kwargs):
#     def reduce_size(self, *args, **kwargs):
#     def warn(self, *args, **kwargs):
# class CacheManager(object):
# 
# Path: librosa/util/exceptions.py
# class ParameterError(LibrosaError):
#     """Exception class for mal-formed inputs"""
# 
#     pass
# 
# Path: librosa/util/decorators.py
# def deprecate_positional_args(func=None, *, version="0.10"):
#     """Decorator for methods that issues warnings for positional arguments.
#     Using the keyword-only argument syntax in pep 3102, arguments after the
#     * will issue a warning when passed as a positional argument.
#     Parameters
#     ----------
#     func : callable, default=None
#         Function to check arguments on.
#     version : callable, default="0.10"
#         The version when positional arguments will result in error.
#     """
# 
#     def _inner_deprecate_positional_args(f):
#         sig = signature(f)
#         kwonly_args = []
#         all_args = []
# 
#         for name, param in sig.parameters.items():
#             if param.kind == Parameter.POSITIONAL_OR_KEYWORD:
#                 all_args.append(name)
#             elif param.kind == Parameter.KEYWORD_ONLY:
#                 kwonly_args.append(name)
# 
#         @wraps(f)
#         def inner_f(*args, **kwargs):
#             extra_args = len(args) - len(all_args)
#             if extra_args <= 0:
#                 return f(*args, **kwargs)
# 
#             # extra_args > 0
#             args_msg = [
#                 "{}={}".format(name, arg)
#                 for name, arg in zip(kwonly_args[:extra_args], args[-extra_args:])
#             ]
#             args_msg = ", ".join(args_msg)
#             warnings.warn(
#                 f"Pass {args_msg} as keyword args. From version "
#                 f"{version} passing these as positional arguments "
#                 "will result in an error",
#                 FutureWarning,
#                 stacklevel=2,
#             )
#             kwargs.update(zip(sig.parameters, args))
#             return f(**kwargs)
# 
#         return inner_f
# 
#     if func is not None:
#         return _inner_deprecate_positional_args(func)
# 
#     return _inner_deprecate_positional_args


import numpy as np
import scipy.signal
from numba import jit
from .._cache import cache
from ..util.exceptions import ParameterError
from ..util.decorators import deprecate_positional_args
    >>> ax[1].set(title=r'MFCC-$\Delta$')
    >>> ax[1].label_outer()
    >>> img3 = librosa.display.specshow(mfcc_delta2, ax=ax[2], x_axis='time')
    >>> ax[2].set(title=r'MFCC-$\Delta^2$')
    >>> fig.colorbar(img1, ax=[ax[0]])
    >>> fig.colorbar(img2, ax=[ax[1]])
    >>> fig.colorbar(img3, ax=[ax[2]])
    """

    data = np.atleast_1d(data)

    if mode == "interp" and width > data.shape[axis]:
        raise ParameterError(
            "when mode='interp', width={} "
            "cannot exceed data.shape[axis]={}".format(width, data.shape[axis])
        )

    if width < 3 or np.mod(width, 2) != 1:
        raise ParameterError("width must be an odd integer >= 3")

    if order <= 0 or not isinstance(order, (int, np.integer)):
        raise ParameterError("order must be a positive integer")

    kwargs.pop("deriv", None)
    kwargs.setdefault("polyorder", order)
    return scipy.signal.savgol_filter(
        data, width, deriv=order, axis=axis, mode=mode, **kwargs
    )



# Path: librosa/_cache.py
# def _decorator_apply(dec, func):
#     def __init__(self, *args, **kwargs):
#     def __call__(self, level):
#         def wrapper(function):
#     def clear(self, *args, **kwargs):
#     def eval(self, *args, **kwargs):
#     def format(self, *args, **kwargs):
#     def reduce_size(self, *args, **kwargs):
#     def warn(self, *args, **kwargs):
# class CacheManager(object):
# 
# Path: librosa/util/exceptions.py
# class ParameterError(LibrosaError):
#     """Exception class for mal-formed inputs"""
# 
#     pass
# 
# Path: librosa/util/decorators.py
# def deprecate_positional_args(func=None, *, version="0.10"):
#     """Decorator for methods that issues warnings for positional arguments.
#     Using the keyword-only argument syntax in pep 3102, arguments after the
#     * will issue a warning when passed as a positional argument.
#     Parameters
#     ----------
#     func : callable, default=None
#         Function to check arguments on.
#     version : callable, default="0.10"
#         The version when positional arguments will result in error.
#     """
# 
#     def _inner_deprecate_positional_args(f):
#         sig = signature(f)
#         kwonly_args = []
#         all_args = []
# 
#         for name, param in sig.parameters.items():
#             if param.kind == Parameter.POSITIONAL_OR_KEYWORD:
#                 all_args.append(name)
#             elif param.kind == Parameter.KEYWORD_ONLY:
#                 kwonly_args.append(name)
# 
#         @wraps(f)
#         def inner_f(*args, **kwargs):
#             extra_args = len(args) - len(all_args)
#             if extra_args <= 0:
#                 return f(*args, **kwargs)
# 
#             # extra_args > 0
#             args_msg = [
#                 "{}={}".format(name, arg)
#                 for name, arg in zip(kwonly_args[:extra_args], args[-extra_args:])
#             ]
#             args_msg = ", ".join(args_msg)
#             warnings.warn(
#                 f"Pass {args_msg} as keyword args. From version "
#                 f"{version} passing these as positional arguments "
#                 "will result in an error",
#                 FutureWarning,
#                 stacklevel=2,
#             )
#             kwargs.update(zip(sig.parameters, args))
#             return f(**kwargs)
# 
#         return inner_f
# 
#     if func is not None:
#         return _inner_deprecate_positional_args(func)
# 
#     return _inner_deprecate_positional_args


# Path: librosa/feature/utils.py
import numpy as np
import scipy.signal
from numba import jit
from .._cache import cache
from ..util.exceptions import ParameterError
from ..util.decorators import deprecate_positional_args

    >>> ax[1].set(title=r'MFCC-$\Delta$')
    >>> ax[1].label_outer()
    >>> img3 = librosa.display.specshow(mfcc_delta2, ax=ax[2], x_axis='time')
    >>> ax[2].set(title=r'MFCC-$\Delta^2$')
    >>> fig.colorbar(img1, ax=[ax[0]])
    >>> fig.colorbar(img2, ax=[ax[1]])
    >>> fig.colorbar(img3, ax=[ax[2]])
    """

    data = np.atleast_1d(data)

    if mode == "interp" and width > data.shape[axis]:
        raise ParameterError(
            "when mode='interp', width={} "
            "cannot exceed data.shape[axis]={}".format(width, data.shape[axis])
        )

    if width < 3 or np.mod(width, 2) != 1:
        raise ParameterError("width must be an odd integer >= 3")

    if order <= 0 or not isinstance(order, (int, np.integer)):
        raise ParameterError("order must be a positive integer")

    kwargs.pop("deriv", None)
    kwargs.setdefault("polyorder", order)
    return scipy.signal.savgol_filter(
        data, width, deriv=order, axis=axis, mode=mode, **kwargs
    )



@deprecate_positional_args