code: def __draw_threshold_rules(
      threshold_df, scales, position, accessibility_mode=False
  ):
      """Draws fairness threshold rules: red lines that mark the defined fairness threshold in the chart."""
      stroke_color = (
          Threshold_Rule.stroke_accessible
          if accessibility_mode
          else Threshold_Rule.stroke
      )
  
      threshold_rules = (
          alt.Chart(threshold_df)
          .mark_rect(
              stroke=stroke_color,
              opacity=Threshold_Rule.opacity,
              strokeWidth=Threshold_Rule.stroke_width,
              tooltip=None,
          )
          .encode(
              x=alt.X(
                  field=f"{position}_threshold_value",
                  type="quantitative",
                  scale=scales["x"],
              ),
              x2=f"{position}_threshold_value:Q",
              y=alt.Y(
                  field="metric",
                  type="nominal",
                  scale=scales["y"],
                  axis=no_axis(),
              ),
          )
      )
      return threshold_rules
  
imports: import altair
  import pandas
  from aequitas.plot.commons.helpers import no_axis, transform_ratio, 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, get_tooltip_text_disparity_explanation
  from aequitas.plot.commons.style.classes import Metric_Axis, Axis, Threshold_Band, Threshold_Rule, Annotation, Bubble, Rule, Chart_Title
  from aequitas.plot.commons.style.sizes import Metric_Chart
  from aequitas.plot.commons.style.text import FONT, FONT_SIZE_SMALL
  from aequitas.plot.commons import initializers
  from aequitas.plot.commons import labels
label_desc: Use image node_id 5 for calling a global function with example usage: __draw_threshold_rules(threshold_df, scales, position, accessibility_mode) and returns: threshold_rules