def METHOD_NAME() -> None:
    def objective(trial: optuna.trial.Trial) -> float:
        callback = PyTorchLightningPruningCallback(trial, monitor="accuracy")
        trainer = pl.Trainer(
            max_epochs=2,
            accelerator="cpu",
            enable_checkpointing=False,
            callbacks=[callback],
        )
        model = Model()
        trainer.fit(model)
        return 1.0
    study = optuna.create_study(pruner=DeterministicPruner(True))
    study.optimize(objective, n_trials=1)
    assert study.trials[0].state == optuna.trial.TrialState.PRUNED
    study = optuna.create_study(pruner=DeterministicPruner(False))
    study.optimize(objective, n_trials=1)
    assert study.trials[0].state == optuna.trial.TrialState.COMPLETE
    assert study.trials[0].value == 1.0