class_docstr: A dataset that accepts as argument multiple datasets and then samples from them based on the specified 
  sampling technique.
  Args:
      datasets (list): A list of datasets to sample from.
      shuffle (bool): Whether to shuffle individual datasets. Only works with non-iterable datasets. 
          Defaults to True.
      sampling_technique (str): Sampling technique to choose which dataset to draw a sample from.
          Defaults to 'temperature'. Currently supports 'temperature', 'random' and 'round-robin'.
      sampling_temperature (int): Temperature value for sampling. Only used when sampling_technique = 'temperature'.
          Defaults to 5.
      sampling_scale: Gives you the ability to upsample / downsample the dataset. Defaults to 1.
      sampling_probabilities (list): Probability values for sampling. Only used when sampling_technique = 'random'.
      seed: Optional value to seed the numpy RNG.
      global_rank (int): Worker rank, used for partitioning map style datasets. Defaults to 0.
      world_size (int): Total number of processes, used for partitioning map style datasets. Defaults to 1.
code: def __iter__(self):
      worker_info = pt_data.get_worker_info()
      if worker_info is None:
          max_elements = self.length
          wid = 0
          wnum = 1
      else:
          wid = worker_info.id
          wnum = worker_info.num_workers
          max_elements = len(range(wid, self.length, wnum))
  
      if self.kind == "map":
          for idx in range(len(self.datasets)):
              start_idx = (
                  len(self.datasets[idx]) // self.world_size
              ) * self.global_rank
              end_idx = start_idx + (
                  len(self.datasets[idx]) // self.world_size
              )
              if self.global_rank == self.world_size - 1:
                  end_idx = len(self.datasets[idx])
              indices = range(start_idx + wid, end_idx, wnum)
              self.datasets[idx] = pt_data.Subset(
                  self.datasets[idx], indices
              )
  
      for idx, dataset in enumerate(self.datasets):
          iterable = self.get_iterable(dataset)
          self.iterables[idx] = iterable
  
      n = 0
      ind_gen = self.index_generator(
          self.datasets, **self.sampling_kwargs
      )
      while n < max_elements:
          n += 1
          try:
              ind = next(ind_gen)
          except StopIteration:
              return
          try:
              val = next(self.iterables[ind])
              if self.kind == "map":
                  val = self.datasets[ind][val]
              yield val
          except StopIteration:
              self.iterables[ind] = self.get_iterable(
                  self.datasets[ind]
              )
              n -= 1
  
imports: import io
  import logging
  from typing import Any, List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.utils.data
  from torch.utils.data import Dataset, IterableDataset
label_desc: Use image node_id 3 for calling the ConcatDataset obj's underlying member method code with example usage: obj.__iter__() without return types