+
    &j!2                     \   R 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Ht ^ RIt^ RIHt ^ RIHtHtHtHtHt  ! R R]]
4      t ! R	 R
4      tR R ltR R lt]P8                  ! R4      tR R ltR R ltR R lt R R lt!R R lt"R R lt#R R lt$]! 4       t%R# )z"Output framework for the `hf` CLI.N)Sequence)Enum)Anycast)ConfirmationError)ANSI
StatusLinedisable_progress_barsis_agenttabulatec                   .    ] tR t^ tRtRtRtRtRtRt	Rt
R# )	OutputFormatzGOutput format for CLI commands with auto detection of agent/human mode.agentautohumanjsonquiet N)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   __static_attributes__r       s/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/huggingface_hub/cli/_output.pyr   r       s    QEDEDEr   r   c                   p  a  ] tR t^*t o RtV 3R lR lt]P                  3V 3R lR lltV 3R lR lt	V 3R lR	 lt
R)RR
RR
/V 3R lR llltRR
RR
RR
/V 3R lR lltRR
/V 3R lR lltV 3R lR ltRRRRRR/V 3R lR lltR)V 3R lR  lltV 3R! lR" ltV 3R# lR$ ltV 3R% lR& ltV 3R' ltR(tV tR
# )*OutputzOutput sink for the `hf` CLI.

Mode is resolved once at init time based on `is_agent()` auto-detection
and can be overridden per-command via `set_mode()`.
c                   < V ^8  d   QhRR/# )   returnNr   )format__classdict__s   "r   __annotate__Output.__annotate__4   s      $ r   c                4    R V n         V P                  4        R# )FN)no_truncateset_modeselfs   &r   __init__Output.__init__4   s     r   c                $   < V ^8  d   QhRS[ RR/# )r   moder    N)r   )r!   r"   s   "r   r#   r$   8   s     $ $\ $$ $r   c                    V\         P                  8X  d1   \        4       '       d   \         P                  M\         P                  pWn        V\         P                  8w  d   \        4        R# R# )zPOverride the output mode (called once at startup and again per '--format' flag).N)r   r   r
   r   r   r-   r	   )r)   r-   s   &&r   r'   Output.set_mode8   sG    <$$$)1<%%9K9KD	<%%%!# &r   c                $   < V ^8  d   QhRS[ RR/# )r   r&   r    Nbool)r!   r"   s   "r   r#   r$   @   s     ' '4 'D 'r   c                    Wn         R# )z2Toggle off cell truncation for human table output.Nr&   )r)   r&   s   &&r   set_no_truncateOutput.set_no_truncate@   s    &r   c                    < V ^8  d   QhRS[ /# )r   r    r1   )r!   r"   s   "r   r#   r$   D   s     / /$ /r   c                <    V P                   \        P                  8H  # N)r-   r   r   r(   s   &r   is_quietOutput.is_quietD   s    yyL....r   Nr   r   c                Z   < V ^8  d   QhRS[ R,          RS[ R,          RS[ R,          RR/# )r   msgNr   r   r    str)r!   r"   s   "r   r#   r$   G   s7     ! !d
 !S4Z !sUYz !ei !r   c                  Ve!   Vf   Ve   \        R4      hTp\        V4      pV P                  ;\        P                  8X  d    Ve   \        V4       R# R# \        P                  8X  d   Ve   \        V4       R# R# R# )z)Print a free-form text message to stdout.Nz&Cannot mix 'msg' with 'human'/'agent'.)
