class_docstr: Iterable dataset to load CSV files and generate dictionary data.
  It is particularly useful when data come from a stream, inherits from PyTorch IterableDataset:
  https://pytorch.org/docs/stable/data.html?highlight=iterabledataset#torch.utils.data.IterableDataset.
  
  It also can be helpful when loading extremely big CSV files that can't read into memory directly,
  just treat the big CSV file as stream input, call `reset()` of `CSVIterableDataset` for every epoch.
  Note that as a stream input, it can't get the length of dataset.
  
  To effectively shuffle the data in the big dataset, users can set a big buffer to continuously store
  the loaded data, then randomly pick data from the buffer for following tasks.
  
  To accelerate the loading process, it can support multi-processing based on PyTorch DataLoader workers,
  every process executes transforms on part of every loaded data.
  Note: the order of output data may not match data source in multi-processing mode.
  
  It can load data from multiple CSV files and join the tables with additional `kwargs` arg.
  Support to only load specific columns.
  And it can also group several loaded columns to generate a new column, for example,
  set `col_groups={"meta": ["meta_0", "meta_1", "meta_2"]}`, output can be::
  
      [
          {"image": "./image0.nii", "meta_0": 11, "meta_1": 12, "meta_2": 13, "meta": [11, 12, 13]},
          {"image": "./image1.nii", "meta_0": 21, "meta_1": 22, "meta_2": 23, "meta": [21, 22, 23]},
      ]
  
  Args:
      src: if provided the filename of CSV file, it can be a str, URL, path object or file-like object to load.
          also support to provide iter for stream input directly, will skip loading from filename.
          if provided a list of filenames or iters, it will join the tables.
      chunksize: rows of a chunk when loading iterable data from CSV files, default to 1000. more details:
          https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html.
      buffer_size: size of the buffer to store the loaded chunks, if None, set to `2 x chunksize`.
      col_names: names of the expected columns to load. if None, load all the columns.
      col_types: `type` and `default value` to convert the loaded columns, if None, use original data.
          it should be a dictionary, every item maps to an expected column, the `key` is the column
          name and the `value` is None or a dictionary to define the default value and data type.
          the supported keys in dictionary are: ["type", "default"]. for example::
  
              col_types = {
                  "subject_id": {"type": str},
                  "label": {"type": int, "default": 0},
                  "ehr_0": {"type": float, "default": 0.0},
                  "ehr_1": {"type": float, "default": 0.0},
                  "image": {"type": str, "default": None},
              }
  
      col_groups: args to group the loaded columns to generate a new column,
          it should be a dictionary, every item maps to a group, the `key` will
          be the new column name, the `value` is the names of columns to combine. for example:
          `col_groups={"ehr": [f"ehr_{i}" for i in range(10)], "meta": ["meta_1", "meta_2"]}`
      transform: transform to apply on the loaded items of a dictionary data.
      shuffle: whether to shuffle all the data in the buffer every time a new chunk loaded.
      seed: random seed to initialize the random state for all the workers if `shuffle` is True,
          set `seed += 1` in every iter() call, refer to the PyTorch idea:
          https://github.com/pytorch/pytorch/blob/v1.10.0/torch/utils/data/distributed.py#L98.
      kwargs_read_csv: dictionary args to pass to pandas `read_csv` function. Default to ``{"chunksize": chunksize}``.
      kwargs: additional arguments for `pandas.merge()` API to join tables.
