code: def add_sun_flare(
      img,
      flare_center_x,
      flare_center_y,
      src_radius,
      src_color,
      circles,
  ):
      """Add sun flare.
  
      From https://github.com/UjjwalSaxena/Automold--Road-Augmentation-Library
  
      Args:
          img (numpy.ndarray):
          flare_center_x (float):
          flare_center_y (float):
          src_radius:
          src_color (int, int, int):
          circles (list):
  
      Returns:
          numpy.ndarray:
  
      """
      non_rgb_warning(img)
  
      input_dtype = img.dtype
      needs_float = False
  
      if input_dtype == np.float32:
          img = from_float(img, dtype=np.dtype("uint8"))
          needs_float = True
      elif input_dtype not in (np.uint8, np.float32):
          raise ValueError(
              "Unexpected dtype {} for RandomSunFlareaugmentation".format(
                  input_dtype
              )
          )
  
      overlay = img.copy()
      output = img.copy()
  
      for alpha, (x, y), rad3, (r_color, g_color, b_color) in circles:
          cv2.circle(
              overlay, (x, y), rad3, (r_color, g_color, b_color), -1
          )
  
          cv2.addWeighted(overlay, alpha, output, 1 - alpha, 0, output)
  
      point = (int(flare_center_x), int(flare_center_y))
  
      overlay = output.copy()
      num_times = src_radius // 10
      alpha = np.linspace(0.0, 1, num=num_times)
      rad = np.linspace(1, src_radius, num=num_times)
      for i in range(num_times):
          cv2.circle(overlay, point, int(rad[i]), src_color, -1)
          alp = (
              alpha[num_times - i - 1]
              * alpha[num_times - i - 1]
              * alpha[num_times - i - 1]
          )
          cv2.addWeighted(overlay, alp, output, 1 - alp, 0, output)
  
      image_rgb = output
  
      if needs_float:
          image_rgb = to_float(image_rgb, max_value=255)
  
      return image_rgb
  
imports: from __future__ import division
  from typing import Optional, Sequence, Union
  from warnings import warn
  import cv2
  import numpy
  import skimage
  from albumentations import random_utils
  from albumentations.augmentations.utils import MAX_VALUES_BY_DTYPE, _maybe_process_in_chunks, clip, clipped, ensure_contiguous, is_grayscale_image, is_rgb_image, non_rgb_warning, preserve_channel_dim, preserve_shape
label_desc: Use image node_id 24 for calling a global function with example usage: add_sun_flare(img, flare_center_x, flare_center_y, src_radius, src_color, circles) and returns: image_rgb