code: def get_module_version(modname: str) -> Optional[LooseVersion]:
      """Raises a ValueError if module is not installed"""
      version = _get_module_version(modname)
      if version is False:
          raise ValueError(f"Module '{modname}' is not installed.")
      return version
  
file_path: pycaret/pycaret/utils/_dependencies.py
imports: import sys
  from distutils.version import LooseVersion
  from importlib import import_module
  from typing import Dict, Optional, Union
  from importlib_metadata import distributions
  from pycaret.internal.logging import get_logger, redirect_output
label_desc: Use image node_id 4 for calling a global function with example usage: get_module_version(modname) and returns: version