code: def _get_paired_iou(
      pairwise_iou: torch.Tensor,
      match_iou_threshold: float = 0.5,
      device: str | torch.device = "cpu",
  ) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
      if match_iou_threshold >= 0.5:
          pairwise_iou[pairwise_iou <= match_iou_threshold] = 0.0
          paired_true, paired_pred = (
              torch.nonzero(pairwise_iou)[:, 0],
              torch.nonzero(pairwise_iou)[:, 1],
          )
          paired_iou = pairwise_iou[paired_true, paired_pred]
          paired_true += 1
          paired_pred += 1
  
          return paired_iou, paired_true, paired_pred
  
      pairwise_iou = pairwise_iou.cpu().numpy()
      paired_true, paired_pred = linear_sum_assignment(-pairwise_iou)
      paired_iou = pairwise_iou[paired_true, paired_pred]
      paired_true = torch.as_tensor(
          list(paired_true[paired_iou > match_iou_threshold] + 1),
          device=device,
      )
      paired_pred = torch.as_tensor(
          list(paired_pred[paired_iou > match_iou_threshold] + 1),
          device=device,
      )
      paired_iou = paired_iou[paired_iou > match_iou_threshold]
  
      return paired_iou, paired_true, paired_pred
  
file_path: MONAI/monai/metrics/panoptic_quality.py
imports: from __future__ import annotations
  from collections.abc import Sequence
  import torch
  from monai.metrics.metric import CumulativeIterationMetric
  from monai.metrics.utils import do_metric_reduction, remap_instance_id
  from monai.utils import MetricReduction, ensure_tuple, optional_import
label_desc: Use image node_id 4 for calling a global function with example usage: _get_paired_iou(pairwise_iou, match_iou_threshold, device) and returns: paired_iou,  paired_true,  paired_pred, paired_iou,  paired_true,  paired_pred