code: def test_capture_imported_modules_scopes_databricks_imports(
      monkeypatch, tmp_path
  ):
      from mlflow.utils._capture_modules import _CaptureImportedModules
  
      monkeypatch.chdir(tmp_path)
      monkeypatch.syspath_prepend(str(tmp_path))
  
      databricks_dir = os.path.join(tmp_path, "databricks")
      os.makedirs(databricks_dir)
      for file_name in [
          "__init__.py",
          "automl.py",
          "automl_runtime.py",
          "automl_foo.py",
          "model_monitoring.py",
          "other.py",
      ]:
          with open(os.path.join(databricks_dir, file_name), "w"):
              pass
  
      with _CaptureImportedModules() as cap:
          # Delete `databricks` from the cache to ensure we load from the dummy module created above.
          if "databricks" in sys.modules:
              del sys.modules["databricks"]
          import databricks
          import databricks.automl
          import databricks.automl_foo
          import databricks.automl_runtime
          import databricks.model_monitoring
  
      assert "databricks.automl" in cap.imported_modules
      assert "databricks.model_monitoring" in cap.imported_modules
      assert "databricks" not in cap.imported_modules
      assert "databricks.automl_foo" not in cap.imported_modules
  
      with _CaptureImportedModules() as cap:
          import databricks.automl
          import databricks.automl_foo
          import databricks.automl_runtime
          import databricks.model_monitoring
          import databricks.other  # noqa: F401
  
      assert "databricks.automl" in cap.imported_modules
      assert "databricks.model_monitoring" in cap.imported_modules
      assert "databricks" in cap.imported_modules
      assert "databricks.automl_foo" not in cap.imported_modules
  
imports: import importlib
  import os
  import sys
  from unittest import mock
  import importlib_metadata
  import pytest
  import mlflow
  import mlflow.utils.requirements_utils
  from mlflow.utils.environment import infer_pip_requirements
  from mlflow.utils.requirements_utils import _capture_imported_modules, _get_installed_version, _get_pinned_requirement, _infer_requirements, _is_comment, _is_empty, _is_requirements_file, _join_continued_lines, _normalize_package_name, _parse_requirements, _prune_packages, _PyPIPackageIndex, _strip_inline_comment, _strip_local_version_label
label_desc: Use image node_id 17 for calling a global function with example usage: test_capture_imported_modules_scopes_databricks_imports(monkeypatch, tmp_path) without return types