class_docstr: Sampler that restricts data loading to a subset of the dataset.
  It is especially useful in conjunction with
  :class:`torch.nn.parallel.DistributedDataParallel`. In such case, each
  process can pass a DistributedSampler instance as a DataLoader sampler,
  and load a subset of the original dataset that is exclusive to it.
  Source:
  https://github.com/rwightman/pytorch-image-models/blob/master/timm/data/distributed_sampler.py
class_docstr_tok: ["Sampler","that","restricts","data","loading","to","a","subset","of","the","dataset",".","It","is","especially","useful","in","conjunction","with",":","class",":","`","torch.nn.parallel.DistributedDataParallel","`",".","In","such","case",",","each","process","can","pass","a","DistributedSampler","instance","as","a","DataLoader","sampler",",","and","load","a","subset","of","the","original","dataset","that","is","exclusive","to","it",".","Source",":","https",":","\/\/github.com\/rwightman\/pytorch-image-models\/blob\/master\/timm\/data\/distributed_sampler.py"]
code: def __iter__(self):
      indices = list(range(len(self.dataset)))
  
      # add extra samples to make it evenly divisible
      indices += [0] * (self.total_size - len(indices))
      assert len(indices) == self.total_size
  
      # subsample
      indices = indices[
          self.rank * self.num_samples : self.rank * self.num_samples
          + self.num_samples
      ]
      assert len(indices) == self.num_samples
  
      return iter(indices)
  
imports: import logging
  import math
  import os
  from typing import Any, DefaultDict, Dict, List, Optional, Tuple, Union, no_type_check
  import networkx
  import numpy
  import pandas
  import pyarrow.parquet
  import torch
  from sklearn.model_selection import GroupShuffleSplit, train_test_split
  from torch import distributed
  from torch.utils.data import DataLoader, Sampler, SequentialSampler
  from llm_studio.src.datasets.conversation_chain_handler import ConversationChainHandler
  from llm_studio.src.utils.exceptions import LLMDataException
  from llm_studio.src.utils.utils import PatchedAttribute, set_seed
label_desc: Use image node_id 2 for calling the OrderedDistributedSampler obj's underlying member method code with example usage: obj.__iter__() and returns: iter