code: def compute_stripe_mask(
      src_w: int,
      src_h: int,
      line_width: float,
      line_angle: float,
      line_density: float,
  ) -> np.ndarray:
      """
      Given stripe parameters such as stripe width, angle, and density, returns
      a binary mask of the same size as the source image indicating the location
      of stripes. This implementation is inspired by
      https://stackoverflow.com/questions/34043381/how-to-create-diagonal-stripe-patterns-and-checkerboard-patterns
      """
      line_angle *= math.pi / 180
      line_distance = (1 - line_density) * min(src_w, src_h)
  
      y_period = math.cos(line_angle) / line_distance
      x_period = math.sin(line_angle) / line_distance
      y_coord_range = np.arange(0, src_h) - src_h / 2
      x_coord_range = np.arange(0, src_w) - src_w / 2
      x_grid_coords, y_grid_coords = np.meshgrid(
          x_coord_range, y_coord_range
      )
  
      if (
          abs(line_angle) == math.pi / 2
          or abs(line_angle) == 3 * math.pi / 2
      ):
          # Compute mask for vertical stripes
          softmax_mask = (
              np.cos(2 * math.pi * x_period * x_grid_coords) + 1
          ) / 2
      elif line_angle == 0 or abs(line_angle) == math.pi:
          # Compute mask for horizontal stripes
          softmax_mask = (
              np.cos(2 * math.pi * y_period * y_grid_coords) + 1
          ) / 2
      else:
          # Compute mask for diagonal stripes
          softmax_mask = (
              np.cos(
                  2
                  * math.pi
                  * (
                      x_period * x_grid_coords
                      + y_period * y_grid_coords
                  )
              )
              + 1
          ) / 2
  
      binary_mask = (
          softmax_mask > (math.cos(math.pi * line_width) + 1) / 2
      )
  
      return binary_mask
  
file_path: AugLy/augly/image/utils/utils.py
imports: import functools
  import json
  import math
  import os
  from typing import List, Optional, Tuple, Union
  import numpy
  from augly import utils
  from PIL import Image
label_desc: Use image node_id 11 for calling a global function with example usage: compute_stripe_mask(src_w, src_h, line_width, line_angle, line_density) and returns: binary_mask