class_docstr: Callback for LightGBM to prune unpromising trials.
  
  See `the example <https://github.com/optuna/optuna-examples/blob/main/
  lightgbm/lightgbm_integration.py>`__
  if you want to add a pruning callback which observes accuracy
  of a LightGBM model.
  
  Args:
      trial:
          A :class:`~optuna.trial.Trial` corresponding to the current evaluation of
          the objective function.
      metric:
          An evaluation metric for pruning, e.g., ``binary_error`` and ``multi_error``.
          Please refer to
          `LightGBM reference
          <https://lightgbm.readthedocs.io/en/latest/Parameters.html#metric>`_
          for further details.
      valid_name:
          The name of the target validation.
          Validation names are specified by ``valid_names`` option of
          `train method
          <https://lightgbm.readthedocs.io/en/latest/Python-API.html#lightgbm.train>`_.
          If omitted, ``valid_0`` is used which is the default name of the first validation.
          Note that this argument will be ignored if you are calling
          `cv method <https://lightgbm.readthedocs.io/en/latest/Python-API.html#lightgbm.cv>`_
          instead of train method.
      report_interval:
          Check if the trial should report intermediate values for pruning every n-th boosting
          iteration. By default ``report_interval=1`` and reporting is performed after every
          iteration. Note that the pruning itself is performed according to the interval
          definition of the pruner.
code: def _find_evaluation_result(
      self, target_valid_name: str, env: CallbackEnv
  ) -> (
      _LGBM_BoosterEvalMethodResultType
      | _LGBM_BoosterEvalMethodResultWithStandardDeviationType
      | None
  ):
      evaluation_result_list = env.evaluation_result_list
      if evaluation_result_list is None:
          return None
  
      for evaluation_result in evaluation_result_list:
          (
              valid_name,
              metric,
              current_score,
              is_higher_better,
          ) = evaluation_result[:4]
          # The prefix "valid " is added to metric name since LightGBM v4.0.0.
          if valid_name != target_valid_name or (
              metric != "valid " + self._metric
              and metric != self._metric
          ):
              continue
          return evaluation_result
  
      return None
  
file_path: optuna/optuna/integration/lightgbm.py
imports: from __future__ import annotations
  import sys
  from typing import TYPE_CHECKING
  import optuna
  from optuna._imports import try_import
  from optuna.integration import _lightgbm_tuner
label_desc: Use image node_id 2 for calling the LightGBMPruningCallback obj's underlying member method code with example usage: obj._find_evaluation_result(target_valid_name, env) and returns: None, None, evaluation_result