code: def _assert_interpolated_points_are_between_base_points(
      base_points, curve, ignore_for_base_points=None
  ):
      def _get_base_point_coordinates(i, data):
          return data.x[i], data.y[i]
  
      if ignore_for_base_points is None:
          ignore_for_base_points = []
  
      # Determine base point indices from base points such that points which are
      # not corners on the convex hull are ignored. These points are listed by
      # index in ignore_for_base_points.
      start_base_point_index = 0
      while start_base_point_index in ignore_for_base_points:
          start_base_point_index += 1
  
      base_point_index = start_base_point_index + 1
      while base_point_index in ignore_for_base_points:
          base_point_index += 1
  
      (
          current_base_point_x,
          current_base_point_y,
      ) = _get_base_point_coordinates(
          start_base_point_index, base_points
      )
      (
          next_base_point_x,
          next_base_point_y,
      ) = _get_base_point_coordinates(base_point_index, base_points)
  
      for x_grid_index in range(len(curve)):
          x = curve.x[x_grid_index]
          y = curve.y[x_grid_index]
          if np.isclose(x, current_base_point_x):
              assert np.isclose(y, current_base_point_y)
              continue
  
          while x > next_base_point_x:
              (
                  current_base_point_x,
                  current_base_point_y,
              ) = _get_base_point_coordinates(
                  base_point_index, base_points
              )
              base_point_index += 1
              while base_point_index in ignore_for_base_points:
                  base_point_index += 1
              (
                  next_base_point_x,
                  next_base_point_y,
              ) = _get_base_point_coordinates(
                  base_point_index, base_points
              )
  
          if np.isclose(x, current_base_point_x):
              assert np.isclose(y, current_base_point_y)
              continue
  
          if np.isclose(x, next_base_point_x):
              assert np.isclose(y, next_base_point_y)
              continue
  
          # We know that current_base_point_x < x < next_base_point_x.
          # Ensure that the curve point lies exactly between the two base points
          # by checking the slope of the lines connecting the curve point to the
          # base points.
          assert np.isclose(
              (y - current_base_point_y) / (x - current_base_point_x),
              (next_base_point_y - y) / (next_base_point_x - x),
          )
  
file_path: fairlearn/test/unit/postprocessing/test_curve_utilities.py
imports: import numpy
  import pandas
  import pytest
  from fairlearn.postprocessing._constants import LABEL_KEY, SCORE_KEY, SENSITIVE_FEATURE_KEY
  from fairlearn.postprocessing._threshold_operation import ThresholdOperation
  from fairlearn.postprocessing._tradeoff_curve_utilities import _calculate_tradeoff_points, _filter_points_to_get_convex_hull, _interpolate_curve, _tradeoff_curve
  from .conftest import _get_grouped_data_and_base_points, labels_ex, scores_ex, sensitive_feature_names_ex1, sensitive_features_ex1
label_desc: Use image node_id 6 for calling a global function with example usage: _assert_interpolated_points_are_between_base_points(base_points, curve, ignore_for_base_points) and returns: data,  data