+
    LV-jP!  ã                   óH   € ^ RI t ^RIHt ^RIHt ^RIHt  ! R R]4      tR# )é    N)ÚAbstractFileSystem)Úinfer_storage_options)Ú
MemoryFilec                   ó    a a€ ] tR t^t oRtRtRtRtRV 3R llt]	R 4       t
R tR t]R	 4       t]R
 4       tRR ltRR ltRR ltRtVtV ;t# )ÚGistFileSystema½  
Interface to files in a single GitHub Gist.

Provides read-only access to a gist's files. Gists do not contain
subdirectories, so file listing is straightforward.

Parameters
----------
gist_id: str
    The ID of the gist you want to access (the long hex value from the URL).
filenames: list[str] (optional)
    If provided, only make a file system representing these files, and do not fetch
    the list of all files for this gist.
sha: str (optional)
    If provided, fetch a particular revision of the gist. If omitted,
    the latest revision is used.
username: str (optional)
    GitHub username for authentication.
token: str (optional)
    GitHub personal access token (required if username is given), or.
timeout: (float, float) or float, optional
    Connect and read timeouts for requests (default 60s each).
kwargs: dict
    Stored on `self.request_kw` and passed to `requests.get` when fetching Gist
    metadata or reading ("opening") a file.
Úgistz&https://api.github.com/gists/{gist_id}z,https://api.github.com/gists/{gist_id}/{sha}c                óæ   <€ \         SV `  4        Wn        W n        W0n        Ve   Vf   \        R4      hW@n        WPn        Wpn        Ve   TMRV n	        V P                  4       V P                  R&   R # )NzUser auth requires a tokenÚ )é<   r   )ÚsuperÚ__init__Úgist_idÚ	filenamesÚshaÚ
ValueErrorÚusernameÚtokenÚ
request_kwÚtimeoutÚ_fetch_file_listÚdircache)	Úselfr   r   r   r   r   r   ÚkwargsÚ	__class__s	   &&&&&&&,€Úl/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/fsspec/implementations/gist.pyr   ÚGistFileSystem.__init__(   sk   ø€ ô 	‰ÑÔØŒØ"ŒØŒØÒ E¢MÜÐ9Ó:Ð:Ø ŒØŒ
Ø Œà")Ò"5‘w¸8ˆŒð !×1Ñ1Ó3ˆ�‰�bÓó    c                ó$  € RRRRR//pVP                  V P                  4       V P                  '       d0   V P                  '       d   V P                  V P                  3VR&   V# V P                  '       d   RV P                   2VR,          R&   V# )	z?Auth parameters passed to 'requests' if we have username/token.ÚheadersÚAcceptzapplication/vnd.github+jsonzX-GitHub-Api-Versionz
2022-11-28ÚauthzBearer ÚAuthorization)Úupdater   r   r   )r   Úkws   & r   r$   ÚGistFileSystem.kwA   s‡   € ð ØÐ7Ø&¨ðð
ˆð 	�	‰	�$—/‘/Ô"Ø�=�=ˆ=˜TŸZŸZ˜ZØŸ-™-¨¯©Ð4ˆBˆv‰Jð ˆ	ð �Z�ZˆZØ/6°t·z±z°lÐ-CˆBˆy�M˜/Ñ*Øˆ	r   c                óð  € V P                   '       d3   V P                  P                  V P                  V P                   R7      pM&V P                  P                  V P                  R7      p\
        P                  ! V3RV P                  /V P                  B pVP                  R8X  d0   \        RV P                   RV P                   ;'       g    R 24      hVP                  4        VP                  4       # )zK
