def is_num_thresholds_gte2(num_thresholds: int) -> None:
    """Validate that the number of thresholds is a positive integer >= 2.

    Args:
        num_thresholds: Number of thresholds to validate.

    Raises:
        TypeError: If ``num_thresholds`` is not an integer.
        ValueError: If ``num_thresholds`` is less than 2.

    Example:
        >>> is_num_thresholds_gte2(5)  # No error
        >>> is_num_thresholds_gte2(1)  # Raises ValueError
        ValueError: Expected the number of thresholds to be larger than 1, but got 1
    """
    if not isinstance(num_thresholds, int):
        msg = f"Expected the number of thresholds to be an integer, but got {type(num_thresholds)}"
        raise TypeError(msg)

    if num_thresholds < 2:
        msg = f"Expected the number of thresholds to be larger than 1, but got {num_thresholds}"
        raise ValueError(msg)
Validate that the number of thresholds is a positive integer >= 2.

    Args:
        num_thresholds: Number of thresholds to validate.

    Raises:
        TypeError: If ``num_thresholds`` is not an integer.
        ValueError: If ``num_thresholds`` is less than 2.

    Example:
        >>> is_num_thresholds_gte2(5)  # No error
        >>> is_num_thresholds_gte2(1)  # Raises ValueError
        ValueError: Expected the number of thresholds to be larger than 1, but got 1
    
src/anomalib/metrics/pimo/_validate.py