code: def add_gauge(
      radius: float,
      max_value: float,
      length: float,
      direction: Literal[-1, 1],
      color: Any,
      major_step: int,
      minor_step: int,
  ) -> None:
      major_angles, minor_angles = [], []
  
      total_angle = start_angle - end_angle
  
      major_angle_step = float(major_step) / max_value * total_angle
      minor_angle_step = float(minor_step) / max_value * total_angle
  
      major_angle = 0
  
      while major_angle <= total_angle:
          major_angles.append(start_angle - major_angle)
          major_angle += major_angle_step
  
      minor_angle = 0
  
      while minor_angle <= total_angle:
          minor_angles.append(start_angle - minor_angle)
          minor_angle += minor_angle_step
  
      major_labels = [
          major_step * i for i, _ in enumerate(major_angles)
      ]
  
      n = major_step / minor_step
      minor_angles = [
          x for i, x in enumerate(minor_angles) if i % n != 0
      ]
  
      glyph = Arc(
          x=0,
          y=0,
          radius=radius,
          start_angle=start_angle,
          end_angle=end_angle,
          direction="clock",
          line_color=color,
          line_width=2,
      )
      plot.add_glyph(glyph)
  
      rotation = 0 if direction == 1 else -pi
  
      angles = [angle + rotation for angle in major_angles]
      source = ColumnDataSource(
          dict(major_angles=major_angles, angle=angles)
      )
  
      t = PolarTransform(radius=radius, angle="major_angles")
      glyph = Ray(
          x=expr(t.x),
          y=expr(t.y),
          length=data(length),
          angle="angle",
          line_color=color,
          line_width=2,
      )
      plot.add_glyph(source, glyph)
  
      angles = [angle + rotation for angle in minor_angles]
      source = ColumnDataSource(
          dict(minor_angles=minor_angles, angle=angles)
      )
  
      t = PolarTransform(radius=radius, angle="minor_angles")
      glyph = Ray(
          x=expr(t.x),
          y=expr(t.y),
          length=data(length / 2),
          angle="angle",
          line_color=color,
          line_width=1,
      )
      plot.add_glyph(source, glyph)
  
      text_angles = [angle - pi / 2 for angle in major_angles]
      source = ColumnDataSource(
          dict(
              major_angles=major_angles,
              angle=text_angles,
              text=major_labels,
          )
      )
  
      t = PolarTransform(
          radius=radius + 2 * length * direction, angle="major_angles"
      )
      glyph = Text(
          x=expr(t.x),
          y=expr(t.y),
          angle="angle",
          text="text",
          text_align="center",
          text_baseline="middle",
      )
      plot.add_glyph(source, glyph)
  
file_path: bokeh/examples/models/gauges.py
imports: from math import pi
  from typing import Any, Literal
  from bokeh.core.properties import expr, value
  from bokeh.document import Document
  from bokeh.embed import file_html
  from bokeh.models import Arc, Circle, ColumnDataSource, Plot, PolarTransform, Range1d, Ray, Text
  from bokeh.util.browser import view
label_desc: Use image node_id 4 for calling a global function with example usage: add_gauge(radius, max_value, length, direction, color, major_step, minor_step) without return types