def has_box_overlap(box, boxes, max_iou=0.3):
  """Check if bounding box overlaps with list of other boxes.

  Args:
    box (Box): Bounding box.
    boxes (List[Box]): List of other boxes.
    max_iou (float, optional): Return true if intersection over union
      between box and any box in boxes is larger than this value. Must
      be a value in [0, 1] (larger means more occlusion is allowed).

  Returns:
    output (bool): True if box overlaps with any box in boxes, False
      otherwise.
  """
  box_area = (box.x1 - box.x0) * (box.y1 - box.y0)
  for other_box in boxes:
    other_area = (other_box.x1 - other_box.x0) * (other_box.y1 - other_box.y0)

    intersection_x0 = max(box.x0, other_box.x0)
    intersection_y0 = max(box.y0, other_box.y0)

    intersection_x1 = min(box.x1, other_box.x1)
    intersection_y1 = min(box.y1, other_box.y1)

    intersection_area = ((intersection_x1 - intersection_x0) *
                         (intersection_y1 - intersection_y0))
    intersection_area = max(0, intersection_area)

    denominator = float(box_area + other_area - intersection_area)
    iou = intersection_area / denominator if denominator > 0.0 else 1.0
    if iou > max_iou:
      return True
  return False