code: def test_compute_recall_at_k(self, ranks, iou_thresholds, expected):
      ground_truth_segments = [
          np.array([10, 20], dtype=np.float32),
          np.array([30, 40], dtype=np.float32),
          np.array([50, 60], dtype=np.float32),
          np.array([70, 70.5], dtype=np.float32),
      ]
      predicted_segments = [
          np.array(
              [[11, 19], [15, 25], [30, 35], [40, 45]], dtype=np.float32
          ),
          np.array(
              [[31, 39], [32, 38], [35, 40], [20, 30]], dtype=np.float32
          ),
          np.array(
              [[51, 59], [52, 58], [55, 60], [60, 65]], dtype=np.float32
          ),
          np.array([], dtype=np.float32),
      ]
      predicted_scores = [
          np.array([0.9, 0.8, 0.7, 0.6]),
          np.array([0.6, 0.7, 0.8, 0.9]),
          np.array([0.9, 0.8, 0.7, 0.6]),
          np.array(
              [], dtype=np.float32
          ),  # no detections under low resolution.
      ]
      actual = metrics.compute_recall_at_k(
          ground_truth_segments,
          predicted_segments,
          predicted_scores,
          ranks,
          iou_thresholds,
      )
      scores_out = [score for _, score in actual.items()]
      self.assertAllClose(scores_out, expected)
  
file_path: scenic/scenic/projects/unloc/metrics_test.py
imports: from absl.testing import parameterized
  import numpy
  from scenic.projects.unloc import metrics
  import tensorflow
label_desc: Use image node_id 7 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_compute_recall_at_k(ranks, iou_thresholds, expected) without return types