Ë
    Z^(h'  ã                   ó<   — d dl Z d dlZd dlmZ dgZ G d„ de«      Zy)é    N)ÚMapDataPipeÚSequenceWrapperMapDataPipec                   ó$   — e Zd ZdZdd„Zd„ Zd„ Zy)r   aö  
    Wraps a sequence object into a MapDataPipe.

    Args:
        sequence: Sequence object to be wrapped into an MapDataPipe
        deepcopy: Option to deepcopy input sequence object

    .. note::
      If ``deepcopy`` is set to False explicitly, users should ensure
      that data pipeline doesn't contain any in-place operations over
      the iterable instance, in order to prevent data inconsistency
      across iterations.

    Example:
        >>> # xdoctest: +SKIP
        >>> from torchdata.datapipes.map import SequenceWrapper
        >>> dp = SequenceWrapper(range(10))
        >>> list(dp)
        [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
        >>> dp = SequenceWrapper({'a': 100, 'b': 200, 'c': 300, 'd': 400})
        >>> dp['a']
        100
    c                 ó¤   — |r	 t        j                  |«      | _        y || _        y # t        $ r t	        j
                  d«       || _        Y y w xY w)NzkThe input sequence can not be deepcopied, please be aware of in-place modification would affect source data)ÚcopyÚdeepcopyÚsequenceÚ	TypeErrorÚwarningsÚwarn)Úselfr	   r   s      úb/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/utils/data/datapipes/map/utils.pyÚ__init__z#SequenceWrapperMapDataPipe.__init__$   sO   € Ùð)Ü $§¡¨hÓ 7�•ð %ˆD�Møô ò )Ü—‘ðXôð !)�–ð)ús   „' §%AÁAc                 ó    — | j                   |   S ©N)r	   )r   Úindexs     r   Ú__getitem__z&SequenceWrapperMapDataPipe.__getitem__1   s   € Ø�}‰}˜UÑ#Ð#ó    c                 ó,   — t        | j                  «      S r   )Úlenr	   )r   s    r   Ú__len__z"SequenceWrapperMapDataPipe.__len__4   s   € Ü�4—=‘=Ó!Ð!r   N)T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   © r   r   r   r      s   „ ñó0%ò$ó"r   )r   r   Ú#torch.utils.data.datapipes.datapiper   Ú__all__r   r   r   r   ú<module>r      s$   ðã Û å ;ð (Ð
(€ô*" õ *"r   