class_docstr: A context manager to capture imported modules by temporarily applying a patch to
  `builtins.__import__` and `importlib.import_module`.
code: def _record_imported_module(self, full_module_name):
      # If the module is an internal module (prefixed by "_") or is the "databricks"
      # module, which is populated by many different packages, don't record it (specific
      # module imports within the databricks namespace are still recorded and mapped to
      # their corresponding packages)
      if (
          full_module_name.startswith("_")
          or full_module_name == "databricks"
      ):
          return
  
      top_level_module = _get_top_level_module(full_module_name)
      second_level_module = _get_second_level_module(full_module_name)
  
      if top_level_module == "databricks":
          # Multiple packages populate the `databricks` module namespace on Databricks;
          # to avoid bundling extraneous Databricks packages into model dependencies, we
          # scope each module to its relevant package
          if second_level_module in DATABRICKS_MODULES_TO_PACKAGES:
              self.imported_modules.add(second_level_module)
              return
  
          for databricks_module in DATABRICKS_MODULES_TO_PACKAGES:
              if full_module_name.startswith(databricks_module):
                  self.imported_modules.add(databricks_module)
                  return
  
      # special casing for mlflow extras since they may not be required by default
      if top_level_module == "mlflow":
          if second_level_module in MLFLOW_MODULES_TO_PACKAGES:
              self.imported_modules.add(second_level_module)
              return
  
      self.imported_modules.add(top_level_module)
  
imports: import argparse
  import builtins
  import functools
  import importlib
  import json
  import os
  import sys
  import mlflow
  from mlflow.models.model import MLMODEL_FILE_NAME, Model
  from mlflow.pyfunc import MAIN
  from mlflow.utils._spark_utils import _prepare_subprocess_environ_for_creating_local_spark_session
  from mlflow.utils.file_utils import write_to
  from mlflow.utils.requirements_utils import DATABRICKS_MODULES_TO_PACKAGES, MLFLOW_MODULES_TO_PACKAGES
label_desc: Use image node_id 4 for calling the _CaptureImportedModules obj's underlying member method code with example usage: obj._record_imported_module(full_module_name) without return types