code: def _prune_by_threshold(
      predictions: List[np.ndarray],
      threshold: float,
      verbose: bool = True,
  ) -> List[np.ndarray]:
      """Removes predicted bounding boxes from predictions who's pred_prob is below the cuttoff threshold."""
  
      predictions_copy = copy.deepcopy(predictions)
      num_ann_to_zero = 0
      total_ann = 0
      for idx_predictions, prediction in enumerate(predictions_copy):
          for idx_class, class_prediction in enumerate(prediction):
              filtered_class_prediction = class_prediction[
                  class_prediction[:, -1] >= threshold
              ]
              if len(class_prediction) > 0:
                  total_ann += 1
                  if len(filtered_class_prediction) == 0:
                      num_ann_to_zero += 1
  
              predictions_copy[idx_predictions][
                  idx_class
              ] = filtered_class_prediction
  
      p_ann_pruned = (
          total_ann and num_ann_to_zero / total_ann or 0
      )  # avoid division by zero
      if p_ann_pruned > MAX_ALLOWED_BOX_PRUNE:
          warnings.warn(
              f"Pruning with threshold=={threshold} prunes {p_ann_pruned}% labels. Consider lowering the threshold.",
              UserWarning,
          )
      if verbose:
          print(
              f"Pruning {num_ann_to_zero} predictions out of {total_ann} using threshold=={threshold}. These predictions are no longer considered as potential candidates for identifying label issues as their similarity with the given labels is no longer considered."
          )
      return predictions_copy
  
imports: import warnings
  from cleanlab.internal.constants import ALPHA, CUSTOM_SCORE_WEIGHT_BADLOC, CUSTOM_SCORE_WEIGHT_OVERLOOKED, CUSTOM_SCORE_WEIGHT_SWAP, EUC_FACTOR, HIGH_PROBABILITY_THRESHOLD, LOW_PROBABILITY_THRESHOLD, MAX_ALLOWED_BOX_PRUNE, TINY_VALUE, TEMPERATURE, LABEL_OVERLAP_THRESHOLD
  import copy
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, TypeVar
  import numpy
  from cleanlab.internal.object_detection_utils import softmin1d, assert_valid_aggregation_weights, assert_valid_inputs
label_desc: Use image node_id 5 for calling a global function with example usage: _prune_by_threshold(predictions, threshold, verbose) and returns: predictions_copy