def import_submodules(package_name, *submodules):
    package = sys.modules[package_name]
    return {
        name: importlib.import_module(package_name + '.' + name)
        for _, name, _ in pkgutil.walk_packages(package.__path__)
        if not submodules or name in submodules
    }

#  pylama:ignore=W0212
Import all submodules by package name.
dataset/ETHPy150Open klen/muffin/muffin/utils.py/import_submodules