ó
    "Eñi  ã            	       óv   • S SK Jr  S SKJr  S SKJr  S SKJr  S/r\" S5       " S S\\	\
\4      5      5       rg)	é    )ÚIterator)ÚIOBase)Úfunctional_datapipe)ÚIterDataPipeÚStreamReaderIterDataPipeÚread_from_streamc                   óh   • \ rS rSrSr S
S\\\\4      S\	S-  SS4S jjr
S\\\\4      4S jrS	rg)r   é   aš  
Given IO streams and their label names, yield bytes with label name as tuple.

(functional name: ``read_from_stream``).

Args:
    datapipe: Iterable DataPipe provides label/URL and byte stream
    chunk: Number of bytes to be read from stream per iteration.
        If ``None``, all bytes will be read until the EOF.

Example:
    >>> # xdoctest: +SKIP
    >>> from torchdata.datapipes.iter import IterableWrapper, StreamReader
    >>> from io import StringIO
    >>> dp = IterableWrapper([("alphabet", StringIO("abcde"))])
    >>> list(StreamReader(dp, chunk=1))
    [('alphabet', 'a'), ('alphabet', 'b'), ('alphabet', 'c'), ('alphabet', 'd'), ('alphabet', 'e')]
NÚdatapipeÚchunkÚreturnc                 ó   • Xl         X l        g ©N)r   r   )Úselfr   r   s      Úi/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/utils/data/datapipes/iter/streamreader.pyÚ__init__Ú!StreamReaderIterDataPipe.__init__    s   € ð !ŒØ�
ó    c              #   óª   #   • U R                    H?  u  p UR                  U R                  5      nU(       d  UR                  5         M:  X4v •  M;     g 7fr   )r   Úreadr   Úclose)r   ÚfurlÚstreamÚds       r   Ú__iter__Ú!StreamReaderIterDataPipe.__iter__&   sE   é € Ø ŸMœM‰LˆDØØ—K‘K §
¡
Ó+�ÞØ—L‘L”NÙØ�i’ñ ò *ùs   ‚AA)r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚtupleÚstrr   Úintr   r   Úbytesr   Ú__static_attributes__© r   r   r   r      sW   † ñð( OSñØ$ U¨3°¨;Ñ%7Ñ8ðØADÀtÁðà	õð ˜( 5¨¨e¨Ñ#4Ñ5÷  r   N)Úcollections.abcr   Úior   Ú%torch.utils.data.datapipes._decoratorr   Ú#torch.utils.data.datapipes.datapiper   Ú__all__r"   r#   r%   r   r'   r   r   Ú<module>r-      sJ   ðÝ $Ý å EÝ <ð &Ð
&€ñ Ð'Ó(ô! ˜|¨E°#°u°*Ñ,=Ñ>ó ! ó )ñ! r   