+
    QV-j<Ú  ã                   óÔ  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHtHtHtHt ^ RIHt ^ RIHt ^ R	I H!t" ^ RI#t#^ RI$t$^ RI%t%^ RI&t%^ RI't'^ R
I(H)t)H*t* ^ RI+H,t, ^ RI-H.t.H/t/ ^ RI0H1t1 ^RI2H3t3H4t4 ^RI5H6t6 ^RI7H8t8 ^RI2H9t9H:t: ^RI;H<t< ^RI=H>t> ^RI?H@t@  ^ RIAHBtC ]:PŒ                  ! ]G4      tHRtI]! R]J]4      tK]C]P˜                  ]'Pš                  Pœ                  ]'Pš                  Pž                  ]$P                   3tQRtRRtSR R ltTR R ltUR  R! ltVR" R# ltWR$ R% ltXR& R' ltYR‘R( ltZR‘R) R* llt[R‘R+ R, llt\R‘R- R. llt]R‘R/ R0 llt^R‘R1 lt_R2 t` ! R3 R4]#PÂ                  PÄ                  4      tbR’R6 ltcR“R7 R8 lltdR9 teR: tfR; tgR< R= lth. R”Oti/ ]8 U Uu/ uF2  p V PÔ                   F  pVP×                  R>4      V PØ                  bK!  	  K4  	  upp CR?R?R@R?/Ctm]8 U Uu/ uF2  p V PÔ                   F  pVP×                  R>4      V PØ                  bK!  	  K4  	  upp tn]8 U u0 uF  q PØ                  kK  	  up to]Pà                  ! RA4      tq]rPç                  RB4      R?]rPç                  RC4      R?]rPç                  RD4      R?]rPç                  RE4      RF]rPç                  RG4      RH]rPç                  RI4      RJ]rPç                  RK4      RL]rPç                  RM4      RN/ttRORP/tu]v! RQ ]! ]t]u4       4       4      tw ! RR RS]E4      txRT RU ltyRV RW ltzR‘RX RY llt{RZ t|R[ t}R‘R\ R] llt~R^ tR_ t€R` t�R‘Ra Rb llt‚R‘Rc Rd lltƒR‘Re Rf llt„R‘Rg lt… ! Rh Ri]EP                  4      t‡Rj tˆR‘Rk Rl llt‰R‘Rm Rn lltŠR•RoR/Rp Rq lllt‹R‘Rr Rs lltŒRtR5RoR/Ru Rv llt�R‘Rw Rx lltŽ ! Ry Rz]�! ]! 4       4      4      t�R{ R| lt‘RoR/R} R~ llt’RoR/R R€ llt“R‘R� R‚ llt”R‘Rƒ R„ llt•R‘R… R† llt–R‘R‡ Rˆ llt—R–R‰ RŠ llt˜R‘R‹ RŒ llt™ ! R� RŽ]@4      tš ! R� R�]@4      t›R#   ]D d     ! R R]E4      tC EL�i ; iu upp i u upp i u up i )—z®
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
N)Ú	Generator)ÚBytesIO)Úchain)ÚPathÚPurePosixPath)ÚAnyÚOptionalÚTypeVarÚUnion)Úpatch)Úurlparse)ÚElementTree)Ústrip_protocolÚ	url_to_fs)Úcan_be_local)Úget_sessionÚinsecure_hashlib)Úversion)Ú__version__Úconfig)ÚDownloadConfig)ÚCOMPRESSION_FILESYSTEMS)Ú_tqdmÚlogging)ÚFileLock)ÚExtractManager)ÚTrackedIterableFromGenerator)ÚClientErrorc                   ó   € ] tR t^6tRtR# )Ú_AiohttpClientError© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r    ó    Új/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/datasets/utils/file_utils.pyr   r   6   s   † Ûr'   r   ú.incompleteÚTiø  i­  c                ó0   € V ^8„  d   QhR\         R\        /# ©é   Úurl_or_filenameÚreturn©ÚstrÚbool)Úformats   "r(   Ú__annotate__r4   K   s   € ÷ sñ s¤3ð s¬4ñ sr'   c                 ó¾   € \        V 4      P                  R 8g  ;'       d?    \        P                  P	                  \        V 4      P                  R,           4      '       * # ©Ú z:/©r   ÚschemeÚosÚpathÚismount©r.   s   &r(   Úis_remote_urlr>   K   sB   € Ü�OÓ$×+Ñ+¨rÑ1×rÐr¼"¿'¹'¿/¹/Ì(ÐSbÓJc×JjÑJjÐmqÕJqÓ:rÔ6rÐrr'   c                ó0   € V ^8„  d   QhR\         R\        /# r,   r0   )r3   s   "r(   r4   r4   O   s   € ÷ nñ n¤3ð n¬4ñ nr'   c                 ó´   € \        V 4      P                  R 8H  ;'       g:    \        P                  P	                  \        V 4      P                  R,           4      # r6   r8   r=   s   &r(   Úis_local_pathrA   O   s@   € ô �OÓ$×+Ñ+¨rÑ1×mÐm´R·W±W·_±_ÄXÈoÓE^×EeÑEeÐhlÕElÓ5mÐmr'   c                ó0   € V ^8„  d   QhR\         R\        /# r,   r0   )r3   s   "r(   r4   r4   V   s   € ÷ Yñ Y¤cð Y¬dñ Yr'   c                 óŠ   € \        V 4      P                  R 8H  ;'       d%    \        P                  P	                  V 4      '       * # )r7   )r   r9   r:   r;   Úisabsr=   s   &r(   Úis_relative_pathrE   V   s0   € Ü�OÓ$×+Ñ+¨rÑ1×XÐX¼"¿'¹'¿-¹-ÈÓ:XÔ6XÐXr'   c                ó0   € V ^8„  d   QhR\         R\         /# ©r-   r;   r/   )r*   )r3   s   "r(   r4   r4   Z   s   € ÷ Jñ J¤Að J¬!ñ Jr'   c           	     ó  € \         P                  P                  \         P                  P                  \         P                  P	                  \        V 4      4      4      4      p\        V \        4      '       d   \        V4      # T# )z'Convert relative path to absolute path.)r:   r;   ÚabspathÚ
expanduserÚ
expandvarsr1   Ú
isinstancer   )r;   Úabs_path_strs   & r(   Úrelative_to_absolute_pathrN   Z   sR   € ä—7‘7—?‘?¤2§7¡7×#5Ñ#5´b·g±g×6HÑ6HÌÈTËÓ6SÓ#TÓU€LÜ!+¨D´$×!7Ò!7Œ4�ÓÐI¸\ÐIr'   c                ó<   € V ^8„  d   QhR\         R\         R\         /# )r-   Ú	base_nameÚ	pathnamesr/   ©r1   )r3   s   "r(   r4   r4   `   s!   € ÷ 6ñ 6¤ð 6´ð 6¼ñ 6r'   c                 ó˜   € \        V 4      '       d    \        P                  ! V .R  V 4       O5!  # \        V .VO5!  P	                  4       # )c              3   ó’   "  € T F=  p\        V4      P                  \        P                  R 4      P	                  R 4      x € K?  	  R# 5i©Ú/N)r1   Úreplacer:   ÚsepÚlstrip)Ú.0Úpathnames   & r(   Ú	<genexpr>Ú#url_or_path_join.<locals>.<genexpr>b   s7   é € Ð*tÑjsÐ^f¬3¨x«=×+@Ñ+@ÄÇÁÈÓ+M×+TÑ+TÐUX×+YÐ+YÓjsùs   ‚AA)r>   Ú	posixpathÚjoinr   Úas_posix)rP   rQ   s   &*r(   Úurl_or_path_joinra   `   sA   € Ü�Y×ÒÜ�~Š~˜iÐuÑ*tÑjsÓ*tÓuÐuä�IÐ* 	Ó*×3Ñ3Ó5Ð5r'   c                ó0   € V ^8„  d   QhR\         R\         /# )r-   Úurl_or_pathr/   rR   )r3   s   "r(   r4   r4   g   s   € ÷ ,ñ ,¤Cð ,¬Cñ ,r'   c                 óŠ   € \        V 4      '       d   V R V P                  R4       # \        P                  P	                  V 4      # )NrV   )r>   Úrindexr:   r;   Údirname)rc   s   &r(   Úurl_or_path_parentrg   g   s9   € Ü�[×!Ò!ØÐ4˜[×/Ñ/°Ó4Ð5Ð5ä�w‰w�‰˜{Ó+Ð+r'   c                óN  € V P                  R4      p\        P                  ! V4      pVP                  4       pV'       dF   VP                  R4      p\        P                  ! V4      pVRVP                  4       ,           ,          pV P	                  R4      '       d
   VR,          pV# )aˆ  
Convert `url` into a hashed filename in a repeatable way.
If `etag` is specified, append its hash to the url's, delimited
by a period.
If the url ends with .h5 (Keras HDF5 weights) adds '.h5' to the name
so that TF 2.0 can identify it as a HDF5 file
(see https://github.com/tensorflow/tensorflow/blob/00fad90125b18b80fe054de1055770cfb8fe4ba3/tensorflow/python/keras/engine/network.py#L1380)
úutf-8Ú.z.py)Úencoder   Úsha256Ú	hexdigestÚendswith)ÚurlÚetagÚ	url_bytesÚurl_hashÚfilenameÚ
etag_bytesÚ	etag_hashs   &&     r(   Úhash_url_to_filenamerv   n   s‡   € ð —
‘
˜7Ó#€IÜ×&Ò& yÓ1€HØ×!Ñ!Ó#€HçØ—[‘[ Ó)ˆ
Ü$×+Ò+¨JÓ7ˆ	Ø�C˜)×-Ñ-Ó/Õ/Õ/ˆà
‡|�|�E×ÒØ�EÕˆà€Or'   c                ó$   € V ^8„  d   QhR\         /# ©r-   r/   rR   )r3   s   "r(   r4   r4   †   s   € ÷ x2ñ x2ô 	ñ	x2r'   c                óD  € Vf   \        R/ VB pVP                  ;'       g    \        P                  p\	        V\
        4      '       d   \        V4      p\	        V \
        4      '       d   \        V 4      p \        V 4      '       d   \        V 4      p \        V 4      '       Edj   \        WR7      w  rV P                  R4      '       dô   V P                  R4      '       gÝ   \        P                  ! \        P                  VP                  R7      P!                  V 4      p \        P"                  ! \        P                  VP                  R\$        \'        VP(                  4      R7      P+                  VP,                  VP.                  VP0                  VP2                  VP4                  VP6                  R7      pM¨\E        V VVP4                  VP(                  VPF                  VP                  VVPH                  VPJ                  R	7	      pMW\L        PN                  PQ                  V 4      '       d   T pM/\S        V 4      '       d   \C        R
V  R24      h\U        RV  R24      hVf   V# VPV                  '       Ed   VPX                  '       dÑ   \[        WaR7      p\]        V P_                  R4      ^ ,          4      p	V'       dœ   V	R9  d•   V P_                  R4      ^ ,          Pa                  R4      '       gh   \c        V4      pV\d        9   dI   \L        PN                  Pg                  V4      p
RV
9   d   V
RV
Pi                  R4       MT
p
V RV
 RV 2pV# V RV 2pV# \k        VP                  R7      Pm                  WaPn                  R7      p\c        V4      #   \        P8                  P:                  \        P8                  P<                  \        P8                  P>                  \        P8                  P@                  3 d   p\C        \        T4      4      ThRp?ii ; i)a{  
Given something that might be a URL (or might be a local path),
determine which. If it's a URL, download the file and cache it, and
return the path to the cached file. If it's already a local path,
make sure the file exists and then return the path.

Return:
    Local path (string)

Raises:
    FileNotFoundError: in case of non-recoverable file
        (non-existent or no cache on disk)
    ConnectionError: in case of unreachable url
        and no cache on disk
    ValueError: if it couldn't parse the url or filename correctly
    httpx.NetworkError or requests.exceptions.ConnectionError: in case of internet connection issue
