+
    –°³j8  ã                   óä   € ^ RI t ^ RIt^ RIHt ^ RIHtHt ^ RIHt ^ RI	H
t
 Rt]
! ]4      tRt]
! ]4      t. ROt ! R R] P                   4      t ! R R	]4      t ! R R
]4      t ! R R4      tR# )é    N)ÚSequence)ÚcastÚIO)ÚBuffer)Ú
try_importÚpyzstdÚ	zstandardÚ	ExtensionÚStreamTransformExtensionÚ	ZStandardÚExtensionRegistryc                   óÈ   a € ] tR t^t o Rt]]P                  V 3R lR l4       4       t]]P                  V 3R lR l4       4       t	]P                  V 3R lR l4       t
RtV tR	# )
r
   a�  
Extensions provide modular additions to functionality within distributed checkpointing,
which affect the layout or format of the written artifacts.  Extensions may be
built into pytorch, or provided externally.

When writing, the caller provides a list of extension instances of the appropriate
type.  Each extension can output a descriptor which is used to reconstitute the
extension at read-time.
c                ó    <€ V ^8„  d   QhRS[ /# ©é   Úreturn©Ústr)ÚformatÚ__classdict__s   "€Úh/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/distributed/checkpoint/_extension.pyÚ__annotate__ÚExtension.__annotate__,   s   ø€ ÷ ñ ™3ñ ó    c                 ó   € R# ©z,
See ExtensionRegistry.from_descriptor_list
N© r   r   r   Úregistry_nameÚExtension.registry_name*   ó   ‚ r   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Úversionr   r
   r   )r   r   s   "€r   r   r   3   s   ø€ ÷ ñ ¡ð ¨ñ r   c                ó   € R# r   r   ©r"   s   &r   Úfrom_descriptorÚExtension.from_descriptor1   r    r   c                ó    <€ V ^8„  d   QhRS[ /# r   r   )r   r   s   "€r   r   r   9   s   ø€ ÷ ñ ¡ñ r   c                ó   € R# )zs
Return descriptor name to be included in metadata.  The form should be
"extension_name[@local-domain][/version]".
Nr   ©Úselfs   &r   Úget_descriptorÚExtension.get_descriptor8   r    r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚstaticmethodÚabcÚabstractmethodr   r%   r+   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r
   r
      sh   ø‡ € ñð Ø×Ñ÷ó ó ðð
 Ø×Ñ÷ó ó ðð
 	×Ñ÷ó ör   c                   ó„   a € ] tR t^@t o Rt]P                  V 3R lR l4       t]P                  V 3R lR l4       tRt	V t
R# )r   aV  
An extension which performs transformation on a byte stream, such as compression
or encryption.

Implementations should try to be memory friendly and performant.  For example, don't
read the whole input, then transform it, and write it back.  If at all possible, do it in
chunks.  But, don't read/transform/write one byte at a time, either.
c                óF   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          /# ©r   Úoutputr   ©r   Úbytes)r   r   s   "€r   r   Ú%StreamTransformExtension.__annotate__K   s#   ø€ ÷ ñ ¡2¡e¥9ð ±±Eµñ r   c                ó   € R# )zÐ
Takes a writeable output stream, and generates a new stream which implements the
output transform.  Input data written to the returned stream will be transformed
and written to the `output` argument stream.
Nr   ©r*   r;   s   &&r   Útransform_toÚ%StreamTransformExtension.transform_toJ   r    r   c                óF   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          /# ©r   Úinputr   r<   )r   r   s   "€r   r   r>   S   s#   ø€ ÷ ñ ¡B¡u¥Ið ±"±Uµ)ñ r   c                ó   € R# )zÊ
Takes a readable input stream, and generates a new stream which implements the
input transform.  When the returned stream is read, data will be read from the
'input' stream, transformed, and returned.
Nr   ©r*   rE   s   &&r   Útransform_fromÚ'StreamTransformExtension.transform_fromR   r    r   r   N)r-   r.   r/   r0   r1   r3   r4   rA   rH   r5   r6   r7   s   @r   r   r   @   s>   ø‡ € ñð 	×Ñ÷ó ðð 	×Ñ÷ó ör   c                   óÈ   a a€ ] tR t^[t o]V3R lR l4       t]V3R lR l4       t]V3R lR l4       tV3R lV 3R lltV3R	 lR
 lt	V3R lR lt
