code: def compute_badloc_box_scores(
      *,
      labels: Optional[List[Dict[str, Any]]] = None,
      predictions: Optional[List[np.ndarray]] = None,
      alpha: Optional[float] = None,
      low_probability_threshold: Optional[float] = None,
      auxiliary_inputs: Optional[List[AuxiliaryTypesDict]] = None,
  ) -> List[np.ndarray]:
      """
      Returns a numeric score for each annotated bounding box in each image, estimating the likelihood that the edges of this box are not badly located.
      This is a helper method mostly for advanced users.
  
      A badly located box error is when a box has the correct label but incorrect coordinates so it does not correctly encapsulate the entire object it is for.
      Score per high-confidence predicted bounding box is between 0 and 1, with lower values indicating boxes we are more confident were overlooked in the given label.
  
      Each image has ``L`` annotated bounding boxes and ``M`` predicted bounding boxes.
      A score is calculated for each predicted box in each of the ``N`` images in dataset.
  
      Note: ``M`` and ``L`` can be a different values for each image, as the number of annotated and predicted boxes varies.
  
      Parameters
      ----------
      labels:
          A list of ``N`` dictionaries such that ``labels[i]`` contains the given labels for the `i`-th image.
          Refer to documentation for this argument in :py:func:`find_label_issues <cleanlab.object_detection.filter.find_label_issues>` for further details.
  
      predictions:
          A list of ``N`` ``np.ndarray`` such that ``predictions[i]`` corresponds to the model predictions for the `i`-th image.
          Refer to documentation for this argument in :py:func:`find_label_issues <cleanlab.object_detection.filter.find_label_issues>` for further details.
  
      alpha:
          Optional weighting between IoU and Euclidean distance when calculating similarity between predicted and annotated boxes. High alpha means weighting IoU more heavily over Euclidean distance. If no alpha is provided, a good default is used.
  
      low_probability_threshold:
          Optional minimum probability threshold that determines which predicted boxes are considered when computing badly located scores. If not provided, a good default is used.
  
      auxiliary_inputs:
          Optional list of ``N`` dictionaries containing keys for sub-parts of label and prediction per image. Useful to minimize computation when computing multiple box scores for a single set of images. For the `i`-th image, `auxiliary_inputs[i]` should contain following keys:
  
         * pred_labels: np.ndarray
              Array of predicted classes for `i`-th image of shape ``(M,)``.
         * pred_label_probs: np.ndarray
              Array of predicted class probabilities for `i`-th image of shape ``(M,)``.
         * pred_bboxes: np.ndarray
              Array of predicted bounding boxes for `i`-th image of shape ``(M, 4)``.
         * lab_labels: np.ndarray
              Array of given label classed for `i`-th image of shape ``(L,)``.
         * lab_bboxes: np.ndarray
              Array of given label bounding boxes for `i`-th image of shape ``(L, 4)``.
         * similarity_matrix: np.ndarray
              Similarity matrix between labels and predictions `i`-th image.
         * min_possible_similarity: float
              Minimum possible similarity value greater than 0 between labels and predictions for the entire dataset.
      Returns
      ---------
      scores_badloc:
          A list of ``N`` numpy arrays where scores_badloc[i] is an array of size ``L`` badly located scores per annotated box for the `i`-th image.
      """
      (
          alpha,
          low_probability_threshold,
          high_probability_threshold,
          temperature,
      ) = _get_valid_subtype_score_params(
          alpha, low_probability_threshold, None, None
      )
      if auxiliary_inputs is None:
          auxiliary_inputs = _get_valid_inputs_for_compute_scores(
              alpha, labels, predictions
          )
  
      scores_badloc = []
      for auxiliary_input_dict in auxiliary_inputs:
          scores_badloc_per_box = _compute_badloc_box_scores_for_image(
              alpha=alpha,
              low_probability_threshold=low_probability_threshold,
              **auxiliary_input_dict,
          )
          scores_badloc.append(scores_badloc_per_box)
      return scores_badloc
  
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 27 for calling a global function with example usage: compute_badloc_box_scores() and returns: scores_badloc