code: def process_coco_annotations(
      coco_annotation_list: List[CocoAnnotation],
      slice_bbox: List[int],
      min_area_ratio,
  ) -> List[CocoAnnotation]:
      """Slices and filters given list of CocoAnnotation objects with given
      'slice_bbox' and 'min_area_ratio'.
  
      Args:
          coco_annotation_list (List[CocoAnnotation])
          slice_bbox (List[int]): Generated from `get_slice_bboxes`.
              Format for each slice bbox: [x_min, y_min, x_max, y_max].
          min_area_ratio (float): If the cropped annotation area to original
              annotation ratio is smaller than this value, the annotation is
              filtered out. Default 0.1.
  
      Returns:
          (List[CocoAnnotation]): Sliced annotations.
      """
  
      sliced_coco_annotation_list: List[CocoAnnotation] = []
      for coco_annotation in coco_annotation_list:
          if annotation_inside_slice(coco_annotation.json, slice_bbox):
              sliced_coco_annotation = (
                  coco_annotation.get_sliced_coco_annotation(slice_bbox)
              )
              if (
                  sliced_coco_annotation.area / coco_annotation.area
                  >= min_area_ratio
              ):
                  sliced_coco_annotation_list.append(
                      sliced_coco_annotation
                  )
      return sliced_coco_annotation_list
  
imports: import concurrent.futures
  import logging
  import os
  import time
  from pathlib import Path
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  from PIL import Image
  from shapely.errors import TopologicalError
  from tqdm import tqdm
  from sahi.annotation import BoundingBox, Mask
  from sahi.utils.coco import Coco, CocoAnnotation, CocoImage, create_coco_dict
  from sahi.utils.cv import IMAGE_EXTENSIONS_LOSSLESS, IMAGE_EXTENSIONS_LOSSY, read_image_as_pil
  from sahi.utils.file import load_json, save_json
label_desc: Use image node_id 3 for calling a global function with example usage: process_coco_annotations(coco_annotation_list, slice_bbox, min_area_ratio) and returns: sliced_coco_annotation_list