class_docstr: Translate from one (source) language to another (target) language.
  .. 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:
docstr: Load a given dataset split.
  
  Args:
      split (str): name of the split (e.g., train, valid, test)
code: def load_dataset(self, split, epoch=1, combine=False, **kwargs):
      """Load a given dataset split.
  
      Args:
          split (str): name of the split (e.g., train, valid, test)
      """
      paths = utils.split_paths(self.args.data)
      is_train = split == getattr(self.args, "train_subset", None)
      assert len(paths) > 0
      if not is_train:
          # if not training data set, use the first shard for valid and test
          paths = paths[:1]
      data_path = paths[0]
  
      # infer langcode
      src, tgt = self.args.source_lang, self.args.target_lang
  
      self.datasets[split] = load_langpair_dataset(
          data_path,
          split,
          src,
          self.src_dict,
          tgt,
          self.tgt_dict,
          combine=combine,
          dataset_impl=self.args.dataset_impl,
          upsample_primary=self.args.upsample_primary,
          left_pad_source=self.args.left_pad_source,
          left_pad_target=self.args.left_pad_target,
          max_source_positions=self.args.max_source_positions,
          max_target_positions=self.args.max_target_positions,
          load_alignments=self.args.load_alignments,
          truncate_source=self.args.truncate_source,
          num_buckets=self.args.num_batch_buckets,
          shuffle=(split != "test"),
          pad_to_multiple=self.args.required_seq_len_multiple,
          shard_iterator=self.shard_iterator,
          is_train=is_train,
      )
  
imports: import itertools
  import json
  import logging
  import os
  import shutil
  import subprocess
  from pathlib import Path
  from argparse import Namespace
  import numpy
  from fairseq import metrics, options, utils
  from fairseq.data import AppendTokenDataset, ConcatDataset, LanguagePairDataset, PrependTokenDataset, StripTokenDataset, TruncateDataset, data_utils, encoders, indexed_dataset
  import torch.distributed
  from fairseq.tasks import LegacyFairseqTask, register_task
  from fairseq.tasks.translation import TranslationTask
label_desc: Use image node_id 4 for calling the LSTranslationTask obj's underlying member method code with example usage: obj.load_dataset(split, epoch, combine) without return types