def test_per_image_binclf_curve(
    anomaly_maps: torch.Tensor,
    masks: torch.Tensor,
    threshold_choice: str,
    thresholds: torch.Tensor | None,
    num_thresholds: int | None,
    expected_thresholds: torch.Tensor,
    expected_binclf_curves: torch.Tensor,
) -> None:
    """Test if `per_image_binclf_curve()` returns the expected values."""
    computed_thresholds, computed_binclf_curves = threshold_and_binary_classification_curve(
        anomaly_maps,
        masks,
        threshold_choice=threshold_choice,
        thresholds=thresholds,
        num_thresholds=num_thresholds,
    )

    # thresholds
    assert computed_thresholds.shape == expected_thresholds.shape
    assert computed_thresholds.dtype == computed_thresholds.dtype
    assert (computed_thresholds == expected_thresholds).all()

    # binclf_curves
    assert computed_binclf_curves.shape == expected_binclf_curves.shape
    assert computed_binclf_curves.dtype == expected_binclf_curves.dtype
    assert (computed_binclf_curves == expected_binclf_curves).all()
Test if `per_image_binclf_curve()` returns the expected values.
tests/unit/metrics/pimo/test_binary_classification_curve.py