def _collect_paths(prefix):
    (dir_paths, file_paths) = ([], [])
    for (dp, dn, filenames) in _os.walk(prefix):
        for f in filenames:
            file_paths.append(_os.path.relpath(_os.path.join(dp, f), prefix))
        dir_paths.extend((_os.path.relpath(_os.path.join(dp, _), prefix) for _ in dn))
    file_list = (file_paths + [dp for dp in dir_paths if (not any((f.startswith(dp) for f in file_paths)))])
    return file_list
def _collect_paths(prefix):
    (dir_paths, file_paths) = ([], [])
    for (dp, dn, filenames) in _os.walk(prefix):
        for f in filenames:
            file_paths.append(_os.path.relpath(_os.path.join(dp, f), prefix))
        dir_paths.extend((_os.path.relpath(_os.path.join(dp, _), prefix) for _ in dn))
    file_list = (file_paths + [dp for dp in dir_paths if (not any((f.startswith(dp) for f in file_paths)))])
    return file_list