class_docstr_tok: ["Iterable","dataset","to","load","CSV","files","and","generate","dictionary","data",".","It","is","particularly","useful","when","data","come","from","a","stream",",","inherits","from","PyTorch","IterableDataset",":","https",":","\/\/pytorch.org\/docs\/stable\/data.html","?","highlight=iterabledataset","#","torch.utils.data.IterableDataset",".","It","also","can","be","helpful","when","loading","extremely","big","CSV","files","that","ca","n't","read","into","memory","directly",",","just","treat","the","big","CSV","file","as","stream","input",",","call","`","reset","(",")","`","of","`","CSVIterableDataset","`","for","every","epoch",".","Note","that","as","a","stream","input",",","it","ca","n't","get","the","length","of","dataset",".","To","effectively","shuffle","the","data","in","the","big","dataset",",","users","can","set","a","big","buffer","to","continuously","store","the","loaded","data",",","then","randomly","pick","data","from","the","buffer","for","following","tasks",".","To","accelerate","the","loading","process",",","it","can","support","multi-processing","based","on","PyTorch","DataLoader","workers",",","every","process","executes","transforms","on","part","of","every","loaded","data",".","Note",":","the","order","of","output","data","may","not","match","data","source","in","multi-processing","mode",".","It","can","load","data","from","multiple","CSV","files","and","join","the","tables","with","additional","`","kwargs","`","arg",".","Support","to","only","load","specific","columns",".","And","it","can","also","group","several","loaded","columns","to","generate","a","new","column",",","for","example",",","set","`","col_groups=","{","``","meta","''",":","[","``","meta_0","''",",","``","meta_1","''",",","``","meta_2","''","]","}","`",",","output","can","be",":",":","[","{","``","image","''",":","``",".\/image0.nii","''",",","``","meta_0","''",":","11",",","``","meta_1","''",":","12",",","``","meta_2","''",":","13",",","``","meta","''",":","[","11",",","12",",","13","]","}",",","{","``","image","''",":","``",".\/image1.nii","''",",","``","meta_0","''",":","21",",","``","meta_1","''",":","22",",","``","meta_2","''",":","23",",","``","meta","''",":","[","21",",","22",",","23","]","}",",","]","Args",":","src",":","if","provided","the","filename","of","CSV","file",",","it","can","be","a","str",",","URL",",","path","object","or","file-like","object","to","load",".","also","support","to","provide","iter","for","stream","input","directly",",","will","skip","loading","from","filename",".","if","provided","a","list","of","filenames","or","iters",",","it","will","join","the","tables",".","chunksize",":","rows","of","a","chunk","when","loading","iterable","data","from","CSV","files",",","default","to","1000.","more","details",":","https",":","\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.read_csv.html",".","buffer_size",":","size","of","the","buffer","to","store","the","loaded","chunks",",","if","None",",","set","to","`","2","x","chunksize","`",".","col_names",":","names","of","the","expected","columns","to","load",".","if","None",",","load","all","the","columns",".","col_types",":","`","type","`","and","`","default","value","`","to","convert","the","loaded","columns",",","if","None",",","use","original","data",".","it","should","be","a","dictionary",",","every","item","maps","to","an","expected","column",",","the","`","key","`","is","the","column","name","and","the","`","value","`","is","None","or","a","dictionary","to","define","the","default","value","and","data","type",".","the","supported","keys","in","dictionary","are",":","[","``","type","''",",","``","default","''","]",".","for","example",":",":","col_types","=","{","``","subject_id","''",":","{","``","type","''",":","str","}",",","``","label","''",":","{","``","type","''",":","int",",","``","default","''",":","0","}",",","``","ehr_0","''",":","{","``","type","''",":","float",",","``","default","''",":","0.0","}",",","``","ehr_1","''",":","{","``","type","''",":","float",",","``","default","''",":","0.0","}",",","``","image","''",":","{","``","type","''",":","str",",","``","default","''",":","None","}",",","}","col_groups",":","args","to","group","the","loaded","columns","to","generate","a","new","column",",","it","should","be","a","dictionary",",","every","item","maps","to","a","group",",","the","`","key","`","will","be","the","new","column","name",",","the","`","value","`","is","the","names","of","columns","to","combine",".","for","example",":","`","col_groups=","{","``","ehr","''",":","[","f","''","ehr_","{","i","}","''","for","i","in","range","(","10",")","]",",","``","meta","''",":","[","``","meta_1","''",",","``","meta_2","''","]","}","`","transform",":","transform","to","apply","on","the","loaded","items","of","a","dictionary","data",".","shuffle",":","whether","to","shuffle","all","the","data","in","the","buffer","every","time","a","new","chunk","loaded",".","seed",":","random","seed","to","initialize","the","random","state","for","all","the","workers","if","`","shuffle","`","is","True",",","set","`","seed","+=","1","`","in","every","iter","(",")","call",",","refer","to","the","PyTorch","idea",":","https",":","\/\/github.com\/pytorch\/pytorch\/blob\/v1.10.0\/torch\/utils\/data\/distributed.py","#","L98",".","kwargs_read_csv",":","dictionary","args","to","pass","to","pandas","`","read_csv","`","function",".","Default","to","``","{","``","chunksize","''",":","chunksize","}","``",".","kwargs",":","additional","arguments","for","`","pandas.merge","(",")","`","API","to","join","tables","."]
code: def __init__(
      self,
      src: str | Sequence[str] | Iterable | Sequence[Iterable],
      chunksize: int = 1000,
      buffer_size: int | None = None,
      col_names: Sequence[str] | None = None,
      col_types: dict[str, dict[str, Any] | None] | None = None,
      col_groups: dict[str, Sequence[str]] | None = None,
      transform: Callable | None = None,
      shuffle: bool = False,
      seed: int = 0,
      kwargs_read_csv: dict | None = None,
      **kwargs,
  ):
      self.src = src
      self.chunksize = chunksize
      self.buffer_size = (
          2 * chunksize if buffer_size is None else buffer_size
      )
      self.col_names = col_names
      self.col_types = col_types
      self.col_groups = col_groups
      self.shuffle = shuffle
      self.seed = seed
      self.kwargs_read_csv = kwargs_read_csv or {"chunksize": chunksize}
      self.kwargs = kwargs
  
      self.iters: list[Iterable] = self.reset()
      super().__init__(data=None, transform=transform)
  
imports: from __future__ import annotations
  from collections.abc import Callable, Iterable, Iterator, Sequence
  from typing import Any
  from torch.utils.data import IterableDataset
  from torch.utils.data import get_worker_info
  from monai.data.utils import convert_tables_to_dicts
  from monai.transforms import apply_transform
  from monai.transforms.transform import Randomizable
  from monai.utils import optional_import
label_desc: Use image node_id 1 to create a new CSVIterableDataset object from inherited base classes: IterableDataset with example: obj = CSVIterableDataset(src, chunksize, buffer_size, col_names, col_types, col_groups, transform, shuffle, seed, kwargs_read_csv)