code: def calc_disp(predictions, X, group_labels, X_prime, group):
      """Return the fp disparity in a group g - helper function for heat_map.
  
      Args:
          :param predictions: dataframe of predictions of the classifier
          :param X: dataframe of covariates
          :param group_labels: dataframe of group labels
          :param X_prime: sensitive covariates
          :param group: object of class Group(), see auditor.py
      Returns:
          :return: weighted disparity on the group g
      """
      X_0 = pd.DataFrame(
          [
              X_prime.iloc[u, :]
              for u, s in enumerate(group_labels)
              if s == 0
          ]
      )
      group_0 = group.predict(X_0)
      n = len(group_labels)
      g_size_0 = np.sum(group_0) * 1.0 / n
      FP = [
          predictions[i] for i, c in enumerate(group_labels) if c == 0
      ]
      FP = np.mean(FP)
      group_members = group.predict(X_prime)
      fp_g = [
          predictions[i]
          for i, c in enumerate(group_labels)
          if group_members[i] == 1 and c == 0
      ]
      if len(fp_g) == 0:
          return 0
      fp_g = np.mean(fp_g)
      return (FP - fp_g) * g_size_0
  
imports: import matplotlib
  import pandas
  import matplotlib.pyplot
  from matplotlib import cm
  from mpl_toolkits.mplot3d import Axes3D
  from aif360.algorithms.inprocessing.gerryfair.reg_oracle_class import *
label_desc: Use image node_id 1 for calling a global function with example usage: calc_disp(predictions, X, group_labels, X_prime, group) and returns: unknown, int