code: def _check_and_convert_path(path: str | Path) -> Path:
      """Check an input path, and convert to Pathlib object.
  
      Args:
          path (str | Path): Input path.
  
      Returns:
          Path: Output path converted to pathlib object.
      """
      if not isinstance(path, Path):
          path = Path(path)
      return path
  
file_path: anomalib/src/anomalib/data/utils/path.py
imports: from __future__ import annotations
  from enum import Enum
  from pathlib import Path
  from torchvision.datasets.folder import IMG_EXTENSIONS
label_desc: Use image node_id 1 for calling a global function with example usage: _check_and_convert_path(path) and returns: path