V3R lR ltRtVtV ;t# )r   c                ó    <€ V ^8„  d   QhRS[ /# r   ©Úbool)r   r   s   "€r   r   ÚZStandard.__annotate__]   s   ø€ ÷ ;ñ ;™$ñ ;r   c                 ó2   € \         R J;'       g	    \        R J# ©N)r	   r   r   r   r   Úis_availableÚZStandard.is_available\   s   € ä Ð$×:Ð:¬°dÐ(:Ð:r   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   r"   r   r   r   )r   r   s   "€r   r   rN   a   s   ø€ ÷ ñ ¡ð ¨ñ r   c                óÖ   € V P                  R 4      ^ ,          R8w  d   \        RV : 24      h\        P                  4       '       g   \        R\         R\
         R24      h\        4       # )Ú.Ú1zUnknown extension version=zOStream with ZStandard compression cannot be processed because no module named 'ú' or 'Ú')Ú	partitionÚ
ValueErrorr   rQ   Úzstandard_module_nameÚpyzstd_module_namer$   s   &r   r%   ÚZStandard.from_descriptor`   so   € à×Ñ˜SÓ! !Õ$¨Ô+ÜÐ:°'±Ð<Ó=Ð=Ü×%Ñ%×'Ò'Üð$Ü$9Ð#:¸&ÔASÐ@TÐTUðWóð ô ‹{Ðr   c                ó    <€ V ^8„  d   QhRS[ /# r   r   )r   r   s   "€r   r   rN   l   s   ø€ ÷ ñ ™3ñ r   c                 ó   € R # )zstream.zstdr   r   r   r   r   ÚZStandard.registry_namek   s   € ár   c                ó   <€ V ^8„  d   QhRR/# ©r   r   Nr   )r   r   s   "€r   r   rN   o   s   ø€ ÷ ñ ˜$ñ r   c                óŒ   <€ \         SV `  4        \        P                  4       '       g   \	        R \
         R\         R24      hR# )z<ZStandard extension is unavailable because no module named 'rW   rX   N)ÚsuperÚ__init__r   rQ   rZ   r[   r\   )r*   Ú	__class__s   &€r   re   ÚZStandard.__init__o   sN   ø€ Ü‰ÑÔÜ×%Ñ%×'Ò'ÜØNÔOdÐNeÐekÔl~Ðkð  @Að  Bóð ñ (r   c                ó    <€ V ^8„  d   QhRS[ /# r   r   )r   r   s   "€r   r   rN   v   s   ø€ ÷ +ñ +¡ñ +r   c                ó(   € V P                  4        R 2# )z/1)r   r)   s   &r   r+   ÚZStandard.get_descriptorv   s   € Ø×$Ñ$Ó&Ð' rÐ*Ð*r   c                óF   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          /# r:   r<   )r   r   s   "€r   r   rN   y   s#   ø€ ÷ /ñ /¡2¡e¥9ð /±±Eµñ /r   c                óÐ   € \         e&   \         P                  4       pVP                  V4      #  ! R R\        P                  4      p\        \        \        ,          V! V4      4      # )Nc                   óh   a € ] tR t^~t o V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltR	tV t	R
# )Ú&ZStandard.transform_to.<locals>.Writerc                ó4   <€ V ^8„  d   QhRS[ S[,          RR/# )r   r;   r   Nr<   )r   r   s   "€r   r   Ú3ZStandard.transform_to.<locals>.Writer.__annotate__   s   ø€ ÷ :ñ :¡r©%¥yð :°Tñ :r   c                óD   € Wn         \        P                  4       V n        R # rP   )r;   r   ÚZstdCompressorÚ
compressorr@   s   &&r   re   Ú/ZStandard.transform_to.<locals>.Writer.__init__   s   € Ø$”Ü"(×"7Ñ"7Ó"9�–r   c                ó    <€ V ^8„  d   QhRS[ /# r   rL   )r   r   s   "€r   r   rp   ƒ   s   ø€ ÷ ñ ¡4ñ r   c                ó   € R # ©Tr   r)   s   &r   Ú	writeableÚ0ZStandard.transform_to.<locals>.Writer.writeableƒ   ó   € Ùr   c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# ©r   Úbr   N©r   Úint)r   r   s   "€r   r   rp   †   s   ø€ ÷ *ñ *™vð *©#°­*ñ *r   c                ó¦   € V P                   P                  V4      pV'       d   V P                  P                  V4       \	        \        V4      4      # rP   )rs   Úcompressr;   ÚwriteÚlenÚ
memoryview)r*   r}   Úoutdatas   && r   r‚   Ú,ZStandard.transform_to.<locals>.Writer.write†   s:   € ØŸ/™/×2Ñ2°1Ó5�ßØ—K‘K×%Ñ% gÔ.Üœ: a›=Ó)Ð)r   c                ó   <€ V ^8„  d   QhRR/# rb   r   )r   r   s   "€r   r   rp   Œ   s   ø€ ÷ $ñ $˜tñ $r   c                ó´   € V P                   P                  4       pV'       d   V P                  P                  V4       V P                  P                  4        R # rP   )rs   Úflushr;   r‚   )r*   r…   s   & r   r‰   Ú,ZStandard.transform_to.<locals>.Writer.flushŒ   s9   € ØŸ/™/×/Ñ/Ó1�ßØ—K‘K×%Ñ% gÔ.Ø—‘×!Ñ!Ö#r   )rs   r;   N)
r-   r.   r/   r0   re   rx   r‚   r‰   r5   r6   r7   s   @r   ÚWriterrn   ~   s-   ø‡ € ÷:ð :÷ð ÷*ð *÷$ö $r   r‹   )r	   rr   Ústream_writerÚioÚ	RawIOBaser   r   r=   )r*   r;   rs   r‹   s   &&  r   rA   ÚZStandard.transform_toy   sN   € ÜÒ Ü"×1Ñ1Ó3ˆJØ×+Ñ+¨FÓ3Ð3ô	$”R—\‘\ô 	$ô( ”B”u•I™v f›~Ó.Ð.r   c                óF   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          /# rD   r<   )r   r   s   "€r   r   rN   ”   s#   ø€ ÷ &.ñ &.¡B¡u¥Ið &.±"±Uµ)ñ &.r   c                óÐ   € \         e&   \         P                  4       pVP                  V4      #  ! R R\        P                  4      p\        \        \        ,          V! V4      4      # )Nc                   óh   a € ] tR t^™t o V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltR	tV t	R
# )Ú(ZStandard.transform_from.<locals>.Readerc                ó4   <€ V ^8„  d   QhRS[ S[,          RR/# )r   rE   r   Nr<   )r   r   s   "€r   r   Ú5ZStandard.transform_from.<locals>.Reader.__annotate__š   s#   ø€ ÷ Eñ E¡b©¥ið E°Dñ Er   c                óD   € Wn         \        P                  4       V n        R # rP   )rE   r   ÚEndlessZstdDecompressorÚdecompressorrG   s   &&r   re   Ú1ZStandard.transform_from.<locals>.Reader.__init__š   s   € Ø"”
Ü$*×$BÑ$BÓ$D�Ö!r   c                ó    <€ V ^8„  d   QhRS[ /# r   rL   )r   r   s   "€r   r   r•   ž   s   ø€ ÷ ñ ¡$ñ r   c                ó   € R # rw   r   r)   s   &r   ÚreadableÚ1ZStandard.transform_from.<locals>.Reader.readablež   rz   r   c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# r|   r~   )r   r   s   "€r   r   r•   ¡   s   ø€ ÷ ñ ¡&ð ©S°4­Zñ r   c                ó  € V P                   P                  '       d   V P                  P                  R4      pMRp\	        V4      p\        V4      pV P                   P                  W$4      pVf   R# \        V4      pWSRV% V# )é€   r   Ni  )r˜   Úneeds_inputrE   Úreadr„   rƒ   Ú
decompress)r*   r}   ÚindataÚbviewÚblenr…   Úcounts   &&     r   ÚreadintoÚ1ZStandard.transform_from.<locals>.Reader.readinto¡   su   € ð ×$Ñ$×0×0Ð0Ø!ŸZ™ZŸ_™_Ð-=Ó>‘Fà �Fä" 1›�Ü˜5“z�Ø×+Ñ+×6Ñ6°vÓD�Ø’?Ùä˜G›�Ø '�f�u�Ø�r   c                ó    <€ V ^8„  d   QhRS[ /# r   rL   )r   r   s   "€r   r   r•   ·   s   ø€ ÷ ñ ¡$ñ r   c                ó   € R # )Fr   r)   s   &r   ÚseekableÚ1ZStandard.transform_from.<locals>.Reader.seekable·   s   € Ùr   )r˜   rE   N)
r-   r.   r/   r0   re   rœ   r¨   r¬   r5   r6   r7   s   @r   ÚReaderr“   ™   s/   ø‡ € ÷Eð E÷ð ÷ð ÷,ö r   r®   )r	   ÚZstdDecompressorÚstream_readerr�   rŽ   r   r   r=   )r*   rE   r˜   r®   s   &&  r   rH   ÚZStandard.transform_from”   sO   € ÜÒ Ü$×5Ñ5Ó7ˆLØ×-Ñ-¨eÓ4Ð4ô	”R—\‘\ô 	ôB ”B”u•I™v e›}Ó-Ð-r   r   )r-   r.   r/   r0   r2   rQ   r%   r   re   r+   rA   rH   r5   r6   Ú__classcell__)rf   r   s   @@r   r   r   [   sl   ù‡ € Ø÷;ó ð;ð ÷ó ðð ÷ó ð÷ó ÷+ð +÷/ð /÷6&.÷ &.ð &.r   c                   óV   a € ] tR t^½t o V 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )	r   c                ó   <€ V ^8„  d   QhRR/# rb   r   )r   r   s   "€r   r   ÚExtensionRegistry.__annotate__¾   s   ø€ ÷ 
ñ 
˜$ñ 
r   c                ód   € \         3 Uu/ uF  qP                  4       VbK  	  upV n        R # u upi rP   )r   r   Ú
extensions©r*   Úclss   & r   re   ÚExtensionRegistry.__init__¾   s2   € ô 2;±ó7
Ù0<¨×ÑÓ Ò$±ñ7
ˆŽùò 7
s   Š-c                ó4   <€ V ^8„  d   QhRS[ S[,          RR/# )r   r¹   r   N)Útyper
   )r   r   s   "€r   r   rµ   Ä   s   ø€ ÷ 3ñ 3™D¡�Oð 3°ñ 3r   c                ó>   € WP                   VP                  4       &   R # rP   )r·   r   r¸   s   &&r   ÚregisterÚExtensionRegistry.registerÄ   s   € Ø/2�‰˜×)Ñ)Ó+Ó,r   c                óF   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          /# )r   Údescriptorsr   )r   r   r
   )r   r   s   "€r   r   rµ   Ç   s$   ø€ ÷ ?ñ ?±¹µð ?Á(É9ÕBUñ ?r   c                óN   a € R V 3R llpV Uu. uF
  q2! V4      NK  	  up# u upi )aÝ  
