def getlist_fileindexrange_multiprocessing(index_start, index_final, nb_of_cpu
    ):
    """
    returns list of 2 elements (index_start, index_final) for each cpu

    TODO: implement step != 1
    """
    nb_files = index_final - index_start + 1
    if nb_of_cpu > nb_files:
        nb_of_cpu = nb_files
    step = nb_files // nb_of_cpu
    fileindexdivision = []
    st_ind = index_start
    fi_ind = index_start + step - 1
    for _ in list(range(nb_of_cpu)):
        fileindexdivision.append([st_ind, fi_ind])
        st_ind += step
        fi_ind += step
    fileindexdivision[-1][-1] = index_final
    return fileindexdivision
