code: def __draw_bubbles(
      plot_table,
      x_metric,
      y_metric,
      ref_group,
      scales,
      interactive_selection_group,
  ):
      """Draws the bubbles for all metrics."""
  
      # FILTER DF
      fields_to_keep_in_metric_table = [
          "group_size",
          "attribute_value",
          "total_entities",
          x_metric,
          y_metric,
      ]
      metric_plot_table = plot_table[
          fields_to_keep_in_metric_table
      ].copy(deep=True)
  
      metric_plot_table["tooltip_group_size"] = plot_table.apply(
          lambda row: get_tooltip_text_group_size(
              row["group_size"], row["total_entities"]
          ),
          axis=1,
      )
  
      # COLOR ENCODING
      bubble_color_encoding = alt.condition(
          interactive_selection_group,
          alt.Color(
              "attribute_value:N", scale=scales["color"], legend=None
          ),
          alt.value(Bubble.color_faded),
      )
  
      # TOOLTIP ENCODING
      bubble_tooltip_encoding = [
          alt.Tooltip(
              field="attribute_value",
              type="nominal",
              title=Label.SINGLE_GROUP,
          ),
          alt.Tooltip(
              field="tooltip_group_size",
              type="nominal",
              title=Label.GROUP_SIZE,
          ),
          alt.Tooltip(
              field=x_metric,
              type="quantitative",
              format=".2f",
              title=x_metric.upper(),
          ),
          alt.Tooltip(
              field=y_metric,
              type="quantitative",
              format=".2f",
              title=y_metric.upper(),
          ),
      ]
  
      # BUBBLE CENTERS
      bubbles_centers = (
          alt.Chart(metric_plot_table)
          .mark_point(
              filled=True, size=Bubble.center_size, cursor=Bubble.cursor
          )
          .encode(
              x=alt.X(
                  f"{x_metric}:Q", scale=scales["x"], axis=no_axis()
              ),
              y=alt.Y(
                  f"{y_metric}:Q", scale=scales["y"], axis=no_axis()
              ),
              tooltip=bubble_tooltip_encoding,
              color=bubble_color_encoding,
              shape=alt.Shape(
                  "attribute_value:N",
                  scale=scales["shape"],
                  legend=None,
              ),
          )
      )
  
      # BUBBLE AREAS
      bubbles_areas = (
          alt.Chart(metric_plot_table)
          .mark_circle(opacity=Bubble.opacity, cursor=Bubble.cursor)
          .encode(
              size=alt.Size(
                  "group_size:Q",
                  legend=None,
                  scale=scales["bubble_size"],
              ),
              x=alt.X(
                  f"{x_metric}:Q", scale=scales["x"], axis=no_axis()
              ),
              y=alt.Y(
                  f"{y_metric}:Q", scale=scales["y"], axis=no_axis()
              ),
              tooltip=bubble_tooltip_encoding,
              color=bubble_color_encoding,
          )
      )
  
      return bubbles_centers + bubbles_areas
  
file_path: aequitas/src/aequitas/plot/xy_metrics_chart.py
imports: import altair
  import pandas
  from aequitas.plot.commons.helpers import no_axis, get_chart_metadata
  from aequitas.plot.commons.legend import draw_legend
  from aequitas.plot.commons.scales import get_chart_size_range
  from aequitas.plot.commons.tooltips import get_tooltip_text_group_size
  from aequitas.plot.commons.style.classes import Threshold_Band, Threshold_Rule, Rule, Bubble, Scatter_Axis, Chart_Title, Axis
  from aequitas.plot.commons.style.text import FONT
  from aequitas.plot.commons.style.sizes import XY_Chart
  from aequitas.plot.commons import initializers
  from aequitas.plot.commons import validators
  from aequitas.plot.commons import labels
label_desc: Use image node_id 5 for calling a global function with example usage: __draw_bubbles(plot_table, x_metric, y_metric, ref_group, scales, interactive_selection_group) and returns: unknown