def _unpack_1q_from_calibration(
    metric_name: str, calibration: engine.Calibration
) -> dict[cirq.Qid, float]:
    """Converts a single-qubit metric from Calibration to dict format."""
    if metric_name not in calibration:
        return {}
    return {
        engine.Calibration.key_to_qubit(key): engine.Calibration.value_to_float(val)
        for key, val in calibration[metric_name].items()
    }
Converts a single-qubit metric from Calibration to dict format.
cirq-google/cirq_google/engine/calibration_to_noise_properties.py