def METHOD_NAME(self, study: "optuna.study.Study", trial: "optuna.trial.FrozenTrial") -> bool:
    step = trial.last_step
    if step is None:
        return False
    n_warmup_steps = self._n_warmup_steps
    if step < n_warmup_steps:
        return False
    if not _is_first_in_interval_step(
        step, trial.intermediate_values.keys(), n_warmup_steps, self._interval_steps
    ):
        return False
    latest_value = trial.intermediate_values[step]
    if math.isnan(latest_value):
        return True
    if latest_value < self._lower:
        return True
    if latest_value > self._upper:
        return True
    return False