docstr: Wrap a :class:`~torch.utils.data.Dataset` and apply noise to the
  samples based on the supplied noising configuration.
  
  Args:
      src_dataset (~torch.utils.data.Dataset): dataset to wrap.
          to build self.src_dataset --
          a LanguagePairDataset with src dataset as the source dataset and
          None as the target dataset. Should NOT have padding so that
          src_lengths are accurately calculated by language_pair_dataset
          collate function.
          We use language_pair_dataset here to encapsulate the tgt_dataset
          so we can re-use the LanguagePairDataset collater to format the
          batches in the structure that SequenceGenerator expects.
      src_dict (~fairseq.data.Dictionary): source dictionary
      seed (int): seed to use when generating random noise
      noiser (WordNoising): a pre-initialized :class:`WordNoising`
          instance. If this is None, a new instance will be created using
          *noising_class* and *kwargs*.
      noising_class (class, optional): class to use to initialize a
          default :class:`WordNoising` instance.
      kwargs (dict, optional): arguments to initialize the default
          :class:`WordNoising` instance given by *noiser*.
docstr_tok: ["Wrap","a",":","class",":","`","~torch.utils.data.Dataset","`","and","apply","noise","to","the","samples","based","on","the","supplied","noising","configuration",".","Args",":","src_dataset","(","~torch.utils.data.Dataset",")",":","dataset","to","wrap",".","to","build","self.src_dataset","--","a","LanguagePairDataset","with","src","dataset","as","the","source","dataset","and","None","as","the","target","dataset",".","Should","NOT","have","padding","so","that","src_lengths","are","accurately","calculated","by","language_pair_dataset","collate","function",".","We","use","language_pair_dataset","here","to","encapsulate","the","tgt_dataset","so","we","can","re-use","the","LanguagePairDataset","collater","to","format","the","batches","in","the","structure","that","SequenceGenerator","expects",".","src_dict","(","~fairseq.data.Dictionary",")",":","source","dictionary","seed","(","int",")",":","seed","to","use","when","generating","random","noise","noiser","(","WordNoising",")",":","a","pre-initialized",":","class",":","`","WordNoising","`","instance",".","If","this","is","None",",","a","new","instance","will","be","created","using","*","noising_class","*","and","*","kwargs","*",".","noising_class","(","class",",","optional",")",":","class","to","use","to","initialize","a","default",":","class",":","`","WordNoising","`","instance",".","kwargs","(","dict",",","optional",")",":","arguments","to","initialize","the","default",":","class",":","`","WordNoising","`","instance","given","by","*","noiser","*","."]
code: def __init__(
      self,
      src_dataset,
      src_dict,
      seed,
      noiser=None,
      noising_class=UnsupervisedMTNoising,
      **kwargs,
  ):
      """
      Wrap a :class:`~torch.utils.data.Dataset` and apply noise to the
      samples based on the supplied noising configuration.
  
      Args:
          src_dataset (~torch.utils.data.Dataset): dataset to wrap.
              to build self.src_dataset --
              a LanguagePairDataset with src dataset as the source dataset and
              None as the target dataset. Should NOT have padding so that
              src_lengths are accurately calculated by language_pair_dataset
              collate function.
              We use language_pair_dataset here to encapsulate the tgt_dataset
              so we can re-use the LanguagePairDataset collater to format the
              batches in the structure that SequenceGenerator expects.
          src_dict (~fairseq.data.Dictionary): source dictionary
          seed (int): seed to use when generating random noise
          noiser (WordNoising): a pre-initialized :class:`WordNoising`
              instance. If this is None, a new instance will be created using
              *noising_class* and *kwargs*.
          noising_class (class, optional): class to use to initialize a
              default :class:`WordNoising` instance.
          kwargs (dict, optional): arguments to initialize the default
              :class:`WordNoising` instance given by *noiser*.
      """
      self.src_dataset = src_dataset
      self.src_dict = src_dict
      self.seed = seed
      self.noiser = (
          noiser
          if noiser is not None
          else noising_class(
              dictionary=src_dict,
              **kwargs,
          )
      )
      self.sizes = src_dataset.sizes
  
imports: import numpy
  import torch
  from fairseq.data import data_utils
label_desc: Use image node_id 1 to create a new NoisingDataset object from inherited base classes: torch.utils.data with example: obj = NoisingDataset(src_dataset, src_dict, seed, noiser, noising_class)