code: def has_match(
      pred1: ObjectPrediction,
      pred2: ObjectPrediction,
      match_type: str = "IOU",
      match_threshold: float = 0.5,
  ) -> bool:
      if match_type == "IOU":
          threshold_condition = (
              calculate_bbox_iou(pred1, pred2) > match_threshold
          )
      elif match_type == "IOS":
          threshold_condition = (
              calculate_bbox_ios(pred1, pred2) > match_threshold
          )
      else:
          raise ValueError()
      return threshold_condition
  
imports: from collections.abc import Sequence
  from typing import List, Union
  import numpy
  import torch
  from sahi.annotation import BoundingBox, Category, Mask
  from sahi.prediction import ObjectPrediction
label_desc: Use image node_id 8 for calling a global function with example usage: has_match(pred1, pred2, match_type, match_threshold) and returns: threshold_condition