N©Údownload_configúhf://zhf://buckets/)ÚendpointÚtokenÚdatasets)r}   r~   Úlibrary_nameÚlibrary_versionÚ
user_agent)Úrepo_idÚ	repo_typeÚrevisionrs   Úforce_downloadÚproxies)Ú	cache_dirr†   r‚   Úuse_etagr~   Ústorage_optionsÚdownload_descÚdisable_tqdmzLocal file z doesn't existzunable to parse z as a URL or as a local pathú::rj   ú://z://::)rˆ   )Úforce_extractr    ©ÚtgzÚtar©z.tar.gzz.tar.bz2z.tar.xz)8r   rˆ   r   ÚDOWNLOADED_DATASETS_PATHrL   r   r1   r   r   r>   Ú!_prepare_path_and_storage_optionsÚ
startswithÚhuggingface_hubÚHfFileSystemÚHF_ENDPOINTr~   Úresolve_pathÚHfApir   Úget_datasets_user_agentr‚   Úhf_hub_downloadrƒ   r„   r…   Úpath_in_repor†   r‡   ÚutilsÚRepositoryNotFoundErrorÚEntryNotFoundErrorÚRevisionNotFoundErrorÚGatedRepoErrorÚFileNotFoundErrorÚget_from_cacher‰   r‹   rŒ   r:   r;   ÚexistsrA   Ú
ValueErrorÚextract_compressed_fileÚextract_on_the_flyÚ_get_extraction_protocolÚ_get_path_extensionÚsplitrn   rN   Ú!SINGLE_FILE_COMPRESSION_PROTOCOLSÚbasenamere   r   Úextractr�   )r.   r{   Údownload_kwargsrˆ   rŠ   Úresolved_pathÚoutput_pathÚeÚprotocolÚ	extensionÚ
inner_files   &&,        r(   Úcached_pathr·   †   s˜  € ð, ÒÜ(Ñ;¨?Ñ;ˆà×)Ñ)×LÐL¬V×-LÑ-L€IÜ�)œT×"Ò"Ü˜	“Nˆ	Ü�/¤4×(Ò(Ü˜oÓ.ˆô �O×$Ò$Ü(¨Ó9ˆä�_×%Ó%ä+LØô,
Ñ(ˆð ×%Ñ% g×.Ò.°×7QÑ7QÐRa×7bÒ7bÜ+×8Ò8Ü×+Ñ+°?×3HÑ3Hôç‰l˜?Ó+ð ð7Ü-×3Ò3Ü#×/Ñ/Ø)×/Ñ/Ø!+Ü$/Ü6°×7QÑ7QÓRô÷ "‘/Ø)×1Ñ1Ø+×5Ñ5Ø*×3Ñ3Ø*×7Ñ7Ø#2×#AÑ#AØ+×3Ñ3ð "ó ñ ô. )ØØ#Ø.×=Ñ=Ø*×5Ñ5Ø(×1Ñ1Ø%×+Ñ+Ø /Ø-×;Ñ;Ø,×9Ñ9ô
‰Kô 
�‰�‰˜×	(Ò	(à%‰Ü	�×	'Ò	'ä +¨oÐ->¸nÐ MÓNÐNô Ð+¨OÐ+<Ð<XÐYÓZÐZàÒØÐà×.×.Ñ.Ø×-×-Ð-ô 0°Ô]ˆHÜ+¨O×,AÑ,AÀ$Ó,GÈÕ,JÓKˆIçØ ^Ô3Ø'×-Ñ-¨dÓ3°AÕ6×?Ñ?Ð@b×cÒcä7¸ÓD�ØÔ@Ô@ä!#§¡×!1Ñ!1°+Ó!>�JØILÐPZÔIZ Ð,D¨j×.?Ñ.?ÀÓ.DÑ!EÐ`j�JØ%- J¨c°*°¸RÀ¸}Ð"M�Kð #Ð"ð &. J¨e°K°=Ð"A�KØ"Ð"ô %¨×/HÑ/HÔI×QÑQØ×'DÑ'Dð Ró 
ˆô % [Ó1Ð1øôs  ×%Ñ%×=Ñ=Ü×%Ñ%×8Ñ8Ü×%Ñ%×;Ñ;Ü×%Ñ%×4Ñ4ð	ô 7ô (¬¨A«Ó/°QÐ6ûð7ús   Ä BN ÎA+PÐPÐPc                óh   € V ^8„  d   QhR\         \        \        \        3,          ,          R\        /# )r-   r‚   r/   )r   r
   r1   Údict)r3   s   "r(   r4   r4     s(   € ÷ ñ ¬´´s¼D°yÕ1AÕ(Bð Ìcñ r'   c                 ó°  € R \          2pVR\        P                   2,          pVR\        P                    2,          pVR\        P                   2,          p\        P
                  '       d   VR\        P                   2,          p\        P                  '       d   VR\        P                   2,          p\        P                  '       d   VR\        P                   2,          p\        V \        4      '       d3   VRRP                  R V P                  4        4       4       2,          pV# \        V \        4      '       d   VRV ,           ,          pV# )	z	datasets/z	; python/z	; hf_hub/z
; pyarrow/z; torch/z; tensorflow/z; jax/z; c              3   ó4   "  € T F  w  rV R V 2x € K  	  R# 5irU   r    )rZ   ÚkÚvs   &  r(   r\   Ú*get_datasets_user_agent.<locals>.<genexpr>  s   é € ÐGÑ4F©D¨A ˜s ! A 3�ZÓ4Fùs   ‚)r   r   Ú
PY_VERSIONr—   ÚPYARROW_VERSIONÚTORCH_AVAILABLEÚTORCH_VERSIONÚTF_AVAILABLEÚ
TF_VERSIONÚJAX_AVAILABLEÚJAX_VERSIONrL   r¹   r_   Úitemsr1   )r‚   Úuas   & r(   rœ   rœ     s#  € Ø”[�MÐ	"€BØˆI”f×'Ñ'Ð(Ð
)Õ)€BØˆI”o×1Ñ1Ð2Ð
3Õ3€BØˆJ”v×-Ñ-Ð.Ð
/Õ/€BÜ××ÐØ
�œ×-Ñ-Ð.Ð/Õ/ˆÜ××ÐØ
�œf×/Ñ/Ð0Ð1Õ1ˆÜ××ÐØ
�”v×)Ñ)Ð*Ð+Õ+ˆÜ�*œd×#Ò#Ø
��4—9‘9ÑG°J×4DÑ4DÔ4FÓGÓGÐHÐIÕIˆð €Iô 
�J¤×	$Ò	$Ø
ˆd�ZÕÕˆØ€Ir'   c                ót   € V ^8„  d   QhR\         R\        \        \         \        3,          ,          R\        /# )r-   ro   r~   r/   )r1   r   r
   r2   r¹   )r3   s   "r(   r4   r4     s0   € ÷ ñ ¬Cð ¼ÄÄsÌDÀyÕAQÕ8Rð Ô^bñ r'   c                óœ   € V P                  \        P                  4      '       d'   \        P                  P                  VR\        R7      # / # )zHandle the HF authenticationr   )r~   r€   r�   )r–   r   r™   r—   rŸ   Úbuild_hf_headersr   )ro   r~   s   &&r(   Ú"get_authentication_headers_for_urlrÌ     sC   € à
‡~�~”f×(Ñ(×)Ò)Ü×$Ñ$×5Ñ5Ø jÄ+ð 6ó 
ð 	
ð ˆ	r'   c                ó:   € V ^8„  d   QhR\         \        ,          /# )r-   Úmsg©r   r1   )r3   s   "r(   r4   r4     s   € ÷ 
ñ 
¬8´C­=ñ 
r'   c                ó¤   € \         P                  '       d:   \        P                  P	                  V f   R4      hR\        V 4      ,           4      hR# )z\Raise an OfflineModeIsEnabled error (subclass of ConnectionError) if HF_HUB_OFFLINE is True.NzOffline mode is enabled.zOffline mode is enabled. )r   ÚHF_HUB_OFFLINEr—   ÚerrorsÚOfflineModeIsEnabledr1   )rÎ   s   &r(   Ú!_raise_if_offline_mode_is_enabledrÔ     sM   € ä××ÐÜ×$Ñ$×9Ñ9Ø*-ª+Ð&ó
ð 	
Ø;VÔY\Ð]`ÓYaÕ;aó
ð 	
ñ r'   c                 óp   € \        R V  24       \        V 3/ T;'       g    / B w  r#VP                  V4      # )úTried to reach )rÔ   r   Úinfo)ro   rŠ   Úfsr;   s   &&  r(   Úfsspec_headrÙ   %  s8   € Ü%¨¸°uÐ&=Ô>Ü˜Ñ8 ×!6Ð!6°BÑ8�H€BØ�7‰7�4‹=Ðr'   c                  óP   € \         P                  ! \        P                  R R/4      # )Ú8HF_DATASETS_STACK_MULTIPROCESSING_DOWNLOAD_PROGRESS_BARSÚ1)r   r¹   r:   Úenvironr    r'   r(   Ú,stack_multiprocessing_download_progress_barsrÞ   +  s    € ô �:Š:”b—j‘jÐ#]Ð_bÐ"cÓdÐdr'   c                   ó6   a a€ ] tR tRt oRV 3R lltRtVtV ;t# )ÚTqdmCallbacki1  c                óê   <€ \         P                  \        P                  ! R 4      8  d"   \        SV `  ! V.VO5/ VB  \        V n        R# \        P                  VR&   \        SV `  ! V.VO5/ VB  R# )z2024.2.0Útqdm_clsN)r   ÚFSSPEC_VERSIONr   ÚparseÚsuperÚ__init__r   Útqdm)ÚselfÚtqdm_kwargsÚargsÚkwargsÚ	__class__s   &&*,€r(   ræ   ÚTqdmCallback.__init__2  s]   ø€ Ü× Ñ ¤7§=¢=°Ó#<Ô<Ü‰GÒ˜[Ð:¨4Ò:°6Ò:ÜˆDŽJä!&§¡ˆF�:ÑÜ‰GÒ˜[Ð:¨4Ò:°6Ô:r'   )r   ©N)r"   r#   r$   r%   ræ   r&   Ú__classdictcell__Ú__classcell__©rì   Ú__classdict__s   @@r(   rà   rà   1  s   ù‡ € ÷;÷ ;r'   rà   Fc                 óª  € \        R V  24       \        V 3/ T;'       g    / B w  rV\        RT;'       g    RRRRRR\        P                  P                  R4      R	8X  dL   \        P                  ! 4       P                  '       d'   \        P                  ! 4       P                  R,          MR
RV/R7      pVP                  WaP                  VR7       R
# )rÖ   ÚdescÚDownloadingÚunitÚBÚ
unit_scaleTÚpositionrÛ   rÜ   NÚdisable)ré   )Úcallbackéÿÿÿÿ)rÔ   r   rà   r:   rÝ   ÚgetÚmultiprocessingÚcurrent_processÚ	_identityÚget_fileÚname)ro   Ú	temp_filerŠ   rô   rŒ   rØ   r;   rû   s   &&&&&   r(   Ú
fsspec_getr  ;  s¸   € Ü%¨¸°uÐ&=Ô>Ü˜Ñ8 ×!6Ð!6°BÑ8�H€BÜà�D×)Ð)˜MØ�CØ˜$ØÜ�z‰z�~‰~ÐXÓYÐ]`Ô`Ü×/Ò/Ó1×;×;Ð;ô (×7Ò7Ó9×CÑCÀBÖGð Ø�|ð	
ô€Hð ‡K�K�—n‘n¨x€KÖ8r'   c                ó$   € V ^8„  d   QhR\         /# rx   rR   )r3   s   "r(   r4   r4   M  s   € ÷ Tñ Tô 	ñTr'   c	                óì  € Vf   / pVf   \         P                  p\        V\        4      '       d   \	        V4      p\
        P                  ! VRR7       Rp	Rp
\        V RR7      p\
        P                  P                  W4      p\
        P                  P                  V4      '       d   V'       g   V'       g   V# \        WR7      pVe   W=R&   \        WR7      p	V'       d-   V	P                  RR4      ;'       g    V	P                  R	R4      MRp
\        W
4      p\
        P                  P                  W4      p\
        P                  P                  V4      '       d   V'       g   V# VR
,           p\        V4      ;_uu_ 4        \
        P                  P                  V4      '       d   V'       g   VuuRRR4       # VR,           p\        VR4      ;_uu_ 4       p\         P#                  V  RVP$                   24       \'        V VWgVR7       RRR4       \         P#                  RV  RV 24       \(        P*                  ! XP$                  V4       \         P#                  RV 24       RV R	V
/pVR,           p\        VRRR7      ;_uu_ 4       p\,        P.                  ! VV4       RRR4       RRR4       V#   + '       g   i     L³; i  + '       g   i     L-; i  + '       g   i     T# ; i)ad  
Given a URL, look for the corresponding file in the local cache.
If it's not there, download it. Then return the path to the cached file.

Return:
    Local path (string)

Raises:
    FileNotFoundError: in case of non-recoverable file
        (non-existent or no cache on disk)
    ConnectionError: in case of unreachable url
        and no cache on disk
NT)Úexist_ok)rp   )r~   z
user-agent©rŠ   ÚETagrp   z.lockr)   zw+bzB not found in cache or force_download set to True, downloading to )rŠ   rô   rŒ   zstoring z in cache at zcreating metadata file for ro   z.jsonÚwri   )Úencoding)r   ÚHF_DATASETS_CACHErL   r   r1   r:   Úmakedirsrv   r;   r_   r¦   rÌ   rÙ   rý   r   ÚopenÚloggerr×   r  r  ÚshutilÚmoveÚjsonÚdump)ro   rˆ   r†   r‚   r‰   r~   rŠ   r‹   rŒ   Úresponserp   rs   Ú
cache_pathÚheadersÚ	lock_pathÚincomplete_pathr  ÚmetaÚ	meta_pathÚ	meta_files   &&&&&&&&&           r(   r¥   r¥   M  sF  € ð0 ÒØˆØÒÜ×,Ñ,ˆ	Ü�)œT×"Ò"Ü˜	“Nˆ	ä‡K‚K�	 DÕ)à€HØ€Dô $ C¨dÔ3€HÜ—‘—‘˜iÓ2€Jä	‡w�w‡~�~�j×!Ò!¯.ÇØÐô 1°ÔB€GØÒØ *�Ñä˜3Ô@€HßIQˆH�L‰L˜ Ó&×DÐD¨(¯,©,°v¸tÓ*DøÐW[€Dô $ CÓ.€HÜ—‘—‘˜iÓ2€Jä	‡w�w‡~�~�j×!Ò!¯.ØÐð ˜WÕ$€IÜ	�)×	Õ	ä�7‰7�>‰>˜*×%Ò%¯nØ÷ 
Ò	ð
 % }Õ4ˆô �/ 5×)Ô)¨YÜ�K‰K˜3˜%ÐaÐbk×bpÑbpÐaqÐrÔsä�s˜I°ÐiuÕv÷ *ô
 	�‰�h˜s˜e =°°Ð=Ô>Ü�Š�I—N‘N JÔ/ä�‰Ð1°*°Ð>Ô?Ø�s˜F DÐ)ˆØ Õ(ˆ	Ü�)˜S¨7×3Õ3°yÜ�IŠI�d˜IÔ&÷ 4÷) 
