code: def convert_and_print_dataframe(
      output_gender_precision_fairness_indicator, model_name
  ):
      metric_names = list(
          output_gender_precision_fairness_indicator.keys()
      )
      attributes_list = []
      for key, value in list(
          output_gender_precision_fairness_indicator[
              metric_names[0]
          ].items()
      ):
          if isinstance(value, dict):
              attributes_list.extend(sorted(value.keys()))
          else:
              attributes_list.append(key)
      attributes_list.remove("-1")
  
      dataframe = {"model": [], "metric": []}
      for item in attributes_list:
          dataframe[item] = []
  
      for metric in metric_names:
          dataframe["model"].append(model_name)
          dataframe["metric"].append(metric)
          for key, value in list(
              output_gender_precision_fairness_indicator[metric].items()
          ):
              if isinstance(value, dict):
                  for attr_name in list(value.keys()):
                      if attr_name not in dataframe:
                          continue
                      dataframe[attr_name].append(value[attr_name])
              elif key in dataframe:
                  dataframe[key].append(value)
      df = pd.DataFrame(data=dataframe)
      print(df.to_markdown())
      return df
  
file_path: vissl/projects/fairness_indicators/similarity_search/inference_casual_conversations.py
imports: import numpy
  import pandas
  import torch
  from vissl.utils.io import load_file
label_desc: Use image node_id 8 for calling a global function with example usage: convert_and_print_dataframe(output_gender_precision_fairness_indicator, model_name) and returns: df