def METHOD_NAME(ref_ts, dataset, norm_ref, norms_dataset):
    """Shift a time series dataset w.r.t. a time series of reference.
    Parameters
    ----------
    ref_ts : array-like, shape=[sz, d], dtype=float64
        Time series of reference.
    dataset : array-like, shape=[n_ts, sz, d], dtype=float64
        Time series dataset.
    norm_ref : float64
    norms_dataset : array-like, shape=[n_ts], dtype=float64
        Norms of the time series dataset.
    Returns
    -------
    dataset_shifted : array-like, shape=[n_ts, sz, d], dtype=float64
    """
    n_ts = dataset.shape[0]
    sz = dataset.shape[1]
    d = dataset.shape[2]
    assert sz == ref_ts.shape[0] and d == ref_ts.shape[1]
    dataset_shifted = np.zeros((n_ts, sz, d))
    if norm_ref < 0:
        norm_ref = np.linalg.norm(ref_ts)
    if (norms_dataset < 0.0).any():
        for i_ts in prange(n_ts):
            norms_dataset[i_ts] = np.linalg.norm(dataset[i_ts, ...])
    for i in prange(n_ts):
        cc = normalized_cc(ref_ts, dataset[i], norm1=norm_ref, norm2=norms_dataset[i])
        idx = np.argmax(cc)
        shift = idx - sz
        if shift > 0:
            dataset_shifted[i, shift:] = dataset[i, :-shift, :]
        elif shift < 0:
            dataset_shifted[i, :shift] = dataset[i, -shift:, :]
        else:
            dataset_shifted[i] = dataset[i]
    return dataset_shifted