code: def _prepare_files_labels(
      path: str | Path,
      path_type: str,
      extensions: tuple[str, ...] | None = None,
  ) -> tuple[list, list]:
      """Return a list of filenames and list corresponding labels.
  
      Args:
          path (str | Path): Path to the directory containing images.
          path_type (str): Type of images in the provided path ("normal", "abnormal", "normal_test")
          extensions (tuple[str, ...] | None, optional): Type of the image extensions to read from the
              directory.
  
      Returns:
          List, List: Filenames of the images provided in the paths, labels of the images provided in the paths
      """
      path = _check_and_convert_path(path)
      if extensions is None:
          extensions = IMG_EXTENSIONS
  
      if isinstance(extensions, str):
          extensions = (extensions,)
  
      if not all(extension.startswith(".") for extension in extensions):
          raise RuntimeError(
              f"All extensions {extensions} must start with the dot"
          )
  
      filenames = [
          f
          for f in path.glob("**/*")
          if f.suffix in extensions
          and not f.is_dir()
          and not any(part.startswith(".") for part in f.parts)
      ]
      if not filenames:
          raise RuntimeError(
              f"Found 0 {path_type} images in {path} with extensions {extensions}"
          )
  
      labels = [path_type] * len(filenames)
  
      return filenames, labels
  
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 2 for calling a global function with example usage: _prepare_files_labels(path, path_type, extensions) and returns: filenames,  labels