@preserve_shape<EOL>def add_sun_flare(img, flare_center_x, flare_center_y, src_radius, src_color, circles):
non_rgb_warning(img)<EOL>input_dtype = img.dtype<EOL>needs_float = False<EOL>if input_dtype == np.float32:<EOL><INDENT>img = from_float(img, dtype=np.dtype('<STR_LIT>'))<EOL>needs_float = True<EOL><DEDENT>elif input_dtype not in (np.uint8, np.float32):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(input_dtype))<EOL><DEDENT>overlay = img.copy()<EOL>output = img.copy()<EOL>for (alpha, (x, y), rad3, (r_color, g_color, b_color)) in circles:<EOL><INDENT>cv2.circle(overlay, (x, y), rad3, (r_color, g_color, b_color), -<NUM_LIT:1>)<EOL>cv2.addWeighted(overlay, alpha, output, <NUM_LIT:1> - alpha, <NUM_LIT:0>, output)<EOL><DEDENT>point = (int(flare_center_x), int(flare_center_y))<EOL>overlay = output.copy()<EOL>num_times = src_radius // <NUM_LIT:10><EOL>alpha = np.linspace(<NUM_LIT:0.0>, <NUM_LIT:1>, num=num_times)<EOL>rad = np.linspace(<NUM_LIT:1>, src_radius, num=num_times)<EOL>for i in range(num_times):<EOL><INDENT>cv2.circle(overlay, point, int(rad[i]), src_color, -<NUM_LIT:1>)<EOL>alp = alpha[num_times - i - <NUM_LIT:1>] * alpha[num_times - i - <NUM_LIT:1>] * alpha[num_times - i - <NUM_LIT:1>]<EOL>cv2.addWeighted(overlay, alp, output, <NUM_LIT:1> - alp, <NUM_LIT:0>, output)<EOL><DEDENT>image_rgb = output<EOL>if needs_float:<EOL><INDENT>image_rgb = to_float(image_rgb, max_value=<NUM_LIT:255>)<EOL><DEDENT>return image_rgb<EOL>
Add sun flare.

    From https://github.com/UjjwalSaxena/Automold--Road-Augmentation-Library

    Args:
        img (np.array):
        flare_center_x (float):
        flare_center_y (float):
        src_radius:
        src_color (int, int, int):
        circles (list):

    Returns: