code: def test_call_works(
      self,
      banned_words: Sequence[str],
      expected_translations: Sequence[str],
  ) -> None:
      text_encoder = self.tokenizer.create_raw_encoder(device=device)
  
      banned_seqs = [text_encoder(b) for b in banned_words]
  
      generator = BeamSearchSeq2SeqGenerator(
          self.model,
          step_processors=[BannedSequenceProcessor(banned_seqs)],
      )
  
      translator = TextTranslator(
          generator,
          self.tokenizer,
          source_lang="eng_Latn",
          target_lang="spa_Latn",
      )
  
      texts, _ = translator.batch_translate(BANNED_ENG_SENTENCES)
  
      assert texts == expected_translations
  
file_path: fairseq2/tests/integration/generation/test_step_processor.py
imports: from typing import ClassVar, Final, Sequence
  import pytest
  import torch
  from fairseq2.data.text import TextTokenizer
  from fairseq2.generation import BannedSequenceProcessor, BeamSearchSeq2SeqGenerator, TextTranslator
  from fairseq2.models.encoder_decoder import EncoderDecoderModel
  from fairseq2.models.nllb import load_nllb_model, load_nllb_tokenizer
  from tests.common import device
label_desc: Use image node_id 3 for calling the TestBannedSequenceProcessor obj's underlying member method code with example usage: obj.test_call_works(banned_words, expected_translations) without return types