ó
    "Eñi«
  ã            	       ó²   • S SK JrJrJrJr  S SKJr  S SKJr  S SK	J
r
  S SKJr  S SKJr  S SKJrJrJrJr  S/r\
" S	5       " S
 S\\\\4      5      5       rg)é    )ÚCallableÚIterableÚIteratorÚSized)ÚBufferedIOBase)ÚAny)Úfunctional_datapipe)ÚIterDataPipe)Ú_deprecation_warning)ÚbasichandlersÚDecoderÚextension_extract_fnÚimagehandlerÚRoutedDecoderIterDataPipeÚrouted_decodec            	       ó–   ^ • \ rS rSrSr\S.S\\\\	4      S\
S\
SS4U 4S	 jjjrS
\
SS4S jrS\\\\4      4S jrS\4S jrSrU =r$ )r   é   af  
Decodes binary streams from input DataPipe, yields pathname and decoded data in a tuple.

(functional name: ``routed_decode``)

Args:
    datapipe: Iterable datapipe that provides pathname and binary stream in tuples
    handlers: Optional user defined decoder handlers. If ``None``, basic and image decoder
        handlers will be set as default. If multiple handles are provided, the priority
        order follows the order of handlers (the first handler has the top priority)
    key_fn: Function for decoder to extract key from pathname to dispatch handlers.
        Default is set to extract file extension from pathname

Note:
    When ``key_fn`` is specified returning anything other than extension, the default
    handler will not work and users need to specify custom handler. Custom handler
    could use regex to determine the eligibility to handle data.
)Úkey_fnÚdatapipeÚhandlersr   ÚreturnNc                ó¼   >• [         TU ]  5         Xl        U(       d  [        [	        S5      4n[        USU06U l        [        [        U 5      R                  SSSS9  g )NÚtorchr   z1.12z1.13r   )Údeprecation_versionÚremoval_versionÚold_functional_name)
ÚsuperÚ__init__r   Údecoder_basichandlersÚdecoder_imagehandlerr   Údecoderr   ÚtypeÚ__name__)Úselfr   r   r   Ú	__class__s       €Új/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/utils/data/datapipes/iter/routeddecoder.pyr   Ú"RoutedDecoderIterDataPipe.__init__(   sW   ø€ ô 	‰ÑÔØ>FŒÞÜ-Ô/CÀGÓ/LÐMˆHÜ Ð8°Ñ8ˆŒÜÜ�‹J×ÑØ &Ø"Ø /ó		
ó    Úhandlerc                 ó6   • U R                   R                  " U6   g )N)r!   Úadd_handler)r$   r)   s     r&   r+   Ú%RoutedDecoderIterDataPipe.add_handler:   s   € Ø�‰× Ò  'Ò*r(   c              #   ón   #   • U R                    H!  nUS   nU R                  U5      nX#U   4v •  M#     g 7f)Nr   ©r   r!   )r$   ÚdataÚpathnameÚresults       r&   Ú__iter__Ú"RoutedDecoderIterDataPipe.__iter__=   s8   é € Ø—M”MˆDØ˜A‘wˆHØ—\‘\ $Ó'ˆFØ HÑ-Ð.Ô.ò "ùs   ‚35c                 ó¬   • [        U R                  [        5      (       a  [        U R                  5      $ [	        [        U 5      R                   S35      e)Nz# instance doesn't have valid length)Ú
isinstancer   r   ÚlenÚ	TypeErrorr"   r#   )r$   s    r&   Ú__len__Ú!RoutedDecoderIterDataPipe.__len__C   s@   € Ü�d—m‘m¤U×+Ñ+Ü�t—}‘}Ó%Ð%Üœ4 ›:×.Ñ.Ð/Ð/RÐSÓTÐTr(   r.   )r#   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   ÚtupleÚstrr   r   r   r+   r   r   r2   Úintr8   Ú__static_attributes__Ú__classcell__)r%   s   @r&   r   r      sŒ   ø† ñð. 0ò	
à˜5  nÐ!4Ñ5Ñ6ð
ð ð
ð ð	
ð
 
÷
ð 
ð$+ Hð +°ô +ð/˜( 5¨¨c¨¡?Ñ3ô /ðU˜÷ Uò Ur(   N)Úcollections.abcr   r   r   r   Úior   Útypingr   Ú%torch.utils.data.datapipes._decoratorr	   Ú#torch.utils.data.datapipes.datapiper
   Ú'torch.utils.data.datapipes.utils.commonr   Ú(torch.utils.data.datapipes.utils.decoderr   r   r   r   r   r    Ú__all__r>   r?   r   © r(   r&   Ú<module>rL      s^   ðß ?Ó ?Ý Ý å EÝ <Ý H÷ó ð 'Ð
'€ñ �_Ó%ô2U ¨U°3¸°8©_Ñ =ó 2Uó &ñ2Ur(   