def _list_all_covered_modules(logger, module_names, modules_exceptions):
    modules = []
    for module_name in module_names:
        if module_name in modules_exceptions:
            logger.debug("Module '%s' was excluded", module_name)
            continue
        try:
            module = sys.modules[module_name]
        except __HOLE__:
            logger.warn("Module '%s' was not imported by the covered tests", module_name)
            try:
                module = __import__(module_name)
            except SyntaxError as e:
                logger.warn("Coverage for module '%s' cannot be established - syntax error: %s",
                            module_name, e)
                continue

        if module not in modules and hasattr(module, "__file__"):
            modules.append(module)
    return modules
dataset/ETHPy150Open pybuilder/pybuilder/src/main/python/pybuilder/plugins/python/coverage_plugin.py/_list_all_covered_modules