code: def test_aupro(labels, preds, fpr_limit, expected_aupro):
      aupro = AUPRO(fpr_limit=fpr_limit)
      aupro.update(preds, labels)
      computed_aupro = aupro.compute()
  
      tmp_labels = [label.squeeze().numpy() for label in labels]
      tmp_preds = [pred.squeeze().numpy() for pred in preds]
      ref_aupro = torch.tensor(
          calculate_au_pro(
              tmp_labels, tmp_preds, integration_limit=fpr_limit
          )[0],
          dtype=torch.float,
      )
  
      TOL = 0.001
      assert torch.allclose(computed_aupro, expected_aupro, atol=TOL)
      assert torch.allclose(computed_aupro, ref_aupro, atol=TOL)
  
imports: import numpy
  import torch
  from anomalib.utils.metrics import AUPRO
  from tests.helpers.aupro_reference import calculate_au_pro
label_desc: Use image node_id 2 for calling a global function with example usage: test_aupro(labels, preds, fpr_limit, expected_aupro) without return types