code: def plot_class_size_distributions(
      labels,
      predictions,
      class_names=None,
      class_to_show=MAX_CLASS_TO_SHOW,
  ):
      """
      Plots the size distributions for bounding boxes for each class.
  
      This plot 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.
  
      class_names: optional
          Optional 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 plotted.
  
      class_to_show: optional
          The number of classes to show in the plots. Classes over `class_to_show` are hidden. If this argument is provided, then the classes are sorted by the number of instances in the dataset.
          Defaults to `MAX_CLASS_TO_SHOW` which is set to 10.
      """
      try:
          import matplotlib.pyplot as plt
      except ImportError as e:
          raise ImportError(
              "This functionality requires matplotlib. Install it via: `pip install matplotlib`"
          )
  
      lab_boxes, pred_boxes = bounding_box_size_distribution(
          labels,
          predictions,
          class_names=class_names,
          sort=True if class_to_show is not None else False,
      )
  
      for i, c in enumerate(lab_boxes.keys()):
          if i >= class_to_show:
              break
          fig, axs = plt.subplots(1, 2, figsize=(10, 5))
          fig.suptitle(
              f"Size distributions for bounding box for class {c}"
          )
          for i, l in enumerate([lab_boxes, pred_boxes]):
              axs[i].hist(l[c], bins="auto")
              axs[i].set_xlabel("box area (pixels)")
              axs[i].set_ylabel("count")
              axs[i].set_title("annotated" if i == 0 else "predicted")
  
          plt.show()
  
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 5 for calling a global function with example usage: plot_class_size_distributions(labels, predictions, class_names, class_to_show) without return types