code: def test_accumulation(preds, targets, exact_match, f1):
      """Tests for metric works with accumulation."""
      squad_metric = SQuAD()
      for pred, target in zip(preds, targets):
          squad_metric.update(preds=[pred], target=[target])
      metrics_score = squad_metric.compute()
  
      _assert_tensor(metrics_score["exact_match"])
      _assert_tensor(metrics_score["f1"])
      _assert_allclose(
          metrics_score["exact_match"],
          torch.mean(torch.tensor(exact_match)),
      )
      _assert_allclose(
          metrics_score["f1"], torch.mean(torch.tensor(f1))
      )
  
file_path: torchmetrics/tests/unittests/text/test_squad.py
imports: import os
  import pytest
  import torch
  import torch.distributed
  import torch.multiprocessing
  from torchmetrics.functional.text import squad
  from torchmetrics.text.squad import SQuAD
  from unittests.helpers.testers import _assert_allclose, _assert_tensor
  from unittests.text.inputs import _inputs_squad_batch_match, _inputs_squad_exact_match, _inputs_squad_exact_mismatch
label_desc: Use image node_id 2 for calling a global function with example usage: test_accumulation(preds, targets, exact_match, f1) without return types