code: def _is_trial_promotable_to_next_rung(
      value: float,
      competing_values: List[float],
      reduction_factor: int,
      study_direction: StudyDirection,
  ) -> bool:
      promotable_idx = (len(competing_values) // reduction_factor) - 1
  
      if promotable_idx == -1:
          # Optuna does not support suspending or resuming ongoing trials. Therefore, for the first
          # `eta - 1` trials, this implementation instead promotes the trial if its value is the
          # smallest one among the competing values.
          promotable_idx = 0
  
      competing_values.sort()
      if study_direction == StudyDirection.MAXIMIZE:
          return value >= competing_values[-(promotable_idx + 1)]
      return value <= competing_values[promotable_idx]
  
file_path: optuna/optuna/pruners/_successive_halving.py
imports: import math
  from typing import List
  from typing import Optional
  from typing import Union
  import optuna
  from optuna.pruners._base import BasePruner
  from optuna.study._study_direction import StudyDirection
  from optuna.trial._state import TrialState
label_desc: Use image node_id 5 for calling a global function with example usage: _is_trial_promotable_to_next_rung(value, competing_values, reduction_factor, study_direction) and returns: unknown, unknown