code: def bbox_sort(a, b, thresh):
      """
      a, b  - function receives two bounding bboxes
  
      thresh - the threshold takes into account how far two bounding bboxes differ in
      Y where thresh is the threshold we set for the
      minimum allowable difference in height between adjacent bboxes
      and sorts them by the X coordinate
      """
  
      bbox_a = a
      bbox_b = b
  
      if abs(bbox_a[1] - bbox_b[1]) <= thresh:
          return bbox_a[0] - bbox_b[0]
  
      return bbox_a[1] - bbox_b[1]
  
imports: import logging
  import os
  import time
  from typing import List, Optional
  from sahi.utils.import_utils import is_available
  from functools import cmp_to_key
  import numpy
  from tqdm import tqdm
  from sahi.auto_model import AutoDetectionModel
  from sahi.models.base import DetectionModel
  from sahi.postprocess.combine import GreedyNMMPostprocess, LSNMSPostprocess, NMMPostprocess, NMSPostprocess, PostprocessPredictions
  from sahi.prediction import ObjectPrediction, PredictionResult
  from sahi.slicing import slice_image
  from sahi.utils.coco import Coco, CocoImage
  from sahi.utils.cv import IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, crop_object_predictions, cv2, get_video_reader, read_image_as_pil, visualize_object_predictions
  from sahi.utils.file import Path, increment_path, list_files, save_json, save_pickle
  from sahi.utils.import_utils import check_requirements
label_desc: Use image node_id 3 for calling a global function with example usage: bbox_sort(a, b, thresh) and returns: unknown, unknown