def split_data_to_chunks(data: list, max_chunk_size: int, overlapping_size: int):
    """
    Because GP can take very long to finish, we split data into smaller chunks and train/predict these chunks separately

    :param data:
    :param max_chunk_size:
    :param overlapping_size:
    :return: list of split data
    """
    chunks = list()
    n = len(data)
    i = 0
    while True:
        next_i = min(i + max_chunk_size, n)
        chunks.append(data[i:next_i])
        if n <= next_i:
            break
        i = next_i - overlapping_size

    return chunks