
    +h$                     6   % S r SSKrSSKrSSKrSSKrSSKJrJrJrJrJ	r	J
r
JrJr  SSKJrJr  SSKJr  \R&                  " 5       rSq\\R,                     \S'   \R                  \R                  \R                  \R                  \R
                  S.r\R                  rSqS	\4S
 jrS	\4S jrS	\R>                  4S jr S*S jr!S*S jr"S	\\\4   4S jr#S+S\\   S	\R>                  4S jjr$S	\4S jr%S\S	S4S jr&S*S jr'S*S jr(S*S jr)S*S jr*S*S jr+S*S jr,S\R,                  S	S4S jr-S\R,                  S	S4S jr.S*S jr/S*S jr0S*S  jr1S*S! jr2S*S" jr3\3\R>                  l3         " S# S$5      r4 " S% S&5      r5\5" 5       rS	\64S' jr7S*S( jr8S*S) jr9g),zLogging utilities.    N)CRITICALDEBUGERRORFATALINFONOTSETWARNWARNING)DictOptional)auto_default_handler)debuginfowarningerrorcriticalTreturnc            	         [         R                  " SS5      n U (       a^  U [        ;   a	  [        U    $ [        R                  " 5       R                  SU  SSR                  [        R                  5       5       35        [        $ )z
If DIFFUSERS_VERBOSITY env var is set to one of the valid choices return that as the new default level. If it is
not - fall back to `_default_log_level`
DIFFUSERS_VERBOSITYNz#Unknown option DIFFUSERS_VERBOSITY=z, has to be one of: z, )	osgetenv
log_levelslogging	getLoggerr   joinkeys_default_log_level)env_level_strs    Q/home/james-whalen/.local/lib/python3.13/site-packages/diffusers/utils/logging.py_get_default_logging_levelr!   4   sr    
 II3T:MJ&m,,''5m_DXY]YbYbcmcrcrctYuXvw     c                  2    [         R                  S5      S   $ )N.r   )__name__split r"   r    _get_library_namer(   D   s    >>#q!!r"   c                  >    [         R                  " [        5       5      $ N)r   r   r(   r'   r"   r    _get_library_root_loggerr+   H   s    .011r"   c                     [            [        (       a
   S S S 5        g [        R                  " 5       q[        R
                  (       a#  [        R
                  R                  [        l        [        5       n U R                  [        5        U R                  [        5       5        SU l        S S S 5        g ! , (       d  f       g = f)NF)_lockr   r   StreamHandlersysstderrflushr+   
addHandlersetLevelr!   	propagatelibrary_root_loggers    r    _configure_library_root_loggerr7   L   s     
 
 #002::%(ZZ%5%5" 78&&'78$$%?%AB(-% 
s   B2BB22
C c                      [            [        (       d
   S S S 5        g [        5       n U R                  [        5        U R	                  [
        R                  5        S qS S S 5        g ! , (       d  f       g = fr*   )r-   r   r+   removeHandlerr3   r   r   r5   s    r    _reset_library_root_loggerr:   _   sS     
 
 78))*:;$$W^^4 
s   A&A A&&
A4c                      [         $ r*   )r   r'   r"   r    get_log_levels_dictr<   l   s    r"   namec                 \    U c
  [        5       n [        5         [        R                  " U 5      $ )z
Return a logger with the specified name.

This function is not supposed to be directly accessed unless you are writing a custom diffusers module.
)r(   r7   r   r   )r=   s    r    
get_loggerr?   p   s(     | ""$T""r"   c                  F    [        5         [        5       R                  5       $ )u  
Return the current level for the 🤗 Diffusers' root logger as an `int`.

Returns:
    `int`:
        Logging level integers which can be one of:

        - `50`: `diffusers.logging.CRITICAL` or `diffusers.logging.FATAL`
        - `40`: `diffusers.logging.ERROR`
        - `30`: `diffusers.logging.WARNING` or `diffusers.logging.WARN`
        - `20`: `diffusers.logging.INFO`
        - `10`: `diffusers.logging.DEBUG`

)r7   r+   getEffectiveLevelr'   r"   r    get_verbosityrB   ~   s      #$#%7799r"   	verbosityc                 J    [        5         [        5       R                  U 5        g)uy  
Set the verbosity level for the 🤗 Diffusers' root logger.

Args:
    verbosity (`int`):
        Logging level which can be one of:

        - `diffusers.logging.CRITICAL` or `diffusers.logging.FATAL`
        - `diffusers.logging.ERROR`
        - `diffusers.logging.WARNING` or `diffusers.logging.WARN`
        - `diffusers.logging.INFO`
        - `diffusers.logging.DEBUG`
N)r7   r+   r3   )rC   s    r    set_verbosityrE      s     #$''	2r"   c                       [        [        5      $ )z&Set the verbosity to the `INFO` level.)rE   r   r'   r"   r    set_verbosity_inforG      s    r"   c                       [        [        5      $ )z)Set the verbosity to the `WARNING` level.)rE   r
   r'   r"   r    set_verbosity_warningrI      s    !!r"   c                       [        [        5      $ )z'Set the verbosity to the `DEBUG` level.)rE   r   r'   r"   r    set_verbosity_debugrK          r"   c                       [        [        5      $ )z'Set the verbosity to the `ERROR` level.)rE   r   r'   r"   r    set_verbosity_errorrN      rL   r"   c                  d    [        5         [        c   e[        5       R                  [        5        g)u?   Disable the default handler of the 🤗 Diffusers' root logger.N)r7   r   r+   r9   r'   r"   r    disable_default_handlerrP      s(     #$''',,-=>r"   c                  d    [        5         [        c   e[        5       R                  [        5        g)u>   Enable the default handler of the 🤗 Diffusers' root logger.N)r7   r   r+   r2   r'   r"   r    enable_default_handlerrR      s(     #$'''))*:;r"   handlerc                 T    [        5         U c   e[        5       R                  U 5        g)z9adds a handler to the HuggingFace Diffusers' root logger.N)r7   r+   r2   rS   s    r    add_handlerrV      s'     #$))'2r"   c                     [        5         U b  U [        5       R                  ;   d   e[        5       R                  U 5        g)zBremoves given handler from the HuggingFace Diffusers' root logger.N)r7   r+   handlersr9   rU   s    r    remove_handlerrY      s8     #$7.F.H.Q.Q#QQQ,,W5r"   c                  6    [        5         S[        5       l        g)zc
Disable propagation of the library log outputs. Note that log propagation is disabled by default.
FNr7   r+   r4   r'   r"   r    disable_propagationr\      s    
 #$+0(r"   c                  6    [        5         S[        5       l        g)z
Enable propagation of the library log outputs. Please disable the HuggingFace Diffusers' default handler to prevent
double logging if the root logger has been configured.
TNr[   r'   r"   r    enable_propagationr^      s     #$+/(r"   c                      [        5       R                  n U  H*  n[        R                  " S5      nUR	                  U5        M,     g)u   
Enable explicit formatting for every 🤗 Diffusers' logger. The explicit formatter is as follows:
```
[LEVELNAME|FILENAME|LINE NUMBER] TIME >> MESSAGE
```
All handlers currently bound to the root logger are affected by this method.
zB[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)sN)r+   rX   r   	FormattersetFormatter)rX   rS   	formatters      r    enable_explicit_formatrc      s;     ()22H%%&jk	Y' r"   c                  `    [        5       R                  n U  H  nUR                  S5        M     g)u   
Resets the formatting for 🤗 Diffusers' loggers.

All handlers currently bound to the root logger are affected by this method.
N)r+   rX   ra   )rX   rS   s     r    reset_formatre      s*     ()22HT" r"   c                 f    [         R                  " SS5      nU(       a  gU R                  " U0 UD6  g)z
This method is identical to `logger.warning()`, but if env var DIFFUSERS_NO_ADVISORY_WARNINGS=1 is set, this
warning will not be printed
DIFFUSERS_NO_ADVISORY_WARNINGSFN)r   r   r   )selfargskwargsno_advisory_warningss       r    warning_advicerl     s-    
 99%EuMLL$!&!r"   c                   6    \ rS rSrSrS rS rS rS rS r	Sr
g	)
	EmptyTqdmi  z%Dummy tqdm which doesn't do anything.c                 6    U(       a  US   U l         g S U l         g )Nr   	_iteratorrh   ri   rj   s      r    __init__EmptyTqdm.__init__  s    $(adr"   c                 ,    [        U R                  5      $ r*   )iterrq   rh   s    r    __iter__EmptyTqdm.__iter__  s    DNN##r"   c                     S nU$ )zReturn empty function.c                      g r*   r'   )ri   rj   s     r    empty_fn'EmptyTqdm.__getattr__.<locals>.empty_fn%  s    r"   r'   )rh   _r|   s      r    __getattr__EmptyTqdm.__getattr__"  s    	 r"   c                     U $ r*   r'   rw   s    r    	__enter__EmptyTqdm.__enter__*  s    r"   c                     g r*   r'   )rh   type_value	tracebacks       r    __exit__EmptyTqdm.__exit__-  s    r"   rp   N)r%   
