code: def overlay_stripes(
      image: Union[str, Image.Image],
      output_path: Optional[str] = None,
      line_width: float = 0.5,
      line_color: Tuple[int, int, int] = utils.WHITE_RGB_COLOR,
      line_angle: float = 0,
      line_density: float = 0.5,
      line_type: Optional[str] = "solid",
      line_opacity: float = 1.0,
      metadata: Optional[List[Dict[str, Any]]] = None,
      bboxes: Optional[List[Tuple]] = None,
      bbox_format: Optional[str] = None,
  ) -> Image.Image:
      """
      Overlay stripe pattern onto the image (by default, white horizontal
      stripes are overlaid)
  
      @param image: the path to an image or a variable of type PIL.Image.Image
          to be augmented
  
      @param output_path: the path in which the resulting image will be stored.
          If None, the resulting PIL Image will still be returned
  
      @param line_width: the width of individual stripes as a float value ranging
          from 0 to 1. Defaults to 0.5
  
      @param line_color: color of the overlaid stripes in RGB values
  
      @param line_angle: the angle of the stripes in degrees, ranging from
          -360° to 360°. Defaults to 0° or horizontal stripes
  
      @param line_density: controls the distance between stripes represented as a
          float value ranging from 0 to 1, with 1 indicating more densely spaced
          stripes. Defaults to 0.5
  
      @param line_type: the type of stripes. Current options include: dotted,
          dashed, and solid. Defaults to solid
  
      @param line_opacity: the opacity of the stripes, ranging from 0 to 1 with
          1 being opaque. Defaults to 1.0
  
      @param metadata: if set to be a list, metadata about the function execution
          including its name, the source & dest width, height, etc. will be appended
          to the inputted list. If set to None, no metadata will be appended or returned
  
      @param bboxes: a list of bounding boxes can be passed in here if desired. If
          provided, this list will be modified in place such that each bounding box is
          transformed according to this function
  
      @param bbox_format: signifies what bounding box format was used in `bboxes`. Must
          specify `bbox_format` if `bboxes` is provided. Supported bbox_format values are
          "pascal_voc", "pascal_voc_norm", "coco", and "yolo"
  
      @returns: the augmented PIL Image
      """
      assert (
          0.0 <= line_width <= 1.0
      ), "Line width must be a value in the range [0.0, 1.0]"
      assert (
          -360.0 <= line_angle <= 360.0
      ), "Line angle must be a degree in the range [360.0, 360.0]"
      assert (
          0.0 <= line_density <= 1.0
      ), "Line density must be a value in the range [0.0, 1.0]"
      assert (
          0.0 <= line_opacity <= 1.0
      ), "Line opacity must be a value in the range [0.0, 1.0]"
      assert (
          line_type in utils.SUPPORTED_LINE_TYPES
      ), "Stripe type not supported"
      utils.validate_rgb_color(line_color)
  
      image = imutils.validate_and_load_image(image)
  
      func_kwargs = imutils.get_func_kwargs(metadata, locals())
      src_mode = image.mode
  
      width, height = image.size
  
      binary_mask = imutils.compute_stripe_mask(
          src_w=width,
          src_h=height,
          line_width=line_width,
          line_angle=line_angle,
          line_density=line_density,
      )
  
      if line_type == "dotted":
          # To create dotted effect, multiply mask by stripes in perpendicular direction
          perpendicular_mask = imutils.compute_stripe_mask(
              src_w=width,
              src_h=height,
              line_width=line_width,
              line_angle=line_angle + 90,
              line_density=line_density,
          )
          binary_mask *= perpendicular_mask
      elif line_type == "dashed":
          # To create dashed effect, multiply mask by stripes with a larger line
          # width in perpendicular direction
          perpendicular_mask = imutils.compute_stripe_mask(
              src_w=width,
              src_h=height,
              line_width=0.7,
              line_angle=line_angle + 90,
              line_density=line_density,
          )
          binary_mask *= perpendicular_mask
  
      mask = Image.fromarray(np.uint8(binary_mask * line_opacity * 255))
  
      foreground = Image.new("RGB", image.size, line_color)
      aug_image = image.copy()  # to avoid modifying the input image
      aug_image.paste(foreground, (0, 0), mask=mask)
  
      imutils.get_metadata(
          metadata=metadata,
          function_name="overlay_stripes",
          aug_image=aug_image,
          **func_kwargs,
      )
  
      return imutils.ret_and_save_image(
          aug_image, output_path, src_mode
      )
  
imports: import io
  import math
  import os
  import pickle
  from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  from augly import utils
  from augly.image import utils
  from augly.image.utils.bboxes import spatial_bbox_helper
  from PIL import Image, ImageDraw, ImageEnhance, ImageFilter, ImageFont
label_desc: Use image node_id 21 for calling a global function with example usage: overlay_stripes(image, output_path, line_width, line_color, line_angle, line_density, line_type, line_opacity, metadata, bboxes, bbox_format) and returns: imutils