code: def __init__(self, defn, sizes=None):
      super().__init__()
      self.defn = _flatten(defn)
      self.sizes = (
          [sizes] if not isinstance(sizes, (list, tuple)) else sizes
      )
  
      first = None
      for v in self.defn.values():
          if not isinstance(
              v,
              (
                  FairseqDataset,
                  torch.utils.data.Dataset,
              ),
          ):
              raise ValueError(
                  "Expected Dataset but found: {}".format(v.__class__)
              )
          first = first or v
          if len(v) > 0:
              assert len(v) == len(first), "dataset lengths must match"
  
      self._len = len(first)
  
file_path: fairseq/fairseq/data/nested_dictionary_dataset.py
imports: from collections import OrderedDict
  import torch
  from torch.utils.data.dataloader import default_collate
  from .None import FairseqDataset
label_desc: Use image node_id 1 to create a new NestedDictionaryDataset object from inherited base classes: FairseqDataset with example: obj = NestedDictionaryDataset(defn, sizes)