code: def bounding_box_size_distribution(
      labels=None,
      predictions=None,
      *,
      auxiliary_inputs=None,
      class_names: Optional[Dict[Any, Any]] = None,
      sort: bool = False,
  ) -> Tuple[Dict[Any, List], Dict[Any, List]]:
      """Return the distribution over sizes of annotated and predicted bounding boxes across the dataset, broken down by each class.
  
      This method can help you find annotated/predicted boxes for a particular class that are abnormally big/small.
  
      Parameters
      ----------
      labels:
          Annotated boxes and class labels in the original dataset, which may contain some errors.
          Refer to documentation for this argument in :py:func:`object_counts_per_image <cleanlab.object_detection.summary.object_counts_per_image>` for further details.
  
      predictions:
          Predictions output by a trained object detection model.
          Refer to documentation for this argument in :py:func:`object_counts_per_image <cleanlab.object_detection.summary.object_counts_per_image>` for further details.
  
      auxiliary_inputs: optional
          Auxiliary inputs to be used in the computation of counts.
          Refer to documentation for this argument in :py:func:`object_counts_per_image <cleanlab.object_detection.summary.object_counts_per_image>` for further details.
  
      class_names: optional
          A dictionary mapping one-hot-encoded class labels back to their original class names in the format ``{"integer-label": "original-class-name"}``.
          You can use this argument to control the classes for which the size distribution is computed.
  
      sort: bool
          If True, the returned dictionaries are sorted by the number of instances of each class in the dataset in descending order.
  
      Returns
      -------
      bbox_sizes: Tuple[Dict[Any, List], Dict[Any, List]]
          A tuple containing two dictionaries. Each maps each class label to a list of the sizes of annotated bounding boxes for that class in the label and prediction datasets, respectively.
      """
      if auxiliary_inputs is None:
          auxiliary_inputs = _get_valid_inputs_for_compute_scores(
              ALPHA, labels, predictions
          )
  
      lab_area: Dict[Any, list] = collections.defaultdict(list)
      pred_area: Dict[Any, list] = collections.defaultdict(list)
      for sample in auxiliary_inputs:
          _get_bbox_areas(
              sample["lab_labels"],
              sample["lab_bboxes"],
              lab_area,
              class_names,
          )
          _get_bbox_areas(
              sample["pred_labels"],
              sample["pred_bboxes"],
              pred_area,
              class_names,
          )
  
      if sort:
          lab_area = dict(
              sorted(lab_area.items(), key=lambda x: -len(x[1]))
          )
          pred_area = dict(
              sorted(pred_area.items(), key=lambda x: -len(x[1]))
          )
  
      return lab_area, pred_area
  
imports: from multiprocessing import Pool
  from typing import Optional, Any, Dict, Tuple, Union, List, TYPE_CHECKING, TypeVar, DefaultDict
  import numpy
  import collections
  from cleanlab.internal.constants import MAX_CLASS_TO_SHOW, ALPHA, EPSILON, TINY_VALUE
  from cleanlab.object_detection.filter import _filter_by_class, _calculate_true_positives_false_positives
  from cleanlab.object_detection.rank import _get_valid_inputs_for_compute_scores, _separate_prediction, _separate_label, _get_prediction_type
  from cleanlab.internal.object_detection_utils import bbox_xyxy_to_xywh
label_desc: Use image node_id 2 for calling a global function with example usage: bounding_box_size_distribution(labels, predictions) and returns: lab_area,  pred_area