code: def try_import_ray() -> ModuleType:
      RAY_MAX_VERSION = "2.7.0"  # sync with core/setup.py
      ray_max_version_os_map = dict(
          Darwin=RAY_MAX_VERSION,
          Windows=RAY_MAX_VERSION,
          Linux=RAY_MAX_VERSION,
      )
      ray_min_version = "2.6.3"
      current_os = platform.system()
      ray_max_version = ray_max_version_os_map.get(
          current_os, RAY_MAX_VERSION
      )
      try:
          import ray
          from packaging import version
  
          if version.parse(ray.__version__) < version.parse(
              ray_min_version
          ) or version.parse(ray.__version__) >= version.parse(
              ray_max_version
          ):
              msg = (
                  f"ray=={ray.__version__} detected. "
                  f"{ray_min_version} <= ray < {ray_max_version} is required. You can use pip to install certain version of ray "
                  f"`pip install ray=={ray_min_version}` "
              )
              raise ValueError(msg)
          return ray
      except ImportError:
          raise ImportError(
              "ray is required to train folds in parallel for TabularPredictor or HPO for MultiModalPredictor. "
              f"A quick tip is to install via `pip install ray=={ray_min_version}`"
          )
  
file_path: autogluon/common/src/autogluon/common/utils/try_import.py
imports: import logging
  import platform
  import sys
  from types import ModuleType
  from ..version import __version__
label_desc: Use image node_id 2 for calling a global function with example usage: try_import_ray() and returns: ray