class_docstr: Translate from one (source) language to another (target) language.
  
  Args:
      langs (List[str]): a list of languages that are being supported
      dicts (Dict[str, fairseq.data.Dictionary]): mapping from supported languages to their dictionaries
      training (bool): whether the task should be configured for training or not
  
  .. note::
  
      The translation task is compatible with :mod:`fairseq-train`,
      :mod:`fairseq-generate` and :mod:`fairseq-interactive`.
  
  The translation task provides the following additional command-line
  arguments:
  
  .. argparse::
      :ref: fairseq.tasks.translation_parser
      :prog:
class_docstr_tok: ["Translate","from","one","(","source",")","language","to","another","(","target",")","language",".","Args",":","langs","(","List","[","str","]",")",":","a","list","of","languages","that","are","being","supported","dicts","(","Dict","[","str",",","fairseq.data.Dictionary","]",")",":","mapping","from","supported","languages","to","their","dictionaries","training","(","bool",")",":","whether","the","task","should","be","configured","for","training","or","not","..","note",":",":","The","translation","task","is","compatible","with",":","mod",":","`","fairseq-train","`",",",":","mod",":","`","fairseq-generate","`","and",":","mod",":","`","fairseq-interactive","`",".","The","translation","task","provides","the","following","additional","command-line","arguments",":","..","argparse",":",":",":","ref",":","fairseq.tasks.translation_parser",":","prog",":"]
code: def __init__(self, args, langs, dicts, training):
      super().__init__(args)
      self.langs = langs
      self.dicts = dicts
      self.training = training
      if training:
          self.lang_pairs = args.lang_pairs
      else:
          self.lang_pairs = [
              "{}-{}".format(args.source_lang, args.target_lang)
          ]
      # eval_lang_pairs for multilingual translation is usually all of the
      # lang_pairs. However for other multitask settings or when we want to
      # optimize for certain languages we want to use a different subset. Thus
      # the eval_lang_pairs class variable is provided for classes that extend
      # this class.
      self.eval_lang_pairs = self.lang_pairs
      # model_lang_pairs will be used to build encoder-decoder model pairs in
      # models.build_model(). This allows multitask type of sub-class can
      # build models other than the input lang_pairs
      self.model_lang_pairs = self.lang_pairs
      self.source_langs = [d.split("-")[0] for d in self.lang_pairs]
      self.target_langs = [d.split("-")[1] for d in self.lang_pairs]
      self.check_dicts(self.dicts, self.source_langs, self.target_langs)
  
      self.sampling_method = SamplingMethod.build_sampler(args, self)
      self.data_manager = MultilingualDatasetManager.setup_data_manager(
          args, self.lang_pairs, langs, dicts, self.sampling_method
      )
  
imports: import datetime
  import logging
  import time
  import torch
  from fairseq.data import FairseqDataset, LanguagePairDataset, ListDataset, data_utils, iterators
  from fairseq.data.multilingual.multilingual_data_manager import MultilingualDatasetManager
  from fairseq.data.multilingual.sampling_method import SamplingMethod
  from fairseq.tasks import LegacyFairseqTask, register_task
  from fairseq.utils import FileContentsAction
label_desc: Use image node_id 2 to create a new TranslationMultiSimpleEpochTask object from inherited base classes: LegacyFairseqTask with example: obj = TranslationMultiSimpleEpochTask(args, langs, dicts, training)