# 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
    kwargs.setdefault("mode", "constant")

    if kwargs["mode"] == "constant":
        kwargs.setdefault("constant_values", [0])

    padding = [(0, 0) for _ in range(data.ndim)]

    # Pad the end with zeros, which will roll to the front below
    if delay > 0:
        padding[-1] = (int((n_steps - 1) * delay), 0)
    else:
        padding[-1] = (0, int((n_steps - 1) * -delay))

    data = np.pad(data, padding, **kwargs)

    # Construct the shape of the target array
    shape = list(data.shape)
    shape[-2] = shape[-2] * n_steps
    shape[-1] = t
    shape = tuple(shape)

    # Construct the output array to match layout and dtype of input
    history = np.empty_like(data, shape=shape)

    # Populate the output array
    __stack(history, data, n_steps, delay)

    return history



# 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

    kwargs.setdefault("mode", "constant")

    if kwargs["mode"] == "constant":
        kwargs.setdefault("constant_values", [0])

    padding = [(0, 0) for _ in range(data.ndim)]

    # Pad the end with zeros, which will roll to the front below
    if delay > 0:
        padding[-1] = (int((n_steps - 1) * delay), 0)
    else:
        padding[-1] = (0, int((n_steps - 1) * -delay))

    data = np.pad(data, padding, **kwargs)

    # Construct the shape of the target array
    shape = list(data.shape)
    shape[-2] = shape[-2] * n_steps
    shape[-1] = t
    shape = tuple(shape)

    # Construct the output array to match layout and dtype of input
    history = np.empty_like(data, shape=shape)

    # Populate the output array
    __stack(history, data, n_steps, delay)

    return history



@jit(nopython=True, cache=True)