code: def get_disparities_group_report(
      group_value_df,
      attribute,
      fairness_measures,
      fairness_measures_depend,
  ):
      def_cols = ["attribute_value"]
      metrics = {}
      for par, disp in fairness_measures_depend.items():
          if par in fairness_measures:
              metrics[disp] = par
      aux_df = group_value_df.loc[
          group_value_df["attribute_name"] == attribute
      ]
      aux_df = aux_df[def_cols + list(metrics.keys())]
      map = {}
      for col in aux_df.columns:
          colstr = col.replace("_", " ")
          if col == "attribute_value":
              colstr = "Attribute Value"
          else:
              colstr = colstr.split(" ")[0].upper() + " Disparity"
          map[col] = colstr  # + ' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
          aux_df.loc[:, col] = (
              "["
              + aux_df[col]
              + "]"
              + "(#"
              + "-".join(attribute.lower().split(" "))
              + "-3)"
          )
      aux_df = aux_df.rename(index=str, columns=map)
      # this is hardcoded. If metrics supported by aequitas change this needs to change
      cols_order = [
          "Attribute Value",
          "PPR Disparity",
          "PPREV Disparity",
          "FDR Disparity",
          "FPR Disparity",
          "FOR Disparity",
          "FNR Disparity",
      ]
      new_order = [col for col in cols_order if col in aux_df.columns]
      aux_df = aux_df[new_order]
      disparities_group = tabulate(
          aux_df,
          headers="keys",
          tablefmt="pipe",
          showindex="never",
          numalign="left",
      )
  
      return disparities_group
  
imports: import datetime
  import logging
  import pandas
  from markdown2 import markdown
  from tabulate import tabulate
label_desc: Use image node_id 5 for calling a global function with example usage: get_disparities_group_report(group_value_df, attribute, fairness_measures, fairness_measures_depend) and returns: disparities_group