def aupimo_normalizing_factor(fpr_bounds: tuple[float, float]) -> float:
    """Compute constant that normalizes AUPIMO integral to 0-1 range.

    The factor is the maximum possible value from the integral in AUPIMO's
    definition. It corresponds to assuming a constant function T_i: thresh --> 1.

    Args:
        fpr_bounds: Lower and upper bounds of FPR integration range

    Returns:
        float: Normalization factor (>0)

    Example:
        >>> factor = aupimo_normalizing_factor((1e-5, 1e-4))
        >>> print(f"{factor:.3f}")
        2.303
    """
    _validate.is_rate_range(fpr_bounds)
    fpr_lower_bound, fpr_upper_bound = fpr_bounds
    # the log's base must be the same as the one used in the integration!
    return float(np.log(fpr_upper_bound / fpr_lower_bound))
Compute constant that normalizes AUPIMO integral to 0-1 range.

    The factor is the maximum possible value from the integral in AUPIMO's
    definition. It corresponds to assuming a constant function T_i: thresh --> 1.

    Args:
        fpr_bounds: Lower and upper bounds of FPR integration range

    Returns:
        float: Normalization factor (>0)

    Example:
        >>> factor = aupimo_normalizing_factor((1e-5, 1e-4))
        >>> print(f"{factor:.3f}")
        2.303
    
src/anomalib/metrics/pimo/functional.py