Given a sequence of descriptor strings as returned by
Extension.get_descriptor at save time, creates a sequence of
Extension instances.  The name[@local-domain] preceding the
version number is used to look up an implementation class in
the registry, and the version is passed to the class's
from_descriptor static method.  If the registry contains no
match, this will throw ValueError.  If the from_descriptor
method raises an exception, that will pass through to the
caller.
c                ó0   € V ^8„  d   QhR\         R\        /# )r   Údescr   )r   r
   )r   s   "r   r   Ú<ExtensionRegistry.from_descriptor_list.<locals>.__annotate__Ô   s   € ÷ 	0ñ 	0¤#ð 	0¬)ñ 	0r   c                 ó¾   <€ V P                  R 4      w  rpVf   ^ pSP                  P                  V4      pV'       g   \        RV: 24      hVP	                  V4      # )Ú/zUnknown extension name=)rY   r·   ÚgetrZ   r%   )rÄ   ÚnameÚ_r"   Úextr*   s   &    €r   r%   Ú?ExtensionRegistry.from_descriptor_list.<locals>.from_descriptorÔ   s[   ø€ Ø#Ÿ~™~¨cÓ2ÑˆD�WØŠØ�Ø—/‘/×%Ñ% dÓ+ˆCßÜ Ð#;°d±WÐ!=Ó>Ð>à×&Ñ& wÓ/Ð/r   r   )r*   rÁ   r%   rÄ   s   f&  r   Úfrom_descriptor_listÚ&ExtensionRegistry.from_descriptor_listÇ   s,   ø€ ÷	0ð 	0ñ 3>Ó>±+¨$� Ö%±+Ñ>Ð>ùÒ>s   �")r·   N)	r-   r.   r/   r0   re   r¾   rÍ   r5   r6   r7   s   @r   r   r   ½   s#   ø‡ € ÷
ð 
÷3ð 3÷?ö ?r   )r
   r   r   r   )r3   r�   Úcollections.abcr   Útypingr   r   Útyping_extensionsr   Útorch._utilsr   r\   r   r[   r	   Ú__all__ÚABCr
   r   r   r   r   r   r   Ú<module>rÕ      s}   ðó Û 	Ý $ß õ %å #ð Ð Ù	Ð&Ó	'€Ø#Ð ÙÐ,Ó-€	ò€ô�—‘ô ôB˜yô ô6_.Ð(ô _.÷D!?ó !?r   