code: def dominance(left, right):
      """Returns the dominance relation between ``left`` and ``right``, according
      to the rules that one ConjectureResult dominates another if and only if it
      is better in every way.
  
      The things we currently consider to be "better" are:
  
          * Something that is smaller in shrinking order is better.
          * Something that has higher status is better.
          * Each ``interesting_origin`` is treated as its own score, so if two
            interesting examples have different origins then neither dominates
            the other.
          * For each target observation, a higher score is better.
  
      In "normal" operation where there are no bugs or target observations, the
      pareto front only has one element (the smallest valid test case), but for
      more structured or failing tests it can be useful to track, and future work
      will depend on it more."""
  
      if left.buffer == right.buffer:
          return DominanceRelation.EQUAL
  
      if sort_key(right.buffer) < sort_key(left.buffer):
          result = dominance(left=right, right=left)
          if result == DominanceRelation.LEFT_DOMINATES:
              return DominanceRelation.RIGHT_DOMINATES
          else:
              # Because we have sort_key(left) < sort_key(right) the only options
              # are that right is better than left or that the two are
              # incomparable.
              assert result == DominanceRelation.NO_DOMINANCE
              return result
  
      # Either left is better or there is no dominance relationship.
      assert sort_key(left.buffer) < sort_key(right.buffer)
  
      # The right is more interesting
      if left.status < right.status:
          return DominanceRelation.NO_DOMINANCE
  
      if not right.tags.issubset(left.tags):
          return DominanceRelation.NO_DOMINANCE
  
      # Things that are interesting for different reasons are incomparable in
      # the dominance relationship.
      if (
          left.status == Status.INTERESTING
          and left.interesting_origin != right.interesting_origin
      ):
          return DominanceRelation.NO_DOMINANCE
  
      for target in set(left.target_observations) | set(
          right.target_observations
      ):
          left_score = left.target_observations.get(target, NO_SCORE)
          right_score = right.target_observations.get(target, NO_SCORE)
          if right_score > left_score:
              return DominanceRelation.NO_DOMINANCE
  
      return DominanceRelation.LEFT_DOMINATES
  
file_path: catboost/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/pareto.py
imports: from enum import Enum
  from sortedcontainers import SortedList
  from hypothesis.internal.conjecture.data import ConjectureData, ConjectureResult, Status
  from hypothesis.internal.conjecture.junkdrawer import LazySequenceCopy, swap
  from hypothesis.internal.conjecture.shrinker import sort_key
label_desc: Use image node_id 1 for calling a global function with example usage: dominance(left, right) and returns: DominanceRelation, DominanceRelation, DominanceRelation, DominanceRelation, DominanceRelation, DominanceRelation, result, DominanceRelation