def timewindow(t_ori, t_target, epochs):
    """
    Cut epoch data according to the provided time window
    :param t_ori: tuple, original time window (start, end)
    :param t_target: tuple, target time window
    :param epochs: 3d array
    :return:
    """
    assert t_target[0] >= t_ori[0] and t_target[1] <= t_ori[1], print(t_target, t_ori)
    start, end = t_ori
    unit = epochs.shape[-1] / (end - start)
    ind_s, ind_e = int((t_target[0] - start) * unit), int((t_target[1] - start) * unit)
    return epochs[..., ind_s:ind_e]