+
    LV-j6!  ã                  óö   a € 0 t $ ^ RIHt ^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	  ^ RI
t]'       d'   ^ RIHt ^ RIHtHtHt ^RIHt ]]]3,          tR]R	&    ! R
 R4      tR#   ] d    ]'       g   ^ RIt LOi ; i)é    )ÚannotationsN)ÚTYPE_CHECKING)Úatomic_write)ÚIterator)ÚAnyÚLiteralÚ	TypeAlias)ÚCachingFileSystemr	   ÚDetailc                  ó¢   € ] tR t^tRtR R ltR R ltR R ltRR R	 lltR
 R lt	R R lt
R R ltR R ltR R ltR R ltR R ltRtR# )ÚCacheMetadataaD  Cache metadata.

All reading and writing of cache metadata is performed by this class,
accessing the cached files and blocks is not.

Metadata is stored in a single file per storage directory in JSON format.
For backward compatibility, also reads metadata stored in pickle format
which is converted to JSON when next saved.
c               ó   € V ^8„  d   QhRR/# )é   Ústoragez	list[str]© )Úformats   "Úv/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/fsspec/implementations/cache_metadata.pyÚ__annotate__ÚCacheMetadata.__annotate__$   s   € ÷ (ñ ( 	ñ (ó    c                óV   € V'       g   \        R4      hWn        / .V n        RV n        R# )z±

Parameters
----------
storage: list[str]
    Directories containing cached files, must be at least one. Metadata
    is stored in the last of these directories by convention.
