+
    ~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   "x/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.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tC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<zz#V!))+-AMM$((*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"[0M&%%w%7==??:hZ/`ai`jjmnoo & H!!7!399;;!!F}oUuvww"/"7"7"9q"9QXXZ&L^LhLhijioioLp&!&&"9J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&**, 
 
"FKKM*	 

 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\        W4      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\/0G;-.E,,-D!#J%/",
lE4025/'#x.t?z#t44ggh'G"*I7|))+H"**G"I7|))+H":9XhHxPVbk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[            Dj	 
 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W3# )	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{{}}UVZU[\]]<<)"<"<==i999#9#9:EEGOOQJ"27"XXN  "",^,<<jk
 	
 -^FF!K/&8L  KF8SVWcVdde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  , & ! ZZ 12 y  '( $  WB
E-` r   