def glob_files_locally(folder_path, pattern):
    """glob files in local folder based on the given pattern"""

    pattern = os.path.join(
        folder_path, pattern.lstrip('/')) if pattern else None

    len_folder_path = len(folder_path) + 1
    for root, _, files in os.walk(folder_path):
        for f in files:
            full_path = os.path.join(root, f)
            if not pattern or _match_path(full_path, pattern):
                yield (full_path, full_path[len_folder_path:])
def glob_files_locally ( folder_path , pattern ) : pattern = os . path . join ( folder_path , pattern . lstrip ( '/' ) ) if pattern else None len_folder_path = len ( folder_path ) + 1 for root , _ , files in os . walk ( folder_path ) : for f in files : full_path = os . path . join ( root , f ) if not pattern or _match_path ( full_path , pattern ) : yield ( full_path , full_path [ len_folder_path : ] )
glob files in local folder based on the given pattern