"""Calibration helpers.""" from __future__ import annotations def calibrate_prob(prob: float, temperature: float = 1.0) -> float: if temperature <= 0: return prob return max(0.0, min(1.0, prob ** (1.0 / temperature)))