Fetch the JSON metadata for this gist (possibly for a specific revision).
)r   r   )r   r   é”  zGist not found: Ú@Úlatest)r   Úgist_rev_urlÚformatr   Úgist_urlÚrequestsÚgetr   r$   Ústatus_codeÚFileNotFoundErrorÚraise_for_statusÚjson)r   ÚurlÚrs   &  r   Ú_fetch_gist_metadataÚ#GistFileSystem._fetch_gist_metadataQ   s¾   € ð �8�8ˆ8Ø×#Ñ#×*Ñ*°4·<±<ÀTÇXÁXÐ*ÓN‰Cà—-‘-×&Ñ&¨t¯|©|Ð&Ó<ˆCä�LŠL˜Ñ> d§l¡lÐ>°d·g±gÑ>ˆØ�=‰=˜CÔÜ#Ø" 4§<¡< .°°$·(±(×2FÐ2F¸hÐ1GÐHóð ð 	
×ÑÔØ�v‰v‹xˆr   c                ó¦  € V P                  4       pV P                  '       dD   VP                  R/ 4      p/ pV P                   F  pWB9  d   \        V4      hW$,          W4&   K   	  MVP                  R/ 4      p. pVP	                  4        FC  w  rgVf   K  VP                  RVRRRVP                  R^ 4      RVP                  R4      /4       KE  	  V# )zb
Returns a list of dicts describing each file in the gist. These get stored
in self.dircache[""].
ÚfilesÚnameÚtypeÚfileÚsizeÚraw_url)r5   r   r.   r0   ÚitemsÚappend)r   ÚmetaÚavailable_filesr8   ÚfnÚoutÚfnameÚfinfos   &       r   r   ÚGistFileSystem._fetch_file_listb   sÊ   € ð
 ×(Ñ(Ó*ˆØ�>�>ˆ>Ø"Ÿh™h w°Ó3ˆOØˆEØ—n”n�ØÔ,Ü+¨BÓ/Ð/Ø+Õ/�“	ò %ð
 —H‘H˜W bÓ)ˆEàˆØ!ŸK™KžM‰LˆEØŠ}áà�J‰Jà˜EØ˜FØ˜EŸI™I f¨aÓ0Ø˜uŸy™y¨Ó3ð	öñ *ð ˆ
r   c                óZ   € \        V4      P                  RV4      pVP                  R4      # )z-
Remove 'gist://' from the path, if present.
ÚpathÚ/)r   r.   Úlstrip)ÚclsrH   s   &&r   Ú_strip_protocolÚGistFileSystem._strip_protocol‚   s*   € ô % TÓ*×.Ñ.¨v°tÓ<ˆØ�{‰{˜3ÓÐr   c                óÞ  € \        V 4      p/ pRV9   d   VR,          '       d   VR,          VR&   RV9   d   VR,          '       d   VR,          VR&   RV9   d   VR,          '       d   VR,          VR&   RV9   ds   VR,          '       dd   VR,          P                  R^4      RR p\        V4      ^8X  d8   V^ ,          '       d   V^ ,          VR	&   V^,          '       d   V^,          .VR
&   V# )zŸ
Parse 'gist://' style URLs into GistFileSystem constructor kwargs.
For example:
  gist://:TOKEN@<gist_id>/file.txt
  gist://username:TOKEN@<gist_id>/file.txt
r   Úpasswordr   Úhostr   rH   rI   Nr   r   éþÿÿÿ)r   ÚrsplitÚlen)rH   ÚsorC   Ú
path_partss   &   r   Ú_get_kwargs_from_urlsÚ$GistFileSystem._get_kwargs_from_urls�   s×   € ô # 4Ó(ˆØˆØ˜Ô  :§¤Ø  �nˆC�
‰OØ˜Ô  :§¤Ø˜j�>ˆC�‰LØ�RŒ<˜B˜vŸJœJà �ZˆC�	‰Nð �RŒ<˜B˜vŸJœJØ˜F�×*Ñ*¨3°Ó2°2°3Ð7ˆJÜ�:‹ !Ô#Ø˜a—=”=Ø!+¨A¥�C˜‘JØ˜a—=”=Ø(2°1­ �C˜Ñ$àˆ
r   c                ó<  € T P                  T;'       g    R4      pVR8X  d   V P                  R,          pMFV P                  R,          pV Uu. uF  qfR,          V8X  g   K  VNK  	  ppV'       g   \        V4      hV'       d   V# \        R V 4       4      # u upi )aI  
List files in the gist. Gists are single-level, so any 'path' is basically
the filename, or empty for all files.

Parameters
----------
path : str, optional
    The filename to list. If empty, returns all files in the gist.
detail : bool, default False
    If True, return a list of dicts; if False, return a list of filenames.
