code: 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
      }
docs: Import all submodules by package name.