+
    QV-j:  ã                   ó2  € ^ RI t ^ RIHt ^ RIHt ^ RIHtHtHt ^RI	H
t
 ^RIHt ^RIHtHt ]'       d   ^RIHt ] P$                  ! R	4      t ! R
 R]4      t]R,          t]! RR7       ! R R4      4       tR R ltR R ltR R ltR R ltR R ltR# )é    N)Ú	dataclass)ÚPath)ÚTYPE_CHECKINGÚLiteralÚ	TypedDict)Ú	constants)Úrepo_folder_name)Úgit_hashÚsha_fileobj)ÚRepoFilez^[0-9a-f]{40}$c                   ó,   a € ] tR t^t o V 3R ltRtV tR# )ÚMismatchc                óJ   <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   # )é   ÚpathÚexpectedÚactualÚ	algorithm)Ústr)ÚformatÚ__classdict__s   "€Út/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/huggingface_hub/utils/_verification.pyÚ__annotate__ÚMismatch.__annotate__   s1   ø‡ ‚ Ù
�Iñ á�Mñ ñ �Kñ ñ �Nò	 ó    © N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      ó   ø‡ ‡ „ r   r   T)Úfrozenc                   ó,   a € ] tR t^t o V 3R ltRtV tR# )ÚFolderVerificationc                ó’   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   S[S[,          ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[;R&   # )r   ÚrevisionÚchecked_countÚ
mismatchesÚmissing_pathsÚextra_pathsÚverified_path)r   ÚintÚlistr   r   )r   r   s   "€r   r   ÚFolderVerification.__annotate__   s\   ø‡ ‚ á�Mñ ñ Ññ ñ ‘X•Ññ	 ñ
 ™•9Ññ ñ ‘c•Ññ ñ Ñò r   r   Nr   r%   s   @r   r)   r)      r&   r   r)   c                óR   € V ^8„  d   QhR\         R\        \        \         3,          /# )r   ÚrootÚreturn)r   Údictr   )r   s   "r   r   r   '   s&   € ÷ Wñ Wœdð W¤t¬C´¨I¥ñ Wr   c                ó¸   € V P                  R4       Uu/ uF:  qP                  4       '       g   K  VP                  V 4      P                  4       VbK<  	  up# u upi )zU
Return a mapping of repo-relative path -> absolute path for all files under `root`.
Ú*)ÚrglobÚis_fileÚrelative_toÚas_posix)r5   Úps   & r   Úcollect_local_filesr?   '   sD   € ð 8<·z±zÀ#´ÓV±°!Ï)É)Ï+Ô-ˆA�M‰M˜$Ó×(Ñ(Ó*¨AÒ-±ÑVÐVùÒVs
   ”A°$Ac                óJ   € V ^8„  d   QhR\         R\        R,          R\        /# )r   Ústorage_folderr+   Nr6   )r   r   )r   s   "r   r   r   .   s&   € ÷ ñ ´Dð ÄCÈ$ÅJð ÔSVñ r   c                ó  € V'       d   \         P                  V4      '       d   V# V R,          pV R,          pV'       dQ   W!,          pVP                  4       '       d!   VP                  RR7      P	                  4       # \        RV RV R24      hVR,          pVP                  4       '       d!   VP                  RR7      P	                  4       # VP                  4       '       g   \        R	V R
24      hVP                  4        Uu. uFM  qfP                  4       '       g   K  \         P                  VP                  4      '       g   KA  VP                  NKO  	  pp\        V4      ^8X  d
   V^ ,          # \        R4      hu upi )zJ
