docstr: Setup the task.
docstr_tok: ["Setup","the","task","."]
code: def setup_task(cls, cfg: MultilingualDenoisingConfig, **kwargs):
      """Setup the task."""
      paths = cfg.data.split(":")
      assert len(paths) > 0
      dictionary = Dictionary.load(os.path.join(paths[0], "dict.txt"))
  
      data_path = paths[0]
      if cfg.langs is None:
          languages = sorted(
              [
                  name
                  for name in os.listdir(data_path)
                  if os.path.isdir(os.path.join(data_path, name))
              ]
          )
      else:
          languages = cfg.langs.split(",")
  
      if cfg.add_lang_token:
          for lang in languages:
              dictionary.add_symbol("[{}]".format(lang))
  
      logger.info("dictionary: {} types".format(len(dictionary)))
      if not hasattr(cfg, "shuffle_instance"):
          cfg.shuffle_instance = False
      return cls(cfg, dictionary)
  
file_path: fairseq/fairseq/tasks/multilingual_denoising.py
imports: import logging
  import os
  from dataclasses import dataclass, field
  from typing import Optional
  import numpy
  from omegaconf import II
  from fairseq.data import AppendTokenDataset, ConcatDataset, DenoisingDataset, Dictionary, PrependTokenDataset, ResamplingDataset, SortDataset, TokenBlockDataset, data_utils
  from fairseq.data.encoders.utils import get_whole_word_mask
  from fairseq.tasks import register_task
  from .denoising import DenoisingConfig, DenoisingTask
label_desc: Use image node_id 1 for calling the MultilingualDenoisingTask obj's underlying member method code with example usage: obj.setup_task(cls, cfg) and returns: cls