code: def __filter_df(disparity_df, metrics, attribute, xy_plot=False):
      viz_fields = [
          "attribute_name",
          "attribute_value",
          "group_size",
          "total_entities",
      ]
      viz_fields += metrics
  
      if not xy_plot:
          viz_fields += [f"{metric}_disparity" for metric in metrics]
  
      plot_table = disparity_df[viz_fields][
          disparity_df["attribute_name"] == attribute
      ].copy(deep=True)
  
      return plot_table
  
file_path: aequitas/src/aequitas/plot/commons/initializers.py
imports: import altair
  from aequitas.plot.commons import validators
  from aequitas.plot.commons import scales
  from aequitas.plot.commons.helpers import to_list, calculate_chart_size_from_elements
label_desc: Use image node_id 2 for calling a global function with example usage: __filter_df(disparity_df, metrics, attribute, xy_plot) and returns: plot_table