
    1Vha                         d Z ddlZddlZddlmZ d Z G d dej                        Z	 G d d	e	      Z
 G d
 dej                        Zdad ZddZy)zGeneric entry point script.    N   )flagsc                 0   t         j                  d   j                  }|s/dt         j                  d   z  }t	        j
                  |dd      }nA|j                  d      d|j                  d	      z  z
  }	 |t         j                  d   f|z  z  }| rt        j                  j                         }nt        t        j                        }	 t         j                  j                  |       |r>t         j                  j                  d
       t         j                  j                  |       t         j                  j                  d       y# t        t        t        f$ r Y w xY w# t        $ r(}|j                   t"        j$                  k7  r Y d}~yd}~ww xY w)zWrites __main__'s docstring to stdout with some help text.

    Args:
      shorthelp: bool, if True, prints only flags from the main module,
          rather than all flags.
    __main__z
USAGE: %s [flags]
r   z        )indentfirstline_indent%   z%%z
flags:

N)_sysmodules__doc__argvr   	text_wrapcountOverflowError	TypeError
ValueErrorFLAGSmain_module_helpstrstdoutwriteIOErrorerrno_errnoEPIPE)	shorthelpdocnum_specifiersflag_stres        V/home/dcms/DCMS/lib/python3.12/site-packages/tensorboard/compat/tensorflow_stub/app.py_usager%      s9    ,,z
"
*
*C%		!4ooc)bI 3!ciio*==	DIIaL?^33C ;;//1u{{#
#KKl+KKh'$ y*5 		   77fll" #s+   6E
 A>E$ 
E! E!$	F-FFc                   0     e Zd ZdZdZdZ fdZd Z xZS )	_HelpFlagz?Special boolean flag that displays usage and raises SystemExit.helphc                 T    t         |   | j                  dd| j                         y )NFzshow this help)
short_name)super__init__NAME
SHORT_NAMEself	__class__s    r$   r-   z_HelpFlag.__init__B   s'    IIu.4?? 	 	
    c                 v    |r7t        d       t                t        d       t        j                  d       y y )NTr   z*Try --helpfull to get a list of all flags.r   )r%   printr   exitr1   args     r$   parsez_HelpFlag.parseG   s+    T"G>?IIaL	 r3   )	__name__
__module____qualname__r   r.   r/   r-   r:   __classcell__r2   s   @r$   r'   r'   <   s    IDJ

r3   r'   c                       e Zd ZdZdZdZy)_HelpshortFlagz#--helpshort is an alias for --help.	helpshortN)r;   r<   r=   r   r.   r/    r3   r$   rA   rA   O   s    -DJr3   rA   c                   (     e Zd ZdZ fdZd Z xZS )_HelpfullFlagz@Display help for flags in main module and all dependent modules.c                 (    t         |   ddd       y )NhelpfullFzshow full help)r,   r-   r0   s    r$   r-   z_HelpfullFlag.__init__Y   s    U,<=r3   c                 L    |r"t        d       t        j                  d       y y )NFr5   r   )r%   r   r7   r8   s     r$   r:   z_HelpfullFlag.parse\   s    U#IIaL r3   )r;   r<   r=   r   r-   r:   r>   r?   s   @r$   rE   rE   V   s    J>r3   rE   Fc                      t         sZt        j                  t                      t        j                  t	                      t        j                  t                      da y y )NT)_define_help_flags_calledr   DEFINE_flagr'   rE   rA   rC   r3   r$   _define_help_flagsrL   e   sA    $)+&-/*.*+$(!	 %r3   c                     t                t        j                  |t        j                  n|d      }| xs t        j
                  d   j                  } t        j                   | |             y)zBRuns the program with an optional 'main' function and 'argv' list.NT)
known_onlyr   )rL   r   r   r   r   r   mainr7   )rO   r   s     r$   runrP   o   sQ      ;;DLtyydtLD04<<
+00D 	IId4jr3   )NN)r   r   r   sysr   r   r   r%   BooleanFlagr'   rA   rE   rJ   rL   rP   rC   r3   r$   <module>rS      s[     "   !H!! &Y 	E%% 	 " )r3   