def cut_list(list, length):
    """ This function allows to cut a list into parts of a certain length.
        It returns a new list which takes less memory and contains for each index a part of the initial list.

        Args :
            list : list of the images path of the whole database\n
            length (int): the length of the parts\n

        Returns :
            list containing the images path cut by parts of <length>

    """

    listing_parts = []
    intervalle_0 = 0
    intervalle_1 = length
    while intervalle_0 <=(len(list)):
        listing_parts.append(list[intervalle_0:intervalle_1])
        intervalle_0 = intervalle_1
        intervalle_1 = intervalle_1 + length
    return listing_parts