code: def __init__(self, datasets, sample_ratios=1):
      super(LanguagePairUpsamplingDataset, self).__init__(
          datasets, sample_ratios
      )
      if isinstance(sample_ratios, float):
          self.memoized_sizes = [
              self.size(idx) for idx in range(len(self))
          ]
      else:
          self.memoized_sizes = np.concatenate(
              [
                  np.tile(ds.src_sizes, sr)
                  for ds, sr in zip(self.datasets, self.sample_ratios)
              ]
          )
  
imports: import numpy
  from fairseq.data.concat_dataset import ConcatDataset
label_desc: Use image node_id 1 to create a new LanguagePairUpsamplingDataset object from inherited base classes: ConcatDataset with example: obj = LanguagePairUpsamplingDataset(datasets, sample_ratios)