def METHOD_NAME(pruning, quantization, quant_expected, model):
    actual = recipe_template(pruning=pruning, quantization=quantization, model=model)
    manager = ScheduledModifierManager.from_yaml(file_path=actual)
    manager.apply(module=model)
    model_is_quantized = (
        hasattr(model, "qconfig")
        and model.qconfig is not None
        and any(isinstance(module, FakeQuantize) for module in model.modules())
    )
    if quant_expected:
        assert model_is_quantized
    else:
        assert model_is_quantized is False
    if pruning != "false":
        weights = [weights for _, weights in model.state_dict().items()]
        sparsity = sum(
            tensor_sparsity(weight) * torch.numel(weight) for weight in weights
        ) / sum(torch.numel(weight) for weight in weights)
        assert sparsity > 0.75