def validate_mask_path(mask_path: Sequence[str] | None) -> list[str] | None:
        """Validate the mask paths for a batch.

        This method validates sequences of mask file paths. It handles:
            - Type conversion to strings
            - Path sequence validation

        Args:
            mask_path (``Sequence[str]`` | ``None``): Input sequence of mask paths.

        Returns:
            ``list[str]`` | ``None``: Validated list of mask paths, or ``None``.

        Raises:
            TypeError: If ``mask_path`` is not a sequence of strings.

        Examples:
            Validate list of paths::

                >>> paths = ['mask1.png', 'mask2.png', 'mask3.png']
                >>> validated = NumpyImageBatchValidator.validate_mask_path(paths)
                >>> validated
                ['mask1.png', 'mask2.png', 'mask3.png']
        """
        if mask_path is None:
            return None
        if not isinstance(mask_path, Sequence):
            msg = f"Mask path must be a sequence of paths or strings, got {type(mask_path)}."
            raise TypeError(msg)
        return [str(path) for path in mask_path]
Validate the mask paths for a batch.

        This method validates sequences of mask file paths. It handles:
            - Type conversion to strings
            - Path sequence validation

        Args:
            mask_path (``Sequence[str]`` | ``None``): Input sequence of mask paths.

        Returns:
            ``list[str]`` | ``None``: Validated list of mask paths, or ``None``.

        Raises:
            TypeError: If ``mask_path`` is not a sequence of strings.

        Examples:
            Validate list of paths::

                >>> paths = ['mask1.png', 'mask2.png', 'mask3.png']
                >>> validated = NumpyImageBatchValidator.validate_mask_path(paths)
                >>> validated
                ['mask1.png', 'mask2.png', 'mask3.png']
        
src/anomalib/data/validators/numpy/image.py