def samples(self, samples: DataFrame) -> None:
        """Set the samples DataFrame.

        Args:
            samples (DataFrame): DataFrame containing dataset samples.

        Raises:
            TypeError: If samples is not a pandas DataFrame.
            ValueError: If required columns are missing.
            FileNotFoundError: If any image paths do not exist.

        Example:
            >>> df = pd.DataFrame({
            ...     'image_path': ['image.png'],
            ...     'split': ['train']
            ... })
            >>> dataset = AnomalibDataset()
            >>> dataset.samples = df
        """
        # validate the passed samples by checking the
        if not isinstance(samples, DataFrame):
            msg = f"samples must be a pandas.DataFrame, found {type(samples)}"
            raise TypeError(msg)

        if not all(col in samples.columns for col in _EXPECTED_COLUMNS):
            msg = f"samples must have (at least) columns {_EXPECTED_COLUMNS}, found {samples.columns}"
            raise ValueError(msg)

        if not samples["image_path"].apply(lambda p: Path(p).exists()).all():
            msg = "missing file path(s) in samples"
            raise FileNotFoundError(msg)

        self._samples = samples.sort_values(by="image_path", ignore_index=True)
Set the samples DataFrame.

        Args:
            samples (DataFrame): DataFrame containing dataset samples.

        Raises:
            TypeError: If samples is not a pandas DataFrame.
            ValueError: If required columns are missing.
            FileNotFoundError: If any image paths do not exist.

        Example:
            >>> df = pd.DataFrame({
            ...     'image_path': ['image.png'],
            ...     'split': ['train']
            ... })
            >>> dataset = AnomalibDataset()
            >>> dataset.samples = df
        
src/anomalib/data/datasets/base/image.py