code: def rose(xy, k: Fraction, A: float = 1) -> None:
      n = k.numerator
      d = k.denominator
  
      T = d * (2 if n * d % 2 == 0 else 1)
  
      angle = np.linspace(0, T * pi, T * 100)
      radius = A * np.cos(float(k) * angle)
  
      source = ColumnDataSource(dict(radius=radius, angle=angle))
      t = PolarTransform()
  
      if k in color_map:
          color = color_map[k]
      else:
          color = color_map[k] = next(dark_colors)
  
      xy.line(x=t.x, y=t.y, line_color=color, source=source)
  
file_path: bokeh/examples/plotting/polar_subcoordinates.py
imports: from fractions import Fraction
  from math import pi
  import numpy
  from bokeh.colors.named import colors
  from bokeh.io import show
  from bokeh.models import ColumnDataSource, PolarTransform, Range1d
  from bokeh.plotting import figure
label_desc: Use image node_id 1 for calling a global function with example usage: rose(xy, k, A) without return types