code: def prune(
      self,
      study: "optuna.study.Study",
      trial: "optuna.trial.FrozenTrial",
  ) -> bool:
      # Get the latest score reported from this trial
      step = trial.last_step
  
      if (
          step
      ):  # trial.last_step == None when no scores have been reported yet
          this_score = trial.intermediate_values[step]
  
          # Get scores from other trials in the study reported at the same step
          completed_trials = study.get_trials(
              deepcopy=False, states=(TrialState.COMPLETE,)
          )
          other_scores = [
              t.intermediate_values[step]
              for t in completed_trials
              if step in t.intermediate_values
          ]
          other_scores = sorted(other_scores)
  
          # Prune if this trial at this step has a lower value than all completed trials
          # at the same step. Note that steps will begin numbering at 0 in the objective
          # function definition below.
          if (
              step >= self._warmup_steps
              and len(other_scores) > self._warmup_trials
          ):
              if this_score < other_scores[0]:
                  print(
                      f"prune() True: Trial {trial.number}, Step {step}, Score {this_score}"
                  )
                  return True
  
      return False
  
file_path: optuna/tutorial/20_recipes/006_user_defined_pruner.py
imports: import numpy
  from sklearn.datasets import load_iris
  from sklearn.model_selection import train_test_split
  from sklearn.linear_model import SGDClassifier
  import optuna
  from optuna.pruners import BasePruner
  from optuna.trial._state import TrialState
label_desc: Use image node_id 2 for calling the LastPlacePruner obj's underlying member method code with example usage: obj.prune(study, trial) and returns: False, True