ValueError_strip_ansir-   r   r   printr   )r)   r=   r   r   s   &&$$r   textOutput.textG   sq    ? E$5 !IJJE$Eii###$%L %##$%L % $r   headersid_key
alignmentsc          
         < V ^8  d   QhRS[ S[S[S[3,          ,          RS[S[,          R,          RS[R,          RS[S[S[3,          R,          RR/# )r   itemsrF   NrG   rH   r    )r   dictr?   r   list)r!   r"   s   "r   r#   r$   X   sd     83 83S#X'83 cT!	83
 d
83 cNT)83 
83r   c          
     n  a V'       gm   V P                   ;;\        P                  8X  d   M;\        P                  8X  d   M M  \	        R4       R# \        P
                  8X  d   \	        R4       R# R# Vfu   \        V^ ,          P                  4       4      pV Uau. uFG  o\        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       g   KE  SNKI  	  ppV UUu. uF"  qr Uu. uF  qP                  V4      NK  	  upNK$  	  p	ppV P                   ;\        P                  8X  d    V Uu. uF  p\        V4      NK  	  p
pV	 UUu. uF  q Uu. uF  p\        V4      NK  	  upNK  	  ppp\        WV P                  R7      p/ \        W)4      CT;'       g    / CpVP                  4        UUu/ uF  w  pp\        V4      VbK  	  ppp\	        \!        \#        RV4      V
VR	7      4       V'       d   V P%                  R
4       R# R# ;\        P                  8X  dH    \	        RP'                  V4      4       V	 F$  p\	        RP'                  R V 4       4      4       K&  	  R# ;\        P
                  8X  d2    \	        \
        P(                  ! \        V4      \*        R7      4       R# \        P,                  8X  d:   T;'       g
    V^ ,          pV F  p\	        VP                  VR4      4       K   	  R# R# u upi u upi u uppi u upi u upi u uppi u uppi )aw  Print tabular data to stdout.

Args:
    items: List of dicts. Headers are auto-detected from keys if not provided.
    headers: Explicit column names. If None, derived from dict keys (all-None columns filtered).
    id_key: Key to print in quiet mode. If None, uses the first header.
    alignments: Optional mapping of header name to "left" or "right". Defaults to "left".
zNo results found.z[]Nc              3   H   <"   T F  qP                  S4      R Jx  K  	  R # 5ir9   )get).0itemcols   & r   	<genexpr>Output.table.<locals>.<genexpr>r   s     8e_dW[#d9R_ds   "TFr4   zlist[list[str | int]])rF   rH   z>Use `--no-truncate` or `--format json` to display full values.	c              3   8   "   T F  p\        V4      x  K  	  R # 5ir9   )_format_table_cell_agentrP   vs   & r   rS   rT      s     #MA$<Q$?$?   default )r-   r   r   r   rC   r   rL   keysanyrO   
_to_header_format_table_value_human_truncate_columnsr&   _infer_alignmentsrJ   r   r   hintjoindumpsr?   r   )r)   rJ   rF   rG   rH   all_columnsrR   rQ   hrowsscreaming_headersrowrY   formatted_rowsis_truncatedinferredkscreaming_alignments	quiet_keys   &&$$$ `            r   tableOutput.tableX   sn     ))<'\''*<,*<*<<-.  "&&$K?uQx}}/K&1fksSS8e_d8eSSS8e_d8e5esskGf;@A54g.g!g.5Aii###<C$DGqZ]G!$Djn2ojncfZ]3^Z]UV4Ma4PZ]3^jn2o01B`d`p`pqU/>U:CSCSQSUEM^^EU'VEUTQ
1q(8EU$'V4nE 1#7  II^_  ###dii()C$))#M#MMN  """djjec:;##"00gaj	!D$((9b12 " $7 g.A %E3^2o
 (WsT   L/LL&L3L;LLL!L+&L&:L+L1L&L+c                8   < V ^8  d   QhRS[ RS[R,          RR/# )r   datarG   Nr    r   r?   )r!   r"   s   "r   r#   r$      s&     < < <t <t <r   c                  \         P                  ! V4      '       d"   \        V\        4      '       g   \	        V4      pV P
                  \        P                  8X  d"   Ve   \        VP                  VR4      4       R# V P
                  \        P                  8X  d   ^MRp\        \        P                  ! W\        R7      4       R# )ztPrint structured data as JSON in all modes (indented for human, compact otherwise).

Accepts a dict or a dataclass.
Nr]   )indentr\   )dataclassesis_dataclass
isinstancetype_dataclass_to_dictr-   r   r   rC   rO   r   r   rf   r?   )r)   ru   rG   rx   s   &&$ r   rK   Output.dict   s    
 ##D))*T42H2H%d+D99***v/A$((62&'ii<#5#554djjc:;r   c                *   < V ^8  d   QhRS[ RS[RR/# )r   messageru   r    N)r?   r   )r!   r"   s   "r   r#   r$      s"     % %c %3 %4 %r   c                $   V P                   ;\        P                  8X  dn    \        P                  ! RV 24      .pVP                  4        F"  w  rEVf   K  VP                  RV RV 24       K$  	  \        RP                  V4      4       R# ;\        P                  8X  dV    VP                  4        UUu. uF  w  rEVf   K  V RV 2NK  	  ppp\        V'       d   RP                  V4      MT4       R# ;\        P                  8X  d3    \        V'       d   \        P                  ! V\        R7      MR	4       R# \        P                  8X  d8   \        VP                  4       4      pV'       d   \        V^ ,          4       R# R# R# u uppi )
z"Print a success summary to stdout.u   ✓ Nz  z: 
= r[   r]   )r-   r   r   r   greenrJ   appendrC   re   r   r   rf   r?   r   rL   values)r)   r   ru   partsro   rY   r   s   &&,    r   resultOutput.result   s   ii###d7)$456 JJLDA}r!Bqc]3 ) dii&'###04

NA3asNchhuoG<"""tdjjs3D##dkkm,&)$  $	 Os   7FFr\   Fyesconfirm_paramz--yesc          
      6   < V ^8  d   QhRS[ RS[RS[RS[ RR/# )r   r   r\   r   r   r    N)r?   r2   )r!   r"   s   "r   r#   r$      s2     < <s < <4 <`c <rv <r   c                   V'       d   R# V P                   \        P                  8w  d   \        V RV R24      h\        P
                  ! WRR7       R# )zF
Ask for confirmation. Raises `ConfirmationError` in non-human modes.
Nz Use z to skip confirmation.T)r\   abort)r-   r   r   r   typerconfirm)r)   r   r\   r   r   s   &&$$$r   r   Output.confirm   sC     99***#wiu]OCY$Z[[gd;r   c                4   < V ^8  d   QhRS[ R,          RS[/# )r   r   Nr    )r?   r   )r!   r"   s   "r   r#   r$      s      cDj J r   c                ~    \        V P                  \        P                  8H  R7      pVe   VP	                  V4       V# )zEReturn a status line that emits only in human mode (no-op otherwise).)enabled)r   r-   r   r   update)r)   r   statuss   && r   r   Output.status   s2    DII1C1C$CDMM'"r   c                $   < V ^8  d   QhRS[ RR/# r   r   r    Nr>   )r!   r"   s   "r   r#   r$      s     : :s :t :r   c                    V P                   \        P                  8X  d5   \        \        P
                  ! RV 24      \        P                  R7       R# \        RV 2\        P                  R7       R# )z0Print a non-fatal warning to stderr (all modes).z	Warning: fileN)r-   r   r   rC   r   yellowsysstderrr)   r   s   &&r   warningOutput.warning   sG    99***$++	'343::FIgY'cjj9r   c                $   < V ^8  d   QhRS[ RR/# r   r>   )r!   r"   s   "r   r#   r$      s     8 8S 8T 8r   c                    V P                   \        P                  8X  d5   \        \        P
                  ! RV 24      \        P                  R7       R# \        RV 2\        P                  R7       R# )z%Print an error to stderr (all modes).zError: r   N)r-   r   r   rC   r   redr   r   r   s   &&r   errorOutput.error   sG    99***$((WWI./cjjAGG9%CJJ7r   c                $   < V ^8  d   QhRS[ RR/# r   r>   )r!   r"   s   "r   r#   r$      s     7 7C 7D 7r   c                    V P                   \        P                  8X  d5   \        \        P
                  ! RV 24      \        P                  R7       R# \        RV 2\        P                  R7       R# )zEPrint a helpful hint to stderr (human: gray, agent/json: plain text).zHint: r   N)r-   r   r   rC   r   grayr   r   r   s   &&r   rd   Output.hint   sG    99***$))fWI./cjjAF7)$3::6r   c                2   < V ^8  d   Qh/ S[ ;R&   S[;R&   # )r   r-   r&   )r   r2   )r!   r"   s   "r   r#   r$   *   s         r   )r-   r&   r9   )r   r   r   r   r   r*   r   r   r'   r5   r:   rD   rr   rK   r   r   r   r   r   rd   __annotate_func__r   __classdictcell__)r"   s   @r   r   r   *   s       -9,=,= $ $' '/ /!$ !\` ! !"83 %)	83
 "83 -183 83t<d < <% %&<u <% <fm < < : :8 87 7O  r   r   c                0    V ^8  d   QhR\         R\         /# )r   rY   r    )object)r!   s   "r   r#   r#      s       6 r   c                r   \        V \        P                  4      '       d   V P                  4       # \        V \        4      '       d5   V P	                  4        UUu/ uF  w  rVf   K  V\        V4      bK  	  upp# \        V \        4      '       d   V  Uu. uF  p\        V4      NK  	  up# V # u uppi u upi )z4Recursively serialize a value to be JSON-compatible.)r{   datetime	isoformatrK   rJ   _serialize_valuerL   )rY   keyvalrQ   s   &   r   r   r      s    !X&&''{{}	At		;<779X9xs*%c**9XX	At		34514 &155H Y5s   B.'B.B4c                R    V ^8  d   QhR\         R\        \        \         3,          /# )r   infor    )r   rK   r?   )r!   s   "r   r#   r#      s&     b bS bT#s(^ br   c                    \         P                  ! V 4      P                  4        UUu/ uF  w  rVf   K  V\        V4      bK  	  upp# u uppi )z0Convert a dataclass to a json-serializable dict.)ry   asdictrJ   r   )r   ro   rY   s   &  r   r}   r}      sC    /:/A/A$/G/M/M/Oa/OtqST"A""/Oaaas
   A	A	z\033\[[0-9;]*mc                0    V ^8  d   QhR\         R\         /# r   rD   r    r>   )r!   s   "r   r#   r#      s     " "c "c "r   c                 .    \         P                  R V 4      # )r]   )_ANSI_REsubrD   s   &r   rB   rB      s    <<D!!r   c                0    V ^8  d   QhR\         R\         /# r   r>   )r!   s   "r   r#   r#      s     " "s "s "r   c                 @    R P                  V P                  4       4      # )r   )re   splitr   s   &r   _single_liner      s    88DJJL!!r   c                0    V ^8  d   QhR\         R\         /# )r   namer    r>   )r!   s   "r   r#   r#      s      S S r   c                R    \         P                  ! RRV 4      pVP                  4       # )zAConvert a camelCase or PascalCase string to SCREAMING_SNAKE_CASE.z([a-z])([A-Z])z\1_\2)rer   upper)r   ss   & r   r`   r`      s!    
 (D1A779r   c                    V ^8  d   QhR\         \        ,          R\         \         \        ,          ,          R\        \        \        3,          /# )r   rF   ri   r    )rL   r?   r   rK   )r!   s   "r   r#   r#      s5      tCy T#Y DcN r   c                   a / p\        V 4       FL  w  op\        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      '       g   KH  RW#&   KN  	  V# )zNReturn ``{"col": "right"}`` for columns where every non-None value is numeric.c              3      <"   T FX  qS,          R J ;'       gB    \        VS,          \        \        34      ;'       d    \        VS,          \        4      '       * x  KZ  	  R # 5ir9   )r{   intfloatr2   )rP   rk   cs   & r   rS   $_infer_alignments.<locals>.<genexpr>  sN     uptil1v~dd*SVc5\"B"c"c:VYZ[V\^bKcGcdpts   A#$A#%A#FTright)	enumerateall)rF   ri   r   rh   r   s   &&  @r   rc   rc      sL    F'"13uptu333uptuuuFI # Mr   c                0    V ^8  d   QhR\         R\        /# r   valuer    rv   )r!   s   "r   r#   r#     s     $ $S $S $r   c                   V f   R# \        V \        4      '       d   V '       d   R# R# \        V \        P                  4      '       d   V P                  R4      # \        V \        4      '       d'   \
        P                  ! RV 4      '       d
   V R,          # \        V \        4      '       d   \        V 4      # \        V \        4      '       d   RP                  R V  4       4      # \        V \        4      '       dB   RV 9   d   \        \	        V R,          4      4      # \        \        P                  ! V 4      4      # \        \	        V 4      4      # )	z/Convert a value to string for terminal display.r]   u   ✔z%Y-%m-%dz^\d{4}-\d{2}-\d{2}T:N
   Nz, c              3   8   "   T F  p\        V4      x  K  	  R # 5ir9   )ra   rX   s   & r   rS   ,_format_table_value_human.<locals>.<genexpr>  s     Eu!2155urZ   r   )r{   r2   r   strftimer?   r   matchr   rL   re   rK   r   rf   r   s   &r   ra   ra     s    }%u%2%%**++~~j))%"((+A5"I"ISz%E""%yyEuEEE	E4	 	 U?E&M 233DJJu-..E
##r   c                    V ^8  d   QhR\         \        ,          R\         \         \        ,          ,          R\        R\        /# )r   rF   ri   r&   r    )rL   r?   r2   )r!   s   "r   r#   r#     s<     - -#Y-
tCy/- 	-
 
-r   c               V  aaaa V'       g	   S'       g   R# \        V 4      p\        V4       Uau. uF=  o\        \        V S,          4      .VV3R l\        \        S4      4       4       O5!  NK?  	  pp\        P                  ! 4       P
                  \        ^ V^,
          4      ,
          p\        V4      V8:  d   R# VP                  4       oV  Uu. uF  p\        \        V4      ^4      NK  	  upo\        S4      V8  dE   \        V3R l\        S4       4       V3R lR	R7      pV^ 8  d   MSV;;,          ^,          uu&   KT  Rp	S FP  p
\        V
4       F>  w  op\        V4      SS,          8  g   K  Rp	VRSS,          ^,
           R,           V
S&   K@  	  KR  	  V	# u upi u upi )
a  Truncate cells in-place to fit the current terminal width.

Returns `True` if any cell was truncated, so the caller can emit a hint.
`shutil.get_terminal_size` is cross-platform: it honors `$COLUMNS`, then
queries the OS-native API, then falls back to `(80, 24)`.
Fc              3   V   <"   T F  p\        SV,          S,          4      x  K   	  R # 5ir9   )len)rP   rr   ri   s   & r   rS   $_truncate_columns.<locals>.<genexpr>,  s!     %P?O!c$q'!*oo?Os   &)c              3   L   <"   T F  w  rVSV,          8  g   K  Vx  K  	  R # 5ir9   r   )rP   iw
min_widthss   &  r   rS   r   :  s      @?41a*Q-.?QQ?s   $
$c                    < SV ,          # r9   r   )r   capss   &r   <lambda>#_truncate_columns.<locals>.<lambda>;  s	    $q'r   )r   r\   TNz...)	r   rangemaxshutilget_terminal_sizecolumnssumcopyr   )rF   ri   r&   nr   naturalbudgetrh   widest	truncatedrk   cellr   r   s   &f$ `       @@r   rb   rb     s[    $GA[`ab[cd[cVWs3wqz?Q%PuSY?O%PQ[cGd %%'//#aQ-?F
7|v
 <<>D*12'Q#c!fa.'2J
d)f
@9T?@!

 A:VI ~GAt4y47" 	mQ!,u4A & 
 9 e 3s   AF!F&c                0    V ^8  d   QhR\         R\        /# r   rv   )r!   s   "r   r#   r#   K  s     $ $C $C $r   c                    \        V \        P                  4      '       d   V P                  4       # \        \	        V 4      4      # )zHFormat a cell value for agent TSV output (ISO timestamps, tabs escaped).)r{   r   r   r   r?   r   s   &r   rW   rW   K  s1    %**++  E
##r   )&r   ry   r   r   r   r   r   collections.abcr   enumr   typingr   r   r   huggingface_hub.errorsr   huggingface_hub.utilsr   r   r	   r
   r   r?   r   r   r   r}   compiler   rB   r   r`   rc   ra   rb   rW   outr   r   r   <module>r     s    )    	  
 $    4 ] ]3 l7 l7db
 ::'(""$*-`$ hr   