code: def __draw_threshold_bands(
      ref_group_value,
      fairness_threshold,
      main_scale,
      aux_scale,
      accessibility_mode=False,
      drawing_x=False,
  ):
      """Draws threshold rules and bands for both axis: regions painted red on the chart
      where the metric is above the defined fairness threshold."""
  
      # DATASOURCE
      threshold_df = pd.DataFrame(
          {
              "start": 0,
              "end": 1,
              "lower_threshold": ref_group_value / fairness_threshold,
              "upper_threshold": min(
                  ref_group_value * fairness_threshold, 1
              ),
          },
          index=[0],
      )
  
      stroke_color = (
          Threshold_Rule.stroke_accessible
          if accessibility_mode
          else Threshold_Rule.stroke
      )
      fill_color = (
          Threshold_Band.color_accessible
          if accessibility_mode
          else Threshold_Band.color
      )
  
      # BASES
      rule_base = alt.Chart(threshold_df).mark_rule(
          stroke=stroke_color,
          strokeWidth=Threshold_Rule.stroke_width,
          opacity=Threshold_Rule.opacity,
          tooltip=None,
      )
  
      band_base = alt.Chart(threshold_df).mark_rect(
          fill=fill_color, opacity=Threshold_Band.opacity, tooltip=None
      )
  
      # PARAMS
      if drawing_x:
          common_params = dict(
              y=alt.Y("start:Q", scale=aux_scale, axis=no_axis()),
              y2="end:Q",
          )
          upper_param = dict(
              x=alt.X(
                  "upper_threshold:Q", scale=main_scale, axis=no_axis()
              )
          )
          lower_param = dict(
              x=alt.X(
                  "lower_threshold:Q", scale=main_scale, axis=no_axis()
              )
          )
          lower_end_param = dict(x2="start:Q")
          upper_end_param = dict(x2="end:Q")
      else:
          common_params = dict(
              x=alt.X("start:Q", scale=aux_scale, axis=no_axis()),
              x2="end:Q",
          )
          upper_param = dict(
              y=alt.Y(
                  "upper_threshold:Q", scale=main_scale, axis=no_axis()
              )
          )
          lower_param = dict(
              y=alt.Y(
                  "lower_threshold:Q", scale=main_scale, axis=no_axis()
              )
          )
          lower_end_param = dict(y2="start:Q")
          upper_end_param = dict(y2="end:Q")
  
      # RULES
      lower_threshold_rule = rule_base.encode(
          **common_params,
          **lower_param,
      )
      upper_threshold_rule = rule_base.encode(
          **common_params,
          **upper_param,
      )
  
      # BANDS
      lower_threshold_band = band_base.encode(
          **common_params, **lower_param, **lower_end_param
      )
      upper_threshold_band = band_base.encode(
          **common_params, **upper_param, **upper_end_param
      )
  
      return (
          lower_threshold_rule
          + upper_threshold_rule
          + lower_threshold_band
          + upper_threshold_band
      )
  
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 2 for calling a global function with example usage: __draw_threshold_bands(ref_group_value, fairness_threshold, main_scale, aux_scale, accessibility_mode, drawing_x) and returns: unknown