code: def _is_first_in_interval_step(
      step: int,
      intermediate_steps: KeysView[int],
      n_warmup_steps: int,
      interval_steps: int,
  ) -> bool:
      nearest_lower_pruning_step = (
          step - n_warmup_steps
      ) // interval_steps * interval_steps + n_warmup_steps
      assert nearest_lower_pruning_step >= 0
  
      # `intermediate_steps` may not be sorted so we must go through all elements.
      second_last_step = functools.reduce(
          lambda second_last_step, s: s
          if s > second_last_step and s != step
          else second_last_step,
          intermediate_steps,
          -1,
      )
  
      return second_last_step < nearest_lower_pruning_step
  
file_path: optuna/optuna/pruners/_percentile.py
imports: import functools
  import math
  from typing import KeysView
  from typing import List
  import numpy
  import optuna
  from optuna.pruners import BasePruner
  from optuna.study._study_direction import StudyDirection
  from optuna.trial._state import TrialState
label_desc: Use image node_id 3 for calling a global function with example usage: _is_first_in_interval_step(step, intermediate_steps, n_warmup_steps, interval_steps) and returns: unknown