code: def setup_group_value_df(
      group_value_df, fairness_measures, fairness_measures_depend
  ):
      group_value_df = group_value_df.round(2)
      group_value_df = group_value_df.applymap(str)
      group_size = group_value_df["group_size_pct"]
      metrics = {}
      for par, disp in fairness_measures_depend.items():
          if par in fairness_measures:
              metrics[disp] = par
              metrics[disp.replace("_disparity", "")] = par
      aux_df = group_value_df[
          ["attribute_name", "attribute_value"] + list(metrics.keys())
      ]
      for col in group_value_df.columns:
          if col in metrics.keys():
              # we want to keep the ref group without green/red so we need to know the name of the column to search for
              if not col.endswith("_disparity"):
                  ref_group = col + "_ref_group_value"
              else:
                  ref_group = col.replace(
                      "_disparity", "_ref_group_value"
                  )
              group_value_df.loc[
                  (group_value_df[metrics[col]] == "True")
                  & (
                      group_value_df["attribute_value"]
                      != group_value_df[ref_group]
                  ),
                  col,
              ] = (
                  "##green## "
                  + group_value_df[col][
                      group_value_df[metrics[col]] == "True"
                  ]
              )
  
              group_value_df.loc[
                  group_value_df[metrics[col]] == "False", col
              ] = (
                  "##red##"
                  + group_value_df[col][
                      group_value_df[metrics[col]] == "False"
                  ]
              )
      # group_value_df['group_size_pct'] = group_size
      # print('**********GROUP SIZES********\n', group_value_df['group_size_pct'])
      return group_value_df
  
imports: import datetime
  import logging
  import pandas
  from markdown2 import markdown
  from tabulate import tabulate
label_desc: Use image node_id 4 for calling a global function with example usage: setup_group_value_df(group_value_df, fairness_measures, fairness_measures_depend) and returns: group_value_df