ð. Ð÷ *×)ú÷ 4×3ú÷) 
Ö	ð. ÐúsI   Æ-K"Æ4K"Ç K"Ç4J<	ÈBK"ÊK	Ê*K"Ê<KËK"ËKËK"Ë"K3	c                  ó   a € V 3R  lpV# )c                 ó„   <€ R P                  S4      R,           V P                  e   V P                  MR ,           V n        V # )r7   ú

)r_   Ú__doc__©ÚfnÚdocstrs   &€r(   Údocstring_decoratorÚ1add_start_docstrings.<locals>.docstring_decorator¥  s1   ø€ Ø—W‘W˜V“_ vÕ-¸r¿z¹zÒ?U°·²Ð[]Õ^ˆŒ
Øˆ	r'   r    ©r"  r#  s   j r(   Úadd_start_docstringsr&  ¤  ó   ø€ õð Ðr'   c                  ó   a € V 3R  lpV# )c                 ó„   <€ V P                   e   V P                   MRR,           RP                  S4      ,           V n         V # )Nr7   r  )r  r_   r   s   &€r(   r#  Ú/add_end_docstrings.<locals>.docstring_decorator­  s1   ø€ Ø$&§J¡JÒ$:�b—j’jÀÀfÕLÈrÏwÉwÐW]ËÕ^ˆŒ
Øˆ	r'   r    r%  s   j r(   Úadd_end_docstringsr+  ¬  r'  r'   c                 ó&   € \        R  V  4       4      # )c              3   óT   "  € T F  qP                  4       P                  x € K   	  R # 5irî   )ÚstatÚst_size)rZ   r;   s   & r(   r\   Ú(estimate_dataset_size.<locals>.<genexpr>µ  s   é € Ð5©u t�y‰y‹{×"Ö"«uùs   ‚&()Úsum)Úpathss   &r(   Úestimate_dataset_sizer3  ´  s   € ÜÑ5©uÓ5Ó5Ð5r'   c                ó8   € V ^8„  d   QhR\         P                  /# )r-   Úf)ÚioÚ	RawIOBase)r3   s   "r(   r4   r4   ¸  s   € ÷ 
ñ 
”—‘ñ 
r'   c                 ó¦   € \        4       p V P                  ^4      pV'       g   M"W,          pVP                  R4      '       g   K<   \        V4      # )Tó   
)Ú	bytearrayÚreadrn   Úbytes)r5  ÚresÚbs   &  r(   Úreadliner?  ¸  sB   € ä
‹+€CØ
Ø�F‰F�1‹IˆßØØ�ˆØ�<‰<˜×ÔØÜ�‹:Ðr'   rj   ÚzipÚevalz(?<!:):/Ú504B0304Ú504B0506Ú504B0708Ú425A68Úbz2Ú1F8BÚgzipÚFD377A585A00ÚxzÚ04224D18Úlz4Ú28B52FFDÚzstds   Rar!Úrarc              #   ó8   "  € T F  p\        V4      x € K  	  R # 5irî   )Úlen)rZ   Úmagic_numbers   & r(   r\   r\   ú  s   é € ð áuˆô ˆ×ÐÛuùs   ‚c                   ó   € ] tR tRtRtR# )ÚNonStreamableDatasetErrori   r    Nr!   r    r'   r(   rT  rT     s   † Ûr'   rT  c                ó0   € V ^8„  d   QhR\         R\         /# rG   rR   )r3   s   "r(   r4   r4     s   € ÷ ñ œcð ¤cñ r'   c                 óx   € V P                  R 4      R,          pR F  pVP                  V4      ^ ,          pK  	  V# )rj   z?-_rü   )r¬   )r;   rµ   Úsymbs   &  r(   r«   r«     s9   € à—
‘
˜3“ Õ#€Ió ˆØ—O‘O DÓ)¨!Õ,Š	ñ àÐr'   c                ó:   € V ^8„  d   QhR\         \        ,          /# rx   rÏ   )r3   s   "r(   r4   r4     s   € ÷ `ñ `´X¼cµ]ñ `r'   c                ó¨  €  V P                  ^ 4       T P	                  \
        4      pT P                  ^ 4       \        \
        4       Fd  p\        P                  TR\
        T,
           4      pTe   Tu # \        P                  TR\
        T,
           4      pTf   KW  \        RT R24      h	  R#   \        \        P                  3 d     R# i ; i)zQread the magic number from a file-like object and return the compression protocolNzCompression protocol 'z' not implemented.)ÚseekÚAttributeErrorr6  ÚUnsupportedOperationr;  ÚMAGIC_NUMBER_MAX_LENGTHÚrangeÚ$MAGIC_NUMBER_TO_COMPRESSION_PROTOCOLrý   Ú0MAGIC_NUMBER_TO_UNSUPPORTED_COMPRESSION_PROTOCOLÚNotImplementedError)r5  rR  ÚiÚcompressions   &   r(   Ú*_get_extraction_protocol_with_magic_numberrd    sÃ   € ðØ	�‰ˆqŒ	ð —6‘6Ô1Ó2€LØ‡F�Fˆ1„IÜÔ*Ö+ˆÜ:×>Ñ>¸|ÐLiÔNeÐhiÕNiÐ?jÓkˆØÒ"ØÒÜF×JÑJÈ<ÐXuÔZqÐtuÕZuÐKvÓwˆØÔ"Ü%Ð(>¸{¸mÐK]Ð&^Ó_Ð_ó ,øô	 œB×3Ñ3Ð4ô Úðús   ‚B2 Â2CÃCc                óh   € V ^8„  d   QhR\         R\        \        ,          R\        \         ,          /# ©r-   Úurlpathr{   r/   ©r1   r   r   )r3   s   "r(   r4   r4      s-   € ÷ ñ ¤cð ¼HÄ^Õ<Tð Ô`hÔilÕ`mñ r'   c                 ó8  € \        V 4      p V P                  R 4      ^ ,          p\        V4      pV\        9   g   VR9   g   VP	                  R4      '       d   R# V\
        9   d   \
        V,          # \        WR7      w  r \        P                  ! V 3/ T;'       g    / B ;_uu_ 4       p\        V4      uuRRR4       #   + '       g   i     R# ; i  \         d;    T P                  \        P                  4      '       d   \        T R,           4      Rhh i ; i)r�   Nrz   úS
If the repo is private or gated, make sure to log in with `huggingface-cli login`.r�   r“   )r1   r¬   r«   ÚBASE_KNOWN_EXTENSIONSrn   Ú!COMPRESSION_EXTENSION_TO_PROTOCOLr•   Úfsspecr  rd  r¤   r–   r   r™   )rg  r{   r;   rµ   rŠ   r5  s   &&    r(   rª   rª      sê   € ä�'‹l€GØ�=‰=˜Ó˜qÕ!€DÜ# DÓ)€IàÔ*Ô*Ø˜Ô&Ø�=‰=Ð;×<Ò<áØ	Ô7Ô	7Ü0°Õ;Ð;Ü@ÀÔjÑ€Gð	Ü�[Š[˜Ñ< _×%:Ð%:¸×<Ò<ÀÜ=¸aÓ@÷ =×<×<Ó<ûäô Ø×Ñœf×0Ñ0×1Ò1Ü#ØÐpÕpóàðð ðús0   Â)C Â*C Â5
C Ã C	ÃC ÃC Ã/DÄDc                ó   € \        V 4      P                  R4      vr\        V 4      '       d#   \        P                  P
                  ! V .VO5!  # \        P
                  ! V .VO5!  p RP                  V .V,           4      # )u÷  
This function extends os.path.join to support the "::" hop separator. It supports both paths and urls.

A shorthand, particularly useful where you have multiple hops, is to â€œchainâ€� the URLs with the special separator "::".
This is used to access files inside a zip file over http for example.

Let's say you have a zip file at https://host.com/archive.zip, and you want to access the file inside the zip file at /folder1/file.txt.
Then you can just chain the url this way:

    zip://folder1/file.txt::https://host.com/archive.zip

The xjoin function allows you to apply the join on the first path of the chain.

Example::

    >>> xjoin("zip://folder1::https://host.com/archive.zip", "file.txt")
    zip://folder1/file.txt::https://host.com/archive.zip
r�   )r1   r¬   rA   r:   r;   r_   r^   )ÚaÚpr>  s   &* r(   Úxjoinrq  :  sc   € ô& �‹F�L‰L˜Ó€E€AÜ�Q×ÒÜ�w‰w�|Š|˜AÐ" Ó"Ð"ä�NŠN˜1Ð!˜qÓ!ˆØ�y‰y˜!˜˜q�Ó!Ð!r'   c                óf  € \        V 4      P                  R4      vr\        V 4      '       d8   \        P                  P                  \        V 4      P                  4       4      p M\        P
                  ! V 4      p V P                  R4      '       d
   V R,          p RP                  V .V,           4      # )u÷  
This function extends os.path.dirname to support the "::" hop separator. It supports both paths and urls.

A shorthand, particularly useful where you have multiple hops, is to â€œchainâ€� the URLs with the special separator "::".
This is used to access files inside a zip file over http for example.

Let's say you have a zip file at https://host.com/archive.zip, and you want to access the file inside the zip file at /folder1/file.txt.
Then you can just chain the url this way:

    zip://folder1/file.txt::https://host.com/archive.zip

The xdirname function allows you to apply the dirname on the first path of the chain.

Example::

    >>> xdirname("zip://folder1/file.txt::https://host.com/archive.zip")
    zip://folder1::https://host.com/archive.zip
r�   Ú:ú//)r1   r¬   rA   r:   r;   rf   r   r`   r^   rn   r_   ©ro  r>  s   & r(   Úxdirnamerv  U  s   € ô& �‹F�L‰L˜Ó€E€AÜ�Q×ÒÜ�G‰G�O‰OœD ›G×,Ñ,Ó.Ó/‰ä×Ò˜aÓ ˆð 	‡z�z�#‡‚Ø	ˆT�	ˆØ�9‰9�a�S˜1•WÓÐr'   c                óF   € V ^8„  d   QhR\         R\        \        ,          /# )r-   rg  r{   rh  )r3   s   "r(   r4   r4   t  s   € ÷ #ñ #”Sð #¬8´NÕ+Cñ #r'   c                ó  € \        V 4      P                  R4      vr#\        V4      '       d    \        P                  P                  V4      # \        WR7      w  rV P                  R4      vr#\        V 3/ VB vrVVP                  V4      # )zíExtend `os.path.exists` function to support both local and remote files.

Args:
    urlpath (`str`): URL path.
    download_config : mainly use token or storage_options to support different platforms and auth types.

Returns:
    `bool`
r�   rz   )Ú_as_strr¬   rA   r:   r;   r¦   r•   r   )rg  r{   Úmain_hopÚ	rest_hopsrŠ   rØ   Ú_s   &&     r(   Úxexistsr}  t  sx   € ô # 7Ó+×1Ñ1°$Ó7Ð€HÜ�X×ÒÜ�w‰w�~‰~˜hÓ'Ð'ä#DÀWÔ#nÑ ˆØ&Ÿ}™}¨TÓ2ÐˆÜ˜7Ñ6 oÑ6ˆˆØ�y‰y˜Ó"Ð"r'   c                óò   € \        V 4      P                  R4      vr\        V 4      '       d7   \        P                  P                  \        V 4      P                  4       4      # \        P
                  ! V 4      # )uØ  
This function extends os.path.basename to support the "::" hop separator. It supports both paths and urls.

A shorthand, particularly useful where you have multiple hops, is to â€œchainâ€� the URLs with the special separator "::".
This is used to access files inside a zip file over http for example.

Let's say you have a zip file at https://host.com/archive.zip, and you want to access the file inside the zip file at /folder1/file.txt.
Then you can just chain the url this way:

    zip://folder1/file.txt::https://host.com/archive.zip

The xbasename function allows you to apply the basename on the first path of the chain.

Example::

    >>> xbasename("zip://folder1/file.txt::https://host.com/archive.zip")
    file.txt
r�   )	r1   r¬   rA   r:   r;   r®   r   r`   r^   ru  s   & r(   Ú	xbasenamer  ‰  sV   € ô& �‹F�L‰L˜Ó€E€AÜ�Q×ÒÜ�w‰w×Ñ¤ Q£× 0Ñ 0Ó 2Ó3Ð3ä×!Ò! !Ó$Ð$r'   c                ól  € \        V 4      P                  R4      vr\        V 4      '       d7   \        P                  P                  \        V 4      P                  4       4      # \        P                  ! V 4      w  rRP                  V P                  R4      '       d
   V R,           MT .V,           4      V3# )u   
This function extends os.path.split to support the "::" hop separator. It supports both paths and urls.

A shorthand, particularly useful where you have multiple hops, is to â€œchainâ€� the URLs with the special separator "::".
This is used to access files inside a zip file over http for example.

Let's say you have a zip file at https://host.com/archive.zip, and you want to access the file inside the zip file at /folder1/file.txt.
Then you can just chain the url this way:

    zip://folder1/file.txt::https://host.com/archive.zip

The xsplit function allows you to apply the xsplit on the first path of the chain.

Example::

    >>> xsplit("zip://folder1/file.txt::https://host.com/archive.zip")
    ('zip://folder1::https://host.com/archive.zip', 'file.txt')
r�   rs  rt  )
r1   r¬   rA   r:   r;   r   r`   r^   r_   rn   )ro  r>  Útails   &  r(   Úxsplitr‚  £  s�   € ô& �‹F�L‰L˜Ó€E€AÜ�Q×ÒÜ�w‰w�}‰}œT !›W×-Ñ-Ó/Ó0Ð0ä—/’/ !Ó$‰ˆØ�y‰y a§j¡j°§o¢o˜!˜dž(¸1Ð=ÀÕAÓBÀDÐHÐHr'   c                ó,  € \        V 4      P                  R4      vr\        V 4      '       d7   \        P                  P                  \        V 4      P                  4       4      # \        P
                  ! V 4      w  rRP                  V .V,           4      V3# )u  
This function extends os.path.splitext to support the "::" hop separator. It supports both paths and urls.

A shorthand, particularly useful where you have multiple hops, is to â€œchainâ€� the URLs with the special separator "::".
This is used to access files inside a zip file over http for example.

Let's say you have a zip file at https://host.com/archive.zip, and you want to access the file inside the zip file at /folder1/file.txt.
Then you can just chain the url this way:

    zip://folder1/file.txt::https://host.com/archive.zip

The xsplitext function allows you to apply the splitext on the first path of the chain.

Example::

    >>> xsplitext("zip://folder1/file.txt::https://host.com/archive.zip")
    ('zip://folder1/file::https://host.com/archive.zip', '.txt')
r�   )
r1   r¬   rA   r:   r;   Úsplitextr   r`   r^   r_   )ro  r>  Úexts   &  r(   Ú	xsplitextr†  ¾  sq   € ô& �‹F�L‰L˜Ó€E€AÜ�Q×ÒÜ�w‰w×Ñ¤ Q£× 0Ñ 0Ó 2Ó3Ð3ä×#Ò# AÓ&‰ˆØ�y‰y˜!˜˜q�Ó! 3Ð&Ð&r'   c                óF   € V ^8„  d   QhR\         \        ,          R\        /# ©r-   r{   r/   ©r   r   r2   )r3   s   "r(   r4   r4   Ù  s   € ÷ #ñ #¤8¬NÕ#;ð #Ätñ #r'   c                ó  € \        V 4      P                  R4      vr#\        V4      '       d    \        P                  P                  V 4      # \        WR7      w  rV P                  R4      vr#\        V 3/ VB vrVVP                  V4      # )zÛExtend `os.path.isfile` function to support remote files.

Args:
    path (`str`): URL path.
    download_config : mainly use token or storage_options to support different platforms and auth types.

Returns:
    `bool`
r�   rz   )r1   r¬   rA   r:   r;   Úisfiler•   r   )r;   r{   rz  r{  rŠ   rØ   r|  s   &&     r(   ÚxisfilerŒ  Ù  su   € ô ˜t›9Ÿ?™?¨4Ó0Ð€HÜ�X×ÒÜ�w‰w�~‰~˜dÓ#Ð#ä AÀ$Ô hÑˆØ#Ÿz™z¨$Ó/ÐˆÜ˜4Ñ3 ?Ñ3ˆˆØ�y‰y˜Ó"Ð"r'   c                óF   € V ^8„  d   QhR\         \        ,          R\        /# rˆ  )r   r   Úint)r3   s   "r(   r4   r4   í  s   € ÷ ñ ¤H¬^Õ$<ð Ìñ r'   c                ó"  € \        V 4      P                  R4      vr#\        V4      '       d    \        P                  P                  V 4      # \        WR7      w  rV P                  R4      vr#\        V 3/ VB ;vrVvrV VP                  V4      pTf9   \        YR7      ;_uu_ 4       p\        TP                  4       4      pRRR4       T# T#   \        P                  P                   d    \        RT  24      hi ; i  + '       g   i     T# ; i)zåExtend `os.path.getsize` function to support remote files.

Args:
    path (`str`): URL path.
    download_config : mainly use token or storage_options to support different platforms and auth types.

Returns:
    `int`: optional
r�   rz   zNo such file: N)r1   r¬   rA   r:   r;   Úgetsizer•   r   Úsizer—   rŸ   r¡   r¤   ÚxopenrQ  r;  )	r;   r{   rz  r{  rŠ   rØ   r|  r‘  r5  s	   &&       r(   Úxgetsizer“  í  sî   € ô ˜t›9Ÿ?™?¨4Ó0Ð€HÜ�X×ÒÜ�w‰w�‰˜tÓ$Ð$ä AÀ$Ô hÑˆØ#Ÿz™z¨$Ó/ÐˆÜ# DÑ<¨OÑ<Ð<ˆˆ��ð	=Ø—7‘7˜8Ó$ˆDð Š<ä�t×=Õ=ÀÜ˜1Ÿ6™6›8“}�÷ >àˆˆtˆøô ×$Ñ$×7Ñ7ô 	=Ü# n°T°FÐ$;Ó<Ð<ð	=ú÷ >Ö=àˆús   Á=C Â&C=Ã.C:Ã=D	c                óF   € V ^8„  d   QhR\         \        ,          R\        /# rˆ  r‰  )r3   s   "r(   r4   r4   	  s   € ÷ $ñ $¤(¬>Õ":ð $Ädñ $r'   c                ó|  € \        V 4      P                  R4      vr#\        V4      '       d    \        P                  P                  V 4      # \        WR7      w  rV P                  R4      vr#\        V 3/ VB ;vrVvrVVP                  R4      R,          pVP                  R4      '       g   R# VP                  V4      # )zÚExtend `os.path.isdir` function to support remote files.

Args:
    path (`str`): URL path.
    download_config : mainly use token or storage_options to support different platforms and auth types.

Returns:
    `bool`
r�   rz   rŽ   rV   Trü   )	r1   r¬   rA   r:   r;   Úisdirr•   r   Ústrip)r;   r{   rz  r{  rŠ   rØ   r|  Ú
inner_paths   &&      r(   Úxisdirr™  	  s£   € ô ˜t›9Ÿ?™?¨4Ó0Ð€HÜ�X×ÒÜ�w‰w�}‰}˜TÓ"Ð"ä AÀ$Ô hÑˆØ#Ÿz™z¨$Ó/ÐˆÜ# DÑ<¨OÑ<Ð<ˆˆ��Ø—^‘^ EÓ*¨2Õ.ˆ
Ø×Ñ ×$Ò$ÙØ�x‰x˜
Ó#Ð#r'   c                ó¤  € \        V 4      P                  R4      vr#\        V4      '       dH   V'       d!   \        P                  P                  W!R7      # \        P                  P                  V4      # V'       d8   \        P
                  ! V\        V4      P                  R4      ^ ,          R7      # \        P                  P                  V4      # )zŸExtend `os.path.relpath` function to support remote files.

Args:
    path (`str`): URL path.
    start (`str`): Start URL directory path.

Returns:
    `str`
r�   )Ústart)r1   r¬   rA   r:   r;   Úrelpathr^   )r;   r›  rz  r{  s   &&  r(   Úxrelpathr�     s�   € ô ˜t›9Ÿ?™?¨4Ó0Ð€HÜ�X×Òß9>Œr�w‰w�‰˜xˆÓ5Ð]ÄBÇGÁGÇOÁOÐT\ÓD]Ð]çOTŒy× Ò  ´°U³×1AÑ1AÀ$Ó1GÈÕ1JÔKÐsÔZ\×ZaÑZa×ZiÑZiÐjrÓZsÐsr'   c                   ó2   a € ] tR tRt o R tR tR tRtV tR# )Ú_OverridableIOWrapperi1  c                ó    € / V n         Wn        R # rî   ©Ú
_overridesr5  )rè   r5  s   &&r(   ræ   Ú_OverridableIOWrapper.__init__2  s   € ØˆŒØŽr'   c                ó¬   € VR 8X  d   \         P                  W4      # WP                  9   d   V P                  V,          # \        V P                  V4      # )r¢  )ÚobjectÚ__getattribute__r¢  Úgetattrr5  )rè   Úattrs   &&r(   r¦  Ú&_OverridableIOWrapper.__getattribute__6  sE   € Ø�<ÔÜ×*Ñ*¨4Ó6Ð6Ø—_‘_Ô$Ø—?‘? 4Õ(Ð(Ü�t—v‘v˜tÓ$Ð$r'   c                ó`   € VR 8X  d   \         P                  WV4       R# W P                  V&   R# )r¢  N)r¥  Ú__setattr__r¢  )rè   r¨  Úvalues   &&&r(   r«  Ú!_OverridableIOWrapper.__setattr__=  s&   € Ø�<ÔÜ×Ñ˜t¨5Ö1à$)�O‰O˜DÓ!r'   r¡  N)	r"   r#   r$   r%   ræ   r¦  r«  r&   rï   ©rò   s   @r(   rŸ  rŸ  1  s   ø‡ € òò%÷*ð *r'   rŸ  c                 ó¤   aa€ V P                   o\        P                  oVV3R  lp Wn         V #   \         d    \	        T 4      p Yn          T # i ; i)c                  óà  <€ R p\        ^S^,           4       F  p S! V / VB p V# 	  \%        R4      Vh  \         d_   pTp\        P                  R\        P
                   RT RS R24       \        P                  ! \        P
                  4        R p?K�  R p?i\        P                  P                   Ed3   pTP                  ez   TP                  P                  \        8X  d[   Tp\        P                  R\        P                   RT RS R24       \        P                  ! \        P                  4        R p?EK+  TP                  e˜   TP                  P                  \        8X  dy   Tp\        P                  \!        T4      4       \        P                  R\        P"                   RT RS R24       \        P                  ! \        P"                  4        R p?EKÐ  h R p?ii ; i)Nz4Got disconnected from remote data host. Retrying in úsec [rV   Ú]úServer Disconnected)r^  ÚCONNECTION_ERRORS_TO_RETRYr  Úwarningr   ÚSTREAMING_READ_RETRY_INTERVALÚtimeÚsleepr—   rÒ   ÚHfHubHTTPErrorr  Ústatus_codeÚSERVER_UNAVAILABLE_CODEÚ0STREAMING_READ_SERVER_UNAVAILABLE_RETRY_INTERVALÚRATE_LIMIT_CODEr1   Ú(STREAMING_READ_RATE_LIMIT_RETRY_INTERVALÚConnectionError)rê   rë   Údisconnect_errÚretryÚoutÚerrÚmax_retriesr;  s   *,    €€r(   Úread_with_retriesÚ?_add_retries_to_file_obj_read_method.<locals>.read_with_retriesH  s   ø€ ØˆÜ˜1˜k¨A�oÖ.ˆEðÙ˜DÐ+ FÑ+�Øð2 ˆ
ñ9 /ô6 "Ð"7Ó8¸nÐLøô/ .ô AØ!$�Ü—‘ØJÌ6×KoÑKoÐJpÐpuÐv{Ðu|Ð|}ð  Jð  ~Kð  KLð  Môô —
’
œ6×?Ñ?×@Ò@ûÜ"×)Ñ)×8Ñ8õ Ø—<‘<Ò+°·±×0HÑ0HÔLcÔ0cØ%(�NÜ—N‘NØNÌv÷  PGñ  PGð  OHð  HMð  NSð  MTð  TUð  Vað  Ubð  bcð  dôô —J’Jœv×VÑV×WÓWØ—\‘\Ò-°#·,±,×2JÑ2JÌoÔ2]Ø%(�NÜ—N‘N¤3 s£8Ô,Ü—N‘NØNÌv×O~ÑO~ÐNð  @Eð  FKð  ELð  LMð  NYð  MZð  Z[ð  \ôô —J’Jœv×NÑN×OÓOàûðús5   ›4´G-¿ABÂ!G-Â:G-Â;B G(ÅBG(Ç'G(Ç(G-)r;  r   ÚSTREAMING_READ_MAX_RETRIESr[  rŸ  )Úfile_objrÅ  rÄ  r;  s   & @@r(   Ú$_add_retries_to_file_obj_read_methodrÉ  D  sS   ù€ Ø�=‰=€DÜ×3Ñ3€Köð@*Ø)Œð €Oøô ô *Ü(¨Ó2ˆØ)�Ø€Oð*ús   §/ ¯AÁAc                ó¸   € V ^8„  d   QhR\         R\        \        ,          R\        \         \        \         \        \         \
        3,          3,          3,          /# rf  ©r1   r   r   Útupler¹   r   )r3   s   "r(   r4   r4   p  sE   € ÷ 	8ñ 	8Üð	8Ü#+¬NÕ#;ð	8ä
Œ3””Sœ$œs¤C˜x�.Ð(Õ)Ð)Õ*ñ	8r'   c                 óÀ   € . p/ pV P                  R 4       F3  p\        WAR7      w  rEVP                  V4       VP                  V4       K5  	  R P	                  V4      X3# )r�   rz   )r¬   Ú,_prepare_single_hop_path_and_storage_optionsÚappendÚupdater_   )rg  r{   Úprepared_urlpathÚprepared_storage_optionsÚhoprŠ   s   &&    r(   r•   r•   p  sc   € ð ÐØ!ÐØ�}‰}˜TÖ"ˆÜKÈCÔqÑˆØ×Ñ Ô$Ø ×'Ñ'¨Ö8ñ #ð �9‰9Ð%Ó&¨Ð7Ð7r'   c                ó¸   € V ^8„  d   QhR\         R\        \        ,          R\        \         \        \         \        \         \
        3,          3,          3,          /# rf  rË  )r3   s   "r(   r4   r4   |  sE   € ÷ 2$ñ 2$Üð2$Ü#+¬NÕ#;ð2$ä
Œ3””Sœ$œs¤C˜x�.Ð(Õ)Ð)Õ*ñ2$r'   c                óŽ  € Vf   RMVP                   pV P                  \        P                  4      '       dC   RV 9   d<   RV \	        \        P                  4      ^,           R P                  RR^4      ,           p RV 9   d   V P                  R4      ^ ,          MRpVe3   W1P                  9   d#   VP                  V,          P                  4       pM`Ve[   W1P                  9  dK   VP                  P                  4        UUu/ uF#  w  rVV\        P                  ! 4       9  g   K!  WVbK%  	  pppM/ pVR9   dß   VP                  R/ 4      pRR	/VCVR&   R
V 9   dŠ   \        4       P                  V ^
R7      pVP                  P                  4        F@  w  ršV	P                  R4      '       g   K  V RV
,           ,          p VP                  pRV/VCpKB  	  RV 9  d
   V R,          p V P                  R4      '       d   VP                  R/ 4      pRR/VCVR&   MVR8X  d   R\        P                  RV/VCpV'       d   W4/pW3# u uppi )a@  
