code: def test_compute_ngram_scores(
      candidate, reference, n, expected_precision, expected_recall
  ):
      scores = compute_ngram_scores(candidate, reference, n=n)
      assert pytest.approx(scores.precision()) == expected_precision
      assert pytest.approx(scores.recall()) == expected_recall
  
imports: import os
  import nltk
  import pytest
  import rouge
  import torch
  import ignite.distributed
  from ignite.exceptions import NotComputableError
  from ignite.metrics.nlp import Rouge
  from ignite.metrics.nlp.rouge import compute_ngram_scores, RougeL, RougeN
  from .None import CorpusForTest
label_desc: Use image node_id 1 for calling a global function with example usage: test_compute_ngram_scores(candidate, reference, n, expected_precision, expected_recall) without return types