def explore_directories(start, exclude, ignore):
    e = '*[!p][!y]'
    exclude = '{0},{1}'.format(e, exclude).split(',') if exclude else [e]
    ignore = '.*,{0}'.format(ignore).split(',') if ignore else ['.*']
    for root, dirs, files in os.walk(start):
        dirs[:] = list(filter_out(dirs, ignore))
        fullpaths = (os.path.normpath(os.path.join(root, p)) for p in files)
        for filename in filter_out(fullpaths, exclude):
            if (not os.path.basename(filename).startswith('.') and
                    filename.endswith('.py')):
                yield filename
Explore files and directories under `start`. `explore` and `ignore`
dataset/ETHPy150Open rubik/radon/radon/cli/tools.py/explore_directories