def _resample_regressor(hr_regressor, hr_frametimes, frametimes, kind='linear'
    ):
    """ this function samples the regressors at frametimes

    Parameters
    ----------
    hr_regressor: array of shape(n),
                  the regressor time course sampled at high temporal resolution
    hr_frametimes: array of shape(n),
                   the corresponding time stamps
    frametimes: array of shape(p),
                the desired time stamps
    kind: string, optional, the kind of desired interpolation

    Returns
    -------
    regressor: array of shape(p), the resampled regressor
    """
    from scipy.interpolate import interp1d
    f = interp1d(hr_frametimes, hr_regressor)
    return f(frametimes).T
