code: def _get_pareto_front_trials_2d(
      trials: Sequence[FrozenTrial],
      directions: Sequence[StudyDirection],
  ) -> List[FrozenTrial]:
      trials = [
          trial
          for trial in trials
          if trial.state == TrialState.COMPLETE
      ]
  
      n_trials = len(trials)
      if n_trials == 0:
          return []
  
      trials.sort(
          key=lambda trial: (
              _normalize_value(trial.values[0], directions[0]),
              _normalize_value(trial.values[1], directions[1]),
          ),
      )
  
      last_nondominated_trial = trials[0]
      pareto_front = [last_nondominated_trial]
      for i in range(1, n_trials):
          trial = trials[i]
          if _dominates(last_nondominated_trial, trial, directions):
              continue
          pareto_front.append(trial)
          last_nondominated_trial = trial
  
      pareto_front.sort(key=lambda trial: trial.number)
      return pareto_front
  
file_path: optuna/optuna/study/_multi_objective.py
imports: from typing import List
  from typing import Optional
  from typing import Sequence
  import optuna
  from optuna.study._study_direction import StudyDirection
  from optuna.trial import FrozenTrial
  from optuna.trial import TrialState
label_desc: Use image node_id 1 for calling a global function with example usage: _get_pareto_front_trials_2d(trials, directions) and returns: pareto_front, list