Prepare the URL and the kwargs that must be passed to the HttpFileSystem or HfFileSystem

In particular it resolves google drive URLs
It also adds the authentication headers for the Hugging Face Hub, for both https:// and hf:// paths.

Storage options are formatted in the form {protocol: storage_options_for_protocol}
Nz	/resolve/r|   Ú@rŽ   ÚfileÚclient_kwargsÚ	trust_envTzdrive.google.com)ÚtimeoutÚdownload_warningz	&confirm=Úcookieszconfirm=z
&confirm=tz"https://raw.githubusercontent.com/r  zAccept-EncodingÚidentityÚhfr}   r~   >   ÚhttpÚhttps)r~   r–   r   r™   rQ  rW   r¬   rŠ   ÚcopyrÇ   rm  Úavailable_protocolsÚpopr   ÚheadrÜ  )rg  r{   r~   r´   rŠ   Úoption_nameÚoption_valuerØ  r  r¼   r½   rÜ  r  s   &&           r(   rÎ  rÎ  |  sD  € ð $Ò+‰D°×1FÑ1F€EØ×Ñœ&×,Ñ,×-Ò-°+ÀÔ2HØ˜G¤C¬×(:Ñ(:Ó$;¸aÕ$?Ð$AÐB×JÑJÈ;ÐX[Ð]^Ó_Õ_ˆØ*/°7Ô*:ˆw�}‰}˜UÓ# AÖ&À€HØÒ" x×3RÑ3RÔ'RØ)×9Ñ9¸(ÕC×HÑHÓJ‰Ø	Ò	$¨×9XÑ9XÔ)Xð .=×-LÑ-L×-RÑ-RÔ-Tô
á-TÑ)�Ø¤&×"<Ò"<Ó">Ñ>ô &ˆKÒ%Ù-Tð 	ñ 
ˆð ˆØÐ$Ô$Ø'×+Ñ+¨O¸RÓ@ˆØ,7¸Ð+OÀÐ+Oˆ˜Ñ(Ø Ô(Ü"“}×)Ñ)¨'¸2Ð)Ó>ˆHØ ×(Ñ(×.Ñ.Ö0‘�Ø—<‘<Ð 2×3Ô3Ø˜{¨Q�Õ.�GØ&×.Ñ.�GØ'0°'Ð&M¸_Ð&M’Oñ	 1ð  Ô(Ø˜<Õ'�Ø×ÑÐB×CÒCà%×)Ñ)¨)°RÓ8ˆGØ*;¸ZÐ)SÈ7Ð)SˆO˜IÑ&øØ	�TÔ	àœ×*Ñ*Ø�Uð
ð ð
ˆ÷
 Ø#Ð5ˆØÐ#Ð#ùóA
s   ÄIÄ%Ir{   c                óF   € V ^8„  d   QhR\         R\        \        ,          /# )r-   r×  r{   rh  )r3   s   "r(   r4   r4   ±  s#   € ÷ Añ A”ð A´xÄÕ7Oñ Ar'   c               óî  € \        V 4      pVP                  R4      vrg\        V4      '       d"   VP                  RR4       \	        Wa.VO5/ VB # \        WRR7      w  r/ VCT;'       g    / Cp\        P                  p	Rp
\        ^V	^,           4       Fm  p \        P                  ! V VVR7      w  rÍpVP	                  V^ ,          V4      p\        VR4      '       d#   \        VP                  R4      '       d   WÏn         M	  \5        R4      V
h\7        V4      pV#   \         d_   pTp
\        P!                  R\        P"                   R	T R
T	 R24       \$        P&                  ! \        P"                  4        Rp?Kî  Rp?i\(         d#   p\+        T4      R8X  d   \-        R4      Thh Rp?i\.         d;    T P1                  \        P2                  4      '       d   \/        T R,           4      Rhh i ; i)ay  Extend `open` function to support remote files using `fsspec`.

It also has a retry mechanism in case connection fails.
The `args` and `kwargs` are passed to `fsspec.open`, except `token` which is used for queries to private repos on huggingface.co

Args:
    file (`str`): Path name of the file to be opened.
    mode (`str`, *optional*, default "r"): Mode in which the file is opened.
    *args: Arguments to be passed to `fsspec.open`.
    download_config : mainly use token or storage_options to support different platforms and auth types.
    **kwargs: Keyword arguments to be passed to `fsspec.open`.

Returns:
    file object
r�   Ú
block_sizeNrz   r  ÚofÚ__exit__z3Failed to connect to remote data host. Retrying in r±  rV   r²  zCannot seek streaming HTTP filezÅStreaming is not possible for this dataset because data host server doesn't support HTTP range requests. You can still load this dataset in non-streaming mode by passing `streaming=False` (default)rj  r³  )ry  r¬   rA   rã  r  r•   r   ÚSTREAMING_OPEN_MAX_RETRIESr^  rm  Úget_fs_token_pathsÚhasattrrê  Ú_fsr´  r  rµ  ÚSTREAMING_OPEN_RETRY_INTERVALr·  r¸  r§   r1   rT  r¤   r–   r™   r¿  rÉ  )r×  Úmoder{   rê   rë   Úfile_strrz  r{  rŠ   rÄ  rÀ  rÁ  rØ   Úfs_tokenr2  rÈ  rÃ  r³   s   &&$*,             r(   r’  r’  ±  sð  € ô" �t‹}€HØ#Ÿ>™>¨$Ó/Ð€HÜ�X×Òà�
‰
�< Ô&Ü�HÐ4 TÒ4¨VÑ4Ð4ä=¸hÔhÑ€DØ2�Ð2˜?×0Ð0¨bÐ2€Fä×3Ñ3€Kà€NÜ�q˜+¨�/Ö*ˆð	Ü"(×";Ò";ØØØ &ô#ÑˆB˜%ð
 —w‘w˜u Q�x¨Ó.ˆHÜ�r˜4× Ò ¤W¨R¯U©U°J×%?Ò%?Ø!”Ùñ +ôB Ð3Ó4¸.ÐHÜ3°HÓ=€HØ€Oøô1 *ô 	=Ø ˆNÜ�N‰NØEÄf×FjÑFjÐEkÐkpÐqvÐpwÐwxð  zEð  yFð  FGð  Hôô �JŠJ”v×;Ñ;×<Ò<ûÜô 	Ü�1‹vÐ:Ô:Ü/ð}óð ðð
 ûÜ ô 	Ø�‰œv×1Ñ1×2Ò2Ü'ØÐqÕqóàðð ð	ús8   ÂA)DÄG4Ä(AFÆG4ÆG4ÆF,Æ,G4Æ9%G4ÇG4c                óh   € V ^8„  d   QhR\         R\        \        ,          R\        \         ,          /# )r-   r;   r{   r/   )r1   r   r   Úlist)r3   s   "r(   r4   r4   õ  s0   € ÷ Fñ F”3ð F¬´.Õ)Að FÌTÔRUÍYñ Fr'   c                ó4  € \        V 4      P                  R4      vr#\        V4      '       d   \        P                  ! V 4      # \        WR7      w  rV P                  R4      vr#\        V 3/ VB vrVVP                  R4      R,          pVP                  R4      '       d&   VP                  V4      '       g   \        RV  24      hVP	                  VRR7      pV U u. uF1  p \        P                  P                  V P                  R4      4      NK3  	  up # u up i )	zàExtend `os.listdir` function to support remote files.

Args:
    path (`str`): URL path.
    download_config : mainly use token or storage_options to support different platforms and auth types.

Returns:
    `list` of `str`
r�   rz   rŽ   rV   zDirectory doesn't exist: F)Údetailrü   )ry  r¬   rA   r:   Úlistdirr•   r   r—  r–  r¤   r;   r®   Úrstrip)	r;   r{   rz  r{  rŠ   rØ   r|  r˜  r2  s	   &&       r(   Úxlistdirrú  õ  sî   € ô # 4›=×.Ñ.¨tÓ4Ð€HÜ�X×ÒÜ�zŠz˜$ÓÐô !BÀ$Ô hÑˆØ#Ÿz™z¨$Ó/ÐˆÜ˜4Ñ3 ?Ñ3ˆˆØ—^‘^ EÓ*¨2Õ.ˆ
Ø×Ñ˜C× Ò ¨¯©°*×)=Ò)=Ü#Ð&?À¸vÐ$FÓGÐGØ—
‘
˜:¨e�
Ó4ˆÙ?DÓE¹u°t”—‘× Ñ  §¡¨SÓ!1Ö2¹uÑEÐEùÒEs   Ã7DÚ	recursivec                ó:   € V ^8„  d   QhR\         \        ,          /# ©r-   r{   ©r   r   )r3   s   "r(   r4   r4     s   € ÷ kñ k¼ÄÕ8Pñ kr'   c               ó  € \        V 4      P                  R4      vr4\        V4      '       d   \        P                  ! W1R7      # \	        WR7      w  rV P                  R4      vr4\        V 3/ VB vrgVP                  R4      ^,          pVP                  V4      p	\        VP                  \        4      '       d   VP                  MVP                  R,          p
V	 Uu. uF!  pRP                  V
 RV 2.V,           4      NK#  	  up# u upi )a“  Extend `glob.glob` function to support remote files.

Args:
    urlpath (`str`): URL path with shell-style wildcard patterns.
    recursive (`bool`, default `False`): Whether to match the "**" pattern recursively to zero or more
        directories or subdirectories.
    download_config : mainly use token or storage_options to support different platforms and auth types.

Returns:
    `list` of `str`
r�   )rû  rz   rŽ   rü   )
ry  r¬   rA   Úglobr•   r   rL   r´   r1   r_   )rg  rû  r{   rz  r{  rŠ   rØ   r|  r˜  Úglobbed_pathsr´   Úglobbed_paths   &$$         r(   Úxglobr    sã   € ô # 7Ó+×1Ñ1°$Ó7Ð€HÜ�X×ÒÜ�yŠy˜Ô7Ð7ô $EÀWÔ#nÑ ˆØ&Ÿ}™}¨TÓ2ÐˆÜ˜7Ñ6 oÑ6ˆˆØ—^‘^ EÓ*¨1Õ-ˆ
ØŸ™ 
Ó+ˆÜ",¨R¯[©[¼#×">Ò">�2—;’;ÀBÇKÁKÐPRÅOˆÙ\iÓjÑ\iÈL�—	‘	˜h˜Z s¨<¨.Ð9Ð:¸YÕFÖGÑ\iÑjÐjùÒjs   Ã'Dc                ó:   € V ^8„  d   QhR\         \        ,          /# rý  rþ  )r3   s   "r(   r4   r4   (  s   € ÷ Zñ Z¤H¬^Õ$<ñ Zr'   c              +  ó’  "  € \        V 4      P                  R4      vr4\        V4      '       d"   \        P                  ! V3/ VB  Rj  x€L
  R# \        WR7      w  rV P                  R4      vr4\        V 3/ VB vrgVP                  R4      R,          pVP                  R4      '       d   VP                  V4      '       g   . # \        VP                  \        4      '       d   VP                  MVP                  R,          p	VP                  ! V3/ VB  F(  w  r«pRP                  V	 RV
 2.V,           4      W¼3x € K*  	  R#  Lû5i)aY  Extend `os.walk` function to support remote files.

Args:
    urlpath (`str`): URL root path.
    download_config : mainly use token or storage_options to support different platforms and auth types.
    **kwargs: Additional keyword arguments forwarded to the underlying filesystem.


Yields:
    `tuple`: 3-tuple (dirpath, dirnames, filenames).
r�   Nrz   rŽ   rV   rü   )ry  r¬   rA   r:   Úwalkr•   r   r—  r–  rL   r´   r1   r_   )rg  r{   rë   rz  r{  rŠ   rØ   r|  r˜  r´   ÚdirpathÚdirnamesÚ	filenamess   &&,          r(   Úxwalkr
  (  s  é € ô # 7Ó+×1Ñ1°$Ó7Ð€HÜ�X×ÒÜ—7’7˜8Ñ. vÑ.×.Ò.ô $EÀWÔ#nÑ ˆØ&Ÿ}™}¨TÓ2ÐˆÜ˜7Ñ6 oÑ6ˆˆØ—^‘^ EÓ*¨2Õ.ˆ
Ø×Ñ˜C× Ò ¨¯©°*×)=Ò)=ØˆIÜ",¨R¯[©[¼#×">Ò">�2—;’;ÀBÇKÁKÐPRÅOˆØ,.¯GªG°JÑ,IÀ&Ô,IÑ(ˆG˜yØ—)‘) ˜z¨¨W¨IÐ6Ð7¸)ÕCÓDÀhÐYÔYó -Jñ 	/ùs   ‚AEÁ	EÁ
A8EÃBEc                   ó  a a€ ] tR tRt oRtV 3R ltRV3R lR lltRV3R lR lltR t]	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R l4       tR tV3R lR ltV3R lR ltV 3R ltRtVtV ;t# )ÚxPathiD  zHExtension of `pathlib.Path` to support both local paths and remote URLs.c                ó  <€ \         SV `  4       pVP                  R 4      vr#\        V4      '       d   V# VP	                  RR4      p\
        P                  RV4      pYDP                  R4      '       d   R,          pV# R,          pV# )r�   Ú\rV   rŽ   rs  rt  r7   )rå   Ú__str__r¬   rA   rW   Ú#SINGLE_SLASH_AFTER_PROTOCOL_PATTERNÚsubrn   )rè   Úpath_strrz  r{  Úpath_as_posixrì   s   &    €r(   r  ÚxPath.__str__G  s„   ø€ Ü‘7‘?Ó$ˆØ'Ÿ~™~¨dÓ3ÐˆÜ˜×"Ò"ØˆOØ ×(Ñ(¨¨sÓ3ˆÜ;×?Ñ?ÀÀ}ÓUˆØ×!7Ñ!7¸×!<Ò!<˜ÕDˆØÐð CEÕDˆØÐr'   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# rý  rþ  )r3   rò   s   "€r(   r4   ÚxPath.__annotate__Q  s   ø€ ÷ 	Cñ 	C¡h©~Õ&>ñ 	Cr'   c                ó.   € \        \        V 4      VR7      # )zÑExtend `pathlib.Path.exists` method to support both local and remote files.

Args:
    download_config : mainly use token or storage_options to support different platforms and auth types.

Returns:
    `bool`
rz   )r}  r1   )rè   r{   s   &&r(   r¦   ÚxPath.existsQ  s   € ô ”s˜4“y°/ÔBÐBr'   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# rý  rþ  )r3   rò   s   "€r(   r4   r  \  s   ø€ ÷ ]ñ ]©X±nÕ-Eñ ]r'   c              #  óf  "  € V P                  4       pVP                  R4      vrE\        V4      '       d%   \        V4      P	                  V4       Rj  x€L
  R# V'       dN   V^ ,          p\        WbR7      w  rgVP                  R4      ^ ,          V/pRP                  WF.VR,          O4      pMRp\        \        W14      3/ T;'       g    / B vr‰VP	                  \        WA4      4      p
V
 F<  p\        V 4      ! RP                  VP                   RV 2.V,           4      4      x € K>  	  R#  LÛ5i)a-  Glob function for argument of type :obj:`~pathlib.Path` that supports both local paths end remote URLs.

Args:
    pattern (`str`): Pattern that resulting paths must match.
    download_config : mainly use token or storage_options to support different platforms and auth types.

Yields:
    [`xPath`]
r�   Nrz   rŽ   :é   NN)r`   r¬   rA   r   r   r•   r_   r   rq  Útyper´   )rè   Úpatternr{   Ú
posix_pathrz  r{  rg  rŠ   rØ   r|  r  r  s   &&&         r(   r   Ú
xPath.glob\  s  é € ð —]‘]“_ˆ
Ø)×/Ñ/°Ó5ÐˆÜ˜×"Ò"Ü˜H“~×*Ñ*¨7Ó3×3Ò3÷ Ø# A�,�Ü+LÈWÔ+vÑ(�Ø#*§=¡=°Ó#7¸Õ#:¸OÐ"L�Ø!ŸY™Y¨Ð'J¸IÀb½MÐ'JÓK‘
à"&�Üœu ZÓ9ÑU¸o×>SÐ>SÐQSÑUˆFˆBØŸG™G¤E¨(Ó$<Ó=ˆMÛ -�Ü˜4”j §¡¨r¯{©{¨m¸3¸|¸nÐ,MÐ+NÐQZÕ+ZÓ![Ó\Ô\ó !.ñ 4ùs   ‚AD1ÁD/ÁD1Á"CD1c                ó6   € V P                   ! RV,           3/ VB # )zÅRglob function for argument of type :obj:`~pathlib.Path` that supports both local paths end remote URLs.

Args:
    pattern (`str`): Pattern that resulting paths must match.

Yields:
    [`xPath`]
z**/)r   )rè   r  rë   s   &&,r(   ÚrglobÚxPath.rglobx  s   € ð �yŠy˜ �Ñ3¨FÑ3Ð3r'   c                ó   <€ V ^8„  d   QhRR/# )r-   r/   r  r    )r3   rò   s   "€r(   r4   r  „  s   ø€ ÷ 5ñ 5˜ñ 5r'   c                óR   € \        V 4      ! \        V P                  4       4      4      # )z€Name function for argument of type :obj:`~pathlib.Path` that supports both local paths end remote URLs.

Returns:
    [`xPath`]
)r  rv  r`   ©rè   s   &r(   ÚparentÚxPath.parentƒ  s   € ô �DŒzœ( 4§=¡=£?Ó3Ó4Ð4r'   c                ó    <€ V ^8„  d   QhRS[ /# rx   rR   )r3   rò   s   "€r(   r4   r  �  ó   ø€ ÷ Bñ B‘cñ Br'   c                ót   € \        V P                  4       P                  R4      ^ ,          4      P                  # )z|Name function for argument of type :obj:`~pathlib.Path` that supports both local paths end remote URLs.

Returns:
    `str`
r�   )r   r`   r¬   r  r%  s   &r(   r  Ú
xPath.nameŒ  ó+   € ô ˜TŸ]™]›_×2Ñ2°4Ó8¸Õ;Ó<×AÑAÐAr'   c                ó    <€ V ^8„  d   QhRS[ /# rx   rR   )r3   rò   s   "€r(   r4   r  –  r)  r'   c                ót   € \        V P                  4       P                  R4      ^ ,          4      P                  # )z|Stem function for argument of type :obj:`~pathlib.Path` that supports both local paths end remote URLs.

Returns:
    `str`
r�   )r   r`   r¬   Ústemr%  s   &r(   r/  Ú
xPath.stem•  r,  r'   c                ó    <€ V ^8„  d   QhRS[ /# rx   rR   )r3   rò   s   "€r(   r4   r  Ÿ  s   ø€ ÷ Dñ D™ñ Dr'   c                ót   € \        V P                  4       P                  R4      ^ ,          4      P                  # )z~Suffix function for argument of type :obj:`~pathlib.Path` that supports both local paths end remote URLs.

Returns:
    `str`
r�   )r   r`   r¬   Úsuffixr%  s   &r(   r3  ÚxPath.suffixž  s+   € ô ˜TŸ]™]›_×2Ñ2°4Ó8¸Õ;Ó<×CÑCÐCr'   c                ó2   € \        \        V 4      .VO5/ VB # )zïExtend :func:`xopen` to support argument of type :obj:`~pathlib.Path`.

Args:
    **args: Arguments passed to :func:`fsspec.open`.
    **kwargs: Keyword arguments passed to :func:`fsspec.open`.

Returns:
    `io.FileIO`: File-like object.
)r’  r1   )rè   rê   rë   s   &*,r(   r  Ú
xPath.open§  s   € ô ”S˜“YÐ0 Ò0¨Ñ0Ð0r'   c                ó8   <€ V ^8„  d   QhRS[ S[R3,          RR/# )r-   rp  .r/   r  )rÌ  r1   )r3   rò   s   "€r(   r4   r  ³  s#   ø€ ÷ 	6ñ 	6™5¡ c �?ð 	6¨wñ 	6r'   c                óV   € \        V 4      ! \        V P                  4       .VO5!  4      # )z˜Extend :func:`xjoin` to support argument of type :obj:`~pathlib.Path`.

Args:
    *p (`tuple` of `str`): Other path components.

Returns:
    [`xPath`]
)r  rq  r`   ©rè   rp  s   &*r(   ÚjoinpathÚxPath.joinpath³  s#   € ô �DŒzœ% §¡£Ð4°!Ó4Ó5Ð5r'   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r-   rp  r/   r  rR   )r3   rò   s   "€r(   r4   r  ¾  s   ø€ ÷  ñ  ™Sð   Wñ  r'   c                ó$   € V P                  V4      # rî   )r:  r9  s   &&r(   Ú__truediv__ÚxPath.__truediv__¾  s   € Ø�}‰}˜QÓÐr'   c           	     ód  <€ \        V 4      P                  R 4      vr#\        V4      '       d(   \        V 4      ! \        \        SV `  V4      4      4      # \        V 4      ! R P                  \        V 4      ! \        V4      P                  V4      4      P                  4       .V,           4      4      # )r�   )	r1   r¬   rA   r  rå   Úwith_suffixr_   r   r`   )rè   r3  rz  r{  rì   s   &&  €r(   rA  ÚxPath.with_suffixÁ  s…   ø€ Ü" 4›yŸ™¨tÓ4ÐˆÜ˜×"Ò"Ü˜”:œc¤%¡'Ñ"5°fÓ"=Ó>Ó?Ð?Ü�DŒz˜$Ÿ)™)¤T¨$¤Z´¸hÓ0G×0SÑ0SÐTZÓ0[Ó%\×%eÑ%eÓ%gÐ$hÐktÕ$tÓuÓvÐvr'   r    rî   )r"   r#   r$   r%   r  r  r¦   r   r!  Úpropertyr&  r  r/  r3  r  r:  r>  rA  r&   rï   rð   rñ   s   @@r(   r  r  D  s¥   ù‡ € ÙRõ÷	Cò 	C÷]ò ]ò8	4ð ÷5ó ð5ð ÷Bó ðBð ÷Bó ðBð ÷Dó ðDò
1÷	6ð 	6÷ ð  ÷wõ wr'   r  c                óP   € V ^8„  d   QhR\         \        \        \        3,          /# )r-   r;   )r
   r1   r   r  )r3   s   "r(   r4   r4   È  s"   € ÷ Kñ K”%œœT¤5Ð(Õ)ñ Kr'   c                 ó~   € \        V \        4      '       d   \        V 4      # \        \        \        V 4      4      4      # rî   )rL   r  r1   )r;   s   &r(   ry  ry  È  s+   € Ü" 4¬×/Ò/Œ3ˆt‹9ÐJ´S¼¼sÀ4»yÓ9IÓ5JÐJr'   c                ó:   € V ^8„  d   QhR\         \        ,          /# rý  rþ  )r3   s   "r(   r4   r4   Ì  s   € ÷ lñ l¼8ÄNÕ;Sñ lr'   c                ó´   € ^ RI p\        V R4      '       d   VP                  ! V .VO5/ VB # \        V 4      p VP                  ! \	        V RVR7      .VO5/ VB # ©é    Nr;  Úrbrz   )rH  rî  r  r1   r’  )Úfilepath_or_bufferr{   rê   rë   rH  s   &$*, r(   Ú
xgzip_openrL  Ì  s^   € ÛäÐ! 6×*Ò*Ø�yŠyÐ+Ð=¨dÒ=°fÑ=Ð=ä Ð!3Ó4ÐØ�yŠyœÐ1°4ÈÔYÐkÐ\`ÒkÐdjÑkÐkr'   c                ó:   € V ^8„  d   QhR\         \        ,          /# rý  rþ  )r3   s   "r(   r4   r4   Ö  s   € ÷ jñ j¼HÄ^Õ<Tñ jr'   c                ó´   € ^ RI p\        V R4      '       d   VP                  ! V .VO5/ VB # \        V 4      p VP                  ! \	        V RVR7      .VO5/ VB # rH  )Únumpyrî  Úloadr1   r’  )rK  r{   rê   rë   Únps   &$*, r(   Úxnumpy_loadrR  Ö  s^   € ÛäÐ! 6×*Ò*Ø�wŠwÐ)Ð;¨DÒ;°FÑ;Ð;ä Ð!3Ó4ÐØ�wŠw”uÐ/°ÀÔWÐiÐZ^ÒiÐbhÑiÐir'   c                ó:   € V ^8„  d   QhR\         \        ,          /# rý  rþ  )r3   s   "r(   r4   r4   à  s   € ÷ 	gñ 	g¼(Ä>Õ:Rñ 	gr'   c                 óô   € ^ RI p\        V R4      '       d   VP                  ! V 3/ VB # \        V 4      p VP	                  RR4      R8X  d   \        WR7      VR&   VP                  ! \        V RVR7      3/ VB # )rI  Nr;  rc  Úinferrz   rJ  )Úpandasrî  Úread_csvr1   rý   rª   r’  ©rK  r{   rë   Úpds   &&, r(   Úxpandas_read_csvrZ  à  sv   € ÛäÐ! 6×*Ò*Ø�{Š{Ð-Ñ8°Ñ8Ð8ä Ð!3Ó4ÐØ�:‰:�m WÓ-°Ô8Ü$<Ð=OÔ$qˆF�=Ñ!Ø�{Š{œ5Ð!3°TÈ?Ô[ÑfÐ_eÑfÐfr'   c                ó:   € V ^8„  d   QhR\         \        ,          /# rý  rþ  )r3   s   "r(   r4   r4   ì  s   € ÷ ñ ¼HÄ^Õ<Tñ r'   c                 ó°  € ^ RI p\        V R4      '       d    VP                  ! V 3/ VB # \        V 4      p  VP                  ! \        V RVR7      3/ VB #   \         d.    TP                  ! \	        T P                  4       4      3/ TB u # i ; i  \         d:    TP                  ! \	        \        T RTR7      P                  4       4      3/ TB u # i ; irH  )rV  rî  Ú
read_excelr§   r   r;  r1   r’  rX  s   &&, r(   Úxpandas_read_excelr^  ì  sÛ   € ÛäÐ! 6×*Ò*ð	OØ—=’=Ð!3Ñ>°vÑ>Ð>ô !Ð!3Ó4Ðð	Ø—=’=¤Ð'9¸4ÐQ`Ô!aÑlÐekÑlÐløô ô 	OØ—=’=¤Ð);×)@Ñ)@Ó)BÓ!CÑNÀvÑNÒNð	Oûô ô 	Ø—=’=ÜœÐ0°$ÈÔX×]Ñ]Ó_Ó`ñØdjñò ð	ús#   ˜A ·B Á5BÂBÂACÃCc                ó:   € V ^8„  d   QhR\         \        ,          /# rý  rþ  )r3   s   "r(   r4   r4   þ  s   € ÷ nñ nÄXÌnÕE]ñ nr'   c                 ó¬   € ^ RI Hp \        V R4      '       d   VP                  ! V 3/ VB # \	        V 4      p VP                  ! \        V RVR7      3/ VB # )rI  Nr;  rJ  )rñ  r{   )Úpyarrow.parquetÚparquetrî  Ú
read_tabler1   r’  )rK  r{   rë   Úpqs   &&, r(   Úxpyarrow_parquet_read_tablere  þ  sT   € Ý äÐ! 6×*Ò*Ø�}Š}Ð/Ñ:°6Ñ:Ð:ä Ð!3Ó4ÐØ�}Š}œUÐ#5¸DÐRaÔbÑmÐflÑmÐmr'   c                ó:   € V ^8„  d   QhR\         \        ,          /# rý  rþ  )r3   s   "r(   r4   r4     s   € ÷ gñ g´h¼~Õ6Nñ gr'   c                 ó–   € ^ RI Hp \        V R4      '       d   VP                  ! V 3/ VB # VP                  ! \	        V RVR7      3/ VB # rH  )Úscipy.ior6  rî  Úloadmatr’  )rK  r{   rë   Úsios   &&, r(   Úxsio_loadmatrk    sG   € ÝäÐ! 6×*Ò*Ø�{Š{Ð-Ñ8°Ñ8Ð8à�{Š{œ5Ð!3°TÈ?Ô[ÑfÐ_eÑfÐfr'   c                ó:   € V ^8„  d   QhR\         \        ,          /# rý  rþ  )r3   s   "r(   r4   r4     s   € ÷ .ñ .´H¼^Õ4Lñ .r'   c                óì   € \        V R4      '       d   \        P                  ! WR7      # \        V RVR7      ;_uu_ 4       p\        P                  ! W1R7      uuRRR4       #   + '       g   i     R# ; i)aƒ  Extend `xml.etree.ElementTree.parse` function to support remote files.

Args:
    source: File path or file object.
    parser (`XMLParser`, *optional*, default `XMLParser`): Parser instance.
    download_config : mainly use token or storage_options to support different platforms and auth types.

Returns:
    `xml.etree.ElementTree.Element`: Root element of the given source document.
r;  )ÚparserrJ  rz   N)rî  ÚETrä   r’  )Úsourcern  r{   r5  s   &&& r(   Ú	xet_parserq    sM   € ô ˆv�v×ÒÜ�xŠx˜Ô.Ð.ä�6˜4°×AÕAÀQÜ—8’8˜AÔ-÷ B×A×AÓAús   Á A"Á"A3	c                ó:   € V ^8„  d   QhR\         \        ,          /# rý  rþ  )r3   s   "r(   r4   r4   #  s   € ÷ 6ñ 6¼hÄ~Õ>Vñ 6r'   c                ó<  € \        V R4      '       d,   \        P                  P                  P                  ! V 3/ VB # \        V RVR7      ;_uu_ 4       p\        P                  P                  P                  ! V3/ VB uuRRR4       #   + '       g   i     R# ; i)aŠ  Extend `xml.dom.minidom.parse` function to support remote files.

Args:
    filename_or_file (`str` or file): File path or file object.
    download_config : mainly use token or storage_options to support different platforms and auth types.
    **kwargs (optional): Additional keyword arguments passed to `xml.dom.minidom.parse`.

Returns:
    :obj:`xml.dom.minidom.Document`: Parsed document.
r;  rJ  rz   N)rî  ÚxmlÚdomÚminidomrä   r’  )Úfilename_or_filer{   rë   r5  s   &&, r(   Úxxml_dom_minidom_parserx  #  sn   € ô Ð ×(Ò(Ü�w‰w�‰×$Ò$Ð%5Ñ@¸Ñ@Ð@äÐ# T¸?×KÕKÈqÜ—7‘7—?‘?×(Ò(¨Ñ5¨fÑ5÷ L×K×KÓKús   Á+B
Â
B	c                   ó¼   a € ] tR tRt o Rt]R 4       t]R 4       t]V 3R lR l4       t	]RV 3R lR	 ll4       t
]V 3R
 lR l4       t]RV 3R lR ll4       tRtV tR# )ÚArchiveIterablei5  zIAn iterable of (path, fileobj) from a TAR archive, used by `iter_archive`c              #  óL  "  € \         P                  ! V R R7      pV F€  pVP                  pVP                  4       '       g   K'  Vf   K-  \        P
                  P                  V4      P                  R4      '       d   Kc  VP                  V4      pW43x € . Vn	        K‚  	  ?R# 5i)zr|*)Úfileobjrñ  N©rj   Ú__)
Útarfiler  r  Úisregr:   r;   r®   r–   ÚextractfileÚmembers)r5  ÚstreamÚtarinfoÚ	file_pathrÈ  s   &    r(   Ú	_iter_tarÚArchiveIterable._iter_tar8  s‡   é € ä—’ a¨eÔ4ˆÛˆGØŸ™ˆIØ—=‘=—?’?ÙØÒ ÙÜ�w‰w×Ñ 	Ó*×5Ñ5°k×BÒBáØ×)Ñ)¨'Ó2ˆHØÐ%Ò%ØˆFŽNñ ò ùs   ‚B"B$c              #  óT  "  € \         P                  ! V 4      pVP                  4        Fy  pVP                  pVP	                  4       '       d   K'  Vf   K-  \
        P                  P                  V4      P                  R4      '       d   Kc  VP                  V4      pW43x € K{  	  R # 5i)Nr}  )
ÚzipfileÚZipFileÚinfolistrs   Úis_dirr:   r;   r®   r–   r  )r5  ÚzipfÚmemberr…  rÈ  s   &    r(   Ú	_iter_zipÚArchiveIterable._iter_zipI  s}   é € ä�Š˜qÓ!ˆØ—m‘m–oˆFØŸ™ˆIØ�}‰}�ŠÙØÒ ÙÜ�w‰w×Ñ 	Ó*×5Ñ5°k×BÒBáØ—y‘y Ó(ˆHØÐ%Ô%ó &ùs   ‚B&B(c                ó6   <€ V ^8„  d   QhRS[ S[RR3,          /# )r-   r/   N)r   rÌ  )r3   rò   s   "€r(   r4   ÚArchiveIterable.__annotate__Y  s    ø€ ÷ (ñ (¡i±°t¸TÐ0AÕ&Bñ (r'   c              #  ó¢   "  € \        V4      pVR 8X  d   V P                  V4       Rj  x€L
  R# V P                  V4       Rj  x€L
  R#  L! L5i)r@  N)rd  r�  r†  )Úclsr5  rc  s   && r(   Ú_iter_from_fileobjÚ"ArchiveIterable._iter_from_fileobjX  sC   é € ä@ÀÓCˆØ˜%ÔØ—}‘} QÓ'×'Ò'à—}‘} QÓ'×'Ò'ñ (á'ùs!   ‚'A©AªAÁAÁAÁANc          	      óR   <€ V ^8„  d   QhRS[ RS[S[,          RS[S[RR3,          /# )r-   rg  r{   r/   N)r1   r   r   r   rÌ  )r3   rò   s   "€r(   r4   r’  a  s6   ø€ ÷ 
,ñ 
,Ùð
,Ù,4±^Õ,Dð
,á	‘5˜$ Ð$Õ	%ñ
,r'   c              #  ó
  "  € \        WR 7      p\        VRV^ R7      ;_uu_ 4       pVR8X  d   V P                  V4       Rj  x€L
  MV P                  V4       Rj  x€L
  RRR4       R#  L( L  + '       g   i     R# ; i5i)rz   rJ  )r{   ré  r@  N)rª   r’  r�  r†  )r”  rg  r{   rc  r5  s   &&&  r(   Ú_iter_from_urlpathÚ"ArchiveIterable._iter_from_urlpath`  sn   é € ô /¨wÔXˆô �7˜D°/Èa×PÕPÐTUØ˜eÔ#ØŸ=™=¨Ó+×+Ñ+àŸ=™=¨Ó+×+Ð+÷	 QÑPá+á+÷	 Q×PÐPüs@   ‚$B¦A/ÁA+ÁA/ÁA-ÁA/Á!
