code: def test_batch_fairseq_parity(self):
      self.tokenizer.src_lang = "en"
      self.tokenizer.tgt_lang = "fr"
  
      batch = self.tokenizer(
          self.src_text,
          text_target=self.tgt_text,
          padding=True,
          return_tensors="pt",
      )
  
      batch["decoder_input_ids"] = shift_tokens_right(
          batch["labels"],
          self.tokenizer.pad_token_id,
          self.tokenizer.eos_token_id,
      )
  
      for k in batch:
          batch[k] = batch[k].tolist()
      # batch = {k: v.tolist() for k,v in batch.items()}
      # fairseq batch: https://gist.github.com/sshleifer/cba08bc2109361a74ac3760a7e30e4f4
      # batch.decoder_inputs_ids[0][0] ==
      assert batch.input_ids[1][0] == EN_CODE
      assert batch.input_ids[1][-1] == 2
      assert batch.labels[1][0] == FR_CODE
      assert batch.labels[1][-1] == 2
      assert batch.decoder_input_ids[1][:2] == [2, FR_CODE]
  
imports: import tempfile
  import unittest
  from pathlib import Path
  from shutil import copyfile
  from transformers import M2M100Tokenizer, is_torch_available
  from transformers.testing_utils import get_tests_dir, nested_simplify, require_sentencepiece, require_tokenizers, require_torch, slow
  from transformers.utils import is_sentencepiece_available
  from ...test_tokenization_common import TokenizerTesterMixin
label_desc: Use image node_id 7 for calling the M2M100TokenizerIntegrationTest obj's underlying member method code with example usage: obj.test_batch_fairseq_parity() without return types