code: def test_filter_top_predictions():
      labels = ["test1", "test2", "test1", "test2", "test2"]
      boxes = torch.ones(5, 4)
      scores = torch.tensor([5.0, 4, 3, 2, 1])
      for i in range(5):
          boxes[i] *= i
  
      preds = filter_top_predictions(labels, boxes, scores)
  
      assert isinstance(preds, tuple) and len(preds) == 3
      # Correct labels
      assert len(preds[0]) == 2 and set(preds[0]) == {"test1", "test2"}
  
      # Correct box coordinates
      assert {preds[1][0][0].item(), preds[1][1][0].item()} == {0, 1}
  
      # Correct scores
      assert {preds[2][0].item(), preds[2][1].item()} == {5, 4}
  
file_path: detecto/detecto/tests/test_utils.py
imports: import os
  import pandas
  import pytest
  import torch
  import torchvision
  from .helpers import get_image
  from detecto.utils import *
  from detecto.utils import _is_iterable
label_desc: Use image node_id 1 for calling a global function with example usage: test_filter_top_predictions() without return types