code: def test_lightgbm_pruning_callback_with_interval(
      cv: bool, interval: int, num_boost_round: int
  ) -> None:
      study = optuna.create_study(pruner=DeterministicPruner(False))
  
      with patch("optuna.trial.Trial.report") as mock:
          study.optimize(
              partial(
                  objective,
                  cv=cv,
                  interval=interval,
                  num_boost_round=num_boost_round,
              ),
              n_trials=1,
          )
  
          if interval <= num_boost_round:
              assert mock.call_count == 1
          else:
              assert mock.call_count == 0
  
          assert (
              study.trials[0].state == optuna.trial.TrialState.COMPLETE
          )
          assert study.trials[0].value == 1.0
  
      study = optuna.create_study(pruner=DeterministicPruner(True))
      study.optimize(
          partial(
              objective,
              cv=cv,
              interval=interval,
              num_boost_round=num_boost_round,
          ),
          n_trials=1,
      )
      if interval > num_boost_round:
          assert (
              study.trials[0].state == optuna.trial.TrialState.COMPLETE
          )
      else:
          assert study.trials[0].state == optuna.trial.TrialState.PRUNED
  
file_path: optuna/tests/integration_tests/test_lightgbm.py
imports: from functools import partial
  from unittest.mock import patch
  import numpy
  import pytest
  import optuna
  from optuna._imports import try_import
  from optuna.integration.lightgbm import LightGBMPruningCallback
  from optuna.testing.pruners import DeterministicPruner
label_desc: Use image node_id 3 for calling a global function with example usage: test_lightgbm_pruning_callback_with_interval(cv, interval, num_boost_round) without return types