def listdir(
    path,
    expression='^.+$',
    drop=True,
    add_dirs=False,
    sort=True,
    maxnum = None,
):
    if path[-1:] != os.path.sep:
        path = path + os.path.sep
    if drop:
        n = len(path)
    else:
        n = 0
    regex = re.compile(expression)
    items = []    
    for (root, dirs, files) in os.walk(path, topdown=True):
        for dir in dirs[:]:
            if dir.startswith('.'):
                dirs.remove(dir)
        if add_dirs:
            items.append(root[n:])
        for file in sorted(files):
            if regex.match(file) and not file.startswith('.'):
                items.append(os.path.join(root, file)[n:])
            if maxnum and len(items)>=maxnum:
                break
    if sort:
        return sorted(items)
    else:
        return items
Make indirectNeed act
dataset/ETHPy150Open uwdata/termite-visualizations/web2py/gluon/fileutils.py/listdir--crossover with--dataset/ETHPy150Open ioflo/ioflo/ioflo/base/building.py/Builder.makeIndirectNeed