code: def test_multilingual_translation(self):
      model = MBartForConditionalGeneration.from_pretrained(
          "facebook/mbart-large-50-many-to-many-mmt"
      )
      tokenizer = MBart50TokenizerFast.from_pretrained(
          "facebook/mbart-large-50-many-to-many-mmt"
      )
  
      translator = pipeline(
          task="translation", model=model, tokenizer=tokenizer
      )
      # Missing src_lang, tgt_lang
      with self.assertRaises(ValueError):
          translator("This is a test")
  
      outputs = translator(
          "This is a test", src_lang="en_XX", tgt_lang="ar_AR"
      )
      self.assertEqual(outputs, [{"translation_text": "هذا إختبار"}])
  
      outputs = translator(
          "This is a test", src_lang="en_XX", tgt_lang="hi_IN"
      )
      self.assertEqual(
          outputs, [{"translation_text": "यह एक परीक्षण है"}]
      )
  
      # src_lang, tgt_lang can be defined at pipeline call time
      translator = pipeline(
          task="translation",
          model=model,
          tokenizer=tokenizer,
          src_lang="en_XX",
          tgt_lang="ar_AR",
      )
      outputs = translator("This is a test")
      self.assertEqual(outputs, [{"translation_text": "هذا إختبار"}])
  
file_path: transformers/tests/pipelines/test_pipelines_translation.py
imports: import unittest
  import pytest
  from transformers import MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, MBart50TokenizerFast, MBartConfig, MBartForConditionalGeneration, TranslationPipeline, pipeline
  from transformers.testing_utils import is_pipeline_test, require_tf, require_torch, slow
  from .test_pipelines_common import ANY
label_desc: Use image node_id 2 for calling the TranslationNewFormatPipelineTests obj's underlying member method code with example usage: obj.test_multilingual_translation() without return types