code: def test_sequence_recall(self, device: str):
      recall = UnigramRecall()
      gold = torch.tensor(
          [[1, 2, 3], [2, 4, 8], [7, 1, 1]], device=device
      )
      predictions = torch.tensor(
          [
              [[1, 2, 3], [1, 2, -1]],
              [[2, 4, 8], [2, 5, 9]],
              [[-1, -1, -1], [7, 1, -1]],
          ],
          device=device,
      )
  
      recall(predictions, gold)
      actual_recall = recall.get_metric()["unigram_recall"]
      assert_allclose(actual_recall, 1)
  
file_path: allennlp/tests/training/metrics/unigram_recall_test.py
imports: from typing import Any, Dict, List, Tuple, Union
  import torch
  from torch.testing import assert_allclose
  from allennlp.common.testing import AllenNlpTestCase, multi_device, global_distributed_metric, run_distributed_test
  from allennlp.training.metrics import UnigramRecall
label_desc: Use image node_id 1 for calling the UnigramRecallTest obj's underlying member method code with example usage: obj.test_sequence_recall(device) without return types