r
   r9   c              3   ó2   "  € T F  qR ,          x € K  	  R# 5i)r9   N© )Ú.0Úfs   & r   Ú	<genexpr>Ú$GistFileSystem.ls.<locals>.<genexpr>Ã   s   é € Ð5©W¨˜FŸ)š)«Wùs   ‚)rL   r   r0   Úsorted)r   rH   Údetailr   ÚresultsÚ	all_filesr\   s   &&&,   r   ÚlsÚGistFileSystem.lsª   s‹   € ð ×#Ñ# D§J J¨BÓ/ˆà�2Œ:Ø—m‘m BÕ'‰Gð Ÿ™ bÕ)ˆIÙ"+ÓA¡)˜Q°­y¸DÑ/@—q�q¡)ˆGÐAßÜ'¨Ó-Ð-ßØˆNäÑ5©WÓ5Ó5Ð5ùò Bs   ÁBÁ"Bc                ó  € VR8w  d   \        R4      hV P                  V4      pV P                  R,           Uu. uF  qUR,          V8X  g   K  VNK  	  ppV'       g   \        V4      hV^ ,          pVP	                  R4      pV'       g   \        RV 24      h\
        P                  ! V3RV P                  /V P                  B p	V	P                  R8X  d   \        V4      hV	P                  4        \        VR	V	P                  4      # u upi )
z#
Read a single file from the gist.
Úrbz'GitHub Gist FS is read-only (no write).r
   r9   r=   zNo raw_url for file: r   r'   N)ÚNotImplementedErrorrL   r   r0   r.   r-   r   r$   r/   r1   r   Úcontent)
r   rH   ÚmodeÚ
block_sizer   r\   ÚmatchesrE   r=   r4   s
   &&&&,     r   Ú_openÚGistFileSystem._openÅ   sè   € ð �4Œ<Ü%Ð&OÓPÐPà×#Ñ# DÓ)ˆà"Ÿm™m¨BÖ/ÓEÑ/˜°Vµ9ÀÑ3D—1�1Ñ/ˆÐEßÜ# DÓ)Ð)Ø˜•
ˆà—)‘)˜IÓ&ˆßÜ#Ð&;¸D¸6Ð$BÓCÐCä�LŠL˜ÑB¨$¯,©,ÐB¸$¿'¹'ÑBˆØ�=‰=˜CÔÜ# DÓ)Ð)Ø	×ÑÔÜ˜$  a§i¡iÓ0Ð0ùò Fs   ¹DÁDc                ó†  € V P                  WR7      p/ pV F9  p V P                  VR4      ;_uu_ 4       pVP                  4       Wg&   RRR4       K;  	  \	        V4      ^8X  d   V^ ,          V8X  d	   Wa,          # V#   + '       g   i     Kv  ; i  \         d&   p	TR8X  d   T	hTR8X  d    Rp	?	Kš  Y–T&    Rp	?	K¤  Rp	?	ii ; i)z€
Return {path: contents} for the given file or files. If 'recursive' is True,
and path is empty, returns all files in the gist.
)Ú	recursiverf   NÚraiseÚomit)Úexpand_pathÚopenÚreadr0   rS   )
r   rH   ro   Úon_errorr   ÚpathsrC   Úpr\   Úes
   &&&&,     r   ÚcatÚGistFileSystem.catÝ   s²   € ð
 × Ñ  Ð Ó;ˆØˆÛˆAð	Ø—Y‘Y˜q $×'Ô'¨1ØŸV™V›X�C‘F÷ (Ñ'ñ ô ˆu‹:˜Œ?˜u Q�x¨4Ô/Ø•9ÐØˆ
÷ (×'Ð'ûä$ô Ø˜wÔ&Ø�GØ Ô'Ýà˜—Fûðús:   ›BµA<ÁBÁ<BÂBÂBÂC ÂB;Â1B;Â;C )r   r   r   r   r   r   r   )NNNNN)r
   F)rf   N)Frp   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úprotocolr,   r*   r   Úpropertyr$   r5   r   ÚclassmethodrL   ÚstaticmethodrV   rc   rl   ry   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   Ú__classdict__s   @@r   r   r      s{   ù‡ € ñð6 €HØ7€HØA€L÷4ð2 ñó ðòò"ð@ ñ ó ð ð ñó ðô86ô61÷0ô r   r   )r-   Úspecr   Úutilsr   Úmemoryr   r   rZ   r   r   Ú<module>r‹      s    ðÛ å %Ý )Ý ôiÐ'ö ir   