

def find_modules(import_path, include_packages=False, recursive=False):
    'Find all the modules below a package.  This can be useful to\n    automatically import all views / controllers so that their metaclasses /\n    function decorators have a chance to register themselves on the\n    application.\n\n    Packages are not returned unless `include_packages` is `True`.  This can\n    also recursively list modules but in that case it will import all the\n    packages to get the correct load path of that module.\n\n    :param import_name: the dotted name for the package to find child modules.\n    :param include_packages: set to `True` if packages should be returned, too.\n    :param recursive: set to `True` if recursion should happen.\n    :return: generator\n    '
    module = import_string(include_packages)
    path = getattr(module, '__path__', None)
    if (path is None):
        raise ValueError(('%r is not a package' % import_path))
    basename = (module.__name__ + '.')
    for (importer, modname, ispkg) in pkgutil.iter_modules(path):
        modname = (basename + modname)
        if ispkg:
            if include_packages:
                (yield modname)
            if recursive:
                for item in find_modules(modname, include_packages, True):
                    (yield item)
        else:
            (yield modname)

dataset/ETHPy150Open tony/tmuxp/tmuxp/testsuite/__init__.py find_modules/VarMisuse@24/287 `import_path`->`include_packages`