class_docstr: Anomalib dataset.
  
  Args:
      task (str): Task type, either 'classification' or 'segmentation'
      transform (A.Compose): Albumentations Compose object describing the transforms that are applied to the inputs.
docstr: Overwrite the samples with a new dataframe.
  
  Args:
      samples (DataFrame): DataFrame with new samples.
docstr_tok: ["Overwrite","the","samples","with","a","new","dataframe",".","Args",":","samples","(","DataFrame",")",":","DataFrame","with","new","samples","."]
code: def samples(self, samples: DataFrame) -> None:
      """Overwrite the samples with a new dataframe.
  
      Args:
          samples (DataFrame): DataFrame with new samples.
      """
      # validate the passed samples by checking the
      assert isinstance(
          samples, DataFrame
      ), f"samples must be a pandas.DataFrame, found {type(samples)}"
      expected_columns = _EXPECTED_COLUMNS_PERTASK[self.task]
      assert all(
          col in samples.columns for col in expected_columns
      ), f"samples must have (at least) columns {expected_columns}, found {samples.columns}"
      assert (
          samples["image_path"].apply(lambda p: Path(p).exists()).all()
      ), "missing file path(s) in samples"
  
      self._samples = samples.sort_values(
          by="image_path", ignore_index=True
      )
  
imports: from __future__ import annotations
  import copy
  import logging
  from abc import ABC, abstractmethod
  from pathlib import Path
  from typing import Sequence
  import albumentations
  import cv2
  import numpy
  import pandas
  from pandas import DataFrame
  from torch import Tensor
  from torch.utils.data import Dataset
  from anomalib.data.task_type import TaskType
  from anomalib.data.utils import masks_to_boxes, read_image
label_desc: Use image node_id 6 for calling the AnomalibDataset obj's underlying member method code with example usage: obj.samples(samples) without return types