z3CacheMetadata expects at least one storage locationFN)Ú
ValueErrorÚ_storageÚcached_filesÚ_force_save_pickle)Úselfr   s   &&r   Ú__init__ÚCacheMetadata.__init__$   s,   € ÷ ÜÐRÓSÐSàŒØ+-¨$ˆÔð #(ˆÖr   c               ó    € V ^8„  d   QhRRRR/# )r   ÚfnÚstrÚreturnr   r   )r   s   "r   r   r   7   s   € ÷ ñ ˜ð  ñ r   c                óì  €  \        VR4      ;_uu_ 4       p\        P                  ! V4      pRRR4       XP                  4        F?  p\        TP                  R4      \        4      '       g   K*  \        TR,          4      TR&   KA  	  T#   + '       g   i     Le; i  \         dL    \        TR4      ;_uu_ 4       p\        P                  ! T4      pRRR4        K©    + '       g   i      Lº; ii ; i)z6Low-level function to load metadata from specific fileÚrNÚrbÚblocks)
ÚopenÚjsonÚloadr   ÚpickleÚvaluesÚ
isinstanceÚgetÚlistÚset)r   r    ÚfÚloadedÚcs   &&   r   Ú_loadÚCacheMetadata._load7   s¢   € ð	(Ü�b˜#—” !ÜŸš 1›�÷ ð
 —‘–ˆAÜ˜!Ÿ%™% ›/¬4×0Ô0Ü! ! H¥+Ó.��(“ñ !ð ˆ÷ —ûäô 	(Ü�b˜$—” 1ÜŸš Q›�÷  ——“úð	(úsE   ‚B –B
­B Â
B	ÂB ÂB ÂC3Â<CÃC3ÃC/Ã)C3Ã/C3c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úmetadata_to_saver   r    r!   r"   ÚNoner   )r   s   "r   r   r   D   s!   € ÷ /ñ / fð /°#ð /¸$ñ /r   c                óJ  € V P                   '       d5   \        V4      ;_uu_ 4       p\        P                  ! W4       RRR4       R# \        VRR7      ;_uu_ 4       p\        P                  ! W4       RRR4       R#   + '       g   i     R# ; i  + '       g   i     R# ; i)z4Low-level function to save metadata to specific fileNÚw)Úmode)r   r   r*   Údumpr(   )r   r6   r    r0   s   &&& r   Ú_saveÚCacheMetadata._saveD   sn   € à×"×"Ð"Ü˜b×!Ô! QÜ—’Ð,Ô0÷ "Ñ!ô ˜b s×+Õ+¨qÜ—	’	Ð*Ô.÷ ,Ñ+÷ "×!Ð!ú÷ ,×+Ð+ús   ¦A=ÁBÁ=B	ÂB"	c               ó    € V ^8„  d   QhRRRR/# )r   Úwritable_onlyÚboolr"   zIterator[tuple[str, str, bool]]r   )r   s   "r   r   r   M   s    € ÷ Dñ DØ!ðDà	(ñDr   c              #  óö   "  € \        V P                  4      p\        V P                  4       FF  w  r4W2^,
          8H  pV'       d   V'       g   K"  \        P                  P                  VR4      WE3x € KH  	  R# 5i)zÔYield locations (filenames) where metadata is stored, and whether
writable or not.

Parameters
----------
writable: bool
    Set to True to only yield writable locations.

Returns
-------
Yields (str, str, bool)
ÚcacheN)Úlenr   Ú	enumerateÚosÚpathÚjoin)r   r?   ÚnÚir   Úwritables   &&    r   Ú_scan_locationsÚCacheMetadata._scan_locationsM   sW   é € ô �—‘ÓˆÜ# D§M¡MÖ2‰JˆAØ �E‘zˆHß§XÙÜ—'‘'—,‘,˜w¨Ó0°'ÐCÔCó	 3ùs   ‚A
A9Á,A9c               ó$   € V ^8„  d   QhRRRRRR/# )r   rF   r!   ÚcfszCachingFileSystem | Noner"   z#Literal[False] | tuple[Detail, str]r   )r   s   "r   r   r   c   s$   € ÷ ñ ØðØ6ðà	,ñr   c                óL  € \        V P                  4       V P                  4       Fû  w  w  r4rVW9  d   K  Wa,          P                  4       pVe‚   VP                  '       d*   VR,          VP
                  P                  V4      8w  d   Ke  VP                  '       d5   \        P                  ! 4       VR,          ,
          VP                  8”  d   K«  \        P                  P                  WGR,          4      p\        P                  P                  V4      '       g   Kø  Ws3u # 	  R# )zÕIf path is in cache return its details, otherwise return ``False``.

If the optional CachingFileSystem is specified then it is used to
perform extra checks to reject possible matches, such as if they are
too old.
ÚuidÚtimer    F)ÚziprK   r   ÚcopyÚcheck_filesÚfsÚukeyÚexpiryrQ   rE   rF   rG   Úexists)r   rF   rN   r    ÚbaseÚ_rB   Údetails   &&&     r   Ú
check_fileÚCacheMetadata.check_filec   sÊ   € ô %(¨×(<Ñ(<Ó(>À×@QÑ@QÖ$RÑ ‰MˆR�qØÔ ÙØ•[×%Ñ%Ó'ˆFàŠØ—?—?�? v¨e¥}¸¿¹¿¹ÀDÓ8IÔ'IáØ—:—:�:¤$§)¢)£+°°vµÕ">ÀÇÁÔ"Káä—‘—‘˜d¨4¥LÓ1ˆBÜ�w‰w�~‰~˜b×!Ô!Ø�zÒ!ñ %Sñ  r   c               ó    € V ^8„  d   QhRRRR/# )r   Úexpiry_timeÚintr"   ztuple[list[str], bool]r   )r   s   "r   r   r   ~   s   € ÷ 3ñ 3¨ð 3Ð1Gñ 3r   c                óò  € . pV P                   R,          P                  4       P                  4        F»  w  r4\        P                  ! 4       VR,          ,
          V8”  g   K/  VP	                  RR4      pV'       g   \        RV 24      h\        P                  P                  V P                  R,          V4      pVP                  V4       V P                   R,          P                  V4       K½  	  V P                   R,          '       dU   \        P                  P                  V P                  R,          R4      pV P                  V P                   R,          V4       V P                   R,          '       * pW'3# )zÛRemove expired metadata from the cache.

Returns names of files corresponding to expired metadata and a boolean
flag indicating whether the writable cache is empty. Caller is
responsible for deleting the expired files.
rQ   r    Ú z)Cache metadata does not contain 'fn' for rB   éÿÿÿÿ)r   rS   ÚitemsrQ   r-   ÚRuntimeErrorrE   rF   rG   r   ÚappendÚpopr<   )r   r_   Úexpired_filesrF   r[   r    Ú
cache_pathÚwritable_cache_emptys   &&      r   Úclear_expiredÚCacheMetadata.clear_expired~   s   € ð ˆØ ×-Ñ-¨bÕ1×6Ñ6Ó8×>Ñ>Ö@‰LˆDÜ�yŠy‹{˜V F�^Õ+¨kÖ9Ø—Z‘Z  bÓ)�ßÜ&ØCÀDÀ6ÐJóð ô —W‘W—\‘\ $§-¡-°Õ"3°RÓ8�Ø×$Ñ$ RÔ(Ø×!Ñ! "Õ%×)Ñ)¨$Ö/ñ Að ×Ñ˜R× Ô ÜŸ™Ÿ™ d§m¡m°BÕ&7¸ÓAˆJØ�J‰J�t×(Ñ(¨Õ,¨jÔ9à#'×#4Ñ#4°RÕ#8Ô8ÐØÐ2Ð2r   c               ó   € V ^8„  d   QhRR/# ©r   r"   r7   r   )r   s   "r   r   r   ˜   s   € ÷ 	1ñ 	1�dñ 	1r   c                ó  € . pV P                  4        F_  w  p p\        P                  P                  V4      '       d#   VP	                  V P                  V4      4       KN  VP	                  / 4       Ka  	  T;'       g    / .V n        R# )z>Load all metadata from disk and store in ``self.cached_files``N)rK   rE   rF   rX   rf   r3   r   )r   r   r    rZ   s   &   r   r)   ÚCacheMetadata.load˜   sk   € àˆØ×,Ñ,Ö.‰HˆB��1Ü�w‰w�~‰~˜b×!Ò!à×#Ñ# D§J¡J¨r£NÖ3à×#Ñ# BÖ'ñ /ð )×0Ð0¨R¨DˆÖr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r0   r   rF   r!   r"   r7   r   )r   s   "r   r   r   £   s!   € ÷ ñ  cð °ð ¸ñ r   c                óÊ   € V P                   R,          V,          pVR,          RJd<   \        VR,          4      VP                  ,          VP                  8¼  d   RVR&   R# R# R# )z{Perform side-effect actions on closing a cached file.

The actual closing of the file is the responsibility of the caller.
r&   TNrc   )r   rC   Ú	blocksizeÚsize)r   r0   rF   r2   s   &&& r   Úon_close_cached_fileÚ"CacheMetadata.on_close_cached_file£   sT   € ð ×Ñ˜bÕ! $Õ'ˆØˆX�;˜dÓ"¤s¨1¨X­;Ó'7¸!¿+¹+Õ'EÈÏÉÔ'OØˆAˆh‹Kñ (PÑ"r   c               ó    € V ^8„  d   QhRRRR/# )r   rF   r!   r"   z
str | Noner   )r   s   "r   r   r   ­   s   € ÷ ñ ˜Sð  Zñ r   c                ó  € V P                  VR4      pV'       g   R# Vw  r4VP                  V P                  R,          4      '       d5   V P                  R,          P	                  V4       V P                  4        V# \        R4      h)z²Remove metadata of cached file.

