code: def _init_modules_to_packages_map():
      global _MODULES_TO_PACKAGES
      if _MODULES_TO_PACKAGES is None:
          # Note `importlib_metada.packages_distributions` only captures packages installed into
          # Python’s site-packages directory via tools such as pip:
          # https://importlib-metadata.readthedocs.io/en/latest/using.html#using-importlib-metadata
          _MODULES_TO_PACKAGES = (
              importlib_metadata.packages_distributions()
          )
  
          # Add mapping for MLflow extras
          _MODULES_TO_PACKAGES.update(MLFLOW_MODULES_TO_PACKAGES)
  
          # 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
          _MODULES_TO_PACKAGES.update(DATABRICKS_MODULES_TO_PACKAGES)
          if "databricks" in _MODULES_TO_PACKAGES:
              _MODULES_TO_PACKAGES["databricks"] = [
                  package
                  for package in _MODULES_TO_PACKAGES["databricks"]
                  if package
                  not in _flatten(
                      DATABRICKS_MODULES_TO_PACKAGES.values()
                  )
              ]
  
          # In Databricks, `_MODULES_TO_PACKAGES` doesn't contain pyspark since it's not installed
          # via pip or conda. To work around this issue, manually add pyspark.
          if is_in_databricks_runtime():
              _MODULES_TO_PACKAGES.update({"pyspark": ["pyspark"]})
  
imports: import json
  import logging
  import os
  import re
  import subprocess
  import sys
  import tempfile
  from collections import namedtuple
  from itertools import chain, filterfalse
  from pathlib import Path
  from threading import Timer
  from typing import NamedTuple, Optional
  import importlib_metadata
  import pkg_resources
  from packaging.requirements import Requirement
  from packaging.version import InvalidVersion, Version
  import mlflow
  from mlflow.environment_variables import MLFLOW_REQUIREMENTS_INFERENCE_TIMEOUT
  from mlflow.exceptions import MlflowException
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
  from mlflow.utils.autologging_utils.versioning import _strip_dev_version_suffix
  from mlflow.utils.databricks_utils import is_in_databricks_runtime
label_desc: Use image node_id 17 for calling a global function with example usage: _init_modules_to_packages_map() without return types