class_docstr: Plotting object allows for visualization of absolute group bias metrics and
  relative disparities calculated by Aequitas Group(), Bias(), and Fairness()
  class instances.
docstr: Finds relative index (row) of reference group value for a given metric.
  
  :param disparities_table: a disparity table. Output of bias.get_disparity or
      fairness.get_fairness functions.
  :param attribute_name: the attribute to plot metric against. Must be a column
      in the disparities_table.
  :param group_metric: the metric to plot. Must be a column in the
      disparities_table.
  :param ref_group_flag: string indicating column indicates reference group
      flag value. Default is '_ref_group_value'.
  
  :return: Integer indicating relative index of reference group value row.
code: def _locate_ref_group_indices(
      cls,
      disparities_table,
      attribute_name,
      group_metric,
      ref_group_flag="_ref_group_value",
  ):
      """
      Finds relative index (row) of reference group value for a given metric.
  
      :param disparities_table: a disparity table. Output of bias.get_disparity or
          fairness.get_fairness functions.
      :param attribute_name: the attribute to plot metric against. Must be a column
          in the disparities_table.
      :param group_metric: the metric to plot. Must be a column in the
          disparities_table.
      :param ref_group_flag: string indicating column indicates reference group
          flag value. Default is '_ref_group_value'.
  
      :return: Integer indicating relative index of reference group value row.
      """
      df_models = disparities_table.model_id.unique()
      if len(df_models) == 1:
          model_id = df_models[0]
      else:
          raise ValueError(
              "This method requires one and only one model_id in the disparities table. "
              "Tip: check disparities_table.model_id.unique() should be just one element list."
          )
      # get absolute metric name from passed group metric (vs. a disparity name)
      abs_metric = group_metric.replace("_disparity", "")
  
      all_ref_groups = assemble_ref_groups(
          disparities_table, ref_group_flag
      )
      ref_group_name = all_ref_groups[attribute_name][abs_metric]
  
      # get index for row associated with reference group for that model
      ind = list(
          disparities_table.loc[
              (disparities_table["attribute_name"] == attribute_name)
              & (disparities_table["attribute_value"] == ref_group_name)
              & (disparities_table["model_id"] == model_id)
          ].index
      )
  
      # there should only ever be one item in list, but JIC, select first
      if len(ind) == 1:
          idx = ind[0]
      else:
          raise ValueError(
              f"failed to find only one index for the reference "
              f"group for attribute_name = {attribute_name} and "
              f"attribute_value of reference = {ref_group_name} "
              f"and model_id={model_id}"
          )
  
      relative_ind = disparities_table.index.get_loc(idx)
      return relative_ind, ref_group_name
  
imports: import logging
  import math
  import numpy
  import collections
  import seaborn
  import matplotlib.pyplot
  import matplotlib.colors
  import matplotlib.cm
  from aequitas import squarify_flipped
label_desc: Use image node_id 6 for calling the Plot obj's underlying member method code with example usage: obj._locate_ref_group_indices(cls, disparities_table, attribute_name, group_metric, ref_group_flag) and returns: relative_ind,  ref_group_name