code: def _sacrebleu_fn(
      preds: Sequence[str],
      targets: Sequence[Sequence[str]],
      tokenize: str,
      lowercase: bool,
  ) -> Tensor:
      sacrebleu_fn = BLEU(tokenize=tokenize, lowercase=lowercase)
      # Sacrebleu expects different format of input
      targets = [
          [target[i] for target in targets]
          for i in range(len(targets[0]))
      ]
      sacrebleu_score = (
          sacrebleu_fn.corpus_score(preds, targets).score / 100
      )
      return tensor(sacrebleu_score)
  
file_path: torchmetrics/tests/unittests/text/test_sacre_bleu.py
imports: from functools import partial
  from typing import Sequence
  import pytest
  from torch import Tensor, tensor
  from torchmetrics.functional.text.sacre_bleu import AVAILABLE_TOKENIZERS, _TokenizersLiteral, sacre_bleu_score
  from torchmetrics.text.sacre_bleu import SacreBLEUScore
  from torchmetrics.utilities.imports import _SACREBLEU_AVAILABLE
  from unittests.text.helpers import TextTester
  from unittests.text.inputs import _inputs_multiple_references
label_desc: Use image node_id 1 for calling a global function with example usage: _sacrebleu_fn(preds, targets, tokenize, lowercase) and returns: tensor