code: def pool_box_scores_per_image(
      box_scores: List[np.ndarray],
      *,
      temperature: Optional[float] = None,
  ) -> np.ndarray:
      """
      Aggregates all per-box scores within an image to return a single quality score for the image rather than for individual boxes within it.
      This is a helper method mostly for advanced users to be used with the outputs of :py:func:`object_detection.rank.compute_overlooked_box_scores <cleanlab.object_detection.rank.compute_overlooked_box_scores>`, :py:func:`object_detection.rank.compute_badloc_box_scores <cleanlab.object_detection.rank.compute_badloc_box_scores>`, and :py:func:`object_detection.rank.compute_swap_box_scores <cleanlab.object_detection.rank.compute_swap_box_scores>`.
  
      Score per image is between 0 and 1, with lower values indicating we are more confident image contains an error.
  
      Parameters
      ----------
      box_scores:
          A list of ``N`` numpy arrays where box_scores[i] is an array of badly located scores per box for the `i`-th image.
  
      temperature:
          Optional temperature of the softmin function where a lower value suggests softmin acts closer to min. If not provided, a good default is used.
  
      Returns
      ---------
      image_scores:
          An array of size ``N`` where ``image_scores[i]`` represents the score for the `i`-th image.
      """
  
      (
          alpha,
          low_probability_threshold,
          high_probability_threshold,
          temperature,
      ) = _get_valid_subtype_score_params(None, None, None, temperature)
  
      image_scores = np.empty(
          shape=[
              len(box_scores),
          ]
      )
      for idx, box_score in enumerate(box_scores):
          image_score = _get_valid_score(
              box_score, temperature=temperature
          )
          image_scores[idx] = image_score
      return image_scores
  
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 30 for calling a global function with example usage: pool_box_scores_per_image(box_scores) and returns: image_scores