def METHOD_NAME(value: Optional[float], thresholds: List[float]) -> RiskLevel:
    """Check the value against thresholds to determine the risk level for the metric.
    Each threshold is the upper limit for the risk level.
    Args:
        value: value of the metric.
        thresholds: list of values corresponding to thresholds for different risk levels
    Returns:
        A RiskLevel.
    """
    assert len(thresholds) in [3, 4], "Must pass low, med and high thresholds."
    if len(thresholds) == 3:
        level_low, level_med, level_high = thresholds
        level_critical = math.inf
    else:
        level_low, level_med, level_high, level_critical = thresholds
    if value is None:
        return RiskLevel.UNKNOWN
    if math.isinf(value) or np.isnan(value):
        return RiskLevel.UNKNOWN
    if value <= level_low:
        return RiskLevel.LOW
    elif value <= level_med:
        return RiskLevel.MEDIUM
    elif value <= level_high:
        return RiskLevel.HIGH
    elif value <= level_critical:
        return RiskLevel.CRITICAL
    return RiskLevel.EXTREME