code: def detect_extension_modules(
      args: argparse.Namespace,
  ) -> Dict[str, bool]:
      modules = {}
  
      # disabled by Modules/Setup.local ?
      with open(args.buildroot / "Makefile") as f:
          for line in f:
              if line.startswith("MODDISABLED_NAMES="):
                  disabled = line.split("=", 1)[1].strip().split()
                  for modname in disabled:
                      modules[modname] = False
                  break
  
      # disabled by configure?
      with open(args.sysconfig_data) as f:
          data = f.read()
      loc: Dict[str, Dict[str, str]] = {}
      exec(data, globals(), loc)
  
      for key, value in loc["build_time_vars"].items():
          if not key.startswith("MODULE_") or not key.endswith(
              "_STATE"
          ):
              continue
          if value not in {"yes", "disabled", "missing", "n/a"}:
              raise ValueError(f"Unsupported value '{value}' for {key}")
  
          modname = key[7:-6].lower()
          if modname not in modules:
              modules[modname] = value == "yes"
      return modules
  
file_path: cpython/Tools/wasm/wasm_assets.py
imports: import argparse
  import pathlib
  import shutil
  import sys
  import sysconfig
  import zipfile
  from typing import Dict
label_desc: Use image node_id 4 for calling a global function with example usage: detect_extension_modules(args) and returns: modules