code: def test_find_label_issues():
      auxiliary_inputs = _get_valid_inputs_for_compute_scores(
          ALPHA, labels, predictions
      )
      test_inputs = _get_valid_inputs_for_compute_scores_per_image(
          alpha=ALPHA, label=labels[0], prediction=predictions[0]
      )
  
      assert (
          test_inputs["pred_label_probs"]
          == auxiliary_inputs[0]["pred_label_probs"]
      ).all()
      per_class_scores = _get_per_class_ap(labels, predictions)
      for i in per_class_scores:
          per_class_scores[i] = 0.3
      lab_list = [_separate_label(label)[1] for label in labels]
      pred_list = [
          _separate_prediction(pred)[1] for pred in predictions
      ]
      pred_dict = _process_class_list(pred_list, per_class_scores)
      lab_dict = _process_class_list(lab_list, per_class_scores)
  
      overlooked_scores_per_box = compute_overlooked_box_scores(
          alpha=ALPHA,
          high_probability_threshold=HIGH_PROBABILITY_THRESHOLD,
          auxiliary_inputs=auxiliary_inputs,
      )
  
      overlooked_scores_no_auxillary_inputs = (
          compute_overlooked_box_scores(
              alpha=ALPHA,
              high_probability_threshold=HIGH_PROBABILITY_THRESHOLD,
              labels=labels,
              predictions=predictions,
          )
      )
  
      for score, no_auxiliary_inputs_score in zip(
          overlooked_scores_per_box,
          overlooked_scores_no_auxillary_inputs,
      ):
          assert (
              score[~np.isnan(score)]
              == no_auxiliary_inputs_score[
                  ~np.isnan(no_auxiliary_inputs_score)
              ]
          ).all()
  
      overlooked_issues_per_box = _find_label_issues_per_box(
          overlooked_scores_per_box,
          pred_dict,
          OVERLOOKED_THRESHOLD_FACTOR,
      )
      overlooked_issues_per_image = _pool_box_scores_per_image(
          overlooked_issues_per_box
      )
      overlooked_issues = np.sum(overlooked_issues_per_image)
      assert (
          np.sum(overlooked_issues_per_image[5:]) == 4
      )  # check bad labels were detected correctly, one overlooked image overlap annotation
      assert overlooked_issues == 4
      badloc_scores_per_box = compute_badloc_box_scores(
          alpha=ALPHA,
          low_probability_threshold=LOW_PROBABILITY_THRESHOLD,
          auxiliary_inputs=auxiliary_inputs,
      )
  
      badloc_scores_no_auxillary_inputs = compute_badloc_box_scores(
          alpha=ALPHA,
          low_probability_threshold=LOW_PROBABILITY_THRESHOLD,
          labels=labels,
          predictions=predictions,
      )
  
      for score, no_auxiliary_inputs_score in zip(
          badloc_scores_per_box, badloc_scores_no_auxillary_inputs
      ):
          assert (score == no_auxiliary_inputs_score).all()
  
      badloc_issues_per_box = _find_label_issues_per_box(
          badloc_scores_per_box, lab_dict, BADLOC_THRESHOLD_FACTOR
      )
      badloc_issues_per_image = _pool_box_scores_per_image(
          badloc_issues_per_box
      )
      badloc_issues = np.sum(badloc_issues_per_image)
      assert (
          np.sum(badloc_issues_per_image[NUM_GOOD_SAMPLES:]) == 2
      )  # check bad labels were detected correctly, only two images have badloc issues that overlap
      assert badloc_issues == 2
  
      swap_scores_per_box = compute_swap_box_scores(
          alpha=ALPHA,
          high_probability_threshold=HIGH_PROBABILITY_THRESHOLD,
          auxiliary_inputs=auxiliary_inputs,
      )
  
      swap_scores_no_auxillary_inputs = compute_swap_box_scores(
          alpha=ALPHA,
          high_probability_threshold=HIGH_PROBABILITY_THRESHOLD,
          labels=labels,
          predictions=predictions,
      )
  
      for score, no_auxiliary_inputs_score in zip(
          swap_scores_per_box, swap_scores_no_auxillary_inputs
      ):
          assert (score == no_auxiliary_inputs_score).all()
  
      swap_issues_per_box = _find_label_issues_per_box(
          swap_scores_per_box, lab_dict, SWAP_THRESHOLD_FACTOR
      )
      swap_issues_per_image = _pool_box_scores_per_image(
          swap_issues_per_box
      )
      swap_issues = np.sum(swap_issues_per_image)
      assert np.sum(swap_scores_per_box[2]) > np.sum(
          swap_scores_per_box[7]
      )
      assert swap_issues == 0
  
      label_issues = find_label_issues(labels, predictions)
      assert np.sum(label_issues) == np.sum(
          (
              swap_issues_per_image
              + badloc_issues_per_image
              + overlooked_issues_per_image
          )
          > 0
      )
      assert (
          np.sum(label_issues[NUM_GOOD_SAMPLES:]) == NUM_BAD_SAMPLES
      )  # check bad labels were detected correctly
      for i in per_class_scores:
          per_class_scores[i] = 0.7
      lab_list = [_separate_label(label)[1] for label in labels]
      lab_dict = _process_class_list(lab_list, per_class_scores)
      swap_issues_per_box = _find_label_issues_per_box(
          swap_scores_per_box, lab_dict, 1.0
      )
      swap_issues_per_image = _pool_box_scores_per_image(
          swap_issues_per_box
      )
      swap_issues = np.sum(swap_issues_per_image)
      assert swap_issues == 1
      assert np.sum(swap_issues_per_image[NUM_GOOD_SAMPLES:]) == 1
  
imports: import os
  from collections import Counter, defaultdict
  from multiprocessing import Pool
  import numpy
  from cleanlab.internal.constants import ALPHA, BADLOC_THRESHOLD_FACTOR, CUSTOM_SCORE_WEIGHT_BADLOC, CUSTOM_SCORE_WEIGHT_OVERLOOKED, CUSTOM_SCORE_WEIGHT_SWAP, HIGH_PROBABILITY_THRESHOLD, LOW_PROBABILITY_THRESHOLD, OVERLOOKED_THRESHOLD_FACTOR, SWAP_THRESHOLD_FACTOR, TEMPERATURE
  from cleanlab.internal.object_detection_utils import bbox_xyxy_to_xywh, softmax, softmin1d
  from cleanlab.object_detection.filter import _calculate_true_positives_false_positives, _filter_by_class, _find_label_issues, _find_label_issues_per_box, _get_per_class_ap, _pool_box_scores_per_image, _process_class_list, find_label_issues
  from cleanlab.object_detection.rank import _compute_label_quality_scores, _get_aggregation_weights, _get_dist_matrix, _get_min_pred_prob, _get_overlap_matrix, _get_prediction_type, _get_valid_inputs_for_compute_scores, _get_valid_inputs_for_compute_scores_per_image, _get_valid_score, _get_valid_subtype_score_params, _has_overlap, _prune_by_threshold, _separate_label, _separate_prediction, compute_badloc_box_scores, compute_overlooked_box_scores, compute_swap_box_scores, get_label_quality_scores, issues_from_scores
  from cleanlab.object_detection.summary import bounding_box_size_distribution, class_label_distribution, get_sorted_bbox_count_idxs, object_counts_per_image, plot_class_distribution, plot_class_size_distributions, visualize, calculate_per_class_metrics, get_average_per_class_confusion_matrix
  import copy
  import warnings
  import matplotlib.pyplot
  import numpy
  import pytest
  from PIL import Image
label_desc: Use image node_id 27 for calling a global function with example usage: test_find_label_issues() without return types