code: def draw_ellipse(mu, C, scales=[1, 2, 3], ax=None, **kwargs):
      if ax is None:
          ax = plt.gca()
  
      # find principal components and rotation angle of ellipse
      sigma_x2 = C[0, 0]
      sigma_y2 = C[1, 1]
      sigma_xy = C[0, 1]
  
      alpha = 0.5 * np.arctan2(2 * sigma_xy, (sigma_x2 - sigma_y2))
      tmp1 = 0.5 * (sigma_x2 + sigma_y2)
      tmp2 = np.sqrt(0.25 * (sigma_x2 - sigma_y2) ** 2 + sigma_xy**2)
  
      sigma1 = np.sqrt(tmp1 + tmp2)
      sigma2 = np.sqrt(tmp1 - tmp2)
  
      for scale in scales:
          ax.add_patch(
              Ellipse(
                  (mu[0], mu[1]),
                  2 * scale * sigma1,
                  2 * scale * sigma2,
                  alpha * 180.0 / np.pi,
                  **kwargs,
              )
          )
  
file_path: astroML/astroML/plotting/tools.py
imports: import numpy
  from io import BytesIO
  from matplotlib import pyplot
  from scipy import interpolate
  from matplotlib import image
  from matplotlib.colors import LinearSegmentedColormap
  from matplotlib.transforms import Bbox
  from matplotlib.patches import Ellipse
label_desc: Use image node_id 3 for calling a global function with example usage: draw_ellipse(mu, C, scales, ax) without return types