class_docstr: Stores multiple instances of FairseqDataset together.
  Unless batch_sample=True, requires each instance
  to be the same dataset, as the collate method needs to work on batches with
  samples from each dataset.
  
  Allows specifying a distribution over the datasets to use. Note that unlike
  MultiCorpusSampledDataset, this distribution allows sampling for each item,
  rather than on a batch level. Note that datasets with sampling probabilty
  of 0 will be skipped.
  
  Each time ordered_indices() is called, a new sample is generated with
  the specified distribution.
  
  Args:
      datasets: a OrderedDict of FairseqDataset instances.
      distribution: a List containing the probability of getting an utterance from
                      corresponding dataset
      seed: random seed for sampling the datsets
      sort_indices: if true, will sort the ordered indices by size
      batch_sample: if true, will ensure each batch is from a single dataset
class_docstr_tok: ["Stores","multiple","instances","of","FairseqDataset","together",".","Unless","batch_sample=True",",","requires","each","instance","to","be","the","same","dataset",",","as","the","collate","method","needs","to","work","on","batches","with","samples","from","each","dataset",".","Allows","specifying","a","distribution","over","the","datasets","to","use",".","Note","that","unlike","MultiCorpusSampledDataset",",","this","distribution","allows","sampling","for","each","item",",","rather","than","on","a","batch","level",".","Note","that","datasets","with","sampling","probabilty","of","0","will","be","skipped",".","Each","time","ordered_indices","(",")","is","called",",","a","new","sample","is","generated","with","the","specified","distribution",".","Args",":","datasets",":","a","OrderedDict","of","FairseqDataset","instances",".","distribution",":","a","List","containing","the","probability","of","getting","an","utterance","from","corresponding","dataset","seed",":","random","seed","for","sampling","the","datsets","sort_indices",":","if","true",",","will","sort","the","ordered","indices","by","size","batch_sample",":","if","true",",","will","ensure","each","batch","is","from","a","single","dataset"]
code: def num_tokens(self, index: int):
      index, key = self._map_index(index)
      return self.datasets[key].num_tokens(index)
  
imports: import asyncio
  import logging
  import time
  from collections import OrderedDict
  from typing import Dict, List, Optional
  import numpy
  from fairseq.data import data_utils
  from .None import FairseqDataset
label_desc: Use image node_id 8 for calling the MultiCorpusDataset obj's underlying member method code with example usage: obj.num_tokens(index) and returns: self