class_docstr: A data loader adaptor for ``torch.utils.data.DataLoader``.
  
  This class iterates and returns items from the Reader in batches.
  
  This loader can be used as an iterator and will terminate when the reader used in the construction of the class
  runs out of samples.
docstr: Initializes a data loader object, with a default collate.
  
  Number of epochs is defined by the configuration of the reader argument.
  
  An optional shuffling queue is created if shuffling_queue_capacity is greater than 0. No samples will be
  returned to a user by the ``DataLoader`` until the queue is full. After that, batches of `batch_size`
  will be created by uniformly sampling the shuffling queue. Once no more samples are available from the data
  reader, the shuffling queue is allowed to be consumed till no further samples are available.
  
  Note that the last returned batch could have less then ``batch_size`` samples.
  
  NOTE: ``make_batch_reader`` has it's own ``shuffle_row_groups`` argument. It randomizes order in
  which parquet row-groups are loaded and has no effect on the order of rows within each row-group. To achieve
  row-level shuffling you should set shuffling_queue_capacity to a non zero value.
  
  :param reader: petastorm Reader instance
  :param batch_size: the number of items to return per batch; factored into the len() of this reader
  :param collate_fn: an optional callable to merge a list of samples to form a mini-batch.
  :param shuffling_queue_capacity: Queue capacity is passed to the underlying :class:`tf.RandomShuffleQueue`
    instance. If set to 0, no shuffling will be done.
code: def __init__(
      self,
      reader,
      batch_size=1,
      collate_fn=decimal_friendly_collate,
      shuffling_queue_capacity=0,
  ):
      """
      Initializes a data loader object, with a default collate.
  
      Number of epochs is defined by the configuration of the reader argument.
  
      An optional shuffling queue is created if shuffling_queue_capacity is greater than 0. No samples will be
      returned to a user by the ``DataLoader`` until the queue is full. After that, batches of `batch_size`
      will be created by uniformly sampling the shuffling queue. Once no more samples are available from the data
      reader, the shuffling queue is allowed to be consumed till no further samples are available.
  
      Note that the last returned batch could have less then ``batch_size`` samples.
  
      NOTE: ``make_batch_reader`` has it's own ``shuffle_row_groups`` argument. It randomizes order in
      which parquet row-groups are loaded and has no effect on the order of rows within each row-group. To achieve
      row-level shuffling you should set shuffling_queue_capacity to a non zero value.
  
      :param reader: petastorm Reader instance
      :param batch_size: the number of items to return per batch; factored into the len() of this reader
      :param collate_fn: an optional callable to merge a list of samples to form a mini-batch.
      :param shuffling_queue_capacity: Queue capacity is passed to the underlying :class:`tf.RandomShuffleQueue`
        instance. If set to 0, no shuffling will be done.
      """
      super(DataLoader, self).__init__()
      self.reader = reader
      self.batch_size = batch_size
      self.collate_fn = collate_fn
  
      # _batch_acc accumulates samples for a single batch.
      self._batch_acc = []
      self.shuffling_queue_capacity = shuffling_queue_capacity
      self._in_iter = None
  
imports: import collections.abc
  import decimal
  import re
  import logging
  import numpy
  from six import PY2
  from torch.utils.data.dataloader import default_collate
  import torch
  from packaging import version
  from petastorm.reader_impl.shuffling_buffer import RandomShufflingBuffer, NoopShufflingBuffer
  from petastorm.reader_impl.pytorch_shuffling_buffer import BatchedRandomShufflingBuffer, BatchedNoopShufflingBuffer
label_desc: Use image node_id 1 to create a new DataLoader object from inherited base classes: LoaderBase with example: obj = DataLoader(reader, batch_size, collate_fn, shuffling_queue_capacity)