@preserve_shape<EOL>def add_rain(img, slant, drop_length, drop_width, drop_color, blur_value, brightness_coefficient, rain_drops):
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>image = img.copy()<EOL>for (rain_drop_x0, rain_drop_y0) in rain_drops:<EOL><INDENT>rain_drop_x1 = rain_drop_x0 + slant<EOL>rain_drop_y1 = rain_drop_y0 + drop_length<EOL>cv2.line(image, (rain_drop_x0, rain_drop_y0), (rain_drop_x1, rain_drop_y1), drop_color, drop_width)<EOL><DEDENT>image = cv2.blur(image, (blur_value, blur_value))  <EOL>image_hls = cv2.cvtColor(image, cv2.COLOR_RGB2HLS).astype(np.float32)<EOL>image_hls[:, :, <NUM_LIT:1>] *= brightness_coefficient<EOL>image_rgb = cv2.cvtColor(image_hls.astype(np.uint8), cv2.COLOR_HLS2RGB)<EOL>if needs_float:<EOL><INDENT>image_rgb = to_float(image_rgb, max_value=<NUM_LIT:255>)<EOL><DEDENT>return image_rgb<EOL>
From https://github.com/UjjwalSaxena/Automold--Road-Augmentation-Library

Args:
    img (np.uint8):
    slant (int):
    drop_length:
    drop_width:
    drop_color:
    blur_value (int): rainy view are blurry
    brightness_coefficient (float): rainy days are usually shady
    rain_drops:

Returns: