+
    Pj)                     R   R t ^ RIt^ RIHtHt ^ RIt^ RIHt ^ RIH	t	H
t
Ht ^ RIHtHt ^ RIHt ^RIHtHtHtHtHtHtHtHtHtHt ^RIHt ^R	IHtH t  ^R
I!H"t"H#t# ]$! ]! ]4      4      t%]! ]4      t&]PN                  ! R]& U u/ uF  q V bK  	  up ](R7      t)]](R,          ] ! RRPU                  ]%4       R2]! ]%4      R7      3,          t+]! RR7      t,],P[                  R. R+OR7      RRRRR]RRRRRR3R R ll4       t.],P[                  R. R,OR7      R-R R ll4       t/],P[                  RRR.R7      R.R R ll4       t0],P[                  R . R/OR7      R.R! R" ll4       t1],P[                  R#R$R%.R7      R0R& R' ll4       t2],P[                  R(. R1OR7      R2R) R* ll4       t3R# u up i )3zDContains commands to interact with datasets on the Hugging Face Hub.N)	Annotatedget_args)execute_raw_sql_query)CLIErrorRepositoryNotFoundErrorRevisionNotFoundError)DatasetSort_TExpandDatasetProperty_T)DatasetCard)
REPO_LIST_DEFAULT_LIMIT	AuthorOpt	FilterOptLimitOptRevisionOpt	SearchOptTokenOpt
get_hf_apimake_expand_properties_parsertyper_factory)list_repo_files_cmd)ArgumentOption)_dataclass_to_dictoutDatasetSortEnum)typezComma-separated properties to return. When used, only the listed properties (and id) are returned. Example: '--expand=downloads,likes,tags'. Valid: z, .)helpcallbackz"Interact with datasets on the Hub.r   z	list | ls)examplesFc                   V ^8  d   QhR\         \        R,          \        RR7      3,          R\        R\        R\
        R\         \        R,          \        R	R7      3,          R
\        R\        R\         \        \        RRRR7      3,          R\         \        \        RRR7      3,          R\         \        \        RRRR7      3,          R\        R\        RR/# )   repo_idNzVDataset ID (e.g. `username/repo-name`) to list files from. If omitted, lists datasets.r   searchauthorfiltersortzSort results.limitexpandhuman_readablez--human-readablez-hz=Show sizes in human readable format (only for listing files).as_treez--treez3List files in tree format (only for listing files).	recursivez--recursivez-Rz0List files recursively (only for listing files).revisiontokenreturn)r   strr   r   r   r   r   r   r   	ExpandOptboolr   r   )formats   "u/Users/ahmed/devFolder/Ultron/claude-voice/gateway/.venv/lib/python3.14/site-packages/huggingface_hub/cli/datasets.py__annotate__r5   H   s     O Od
no	qO
 O O O $O$	&O O O !4.mn	pO$ xST	V%O, }d)[\	^-O4 5O6 7O8 
9O    c           
     8   V e   Ve   \         P                  ! R4      hVe   \         P                  ! R4      hVe   \         P                  ! R4      hVe   \         P                  ! R4      hV\        8w  d   \         P                  ! R4      hVe   \         P                  ! R4      h\        V RVVV	V
VR	7      # V'       d   \         P                  ! R
4      hV	'       d   \         P                  ! R4      hV'       d   \         P                  ! R4      hV
e   \         P                  ! R4      h\	        VR7      pV'       d   VP
                  MRpVP                  VVVVVVR7       Uu. uF  p\        V4      NK  	  pp\        P                  ! V4       R# u upi )zList datasets on the Hub, or files in a dataset repo.

When called with no argument, lists datasets on the Hub.
When called with a dataset ID, lists files in that dataset repo.
Nz'Cannot use --search when listing files.z'Cannot use --author when listing files.z'Cannot use --filter when listing files.z%Cannot use --sort when listing files.z&Cannot use --limit when listing files.z'Cannot use --expand when listing files.dataset)r#   	repo_typer*   r+   r,   r-   r.   z(Cannot use --tree when listing datasets.z-Cannot use --recursive when listing datasets.z2Cannot use --human-readable when listing datasets.z,Cannot use --revision when listing datasets.r.   )r&   r%   r$   r'   r(   r)   )
clickBadParameterr   r   r   valuelist_datasetsr   r   table)r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   apisort_keydataset_inforesultss   &&&&&&&&&&&&    r4   datasets_lsrD   <   s   \ $$%NOO$$%NOO$$%NOO$$%LMM++$$%MNN$$%NOO")
 	
   !KLL  !PQQ  !UVV  !OPP
5
!C!tzztH  -- . 


L 	<(
  
 IIg
s   )Fleaderboardc                n    V ^8  d   QhR\         \        \        RR7      3,          R\        R\        RR/# )r"   
dataset_idz?The benchmark dataset ID (e.g. `SWE-bench/SWE-bench_Verified`).r   r(   r.   r/   N)r   r0   r   r   r   )r3   s   "r4   r5   r5      sF     b b#x-noopbb b 
	br6   c                R   \        VR7      pVP                  V R7      pVRV  Uu. uF  p\        V4      NK  	  pp\        P                  ! V. R	ORR7       \        P
                  ! R4       V'       d.   \        P
                  ! RV^ ,          P                   R24       R# R# u upi )
zList model scores from a dataset leaderboard. This command helps find the best models for a task or compare models by benchmark scores. Use 'hf datasets ls --filter benchmark:official' to list available leaderboards.r:   )r#   Nmodel_idheadersid_keyzPUse 'hf datasets ls --filter benchmark:official' to list available leaderboards.zUse 'hf models info z' to get details about a model.)rankrI   r=   source)r   get_dataset_leaderboardr   r   r?   hintrI   )rG   r(   r.   r@   rE   entryrC   s   &&&    r4   datasets_leaderboardrR      s     5
!C--j-AK6A&56IJ6IU!%(6IGJII7
 HH_`'A(?(?'@@_`a  Ks   B$infoz&hf datasets info HuggingFaceFW/finewebz9hf datasets info my-dataset --expand downloads,likes,tagsc          
      z    V ^8  d   QhR\         \        \        RR7      3,          R\        R\        R\
        RR/# )	r"   rG   +The dataset ID (e.g. `username/repo-name`).r   r-   r)   r.   r/   N)r   r0   r   r   r1   r   )r3   s   "r4   r5   r5      sJ      #x-Z[[\  	
 
r6   c                    \        VR7      p VP                  WVR7      p\
        P                  ! T4       R#   \         d   p\        RT  R24      ThRp?i\         d   p\        RT RT  R24      ThRp?ii ; i)	z$Get info about a dataset on the Hub.r:   )r#   r-   r)   z	Dataset 'z' not found.Nz
Revision 'z' not found on 'z'.)r   rB   r   r   r   r   dict)rG   r-   r)   r.   r@   rS   es   &&&&   r4   datasets_inforY      s     5
!CU
fU
 HHTN	 # D:,l;<!C  UH:-=j\LMSTTUs'   9 A:AA:!A:"A55A:parquetc                    V ^8  d   QhR\         \        \        RR7      3,          R\         \        R,          \        RRR7      3,          R\         \        R,          \        R	R7      3,          R
\        RR/# )r"   rG   rU   r   subsetNz--subsetz(Filter parquet entries by subset/config.splitz Filter parquet entries by split.r.   r/   )r   r0   r   r   r   )r3   s   "r4   r5   r5      s{     Q Q#x-Z[[\QcDj&:d"eefQ S4Z-O!PPQQ 	Q
 
Qr6   c                \   \        VR7      pVP                  WR7      pV Uu. uF  qbe   VP                  V8X  g   K  VNK  	  ppV Uu. uF5  pRVP                  RVP                  RVP                  RVP
                  /NK7  	  pp\        P                  ! V. R	ORR7       R# u upi u upi )
z/List parquet file URLs available for a dataset.r:   )r#   configNr\   r]   urlsizerJ   )r\   r]   r`   ra   )r   list_dataset_parquet_filesr]   r_   r`   ra   r   r?   )	rG   r\   r]   r.   r@   entriesrQ   filteredrC   s	   &&&&     r4   datasets_parquetre      s      5
!C,,Z,OG#*T7%mu{{e?S7HTjrjraf5<<%++ueiiQVQ[Q[\jr   IIgA%P	 Us   B$B$
;B)sqlzhf datasets sql "SELECT COUNT(*) AS rows FROM read_parquet('https://huggingface.co/api/datasets/cfahlgren1/hub-stats/parquet/models/train/0.parquet')"zhf datasets sql "SELECT * FROM read_parquet('https://huggingface.co/api/datasets/cfahlgren1/hub-stats/parquet/models/train/0.parquet') LIMIT 5" --format jsonc                b    V ^8  d   QhR\         \        \        RR7      3,          R\        RR/# )r"   rf   zRaw SQL query to execute.r   r.   r/   N)r   r0   r   r   )r3   s   "r4   r5   r5      s6     	 		3&ABB	C		 
	r6   c                     \        WR7      p\        P
                  ! T4       R#   \         d   p\        \        T4      4      ThRp?ii ; i)zAExecute a raw SQL query with DuckDB against dataset parquet URLs.)	sql_queryr.   N)r   ImportErrorr   r0   r   r?   )rf   r.   resultrX   s   &&  r4   datasets_sqlrl      sB    &&B IIf  &s1vA%&s   & AAAcardc                    V ^8  d   QhR\         \        \        RR7      3,          R\         \        \	        RRR7      3,          R\         \        \	        RR	R7      3,          R
\
        RR/# )r"   rG   rU   r   metadataz
--metadataz'Output only the metadata from the card.textz--textz(Output only the text body (no metadata).r.   r/   N)r   r0   r   r2   r   r   )r3   s   "r4   r5   r5     su     g g#x-Z[[\gf\8abbcg D&0Z[[
\g 	g
 
gr6   c                   V'       d   V'       d   \        R4      h\        P                  ! WR7      pV'       d1   \        P                  ! VP
                  P                  4       4       R# V'       d#   \        P                  ! VP                  4       R# \        P                  ! VP                  4       \        P                  ! RV  R24       R# )z7Get the dataset card (README) for a dataset on the Hub.z---metadata and --text are mutually exclusive.r:   zUse `hf datasets card z/ --metadata` to extract only the card metadata.N)
r   r
   loadr   rW   datato_dictrp   contentrP   )rG   ro   rp   r.   rm   s   &&&& r4   datasets_cardrv      s{      DFGGJ4D""$%	)*5defr6   )zhf datasets lsz*hf datasets ls --sort downloads --limit 10zhf datasets ls --search "code"z*hf datasets ls --filter benchmark:officialz$hf datasets ls HuggingFaceFW/finewebz'hf datasets ls HuggingFaceFW/fineweb -Rz.hf datasets ls HuggingFaceFW/fineweb --tree -h)z4hf datasets leaderboard SWE-bench/SWE-bench_VerifiedzLhf datasets leaderboard SWE-bench/SWE-bench_Verified --limit 5 --format jsonzIhf datasets ls --filter benchmark:official  # list available leaderboards)   N)NNN)z(hf datasets parquet cfahlgren1/hub-statsz8hf datasets parquet cfahlgren1/hub-stats --subset modelsz6hf datasets parquet cfahlgren1/hub-stats --split trainz6hf datasets parquet cfahlgren1/hub-stats --format json)N)z&hf datasets card HuggingFaceFW/finewebz1hf datasets card HuggingFaceFW/fineweb --metadataz?hf datasets card HuggingFaceFW/fineweb --metadata --format jsonz-hf datasets card HuggingFaceFW/fineweb --text)FFN)4__doc__enumtypingr   r   r;   huggingface_hub._dataset_viewerr   huggingface_hub.errorsr   r   r   huggingface_hub.hf_apir   r	   huggingface_hub.repocardr
   
_cli_utilsr   r   r   r   r   r   r   r   r   r   _file_listingr   
_frameworkr   r   _outputr   r   sorted_EXPAND_PROPERTIES_SORT_OPTIONSEnumr0   r   joinr1   datasets_clicommandrD   rR   rY   re   rl   rv   )ss   0r4   <module>r      sJ   K  &  A [ [ I 0   / ( , H%<=> '))-m/Lm1m/LSVW $J
 d  ei  en  en  oA  eB  dC  CD  E./AB	 "FG     	 	- 	 	 	 7OOd   bb& 
0C  "   QQ  	 	c 	j  		 
  ggk 0Ms   F$
