code: def _filter_points_to_get_convex_hull(points_sorted):
      """Find the upper convex hull.
  
      Parameters
      ----------
      points_sorted : pandas.DataFrame
          Points represented as rows with 'x' and 'y' columns, sorted by 'x'.
  
      Returns
      -------
      result : pandas.DataFrame
          Points that make the upper convex hull.
  
      Notes
      -----
      Uses `Andrew's monotone chain convex hull algorithm
      <https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain>`_.
  
      """
      selected = []
      for r2 in points_sorted.itertuples():
          # For each set of three points, i.e. the last two points in selected
          # and the next point from the sorted list of base points, check
          # whether the middle point (r1) lies above the line between the
          # first point (r0) and the next base point (r2). If it is above,
          # it is indeed required for the convex hull. If it is below or
          # on the line, then it is part of the convex hull as defined with
          # just r0 and r2 and we can drop it from the list of selected points.
          while len(selected) >= 2:
              r1 = selected[-1]
              r0 = selected[-2]
              # Compare slopes of lines between r0 and r1/r2 to determine
              # whether or not to drop r1. Instead of delta_y/delta_x we
              # multiplied both sides of the inequation by the delta_xs.
              if (r1.y - r0.y) * (r2.x - r0.x) <= (r2.y - r0.y) * (
                  r1.x - r0.x
              ):
                  # drop r1
                  selected.pop()
              else:
                  break
          selected.append(r2)
      return selected
  
file_path: fairlearn/fairlearn/postprocessing/_tradeoff_curve_utilities.py
imports: import numpy
  import pandas
  from sklearn.utils import Bunch
  from ._constants import LABEL_KEY, P0_KEY, P1_KEY, SCORE_KEY
  from ._threshold_operation import ThresholdOperation
label_desc: Use image node_id 3 for calling a global function with example usage: _filter_points_to_get_convex_hull(points_sorted) and returns: selected