def validate_pred_score(pred_score: np.ndarray | float | None) -> np.ndarray | None:
        """Validate the prediction score.

        Args:
            pred_score (``np.ndarray`` | ``float`` | ``None``): Input prediction score to
                validate.

        Returns:
            ``np.ndarray`` | ``None``: Validated prediction score as float32 numpy array,
                or None if input is None.

        Raises:
            TypeError: If ``pred_score`` is not a float or numpy array.
            ValueError: If ``pred_score`` is not a scalar.

        Example:
            >>> validator = NumpyVideoValidator()
            >>> score = 0.75
            >>> validated_score = validator.validate_pred_score(score)
            >>> print(validated_score, validated_score.dtype)
            0.75 float32
        """
        if pred_score is None:
            return None
        if isinstance(pred_score, float):
            pred_score = np.array(pred_score)
        if not isinstance(pred_score, np.ndarray):
            msg = f"Prediction score must be a float or numpy.ndarray, got {type(pred_score)}."
            raise TypeError(msg)
        if pred_score.ndim != 0:
            msg = f"Prediction score must be a scalar, got shape {pred_score.shape}."
            raise ValueError(msg)
        return pred_score.astype(np.float32)
Validate the prediction score.

        Args:
            pred_score (``np.ndarray`` | ``float`` | ``None``): Input prediction score to
                validate.

        Returns:
            ``np.ndarray`` | ``None``: Validated prediction score as float32 numpy array,
                or None if input is None.

        Raises:
            TypeError: If ``pred_score`` is not a float or numpy array.
            ValueError: If ``pred_score`` is not a scalar.

        Example:
            >>> validator = NumpyVideoValidator()
            >>> score = 0.75
            >>> validated_score = validator.validate_pred_score(score)
            >>> print(validated_score, validated_score.dtype)
            0.75 float32
        
src/anomalib/data/validators/numpy/video.py