code: def _dominates(
      trial0: FrozenTrial,
      trial1: FrozenTrial,
      directions: Sequence[StudyDirection],
  ) -> bool:
      values0 = trial0.values
      values1 = trial1.values
  
      assert values0 is not None
      assert values1 is not None
  
      if len(values0) != len(values1):
          raise ValueError(
              "Trials with different numbers of objectives cannot be compared."
          )
  
      if len(values0) != len(directions):
          raise ValueError(
              "The number of the values and the number of the objectives are mismatched."
          )
  
      if trial0.state != TrialState.COMPLETE:
          return False
  
      if trial1.state != TrialState.COMPLETE:
          return True
  
      normalized_values0 = [
          _normalize_value(v, d) for v, d in zip(values0, directions)
      ]
      normalized_values1 = [
          _normalize_value(v, d) for v, d in zip(values1, directions)
      ]
  
      if normalized_values0 == normalized_values1:
          return False
  
      return all(
          v0 <= v1
          for v0, v1 in zip(normalized_values0, normalized_values1)
      )
  
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 5 for calling a global function with example usage: _dominates(trial0, trial1, directions) and returns: all, False, True, False