If path is in the cache, return the filename of the cached file,
otherwise return ``None``.  Caller is responsible for deleting the
cached file.
Nz<Can only delete cached file in last, writable cache locationrc   )r\   Ú
startswithr   r   rg   ÚsaveÚPermissionError)r   rF   ÚdetailsrZ   r    s   &&   r   Úpop_fileÚCacheMetadata.pop_file­   st   € ð —/‘/ $¨Ó-ˆßÙØ‰ˆØ�=‰=˜Ÿ™ rÕ*×+Ò+Ø×Ñ˜bÕ!×%Ñ% dÔ+Ø�I‰IŒKð
 ˆ	ô "ØNóð r   c               ó   € V ^8„  d   QhRR/# rn   r   )r   s   "r   r   r   Á   s   € ÷ "1ñ "1�dñ "1r   c                óÊ  € \        V P                  4       V P                  4       EF³  w  w  rr4V'       g   K  \        P                  P                  V4      '       dß   V P                  V4      pVP                  4        F“  w  rgWd9   g   K  VR,          RJ g   WF,          R,          RJ d   RVR&   M+WF,          R,          pVP                  VR,          4       W‡R&   \        VR,          WF,          R,          4      VR&   WF,          R,          VR&   K•  	  VP                  4        F  w  rgWe9  g   K  WuV&   K  	  MTpVP                  4        UU	u/ uF  w  riWiP                  4       bK  	  ppp	VP                  4        F7  p\        VR,          \        4      '       g   K"  \        VR,          4      VR&   K9  	  V P                  WA4       WPP                  R&   EK¶  	  R# u up	pi )zSave metadata to diskr&   TrQ   rP   Nrc   )rR   rK   r   rE   rF   rX   r3   rd   ÚupdateÚmaxrS   r+   r,   r/   r.   r<   )
