def METHOD_NAME(d):
    file_list = []
    for dirname, dirs, names in os.walk(d):
        file_list.append((dirname, filter(lambda x, d=dirname: is_file_or_link(d, x),
            names)))
    return file_list