9b95e0f07b60b6a144893dcc506dfaf90db61c95,librosa/feature/utils.py,,stack_memory,#Any#Any#Any#,119

Before Change



    data = np.pad(data, [(0, 0), padding], **kwargs)

    history = np.vstack([np.roll(data, -i * delay, axis=1) for i in range(n_steps)[::-1]])

    // Trim to original width
    if delay > 0:
        history = history[:, :t]

After Change


    if n_steps < 1:
        raise ParameterError("n_steps must be a positive integer")

    if data.ndim > 2:
        raise ParameterError("Input must be at most 2-dimensional. "
                             "Given data.shape={}".format(data.shape))

    if delay == 0:
        raise ParameterError("delay must be a non-zero integer")

    data = np.atleast_2d(data)
    t = data.shape[-1]
    
    if t < 1:
        raise ParameterError("Cannot stack memory when input data has "
                             "no columns. Given data.shape={}".format(data.shape))
    kwargs.setdefault("mode", "constant")

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

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

    data = np.pad(data, [(0, 0), padding], **kwargs)

    // Construct the shape of the target array
    shape = list(data.shape)
    shape[0] = shape[0] * 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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: librosa/librosa
Commit Name: 9b95e0f07b60b6a144893dcc506dfaf90db61c95
Time: 2020-05-18
Author: bmcfee@users.noreply.github.com
File Name: librosa/feature/utils.py
Class Name:
Method Name: stack_memory


Project Name: freelunchtheorem/Conditional_Density_Estimation
Commit Name: 84fc67184a854b78155599a6d8a8643d907601a1
Time: 2018-01-19
Author: jonas.rothfuss@gmx.de
File Name: evaluation/GoodnessOfFit.py
Class Name: GoodnessOfFit
Method Name: compute_results


Project Name: Calamari-OCR/calamari
Commit Name: 8d0d0c7a6db3904f0222cbe058388a92cf21a548
Time: 2021-02-06
Author: ChWick@users.noreply.github.com
File Name: calamari_ocr/ocr/dataset/imageprocessors/center_normalizer.py
Class Name: CenterNormalizer
Method Name: dewarp