__module____qualname____firstlineno____doc__rs   rx   r   r   r   __static_attributes__r'   r"   r    rn   rn     s    /3$r"   rn   c                   &    \ rS rSrS rS rS rSrg)	_tqdm_clsi1  c                 Z    [         (       a  [        R                  " U0 UD6$ [        U0 UD6$ r*   )_tqdm_activetqdm_libtqdmrn   rr   s      r    __call___tqdm_cls.__call__2  s+    <==$1&11d-f--r"   c                 h    S U l         [        (       a   [        R                  R                  " U0 UD6$ g r*   )r-   r   r   r   set_lockrr   s      r    r   _tqdm_cls.set_lock8  s-    
<==))4:6:: r"   c                 V    [         (       a  [        R                  R                  5       $ g r*   )r   r   r   get_lockrw   s    r    r   _tqdm_cls.get_lock=  s    <==))++ r"   )r-   N)r%   r   r   r   r   r   r   r   r'   r"   r    r   r   1  s    .;
,r"   r   c                       [        [        5      $ )zCReturn a boolean indicating whether tqdm progress bars are enabled.)boolr   r'   r"   r    is_progress_bar_enabledr   E  s     r"   c                      Sq g)zEnable tqdm progress bar.TNr   r'   r"   r    enable_progress_barr   K  s	     Lr"   c                      Sq g)zDisable tqdm progress bar.FNr   r'   r"   r    disable_progress_barr   Q  s	     Lr"   )r   Nr*   ):r   r   r   r/   	threadingr   r   r   r   r   r   r	   r
   typingr   r   r   r   r   Lockr-   r   Handler__annotations__r   r   r   intr!   strr(   Loggerr+   r7   r:   r<   r?   rB   rE   rG   rI   rK   rN   rP   rR   rV   rY   r\   r^   rc   re   rl   rn   r   r   r   r   r   r'   r"   r    <module>r      s     	 
 	 	 	 " ! 	.2 (7??+ 2 ]]LL]]  
 __ C  "3 "2'.. 2.&
 T#s(^ #Xc] #gnn #:s :(3S 3T 3&
"
 
 
?<3 3T 36GOO 6 610(	#" !/  0, ," { r"   