cart.py
def make_chunk(files, max_len):
    '''
        Split the files into "chunks" that, when stringified with
        stringify_files is no longer than max_len
    '''
    file_chunk = []
    chunk_length = 0
    cont = True
    while cont and len(files) > 0:
        file = files.pop()
        length = len(file) + 4  # length of filename + quotes + ,
        chunk_length += length
        if chunk_length > max_len:
            files.append(file)  # re-add the file so it's not forgotten
            cont = False
        else:
            file_chunk.append(file)
    return file_chunk

        Split the files into "chunks" that, when stringified with
        stringify_files is no longer than max_len
    
Split the files into "chunks" that, when stringified with
stringify_files is no longer than max_len
Split the files into " chunks " that when stringified with stringify_files is no longer than max_len
def make_chunk(files, max_len):
    file_chunk = []
    chunk_length = 0
    cont = True
    while cont and len(files) > 0:
        file = files.pop()
        length = len(file) + 4  
        chunk_length += length
        if chunk_length > max_len:
            files.append(file)  
            cont = False
        else:
            file_chunk.append(file)
    return file_chunk
def make_chunk ( files , max_len ) : file_chunk = [ ] chunk_length = 0 cont = True while cont and len ( files ) > 0 : file = files . pop ( ) length = len ( file ) + 4 chunk_length += length if chunk_length > max_len : files . append ( file ) cont = False else : file_chunk . append ( file ) return file_chunk
Split the files into "chunks" that, when stringified with
stringify_files is no longer than max_len
Split the files into " chunks " that when stringified with stringify_files is no longer than max_len
'''
        Split the files into "chunks" that, when stringified with
        stringify_files is no longer than max_len
    ''' # length of filename + quotes + , # re-add the file so it's not forgotten
files
max_len