BÁ+A/Á-A/Á/B 	Á:	Bc                ó   <€ V ^8„  d   QhRR/# )r-   r/   rz  r    )r3   rò   s   "€r(   r4   r’  n  s   ø€ ÷ 4ñ 4Ð"3ñ 4r'   c                ó(   € V ! V P                   V4      # rî   )r•  )r”  r|  s   &&r(   Úfrom_bufÚArchiveIterable.from_bufm  s   € á�3×)Ñ)¨7Ó3Ð3r'   c                ó4   <€ V ^8„  d   QhRS[ S[,          RR/# )r-   r{   r/   rz  rþ  )r3   rò   s   "€r(   r4   r’  r  s%   ø€ ÷ Lñ L¹8ÁNÕ;Sð LÐ_pñ Lr'   c                ó(   € V ! V P                   W4      # rî   )r™  )r”  Úurlpath_or_bufr{   s   &&&r(   Úfrom_urlpathÚArchiveIterable.from_urlpathq  s   € á�3×)Ñ)¨>ÓKÐKr'   r    rî   )r"   r#   r$   r%   r  Ústaticmethodr†  r�  Úclassmethodr•  r™  r�  r¢  r&   rï   r®  s   @r(   rz  rz  5  s‹   ø‡ € ÙSàñó ðð  ñ&ó ð&ð ÷(ó ð(ð ÷
,ñ 
,ó ð
,ð ÷4ó ð4ð ÷Lñ Ló öLr'   rz  c                   ód   a € ] tR tRt o Rt]R	V 3R lR ll4       t]R	V 3R lR ll4       tRtV t	R# )
ÚFilesIterableiv  z8An iterable of paths from a list of directories or filesNc          	      óx   <€ V ^8„  d   QhRS[ S[S[S[,          3,          RS[S[,          RS[S[RR3,          /# )r-   Úurlpathsr{   r/   N)r
   r1   rõ  r   r   r   )r3   rò   s   "€r(   r4   ÚFilesIterable.__annotate__z  sB   ø€ ÷ 1ñ 1Ù™S¡$¡s¥)˜^Õ,ð1Ù?GÉÕ?Wð1á	‘3˜˜d�?Õ	#ñ1r'   c           
   #  ó  "  € \        V\        4      '       g   V.pV FÞ  p\        W2R 7      '       d   Vx € K  \        W2R 7      '       d©   \	        W2R 7       F–  w  rEp\        V Uu. uF  qwP                  R4      '       d   K  VNK  	  up4      VR&   \        V4      P                  R4      '       d   K^  \        V4       F)  pVP                  R4      '       d   K  \        WH4      x € K+  	  K˜  	  KÕ  \        V4      h	  R# u upi 5i)rz   :NNNNr}  )
rL   rõ  rŒ  r™  r
  Úsortedr–   r  rq  r¤   )	r”  r©  r{   rg  r  r  r	  rf   rs   s	   &&&      r(   Ú_iter_from_urlpathsÚ!FilesIterable._iter_from_urlpathsy  sÚ   é € ô ˜(¤D×)Ò)Ø �zˆHÛˆGÜ�w×@Ó@Ø”Ü˜×AÓAÜ49¸'×4cÑ0�G yä"(ÁÓ)qÁ°g×QcÑQcÐdo×Qp¯'¨'ÁÑ)qÓ"r�H˜Q‘KÜ  Ó)×4Ñ4°[×AÒAá Ü$*¨9Ö$5˜Ø#×.Ñ.¨{×;Ò;á$Ü# GÓ6Ô6ó	 %6ó 5dô (¨Ó0Ð0ó!  ùò *rùs   ‚A$DÁ&DÂDÂ	A>Dc                ó4   <€ V ^8„  d   QhRS[ S[,          RR/# )r-   r{   r/   r§  rþ  )r3   rò   s   "€r(   r4   rª  ’  s%   ø€ ÷ Gñ G±h¹~Õ6Nð GÐZiñ Gr'   c                ó(   € V ! V P                   W4      # rî   )r­  )r”  r©  r{   s   &&&r(   Úfrom_urlpathsÚFilesIterable.from_urlpaths‘  s   € á�3×*Ñ*¨HÓFÐFr'   r    rî   )
r"   r#   r$   r%   r  r¥  r­  r±  r&   rï   r®  s   @r(   r§  r§  v  s;   ø‡ € ÙBà÷1ñ 1ó ð1ð. ÷Gñ Gó öGr'   r§  rî   )NNF)NFNTNNNF)ÚtxtÚcsvr  ÚjsonlÚtsvÚconllÚconlluÚorigrb  ÚpklÚpickleÚrelrt  Úarrow)Úr)NN)œr  Úasyncior   r6  r  rþ   r:   r^   Úrer  r  r·  Úxml.dom.minidomrt  r‰  Úcollections.abcr   r   Ú	itertoolsr   Úpathlibr   r   Útypingr   r   r	   r
   Úunittest.mockr   Úurllib.parser   Ú	xml.etreer   ro  rm  Úhttpxr—   Úhuggingface_hub.errorsÚrequestsÚfsspec.corer   r   Úfsspec.utilsr   Úhuggingface_hub.utilsr   r   Ú	packagingr   r7   r   r   Údownload.download_configr   Úfilesystemsr   r   r   Ú	_filelockr   r¯   r   Útrackr   Úaiohttp.client_exceptionsr   r   ÚImportErrorÚ	ExceptionÚ
get_loggerr"   r  ÚINCOMPLETE_SUFFIXr1   r*   ÚTimeoutErrorÚ
exceptionsr¿  ÚTimeoutÚRequestErrorr´  r»  r½  r>   rA   rE   rN   ra   rg   rv   r·   rœ   rÌ   rÔ   rÙ   rÞ   Ú	callbacksrà   r  r¥   r&  r+  r3  r?  rk  Ú
extensionsrY   r´   rl  Ú-SINGLE_FILE_COMPRESSION_EXTENSION_TO_PROTOCOLr­   Úcompiler  r<  Úfromhexr_  r`  Úmaxr]  rT  r«   rd  rª   rq  rv  r}  r  r‚  r†  rŒ  r“  r™  r�  r7  rŸ  rÉ  r•   rÎ  r’  rú  r  r
  r  r  ry  rL  rR  rZ  r^  re  rk  rq  rx  rz  r§  )Úfs_classrµ   s   00r(   Ú<module>rä     sX  ðñó Û Û 	Û Û Û 	Û Û 	Û Û Û Û Û Ý %Ý Ý ß 'ß 0Ó 0Ý Ý !Ý 'ã Û Û Û Û ß 1Ý %ß ?Ý ç "Ý 5Ý 1ß Ý Ý #Ý /ðÝLð 
×	Ò	˜HÓ	%€à!Ð áˆC��dÓ€ð Ø×ÑØ×Ñ×'Ñ'Ø×Ñ×ÑØ	×ÑðÐ ð Ð Ø€õsõnõYõJõ6õ,ô÷0x2÷v÷$÷
ôòeô;�6×#Ñ#×0Ñ0ô ;ô9÷$Tònòò6õ
ò"Ð ð 
%ñ 0ôá/ˆHØ!×,Ô,ˆIð 	×Ñ˜Ó˜x×0Ñ0Ò0á,ñ 	Ù/òð
%ð 
ˆ5Ø
ˆEñ
%Ð !ñ ,ô1á+ˆØ×(Ô(ˆ	ð ×Ñ�SÓ˜8×,Ñ,Ò,á(ñ Ù+ò1Ð -ñ
 H_Ó$_ÑG^¸8×%6Ô%6ÑG^Ñ$_Ð !Ø&(§j¢j°Ó&=Ð #ð 
‡M�M�*Ó˜uØ	‡M�M�*Ó˜uØ	‡M�M�*Ó˜uØ	‡M�M�(Ó˜UØ	‡M�M�&Ó˜6Ø	‡M�M�.Ó! 4Ø	‡M�M�*Ó˜uØ	‡M�M�*Ó˜vð	(Ð $ð ˆUð4Ð 0ñ ñ áÐBÐDtÔuóó Ð ô	 	ô 	õõ`÷$ò4"ò6÷>#ò*%ò4Iò6'÷6#÷(÷8$ô.tô"*˜BŸLšLô *ò&)÷X	8÷2$ñjAÐRV÷ Að A÷HFð2k ð kÐSW÷ k÷4Zô8Aw‰D‘“‹Lô AwõHKðlÐVZ÷ lðjÐW[÷ j÷	g÷÷$n÷g÷.÷$6ô$>LÐ2ô >LôBGÐ0ö GøðI* ô ô˜i÷ ð	üóRùó1ùò
 %`s$   ÃQ  Ç8QÈ8QÉQ%Ñ QÑQ