from pathlib import Path


def find_bigfiles(data_folder, gte_size=100, verbose=False):
    """
    Return a list of file paths (truncated from the  
    data_folder.name part) for all file exceeding 
    gte_size MB.
    gte_size: multiple of 1 MB => 100 MB default.
           :: github file size limit = 100 * 2^20
    """
    if gte_size == 0:
        print('No file size limit: gte_size=0.')
        return

    mb = 2**20  #kb = 2**10   #gb = 2**30
    size_limit = gte_size * mb
    
    out = []
    p = Path(data_folder)
    
    # output only parts from data_folder name, i.e.: data/file.csv
    for f in p.glob('**/*.*'):
        if f.stat().st_size >= size_limit:
            parent_idx = f.parts.index(p.name)
            fout = '/'.join(f for f in f.parts[parent_idx:])
            out.append(fout)
            
            if verbose: print(f, '\t', f.stat().st_size)
    return out