code: def crop_bboxes_helper(
      bbox: Tuple, x1: float, y1: float, x2: float, y2: float, **kwargs
  ) -> Tuple:
      """
      If part of the bbox was cropped out in the x-axis, the left/right side will now be
      0/1 respectively; otherwise the fraction x1 is cut off from the left & x2 from the
      right and we renormalize with the new width. Analogous for the y-axis
      """
      left_factor, upper_factor, right_factor, lower_factor = bbox
      new_w, new_h = x2 - x1, y2 - y1
      return (
          max(0, (left_factor - x1) / new_w),
          max(0, (upper_factor - y1) / new_h),
          min(1, 1 - (x2 - right_factor) / new_w),
          min(1, 1 - (y2 - lower_factor) / new_h),
      )
  
file_path: AugLy/augly/image/utils/bboxes.py
imports: import math
  from typing import Callable, List, Optional, Tuple
  import numpy
  from augly.image import utils
  from PIL import Image, ImageDraw
label_desc: Use image node_id 1 for calling a global function with example usage: crop_bboxes_helper(bbox, x1, y1, x2, y2) and returns: max,  max,  min,  min