Resolve a commit hash from a cache repo folder and an optional revision.
ÚrefsÚ	snapshotszutf-8)Úencodingz
Revision 'z1' could not be resolved in cache (expected file 'z').Úmainz+Cache repo is missing snapshots directory: z . Provide --revision explicitly.zhAmbiguous cached revision: multiple snapshots found and no refs to disambiguate. Please pass --revision.)
Ú_REGEX_COMMIT_HASHÚ	fullmatchr;   Ú	read_textÚstripÚ
ValueErrorÚis_dirÚiterdirÚnameÚlen)rA   r+   Úrefs_dirÚsnapshots_dirÚref_pathÚmain_refr>   Ú
candidatess   &&      r   Ú_resolve_commit_hash_from_cacherU   .   sQ  € ÷ Ô&×0Ñ0°×:Ò:Øˆà Õ&€HØ" [Õ0€MçØÕ&ˆØ×Ñ×ÒØ×%Ñ%¨wÐ%Ó7×=Ñ=Ó?Ð?Ü˜: h ZÐ/`ÐaiÐ`jÐjmÐnÓoÐoð ˜&Õ €HØ×Ñ×ÒØ×!Ñ!¨7Ð!Ó3×9Ñ9Ó;Ð;à×Ñ×!Ò!ÜÐFÀ}ÀoÐUuÐvÓwÐwà"/×"7Ñ"7Ô"9ÓqÑ"9˜Q¿X¹X¿Z”&ÔL^×LhÑLhÐij×ioÑio×Lp”&�!—&”&Ñ"9€JÐqÜ
ˆ:ƒ˜!ÔØ˜!�}Ðä
Øróð ùò	 rs   ÄE?Ä""E?Å	E?c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   r   r   r6   )r   ÚHashAlgor   )r   s   "r   r   r   O   s&   € ÷ 
Eñ 
EœDð 
E¬Xð 
E¼#ñ 
Er   c                ó"  € V P                  R4      ;_uu_ 4       pVR8X  d$   \        V4      P                  4       uuRRR4       # VR8X  d$   \        VP	                  4       4      uuRRR4       # \        RV 24      h  + '       g   i     R# ; i)zE
Compute the checksum of a local file using the requested algorithm.
ÚrbÚsha256Núgit-sha1zUnsupported hash algorithm: )Úopenr   Úhexr
   ÚreadrK   )r   r   Ústreams   && r   Úcompute_file_hashr`   O   sq   € ð
 
�‰�4�Œ˜FØ˜Ô Ü˜vÓ&×*Ñ*Ó,÷ 
Šð ˜
Ô"Ü˜FŸK™K›MÓ*÷	 
Šô
 Ð7¸	°{ÐCÓDÐD÷ 
�ˆús   š A=ÁA=Á/A=Á=B	c          
      ó�   € V ^8„  d   QhR\         \        R3,          R\         \        \        3,          R\        R\        R\        /# )r   Úremote_by_pathr   Úlocal_by_pathr+   r0   r6   )r7   r   r   r)   )r   s   "r   r   r   \   sM   € ÷ -ñ -äœ˜j˜Õ)ð-ô œœT˜	•?ð-ô ð	-ô
 ð-ô ñ-r   c           
     óŽ  € \        V 4      p\        V4      p\        WE,
          4      p\        WT,
          4      p\        WE,          4      p. p	V FÛ  p
W
,          pW,          p\        VRR4      pVe   \        VRR4      MRpVf(   \        V\        4      '       d   VP                  R4      pV'       d   Rp\        V4      P                  4       pM'VP                  pRp\        V4      P                  4       p\        WÏ4      pVV8w  g   K½  V	P                  \        V
VVVR7      4       KÝ  	  \        V\        V4      V	VVVR7      # )zHCompare remote entries and local files and return a verification result.ÚlfsNrZ   r[   )r   r   r   r   )r+   r,   r-   r.   r/   r0   )ÚsetÚsortedÚgetattrÚ
isinstancer7   Úgetr   ÚlowerÚblob_idr`   Úappendr   r)   rO   )rb   rc   r+   r0   Úremote_pathsÚlocal_pathsÚmissingÚextraÚbothr-   Úrel_pathÚremote_entryÚ
local_pathre   Úlfs_shar   r   rl   r   s   $$$$               r   Úverify_mapsrw   \   s-  € ô �~Ó&€LÜ�mÓ$€Kä�\Õ/Ó0€GÜ�;Õ-Ó.€EÜ�,Õ,Ó-€Dà!#€JãˆØ%Õ/ˆØ"Õ,ˆ
ä�l E¨4Ó0ˆØ25²/”'˜#˜x¨Ô.ÀtˆØŠ?œz¨#¬t×4Ò4Ø—g‘g˜hÓ'ˆGßØ"*ˆIÜ˜7“|×)Ñ)Ó+‰Hà"×*Ñ*ˆGØ"ˆIÜ˜7“|×)Ñ)Ó+ˆHä" :Ó9ˆà�XÖØ×Ñœh¨H¸xÐPVÐbkÔlÖmñ' ô* ØÜ˜$“iØØØØ#ôð r   c                ó¬   € V ^8„  d   QhR\         R\         R\         R,          R\        R,          R\        R,          R\        \        \         3,          /# )r   Úrepo_idÚ	repo_typer+   NÚ	cache_dirÚ	local_dirr6   )r   r   Útuple)r   s   "r   r   r   Œ   s[   € ÷  ñ  äð ô ð ô �D�jð	 ô
 �d�{ð ô �d�{ð ô Œ4”ˆ9Õñ r   c                óP  € Veg   \        V4      P                  4       P                  4       pVP                  4       '       g   \	        RV 24      hYR;'       g    \
        P                  3# \        T;'       g    \
        P                  4      P                  4       P                  4       pV\        WR7      ,          pVP                  4       '       g   \	        RV R24      h\        Wr4      pVR,          V,          p	V	P                  4       '       g   \	        RV RV	 R24      hW˜3# )	zO
Resolve the root directory to scan locally and the remote revision to verify.
z6Local directory does not exist or is not a directory: )ry   rz   zRepo is not present in cache: z.. Use 'hf download' first or pass --local-dir.rD   z0Snapshot directory does not exist for revision 'z': Ú.)r   Ú
expanduserÚresolverL   rK   r   ÚDEFAULT_REVISIONÚHF_HUB_CACHEr	   ÚexistsrU   )
ry   rz   r+   r{   r|   r5   Ú
cache_rootrA   ÚcommitÚsnapshot_dirs
   $$$$$     r   Úresolve_local_rootrˆ   Œ   s  € ð ÒÜ�I‹×)Ñ)Ó+×3Ñ3Ó5ˆØ�{‰{�}Š}ÜÐUÐVZÐU[Ð\Ó]Ð]Ø×<Ð<¤)×"<Ñ"<Ð=Ð=ä�i×9Ð9¤9×#9Ñ#9Ó:×EÑEÓG×OÑOÓQ€JØÔ"2¸7Ô"XÕX€NØ× Ñ ×"Ò"ÜØ,¨^Ð,<Ð<jÐkó
ð 	
ô -¨^ÓF€FØ! KÕ/°&Õ8€LØ×Ñ× Ò ÜÐKÈFÈ8ÐSVÐWcÐVdÐdeÐfÓgÐgØÐÐr   )rZ   r[   )ÚreÚdataclassesr   Úpathlibr   Útypingr   r   r   Ú r   Úfile_downloadr	   Úshar
   r   Úhf_apir   ÚcompilerG   r   rW   r)   r?   rU   r`   rw   rˆ   r   r   r   Ú<module>r’      s‹   ðÛ 	Ý !Ý ß 4Ñ 4å Ý ,ß &÷ Ý!ð —Z’ZÐ 1Ó2Ð ôˆyô ð Ð'Õ(€ñ �$Ô÷ð ó ðõWõõB
Eõ-÷` r   