
    hs                     l    S SK r S SKJrJrJr  S SKJr  S SKJr  SS/r " S S\	5      r
 " S S\5      rg)	    N)EventThreadcurrent_thread)time)warnTMonitorTqdmSynchronisationWarningc                       \ rS rSrSrSrg)r	   	   zdtqdm multi-thread/-process errors which may cause incorrect nesting
but otherwise no adverse effects N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       ?/var/www/html/env/lib/python3.13/site-packages/tqdm/_monitor.pyr	   r	   	   s
    (r   c                   :    \ rS rSrSr0 rS rS rS rS r	S r
Srg	)
r      a6  
Monitoring thread for tqdm bars.
Monitors if tqdm bars are taking too much time to display
and readjusts miniters automatically if necessary.

Parameters
----------
tqdm_cls  : class
    tqdm class to use (can be core tqdm or a submodule).
sleep_interval  : float
    Time to sleep between monitoring checks.
c                 b   [         R                  " U 5        SU l        SU l        Xl        X l        U R                  R                  S[        5      U l	        U R                  R                  S[        5      " 5       U l        [        R                  " U R                  5        U R                  5         g )NTr   r   r   )r   __init__daemonwokentqdm_clssleep_interval_testgetr   _timer   
was_killedatexitregisterexitstart)selfr   r   s      r   r   TMonitor.__init__   so    
 ,ZZ^^FD1
**..%8:		"

r   c                     U R                   R                  5         U [        5       La  U R                  5         U R	                  5       $ N)r    setr   joinreportr%   s    r   r#   TMonitor.exit)   s2    ~''IIK{{}r   c                     U R                   R                  R                  5        Vs/ s H  n[        US5      (       d  M  UPM     sn$ s  snf )Nstart_t)r   
_instancescopyhasattr)r%   is     r   get_instancesTMonitor.get_instances/   sD    ==3388: *:a1i( : * 	* *s   A	 A	c                    U R                  5       n Xl        U R                  R                  U R                  5        U R                  R                  5       (       a  g U R                  R                  5          U R                  5       nU R                  5       nU Ho  nU R                  R                  5       (       a
    S S S 5        g UR                  S:  a2  XR                  -
  UR                  :  a  SUl	        UR                  SS9  AMq     X R                  5       :w  a  [        S[        SS9  AS S S 5        GM)  ! , (       d  f       N= f)NT   )nolockzOSet changed size during iteration (see https://github.com/tqdm/tqdm/issues/481)   )
stacklevel)r   r   r    waitr   is_setr   get_lockr4   miniterslast_print_tmaxintervalrefreshr   r	   )r%   cur_t	instancesinstances       r   runTMonitor.run5   s   

 JOO  !4!45%%'' '')

 ..0	 )H--// *) !))A-"%:%::x?S?SS -.) (((5 ! !*"  2 2 44 J3C 5 *  *)s   7AD;A*D;;
E	c                 @    U R                   R                  5       (       + $ r(   )r    r<   r,   s    r   r+   TMonitor.report^   s    ??))+++r   )r   r   r   r   r    r   N)r   r   r   r   r   r   r   r#   r4   rE   r+   r   r   r   r   r   r      s(     E	*'R,r   )r!   	threadingr   r   r   r   warningsr   __all__RuntimeWarningr	   r   r   r   r   <module>rM      s9     3 3  3
4	 	P,v P,r   