class_docstr: Reads a dataset from a Petastorm dataset.
  
  :ivar last_row_consumed: True if the last row was already returned by the Reader.
class_docstr_tok: ["Reads","a","dataset","from","a","Petastorm","dataset",".",":","ivar","last_row_consumed",":","True","if","the","last","row","was","already","returned","by","the","Reader","."]
docstr: Resets ``Reader`` state and allows to fetch more samples once the ``Reader`` finished reading all epochs,
  as specified by the ``num_epochs`` parameter.
  
  Once all samples were read from a reader, an attempt to fetch new sample (e.g. ``next(reader)`` would raise
  ``StopIterationError``. You can reset the reader to the original state and restart reading samples
  calling ``reset()``.
  
  We do not support calling ``reset()`` until all samples were consumed. ``NotImplementedError``
  will be raised if a user attempt to do so.
  
  Calling reset after ``stop()`` was called has no effect.
  
  :return: None
docstr_tok: ["Resets","``","Reader","``","state","and","allows","to","fetch","more","samples","once","the","``","Reader","``","finished","reading","all","epochs",",","as","specified","by","the","``","num_epochs","``","parameter",".","Once","all","samples","were","read","from","a","reader",",","an","attempt","to","fetch","new","sample","(","e.g",".","``","next","(","reader",")","``","would","raise","``","StopIterationError","``",".","You","can","reset","the","reader","to","the","original","state","and","restart","reading","samples","calling","``","reset","(",")","``",".","We","do","not","support","calling","``","reset","(",")","``","until","all","samples","were","consumed",".","``","NotImplementedError","``","will","be","raised","if","a","user","attempt","to","do","so",".","Calling","reset","after","``","stop","(",")","``","was","called","has","no","effect",".",":","return",":","None"]
code: def reset(self):
      """Resets ``Reader`` state and allows to fetch more samples once the ``Reader`` finished reading all epochs,
      as specified by the ``num_epochs`` parameter.
  
      Once all samples were read from a reader, an attempt to fetch new sample (e.g. ``next(reader)`` would raise
      ``StopIterationError``. You can reset the reader to the original state and restart reading samples
      calling ``reset()``.
  
      We do not support calling ``reset()`` until all samples were consumed. ``NotImplementedError``
      will be raised if a user attempt to do so.
  
      Calling reset after ``stop()`` was called has no effect.
  
      :return: None
      """
      # TODO(yevgeni): could there be a race here?
      if not self.last_row_consumed:
          # Don't allow reseting in the middle of epoch iterations since it is not very well defined how
          # to treat samples that are already 'in-flight': do we need to stop emitting results immediately and
          # drop these in-flight samples? Or just ignore it? What would happen if we have two concurrent ventilators
          # that are emitting load requests at the same time?
          raise NotImplementedError(
              "Currently do not support resetting a reader while in the middle of iteration. "
              "You can call reset only after all samples were consumed."
          )
      self.last_row_consumed = False
      self.ventilator.reset()
  
imports: import collections.abc
  import logging
  import warnings
  import six
  from pyarrow import parquet
  from petastorm.arrow_reader_worker import ArrowReaderWorker
  from petastorm.cache import NullCache
  from petastorm.errors import NoDataAvailableError
  from petastorm.etl import dataset_metadata, rowgroup_indexing
  from petastorm.etl.dataset_metadata import PetastormMetadataError, infer_or_load_unischema
  from petastorm.fs_utils import get_filesystem_and_path_or_paths, normalize_dir_url
  from petastorm.local_disk_cache import LocalDiskCache
  from petastorm.ngram import NGram
  from petastorm.predicates import PredicateBase
  from petastorm.py_dict_reader_worker import PyDictReaderWorker
  from petastorm.reader_impl.arrow_table_serializer import ArrowTableSerializer
  from petastorm.reader_impl.pickle_serializer import PickleSerializer
  from petastorm.selectors import RowGroupSelectorBase
  from petastorm.transform import transform_schema
  from petastorm.workers_pool.dummy_pool import DummyPool
  from petastorm.workers_pool.process_pool import ProcessPool
  from petastorm.workers_pool.thread_pool import ThreadPool
  from petastorm.workers_pool.ventilator import ConcurrentVentilator
label_desc: Use image node_id 2 for calling the Reader obj's underlying member method code with example usage: obj.reset() without return types