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: Calculates which rowgroups will be read during.
  
  The following filters are applied:
  - predicates;
  - row-group selector (our indexing mechanism);
  - training partition
  
  :param dataset: ParquetDataset instance
  :param row_groups: a list of row groups (a list of ParquetDatasetPiece objects)
  :param predicate: instance of predicate object to filter rows to be returned by reader.
  :param rowgroup_selector: instance of row group selector object to select row groups to be read
  :param cur_shard: An int denoting the current shard number used. Each node should
                 pass in a unique partition number in the range [0, shard_count).
  :param shard_count: An int denoting the number of reader shards
  :param seed: If not None: random seed to shuffle row groups for data sharding.
  :return: (filtered_row_group_indexes, worker_predicate): filtered_row_group_indexes an integer index into
  row_groups array. worker_predicate contains only predicates that could not be resolved on the partitioned fields
  and need to be evaluated by workers.
docstr_tok: ["Calculates","which","rowgroups","will","be","read","during",".","The","following","filters","are","applied",":","-","predicates",";","-","row-group","selector","(","our","indexing","mechanism",")",";","-","training","partition",":","param","dataset",":","ParquetDataset","instance",":","param","row_groups",":","a","list","of","row","groups","(","a","list","of","ParquetDatasetPiece","objects",")",":","param","predicate",":","instance","of","predicate","object","to","filter","rows","to","be","returned","by","reader",".",":","param","rowgroup_selector",":","instance","of","row","group","selector","object","to","select","row","groups","to","be","read",":","param","cur_shard",":","An","int","denoting","the","current","shard","number","used",".","Each","node","should","pass","in","a","unique","partition","number","in","the","range","[","0",",","shard_count",")",".",":","param","shard_count",":","An","int","denoting","the","number","of","reader","shards",":","param","seed",":","If","not","None",":","random","seed","to","shuffle","row","groups","for","data","sharding",".",":","return",":","(","filtered_row_group_indexes",",","worker_predicate",")",":","filtered_row_group_indexes","an","integer","index","into","row_groups","array",".","worker_predicate","contains","only","predicates","that","could","not","be","resolved","on","the","partitioned","fields","and","need","to","be","evaluated","by","workers","."]
code: def _filter_row_groups(
      self,
      dataset,
      row_groups,
      predicate,
      rowgroup_selector,
      cur_shard,
      shard_count,
      seed,
  ):
      """Calculates which rowgroups will be read during.
  
      The following filters are applied:
      - predicates;
      - row-group selector (our indexing mechanism);
      - training partition
  
      :param dataset: ParquetDataset instance
      :param row_groups: a list of row groups (a list of ParquetDatasetPiece objects)
      :param predicate: instance of predicate object to filter rows to be returned by reader.
      :param rowgroup_selector: instance of row group selector object to select row groups to be read
      :param cur_shard: An int denoting the current shard number used. Each node should
                     pass in a unique partition number in the range [0, shard_count).
      :param shard_count: An int denoting the number of reader shards
      :param seed: If not None: random seed to shuffle row groups for data sharding.
      :return: (filtered_row_group_indexes, worker_predicate): filtered_row_group_indexes an integer index into
      row_groups array. worker_predicate contains only predicates that could not be resolved on the partitioned fields
      and need to be evaluated by workers.
      """
  
      (
          filtered_row_group_indexes,
          worker_predicate,
      ) = self._apply_predicate_to_row_groups(
          dataset, row_groups, predicate
      )
  
      if rowgroup_selector:
          filtered_row_group_indexes = self._apply_row_group_selector(
              dataset, rowgroup_selector, filtered_row_group_indexes
          )
  
      if cur_shard is not None or shard_count is not None:
          filtered_row_group_indexes = self._partition_row_groups(
              dataset,
              row_groups,
              shard_count,
              cur_shard,
              filtered_row_group_indexes,
              seed,
          )
  
      if not filtered_row_group_indexes:
          warnings.warn(
              "No matching data is available for loading after rowgroup "
              "selector were applied and the data was sharded."
          )
  
      return filtered_row_group_indexes, worker_predicate
  
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 4 for calling the Reader obj's underlying member method code with example usage: obj._filter_row_groups(dataset, row_groups, predicate, rowgroup_selector, cur_shard, shard_count, seed) and returns: filtered_row_group_indexes,  worker_predicate