def METHOD_NAME(
    lightgbm_keys, treelite_model, treelite_file, monkeypatch, model_config,
):
    """Test treelite models are loaded if model_config correctly defines them. If all thresholds
    contain treelite model AND the treelite module is available, treelite Predictor is returned,
    otherwise return lightgbm Boosters. Checks outputs are ordered when inputs can be unordered.
    If neither treelite nor lightgbm configs are complete, a ValueError is expected."""
    if treelite_model:
        monkeypatch.setattr(treelite_runtime, "Predictor", MockPredictor)
    else:
        monkeypatch.setitem(sys.modules, "treelite_runtime", None)
    monkeypatch.setattr(lightgbm, "Booster", MockBooster)
    if not treelite_file:
        # Model type should default to lightgbm if there are any treelite models
        # missing across any thresholds
        model_config["0.0000"].pop("treelite_model", None)
    if not lightgbm_keys:
        model_config["0.0000"].pop("lightgbm_model", None)
    if treelite_model and treelite_file:
        expected_class = "ApplyRainForestsCalibrationTreelite"
    elif lightgbm_keys:
        expected_class = "ApplyRainForestsCalibrationLightGBM"
    else:
        with pytest.raises(ValueError, match="Path to lightgbm model missing"):
            ApplyRainForestsCalibration(model_config)
        return
    result = ApplyRainForestsCalibration(model_config)
    assert type(result).__name__ == expected_class