code: def split_by_label(
      dataset: AnomalibDataset,
  ) -> tuple[AnomalibDataset, AnomalibDataset]:
      """Splits the dataset into the normal and anomalous subsets."""
      samples = dataset.samples
      normal_indices = samples[samples.label_index == 0].index
      anomalous_indices = samples[samples.label_index == 1].index
  
      normal_subset = dataset.subsample(list(normal_indices))
      anomalous_subset = dataset.subsample(list(anomalous_indices))
      return normal_subset, anomalous_subset
  
file_path: anomalib/src/anomalib/data/utils/split.py
imports: from __future__ import annotations
  import math
  import warnings
  from enum import Enum
  from typing import TYPE_CHECKING, Sequence
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: split_by_label(dataset) and returns: normal_subset,  anomalous_subset