code: def calculate_au_pro(
      gts, predictions, integration_limit=0.3, num_thresholds=100
  ):
      """
      Compute the area under the PRO curve for a set of ground truth images and corresponding anomaly images.
      Args:
          gts:         List of tensors that contain the ground truth images for a single dataset object.
          predictions: List of tensors containing anomaly images for each ground truth image.
          integration_limit:    Integration limit to use when computing the area under the PRO curve.
          num_thresholds:       Number of thresholds to use to sample the area under the PRO curve.
      Returns:
          au_pro:    Area under the PRO curve computed up to the given integration limit.
          pro_curve: PRO curve values for localization (fpr,pro).
      """
      # Compute the PRO curve.
      pro_curve = compute_pro(
          anomaly_maps=predictions,
          ground_truth_maps=gts,
          num_thresholds=num_thresholds,
      )
  
      # Compute the area under the PRO curve.
      au_pro = trapezoid(
          pro_curve[0], pro_curve[1], x_max=integration_limit
      )
      au_pro /= integration_limit
  
      # Return the evaluation metrics.
      return au_pro, pro_curve
  
file_path: anomalib/tests/helpers/aupro_reference.py
imports: from bisect import bisect
  import numpy
  from scipy.ndimage.measurements import label
label_desc: Use image node_id 4 for calling a global function with example usage: calculate_au_pro(gts, predictions, integration_limit, num_thresholds) and returns: au_pro,  pro_curve