r   r    rZ   rJ   rB   r   Úkr2   r&   Úvs
   &         r   rz   ÚCacheMetadata.saveÁ   s„  € ä(+¨D×,@Ñ,@Ó,BÀD×DUÑDU×(VÑ$ÑˆR�HßÙä�w‰w�~‰~˜b×!Ò!Ø#Ÿz™z¨"›~�Ø(×.Ñ.Ö0‘D�AØ–zØ˜X�;¨$Ó.°%µ(¸8Õ2DÈÓ2LØ*.˜A˜hšKð &+¥X¨hÕ%7˜FØ"ŸM™M¨!¨H­+Ô6Ø*0˜h™KÜ$'¨¨&­	°5µ8¸FÕ3CÓ$D˜˜&™	Ø#(¥8¨E¥?˜˜%›ñ 1ð  "ŸK™KžM‘D�AØÖ,Ø*+ Q›ò *ð  %�Ø-9×-?Ñ-?Ô-AÔBÑ-A¡T Q�QŸ™›’[Ñ-AˆEÑBØ—\‘\–^�Ü˜a �k¬3×/Ô/Ü"& q¨¥{Ó"3�A�h“Kñ $ð �J‰J�uÔ!Ø$0×Ñ˜bÔ!óA )Wùó6 Cs   ÅGc               ó$   € V ^8„  d   QhRRRRRR/# )r   rF   r!   r[   r   r"   r7   r   )r   s   "r   r   r   å   s!   € ÷ -ñ - ð -¨Vð -¸ñ -r   c                ó0   € W P                   R,          V&   R# )z8Update metadata for specific file in memory, do not saveNrc   )r   )r   rF   r[   s   &&&r   Úupdate_fileÚCacheMetadata.update_fileå   s   € à&,×Ñ˜"Õ˜dÓ#r   )r   r   r   N)F)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r3   r<   rK   r\   rk   r)   ru   r}   rz   rˆ   Ú__static_attributes__r   r   r   r   r      sE   † ñõ(õ&õ/÷Dõ,õ63õ4	1õõõ("1÷H-ñ -r   r   )Ú__conditional_annotations__Ú
__future__r   rE   r*   rQ   Útypingr   Úfsspec.utilsr   Úujsonr(   ÚImportErrorÚcollections.abcr   r   r   r	   Úcachedr
   Údictr!   r   Ú__annotations__r   )r�   s   @r   Ú<module>rš      sj   øðß "Ð "ã 	Û Û Ý  å %ðÛ÷
 Ý(ß.Ñ.å)à˜S #˜X�€FˆIÓ&÷N-ó N-øð ô ßÛùðús   ¤A" Á"A8Á1A8Á7A8