class_docstr: The `CombinedStreamingDataset` enables to stream data from multiple StreamingDataset with the sampling ratio of
  your choice.
  
  Addtionally, the `CombinedStreamingDataset` keeps track of the number of
  samples fetched to enable resumability of the datasets.
class_docstr_tok: ["The","`","CombinedStreamingDataset","`","enables","to","stream","data","from","multiple","StreamingDataset","with","the","sampling","ratio","of","your","choice",".","Addtionally",",","the","`","CombinedStreamingDataset","`","keeps","track","of","the","number","of","samples","fetched","to","enable","resumability","of","the","datasets","."]
code: def __init__(
      self,
      datasets: List[StreamingDataset],
      seed: int = 42,
      weights: Optional[Sequence[float]] = None,
  ) -> None:
      self._seed = seed
      self._datasets = datasets
      self._weights = weights
      num_datasets = len(datasets)
  
      if weights is None:
          # Inversely weighted based on length
          self._weights = [1 / float(num_datasets)] * num_datasets
      else:
          self._weights = [w / sum(weights) for w in weights]
  
      self._iterator: Optional[_CombinedDatasetIterator] = None
  
file_path: pytorch-lightning/src/lightning/data/streaming/combined.py
imports: import random
  from typing import Any, Dict, Iterator, List, Optional, Sequence
  from torch.utils.data import IterableDataset
  from lightning.data.streaming.dataset import StreamingDataset
label_desc: Use image node_id 1 to create a new CombinedStreamingDataset object from inherited base classes: IterableDataset with example: obj = CombinedStreamingDataset(datasets, seed, weights)