code: def _get_class_from_path(class_path: str) -> Any:
      """Get a class from a module assuming the string format is `package.subpackage.module.ClassName`."""
      module_name, class_name = class_path.rsplit(".", 1)
      module = importlib.import_module(module_name)
      assert hasattr(
          module, class_name
      ), f"Class {class_name} not found in module {module_name}"
      cls = getattr(module, class_name)
      return cls
  
imports: from __future__ import annotations
  import importlib
  import warnings
  from typing import Any
  import torchmetrics
  from omegaconf import DictConfig, ListConfig
  from .anomaly_score_distribution import AnomalyScoreDistribution
  from .anomaly_score_threshold import AnomalyScoreThreshold
  from .aupr import AUPR
  from .aupro import AUPRO
  from .auroc import AUROC
  from .collection import AnomalibMetricCollection
  from .min_max import MinMax
  from .optimal_f1 import OptimalF1
  from .pro import PRO
label_desc: Use image node_id 3 for calling a global function with example usage: _get_class_from_path(class_path) and returns: cls