def chop_signal(raw, n_sample_per_epoch:int):
    """Generate dataset from EEG signals and labels

    Args:
        raw: EEG signals. Shape: (n_channel, n_sample).
        n_sample_per_epoch: Number of samples per epoch.

    Returns:
        list: EEG signals (n_epochs, n_channels, n_sample_per_epoch).

    """
    n_times = len(raw[0])
    res = []
    for i in range(0, n_times // int(n_sample_per_epoch), 1):
        res.append([channel[i * n_sample_per_epoch:(i + 1) * n_sample_per_epoch] for channel in raw])
    return res