class_docstr: A Datasource for WebDataset datasets (tar format with naming conventions).
class_docstr_tok: ["A","Datasource","for","WebDataset","datasets","(","tar","format","with","naming","conventions",")","."]
docstr: Read and decode samples from a stream.
  
  Note that fileselect selects files during reading, while suffixes
  selects files during the grouping step.
  
  Args:
      stream: File descriptor to read from.
      path: Path to the data.
      decoder: decoder or list of decoders to be applied to samples
      fileselect: Predicate for skipping files in tar decoder.
          Defaults to lambda_:False.
      suffixes: List of suffixes to be extracted. Defaults to None.
      verbose_open: Print message when opening files. Defaults to False.
  
  Yields:
      List[Dict[str, Any]]: List of sample (list of length 1).
docstr_tok: ["Read","and","decode","samples","from","a","stream",".","Note","that","fileselect","selects","files","during","reading",",","while","suffixes","selects","files","during","the","grouping","step",".","Args",":","stream",":","File","descriptor","to","read","from",".","path",":","Path","to","the","data",".","decoder",":","decoder","or","list","of","decoders","to","be","applied","to","samples","fileselect",":","Predicate","for","skipping","files","in","tar","decoder",".","Defaults","to","lambda_",":","False",".","suffixes",":","List","of","suffixes","to","be","extracted",".","Defaults","to","None",".","verbose_open",":","Print","message","when","opening","files",".","Defaults","to","False",".","Yields",":","List","[","Dict","[","str",",","Any","]","]",":","List","of","sample","(","list","of","length","1",")","."]
code: def _read_stream(self, stream: "pyarrow.NativeFile", path: str):
      """Read and decode samples from a stream.
  
      Note that fileselect selects files during reading, while suffixes
      selects files during the grouping step.
  
      Args:
          stream: File descriptor to read from.
          path: Path to the data.
          decoder: decoder or list of decoders to be applied to samples
          fileselect: Predicate for skipping files in tar decoder.
              Defaults to lambda_:False.
          suffixes: List of suffixes to be extracted. Defaults to None.
          verbose_open: Print message when opening files. Defaults to False.
  
      Yields:
          List[Dict[str, Any]]: List of sample (list of length 1).
      """
      import pandas as pd
  
      files = _tar_file_iterator(
          stream,
          fileselect=self.fileselect,
          filerename=self.filerename,
          verbose_open=self.verbose_open,
      )
      samples = _group_by_keys(
          files, meta=dict(__url__=path), suffixes=self.suffixes
      )
      for sample in samples:
          if self.decoder is not None:
              sample = _apply_list(
                  self.decoder, sample, default=_default_decoder
              )
          yield pd.DataFrame({k: [v] for k, v in sample.items()})
  
imports: import fnmatch
  import io
  import re
  import tarfile
  from functools import partial
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union
  from ray.data.block import BlockAccessor
  from ray.data.datasource.file_based_datasource import FileBasedDatasource
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 2 for calling the WebDatasetDatasource obj's underlying member method code with example usage: obj._read_stream(stream, path) without return types