
    Dh                       d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dl	m
Z
mZmZ ddlmZmZmZmZ ddlmZ ej&                  rddlmZmZ  ej.                  e      Zej4                  j6                  Zej:                  j6                  Zej                  j6                  Zej@                  e!ejD                  f   Z#ejH                  e!   Z% ejL                  d	      Z'd
 Z(d Z)d Z*dYdZ+ G d dejX                        Z- G d dejX                        Z. G d dej^                        Z0 G d dej^                        Z1 G d de.ejd                        Z3 G d de3ejd                        Z4 G d de3ejd                        Z5 G d de-e3      Z6 G d d e6e5      Z7 G d! d"e5ejd                        Z8 G d# d$e7      Z9 G d% d&e9      Z: G d' d(e9e8      Z; G d) d*e9      Z< G d+ d,e-e3      Z= G d- d.e-e5      Z> G d/ d0e>e8      Z? G d1 d2e5      Z@e@ZA G d3 d4e-e3      ZB G d5 d6      ZC G d7 d8e-eCe3      ZD G d9 d:e-eCe3      ZE G d; d<e4      ZF G d= d>eF      ZG G d? d@eFe5      ZH G dA dBe-e3      ZI G dC dD      ZJ G dE dFeFeJ      ZK G dG dHeK      ZL G dI dJ      ZM G dK dLe4      ZN G dM dNe6eF      ZO G dO dPeDeO      ZP G dQ dRe-eJe3      ZQ G dS dTeQ      ZR G dU dVe-e5      ZS G dW dXeFeJ      ZTy)Z    )annotationsN)ClassVar)
containers
converterstypes   )
algorithmsbaseterminalutils)colors)NumberTProgressBarMixinBaseTc                6     t         t              r fd}|S  S )Nc                    |z  S N )progressdatawidthinput_s      u/var/www/fastuser/data/www/generator.snapmosaic.io/flask_app/venv/lib/python3.12/site-packages/progressbar/widgets.pyrender_inputz&string_or_lambda.<locals>.render_input%   s    D=     )
isinstancestr)r   r   s   ` r   string_or_lambdar   "   s    &#	! r   c                    t        | t              r$t        |       dk(  r| \  }}|xs ddz   |xs dz   } n| syt        | t              rd| v sJ d       | S t	        d      )zConvert a wrapper tuple or format string to a format string.

    >>> create_wrapper('')

    >>> print(create_wrapper('a{}b'))
    a{}b

    >>> print(create_wrapper(('a', 'b')))
    a{}b
        z{}Nz&Expected string with {} for formattingzHPass either a begin/end string as a tuple or a template string with `{}`)r   tuplelenr   RuntimeError)wrapperabs      r   create_wrapperr(   -   sv     '5!c'la&717d"ag2.'3wH HH N 
 	
r   c                d     t              s S t        j                          fd       }|S )z_Wrap the output of a function in a template string or a tuple with
    begin/end strings.

    c                 2    j                   | i |      S r   format)argskwargsfunctionwrapper_s     r   wrapzwrapper.<locals>.wrapR   s    x8899r   )r(   	functoolswraps)r/   r0   r1   s   `` r   r%   r%   I   s9    
 h'H__X: : Kr   c                      fd}t         t              rBt        j                          d}t	        j
                         dk(  sJ |       t        ||      S t         |      S )Nc                    | j                   t        j                  ur9| j                   dkD  r*t        | j                  | j                   z  |z        }|z  S S Nr   )	max_valuer
   UnknownLengthintvalue)r   r   r   lengthmarkers       r   _markerzcreate_marker.<locals>._markerZ   sR    d&8&88""Q&(*<*<<uDEFF?"Mr   z!Markers are required to be 1 charr   )r   r   r   
to_unicoder   	len_colorr%   )r<   r1   r=   marker_length_errors   `   r   create_markerrA   Y   sa     &#&&v.Av&!+@-@@+w%%vt$$r   c                  N    e Zd ZdZdddZ	 d	 	 	 	 	 	 	 d	dZ	 d	 	 	 	 	 	 	 d	dZy)
FormatWidgetMixinao  Mixin to format widgets using a formatstring.

    Variables available:
     - max_value: The maximum value (can be None with iterators)
     - value: The current value
     - total_seconds_elapsed: The seconds since the bar started
     - seconds_elapsed: The seconds since the bar started modulo 60
     - minutes_elapsed: The minutes since the bar started modulo 60
     - hours_elapsed: The hours since the bar started modulo 24
     - days_elapsed: The hours since the bar started
     - time_elapsed: Shortcut for HH:MM:SS time since the bar started including
       days
     - percentage: Percentage as a float
    c                     || _         || _        y r   )	new_styler,   )selfr,   rE   r.   s       r   __init__zFormatWidgetMixin.__init__~   s    "r   Nc                "    |xs | j                   S r   r+   rF   r   r   r,   s       r   
get_formatzFormatWidgetMixin.get_format   s     $$r   c                    | j                  |||      }	 | j                  r |j                  di |S ||z  S # t        t        f$ r t
        j                  d||        w xY w)z!Formats the widget into a string.z'Error while formatting %r with data: %rr   )rJ   rE   r,   	TypeErrorKeyErrorlogger	exception)rF   r   r   r,   format_s        r   __call__zFormatWidgetMixin.__call__   sp     //(D&9	~~%w~~---~%8$ 	9
 	s   8 8 (A F)r,   r   rE   boolr   )r   r   r   Datar,   types.Optional[str]returnr   )__name__
__module____qualname____doc__rG   rJ   rQ   r   r   r   rC   rC   n   sl     '+	%&% % $	%
 
% '+	&  $	
 
r   rC   c                       e Zd ZdZddZddZy)WidthWidgetMixina  Mixing to make sure widgets are only visible if the screen is within a
    specified size range so the progressbar fits on both large and small
    screens.

    Variables available:
     - min_width: Only display the widget if at least `min_width` is left
     - max_width: Only display the widget if at most `max_width` is left

    >>> class Progress:
    ...     term_width = 0

    >>> WidthWidgetMixin(5, 10).check_size(Progress)
    False
    >>> Progress.term_width = 5
    >>> WidthWidgetMixin(5, 10).check_size(Progress)
    True
    >>> Progress.term_width = 10
    >>> WidthWidgetMixin(5, 10).check_size(Progress)
    True
    >>> Progress.term_width = 11
    >>> WidthWidgetMixin(5, 10).check_size(Progress)
    False
    Nc                     || _         || _        y r   )	min_width	max_width)rF   r^   r_   r.   s       r   rG   zWidthWidgetMixin.__init__   s    ""r   c                |    | j                   }| j                  }|r||j                  kD  ry|r||j                  k  ryy)NFT)r_   r^   
term_width)rF   r   r_   r^   s       r   
check_sizezWidthWidgetMixin.check_size   s=    NN	NN	X%8%889x':'::r   NNr   r   )rW   rX   rY   rZ   rG   rb   r   r   r   r\   r\      s    0#r   r\   c                  "    e Zd ZU ded<   ded<   y)TGradientColorsz-types.Optional[terminal.OptionalColor | None]fgbgNrW   rX   rY   __annotations__r   r   r   rf   rf      s    5555r   rf   c                  "    e Zd ZU ded<   ded<   y)TFixedColorsz%types.Optional[terminal.Color | None]fg_nonebg_noneNri   r   r   r   rl   rl      s    2222r   rl   c                       e Zd ZU dZdZej                  dd       Z edd      Z	de
d<    edd      Zd	e
d
<   eZde
d<   ej                   d        ZddZddd fd
Z xZS )
WidgetBasea  The base class for all widgets.

    The ProgressBar will call the widget's update value when the widget should
    be updated. The widget's size may change between calls, but the widget may
    display incorrectly if the size changes drastically and repeatedly.

    The INTERVAL timedelta informs the ProgressBar that it should be
    updated more often because it is time sensitive.

    The widgets are only visible if the screen is within a
    specified size range so the progressbar fits on both large and small
    screens.

    WARNING: Widgets can be shared between multiple progressbars so any state
    information specific to a progressbar should be stored within the
    progressbar instead of the widget.

    Variables available:
     - min_width: Only display the widget if at least `min_width` is left
     - max_width: Only display the widget if at most `max_width` is left
     - weight: Widgets with a higher `weight` will be calculated before widgets
       with a lower one
     - copy: Copy this widget when initializing the progress bar so the
       progressbar can be reused. Some widgets such as the FormatCustomText
       require the shared state so this needs to be optional

    Tc                     y)zWUpdates the widget.

        progress - a reference to the calling ProgressBar
        Nr   rF   r   r   s      r   rQ   zWidgetBase.__call__       r   Nrm   rn   ClassVar[TFixedColors]_fixed_colorsrg   rh   ClassVar[TGradientColors]_gradient_colorsz#typing.Callable[[str | bytes], int]_lenc                    | j                   j                         D ]  }| y t        d | j                  j                         D              S )NTc              3  $   K   | ]  }|d u 
 y wr   r   ).0r:   s     r   	<genexpr>z)WidgetBase.uses_colors.<locals>.<genexpr>  s     N5$Ns   )ry   valuesanyrv   )rF   r:   s     r   uses_colorszWidgetBase.uses_colors  sK    **113 	E 	 N$2D2D2K2K2MNNNr   c                    | j                   r<t        j                  ||j                  d      fi | j                  | j
                  S |S )N
percentage)r   r   apply_colorsgetry   rv   )rF   textr   s      r   _apply_colorszWidgetBase._apply_colors  sT    ((& '' $$	  Kr   )fixed_colorsgradient_colorsc                   || j                   j                  |       || j                  j                  |       | j                  rt        j
                  | _        t        |    |i | y r   )	rv   updatery   r   r   r?   rz   superrG   )rF   r   r   r-   r.   	__class__s        r   rG   zWidgetBase.__init__  s_     #%%l3&!!((9DI$)&)r   )r   r   r   rT   rV   r   )r   r   r   rT   rV   r   )rW   rX   rY   rZ   copyabcabstractmethodrQ   rl   rv   rj   rf   ry   r#   rz   r2   cached_propertyr   r   rG   __classcell__r   s   @r   rp   rp      s    8 D  -9-M)  3B3/  14D
-3O O	 	* *r   rp   )	metaclassc                  H    e Zd ZdZej
                  	 d	 	 	 	 	 	 	 dd       Zy)AutoWidthWidgetBasea	  The base class for all variable width widgets.

    This widget is much like the \hfill command in TeX, it will expand to
    fill the line. You can use more than one in the same line, and they will
    all have the same width, and together will fill the line.
    c                     y)zUpdates the widget providing the total width the widget must fill.

        progress - a reference to the calling ProgressBar
        width - The total width the widget must fill
        Nr   )rF   r   r   r   s       r   rQ   zAutoWidthWidgetBase.__call__3  rs   r   Nr   )r   r   r   rT   r   r9   rV   r   )rW   rX   rY   rZ   r   r   rQ   r   r   r   r   r   +  sL     	
 	
&
 
 	

 

 
r   r   c                  6    e Zd ZdZ ej
                  d      Zy)TimeSensitiveWidgetBasezThe base class for all time sensitive widgets.

    Some widgets like timers would become out of date unless updated at least
    every `INTERVAL`
    d   millisecondsN)rW   rX   rY   rZ   datetime	timedeltaINTERVALr   r   r   r   r   A  s     "x!!s3Hr   r   c            	      p    e Zd ZU dZ eddddddej                  fd	      Zd
ed<   ddZ		 d	 	 	 	 	 ddZ
y)FormatLabela  Displays a formatted label.

    >>> label = FormatLabel('%(value)s', min_width=5, max_width=10)
    >>> class Progress:
    ...     pass
    >>> label = FormatLabel('{value} :: {value:^6}', new_style=True)
    >>> str(label(Progress, dict(value='test')))
    'test ::  test '

    )end_timeN)last_update_timeN)r7   N)seconds_elapsedN)
start_timeNtotal_seconds_elapsed)r:   N)finishedlast_updatemaxsecondsstartelapsedr:   z6ClassVar[types.Dict[str, types.Tuple[str, types.Any]]]mappingc                `    t        j                  | fd|i| t        j                  | fi | y Nr,   rC   rG   rp   rF   r,   r.   s      r   rG   zFormatLabel.__init__a  s-    ""4AA&AD+F+r   Nc                   | j                   j                         D ]M  \  }\  }}t        j                  t        t
        t              5  |	||   ||<   n |||         ||<   d d d        O t        j                  | |||      S # 1 sw Y   qxY wr   )	r   items
contextlibsuppressrM   
ValueError
IndexErrorrC   rQ   )rF   r   r   r,   namekey	transforms          r   rQ   zFormatLabel.__call__e  s     '+ll&8&8&: 	6"D"3	$$Xz:F 6$!%cDJ!*49!5DJ	6 6	6 !))$$GG6 6s   BB	)r,   r   r   r   r   r   rT   r,   rU   )rW   rX   rY   rZ   dictr   format_timer   rj   rG   rQ   r   r   r   r   r   K  sm    	 GK#.)"(%*;*;<GGC , '+	H&H H $	Hr   r   c                  <    e Zd ZdZddZ eej                        Zy)Timerz.WidgetBase which displays the elapsed seconds.c                    d|v rd|vr|j                  dd      }t        j                  | fd|i| t        j                  | fi | y )N%sz%(elapsed)sr,   )replacer   rG   r   r   s      r   rG   zTimer.__init__x  sK    6>m69^^D-8FT;&;F;((88r   N)zElapsed Time: %(elapsed)s)rW   rX   rY   rZ   rG   staticmethodr   r   r   r   r   r   r   u  s    89 u001Kr   r   c                  d    e Zd ZdZ ej
                  d      dfdZd	dZd	dZ	 d
	 	 	 	 	 ddZ	y)SamplesMixina  
    Mixing for widgets that average multiple measurements.

    Note that samples can be either an integer or a timedelta to indicate a
    certain amount of time

    >>> class progress:
    ...     last_update_time = datetime.datetime.now()
    ...     value = 1
    ...     extra = dict()

    >>> samples = SamplesMixin(samples=2)
    >>> samples(progress, None, True)
    (None, None)
    >>> progress.last_update_time += datetime.timedelta(seconds=1)
    >>> samples(progress, None, True) == (datetime.timedelta(seconds=1), 0)
    True

    >>> progress.last_update_time += datetime.timedelta(seconds=1)
    >>> samples(progress, None, True) == (datetime.timedelta(seconds=1), 0)
    True

    >>> samples = SamplesMixin(samples=datetime.timedelta(seconds=1))
    >>> _, value = samples(progress, None)
    >>> value
    SliceableDeque([1, 1])

    >>> samples(progress, None, True) == (datetime.timedelta(seconds=1), 0)
    True
    r    r   Nc                    || _         |xs | j                  j                  dz   | _        t	        j
                  | fi | y )N_)samplesr   rW   
key_prefixr   rG   )rF   r   r   r.   s       r   rG   zSamplesMixin.__init__  s9     %@)@)@CG((88r   c                x    |j                   j                  | j                   dt        j                               S )Nsample_timesextra
setdefaultr   r   SliceableDequerr   s      r   get_sample_timeszSamplesMixin.get_sample_times  s4    ~~((|,%%'
 	
r   c                x    |j                   j                  | j                   dt        j                               S )Nsample_valuesr   rr   s      r   get_sample_valueszSamplesMixin.get_sample_values  s4    ~~((}-%%'
 	
r   c                   | j                  ||      }| j                  ||      }|r|d   }nt        j                  j                  }|j                  |z
  | j
                  kD  r |j                  |j                         |j                  |j                         t        | j                  t        j                        rl|j                  | j                  z
  }|d   }|dd  r||d   kD  r{||d   kD  rs|j                  d       |j                  d       |dd  rL||d   kD  rD||d   kD  r8n:t        |      | j                  kD  r"|j                  d       |j                  d       |r|d   |d   z
  x}	r|d   |d   z
  }
|	|
fS y||fS )Nr    r   r   rc   )r   r   r   minr   r   appendr:   r   r   r   popr#   )rF   r   r   deltar   r   sample_timeminimum_timeminimum_value
delta_timedelta_values              r   rQ   zSamplesMixin.__call__  s    ,,Xt<..x>&r*K"++//K$${2T]]B 9 9:  0$,,(:(:;'884<<G -b 1 $$|A6%a(88 $$Q'!%%a( !$$|A6%a(88 \"T\\1  #!!!$)"-Q??z?+B/-2BB!;..!..r   r   r   r   rT   rR   )r   r   r   rT   r   rS   )
rW   rX   rY   rZ   r   r   rG   r   r   rQ   r   r   r   r   r     sR    B #""1-9

 	(/&(/ (/ 	(/r   r   c                  F    e Zd ZdZ	 	 	 	 	 ddZ	 	 	 	 ddZ	 	 d	 	 	 ddZy)	ETAz:WidgetBase which attempts to estimate the time of arrival.c                    d|v rd|vr|j                  dd      }t        j                  | fi | || _        || _        || _        || _        || _        y )Nr   z%(eta)s)r   r   rG   format_not_startedformat_finishedr,   format_zero	format_NA)rF   r   r   r,   r   	format_nar.   s          r   rG   zETA.__init__  sY     6>iv5^^D)4Ft&v&"4.&"r   c                p    |r4|j                         t        |d      z  }|j                  |d   z
  }||z  S y)?Updates the widget to show the ETA or total time when finished.gư>r:   r   )total_secondsr   r7   )rF   r   r   r:   r   per_item	remainings          r   _calculate_etazETA._calculate_eta  sC     ,,.UD1AAH **T']:Ix''r   Nc                6   ||d   }||d   }d}	 | j                  ||||      |d<   d|d<   |d   rGt        j                  t        t
        t              5  t        j                  |d         |d<   ddd       |d   |j                  k(  r| j                  }nF|j                  r| j                  }n-|d   r| j                  }n|r| j                  }n| j                  }t         j#                  | |||	      S # t        $ r
 d|d<   d}Y w xY w# 1 sw Y   xY w)
r   Nr:   time_elapsedFr:   r   eta_secondsTetar+   )r   rL   r   r   r   OverflowErrorOSErrorr   r   	min_valuer   r   r   r,   r   r   r   rQ   )rF   r   r   r:   r   eta_nafmts          r   rQ   zETA.__call__
  s9    =ME?>*G		"&"5"5	 #6 #D U$$ZH E#//]0CDUE =H...))C&&C%[++C..C""C~~dHd3~??)  	"&DF	E Es   C9 D9DDD)zETA:  --:--:--zTime: %(elapsed)8szETA:  %(eta)8szETA:  00:00:00zETA:      N/Ar   rc   )rW   rX   rY   rZ   rG   r   rQ   r   r   r   r   r     sT    D ,,$!#&& ( *@&*@ *@r   r   c                  .    e Zd ZdZ	 	 	 	 ddZ	 	 	 ddZy)AbsoluteETAz?Widget which attempts to estimate the absolute time of arrival.c                    t         j                  | ||||      }t        j                  j                         }	 |t        j                  |      z   S # t
        $ r t        j                  j                  cY S w xY w)Nr   )r   r   r   nowr   r   r   )rF   r   r   r:   r   r   r   s          r   r   zAbsoluteETA._calculate_eta:  sl     ((xugN##%	)++K@@@ 	)$$(((	)s   A #A87A8c                8    t        j                  | f|||d| y )N)r   r   r,   )r   rG   )rF   r   r   r,   r.   s        r   rG   zAbsoluteETA.__init__H  s+     		
1+		

 	
r   Nr   )z+Estimated finish time:  ----/--/-- --:--:--zFinished at: %(elapsed)szEstimated finish time: %(eta)s)rW   rX   rY   rZ   r   rG   r   r   r   r   r   7  s-    I)&) )  I2/	
r   r   c                  F    e Zd ZU dZded<   ded<   	 	 d	dZ	 	 d
	 	 	 ddZy)AdaptiveETAzWidgetBase which attempts to estimate the time of arrival.

    Uses a sampled average of the speed based on the 10 last updates.
    Very convenient for resuming the progress halfway.
    rS   exponential_smoothingfloatexponential_smoothing_factorc                x    || _         || _        t        j                  | fi | t	        j                  | fi | y r   )r  r  r   rG   r   )rF   r  r  r.   s       r   rG   zAdaptiveETA.__init__b  s8     &;",H)T$V$d-f-r   Nc                z    t         j                  | ||d      \  }}|sd }d}t        j                  | ||||      S )NTr   r   r   )r   rQ   r   rF   r   r   r:   r   s        r   rQ   zAdaptiveETA.__call__m  sQ     &..	 / 
 EG||D(Dw|OOr   )T皙?rc   r   )rW   rX   rY   rZ   rj   rG   rQ   r   r   r   r   r   X  sD      "'' #%(	. P&P Pr   r   c                  b    e Zd ZU dZded<   ded<   ej                  df	 	 	 d	dZ	 	 d
	 	 	 ddZy)SmoothingETAa[  
    WidgetBase which attempts to estimate the time of arrival using an
    exponential moving average (EMA) of the speed.

    EMA applies more weight to recent data points and less to older ones,
    and doesn't require storing all past values. This approach works well
    with varying data points and smooths out fluctuations effectively.
    zalgorithms.SmoothingAlgorithmsmoothing_algorithmzdict[str, float]smoothing_parametersNc                |    |xs i | _          |di | j                   xs i | _        t        j                  | fi | y )Nr   )r  r  r   rG   )rF   r  r  r.   s       r   rG   zSmoothingETA.__init__  sD     %9$>B!#6 $
((.B$
  	T$V$r   c                    ||d   }||d   }| j                   j                  ||       t        j                  | ||||      S )Nr:   r   r   )r  r   r   rQ   r  s        r   rQ   zSmoothingETA.__call__  sP     =ME?>*G  ''w7||D(Dw|OOr   )r  z#type[algorithms.SmoothingAlgorithm]r  zdict[str, float] | Nonerc   r   )	rW   rX   rY   rZ   rj   r	   ExponentialMovingAveragerG   rQ   r   r   r   r
  r
    s^     76** //8<%
%
 6%$ P&P Pr   r
  c                  6    e Zd ZdZ	 	 	 	 ddZ	 d	 	 	 	 	 ddZy)DataSizez
    Widget for showing an amount of data transferred/processed.

    Automatically formats the value (assumed to be a count of bytes) with an
    appropriate sized unit, based on the IEC binary prefixes (powers of 1024).
    c                    || _         || _        || _        t        j                  | fd|i| t        j                  | fi | y r   )variableunitprefixesrC   rG   rp   )rF   r  r,   r  r  r.   s         r   rG   zDataSize.__init__  sD     !	 ""4AA&AD+F+r   Nc                   || j                      }|-t        j                  |t        | j                              \  }}ndx}}||d<   | j                  |   |d<   | j
                  |d<   t        j                  | |||      S )Nr   scaledprefixr  )r  r   
scale_1024r#   r  r  rC   rQ   )rF   r   r   r,   r:   r  powers          r   rQ   zDataSize.__call__  s     T]]#!,,UC4FGMFEFUXu-XyyV ))$$GGr   )r:   z %(scaled)5.1f %(prefix)s%(unit)sB	r!   KiMiGiTiPiEiZiYir   r   rW   rX   rY   rZ   rG   rQ   r   r   r   r  r    sD     1E,$ '+	H&H H $	Hr   r  c                  6    e Zd ZdZ	 	 	 	 ddZd Z	 	 d	 ddZy)	FileTransferSpeedzT
    Widget for showing the current transfer speed (useful for file transfers).
    c                    || _         || _        || _        t        j                  | fd|i| t        j                  | fi | y r   )r  r  inverse_formatrC   rG   r   )rF   r,   r)  r  r  r.   s         r   rG   zFileTransferSpeed.__init__  sE     	 ,""4AA&A((88r   c                p    t        |      |z  }t        j                  |t        | j                              S r   )r  r   r  r#   r  )rF   r:   r   speeds       r   _speedzFileTransferSpeed._speed  s,    ew&s4=='9::r   Nc                   ||d   }t        j                  ||d         }|"| |dkD  r|dkD  r| j                  ||      \  }}ndx}}| j                  |d<   |dk(  rH|dk  rC|dkD  rd|z  }||d<   | j                  d   |d	<   t
        j                  | ||| j                        S ||d<   | j                  |   |d	<   t
        j                  | ||      S )
z6Updates the widget with the current SI prefixed speed.r:   r   g>r   r  r  r   r  r  )r   deltas_to_secondsr,  r  r  rC   rQ   r)  )rF   r   r   r:   r   r   r  r  s           r   rQ   zFileTransferSpeed.__call__  s    =ME))!()
 #$ KKw7MFEFUyyVA:&3,zV#DN!]]1-DN$--##	  $DN!]]51DN$--dHdCCr   )z#%(scaled)5.1f %(prefix)s%(unit)-s/sz#%(scaled)5.1f s/%(prefix)s%(unit)-sr  r  rc   rd   )rW   rX   rY   rZ   rG   r,  rQ   r   r   r   r'  r'    s6     5<E9; ")D&)Dr   r'  c                  &    e Zd ZdZd Z	 	 d	 ddZy)AdaptiveTransferSpeedzBWidget for showing the transfer speed based on the last X samples.c                \    t        j                  | fi | t        j                  | fi | y r   )r'  rG   r   )rF   r.   s     r   rG   zAdaptiveTransferSpeed.__init__  s(    ""4262d-f-r   Nc                l    t         j                  | ||d      \  }}t        j                  | ||||      S )NTr  )r   rQ   r'  )rF   r   r   r:   r   r   s         r   rQ   zAdaptiveTransferSpeed.__call__   sD     &..	 / 
 !))$$wOOr   rc   rd   r%  r   r   r   r0  r0    s!    L. "P&Pr   r0  c                  ,    e Zd ZdZ	 	 	 	 	 ddZdddZy)AnimatedMarkerzaAn animated marker for the progress bar which defaults to appear as if
    it were rotating.
    Nc                    || _         t        |      | _        |xs |d   | _        t        |      | _        |rt        || j                        nd | _        t        j                  | fi | y r6   )	markersr(   marker_wrapdefault	fill_wraprA   fillrp   rG   )rF   r6  r8  r:  r7  r9  r.   s          r   rG   zAnimatedMarker.__init__5  s]     )+6,'!*'	2;?M$7T	D+F+r   c                   |j                   r| j                  S | j                  |d   t        | j                        z     }| j                  r| j                  j                  |      }| j                  r&| j                  ||||j                  |      z
        }nd}t        |t              r t        |      }|j                         }||z   S  t        |      |      }||z   S )z^Updates the widget to show the next marker or the first marker when
        finished.
        updatesr!   )r   r8  r6  r#   r7  r,   r:  
custom_lenr   r9   bytesencodetype)rF   r   r   r   r<   r:  s         r   rQ   zAnimatedMarker.__call__E  s     <<d9oDLL0AAB%%,,V4F9999++F33D D fc"6]F;;=D
 f}  4<%Df}r   )z|/-\Nr!   NNr   r   r%  r   r   r   r4  r4  0  s"     , r   r4  c                  *    e Zd ZdZddZ	 d	 	 	 ddZy)CounterzDisplays the current count.c                d    t        j                  | fd|i| t        j                  | fd|i| y r   r   r   s      r   rG   zCounter.__init__l  s2    ""4AA&AD::6:r   Nc                2    t         j                  | |||      S r   )rC   rQ   rI   s       r   rQ   zCounter.__call__p  s     !))$$GGr   )z	%(value)dr   r   r%  r   r   r   rB  rB  i  s)    %; 	H&H Hr   rB  c                  r    e Zd ZU  eej
                  d      Zded<    eej                  d      Z
ded<   y)ColoredMixinNrt   ru   rv   rw   rx   ry   )rW   rX   rY   rl   r   yellowrv   rj   rf   gradientry   r   r   r   rF  rF  y  s>    ,8-M)  3B??3/ r   rF  c                  *    e Zd ZdZddZ	 d	 	 	 ddZy)
Percentagez@Displays the current percentage as a number with a percent sign.c                r    || _         t        j                  | fd|i| t        j                  | fd|i| y r   )narC   rG   rp   rF   r,   rL  r.   s       r   rG   zPercentage.__init__  s9    ""4AA&AD::6:r   Nc                    |j                  dt        j                        }|s|dk7  r| j                  }nt        j                  | |||      }| j                  ||      S )Nr   r   )r   r
   	UndefinedrL  rC   rJ   r   )rF   r   r   r,   r   outputs         r   rJ   zPercentage.get_format  sS     XXlDNN;
jAoWWF&11$$OF!!&$//r   )z%(percentage)3d%%N/A%%r   r   )rW   rX   rY   rZ   rG   rJ   r   r   r   rJ  rJ    s&    J; 	0&0 0r   rJ  c                  <    e Zd ZU dZded<   dZefdZ	 d	 	 	 d	dZy)
SimpleProgressz;Returns progress as a count of the total (e.g.: "5 of 47").zdict[str | tuple[NumberT | types.Type[base.UnknownLength] | None, NumberT | types.Type[base.UnknownLength] | None], types.Optional[int]]max_width_cachez%(value_s)s of %(max_value_s)sc                    t        j                  | fd|i| t        j                  | fd|i| t               | _        | j
                  xs d| j                  d<   y )Nr,   r   r8  )rC   rG   rp   r   rT  r_   r   s      r   rG   zSimpleProgress.__init__  sU    ""4AA&AD::6:#v*...*=AY'r   Nc           	     L   |j                  d      r	|d   |d<   nd|d<   |j                  d      r	|d   |d<   nd|d<   t        j                  | |||      }|j                  |j                  f}| j
                  j                  || j                        }|si|j                         }|D ]E  }|||d<   |j                  t        j                  | |||            x}	s6t        |xs d|	      }G || j
                  |<   |r|j                  |      }| j                  ||      S )Nr7   max_value_szN/Ar:   value_sr   r+   )r   rC   rQ   r   r7   rT  r_   r   r=  r   rjustr   )
rF   r   r   r,   	formattedr   r_   temporary_datar:   r   s
             r   rQ   zSimpleProgress.__call__  sZ    88K "&{"3D"'D 88G"7mDODO%..	 / 
	   ("4"44)-)=)=)A)ANN*
	 !YY[N ;=*/w'$//%.. &%	 /  5  !$INE :I; )2D  % !	2I!!)T22r   r   r   )rW   rX   rY   rZ   rj   DEFAULT_FORMATrG   rQ   r   r   r   rS  rS    s:    E  6N, > 	63&63 63r   rS  c                  n    e Zd ZU dZej
                  Zded<   dZded<   	 	 	 	 	 	 ddZ		 	 d		 	 	 	 	 d
dZ
y)Barz0A progress bar which stretches to fill the line.zterminal.OptionalColor | Nonerg   Nrh   c                    t        ||      | _        t        |      | _        t        |      | _        t        |      | _        || _        t        j                  | fi | y)a  Creates a customizable progress bar.

        The callable takes the same parameters as the `__call__` method

        marker - string or callable object to use as a marker
        left - string or callable object to use as a left border
        right - string or callable object to use as a right border
        fill - character to use for the empty part of the progress bar
        fill_left - whether to fill from the left or the right
        N)	rA   r<   r   leftrightr:  	fill_leftr   rG   )rF   r<   r`  ra  r:  rb  r7  r.   s           r   rG   zBar.__init__  sP    ( $FK8$T*	%e,
$T*	"$$T4V4r   c                X   t        j                  | j                  |||            }t        j                  | j                  |||            }||j	                  |      |j	                  |      z   z  }t        j                  | j                  |||            }t        j                  | j                  |||            }|t        |      |j	                  |      z
  z  }| j                  r|j                  ||      }n|j                  ||      }|r| j                  ||      }||z   |z   S )/Updates the progress bar and its subcomponents.)r   r>   r`  ra  r=  r<   r:  r#   rb  ljustrY  r   )	rF   r   r   r   colorr`  ra  r<   r:  s	            r   rQ   zBar.__call__  s    $$TYYxu%EF%%djj4&GH$$T*X-@-@-GGG&&t{{8T5'IJ$$TYYxu%EF 	Vx226:::>>\\%.F\\%.F''5Ff}u$$r   )#|rh   TNr   Tr   r   r   rT   r   r9   )rW   rX   rY   rZ   r   rH  rg   rj   rh   rG   rQ   r   r   r   r^  r^    sb    :(.B%7(,B%, 5@ %&% % 	%r   r^  c                  "    e Zd ZdZ	 	 	 	 	 ddZy)
ReverseBarz6A bar which has a marker that goes from right to left.c           	     <    t        j                  | f|||||d| y)ay  Creates a customizable progress bar.

        marker - string or updatable object to use as a marker
        left - string or updatable object to use as a left border
        right - string or updatable object to use as a right border
        fill - character to use for the empty part of the progress bar
        fill_left - whether to fill from the left or the right
        )r<   r`  ra  r:  rb  N)r^  rG   )rF   r<   r`  ra  r:  rb  r.   s          r   rG   zReverseBar.__init__0  s1    " 		
	
 	
r   N)rg  rh  rh  ri  FrW   rX   rY   rZ   rG   r   r   r   rm  rm  -  s    @ 
r   rm  c                  N    e Zd ZdZ ej
                  d      Z	 	 d	 	 	 	 	 ddZy)BouncingBarz9A bar which has a marker which bounces from side to side.r   r   c                n   t        j                  | j                  |||            }t        j                  | j                  |||            }||j	                  |      |j	                  |      z   z  }t        j                  | j                  |||            }t        j                  | j                  |||            }|rnt        |d   | j                  j                         z        }	|	|z  }
||
z
  dz
  }|	|dz  z  |k\  r||
}}
| j                  r|
|z  |z   ||z  z   }n||z  |z   |
|z  z   }||z   |z   S )rd  r   r   r    )r   r>   r`  ra  r=  r<   r:  r9   r   r   rb  )rF   r   r   r   rf  r`  ra  r<   r:  r:   r&   r'   s               r   rQ   zBouncingBar.__call__Q  s;    $$TYYxu%EF%%djj4&GH$$T*X-@-@-GGG&&t{{8T5'IJ$$TYYxu%EF,-0K0K0MME A	AA	"e+!1~~TF*QX5TF*QX5f}u$$r   Nrj  rk  )rW   rX   rY   rZ   r   r   r   rQ   r   r   r   rq  rq  L  s@    C!x!!s3H %&% % 	%r   rq  c                  Z    e Zd ZU  e       Zded<   dZ	 d	 	 	 d	dZd
dZ	 d	 	 	 	 	 ddZ	y)FormatCustomTexttypes.Dict[str, types.Any]r   FNc                    || _         |xs | j                  | _        t        j                  | fd|i| t	        j                  | fi | y r   )r,   r   rC   rG   rp   )rF   r,   r   r.   s       r   rG   zFormatCustomText.__init__v  sF     .$,,""4AA&AD+F+r   c                :    | j                   j                  |       y r   )r   r   )rF   r   s     r   update_mappingzFormatCustomText.update_mapping  s    G$r   c                b    t         j                  | || j                  |xs | j                        S r   )rC   rQ   r   r,   rI   s       r   rQ   zFormatCustomText.__call__  s0     !))LL!dkk	
 	
r   r   )r,   r   r   z*types.Optional[types.Dict[str, types.Any]])r   ru  r   )
rW   rX   rY   r   r   rj   r   rG   rx  rQ   r   r   r   rt  rt  r  s\    *.&G'0D
 ?C	,	, <	,% '+	
&
 
 $	
r   rt  c                      e Zd ZdZd Zy)VariableMixinz(Mixin to display a custom user variable.c                    t        |t              st        d      t        |j	                               dkD  rt        d      || _        y )Nz%Variable(): argument must be a stringr   z(Variable(): argument must be single word)r   r   rL   r#   splitr   r   )rF   r   r.   s      r   rG   zVariableMixin.__init__  s>    $$CDDtzz|q GHH	r   Nro  r   r   r   r{  r{    s
    2r   r{  c                  6    e Zd ZdZd ZddZ	 	 d	 	 	 	 	 ddZy)	MultiRangeBarz
    A bar with multiple sub-ranges, each represented by a different symbol.

    The various ranges are represented on a user-defined variable, formatted as

    .. code-block:: python

        [['Symbol1', amount1], ['Symbol2', amount2], ...]
    c                    t         j                  | |       t        j                  | fi | |D cg c]  }t        |       c}| _        y c c}w r   )r{  rG   r^  r   r6  )rF   r   r6  r.   r<   s        r   rG   zMultiRangeBar.__init__  s>    tT*T$V$?FGV(0GGs   Ac                .    |d   | j                      xs g S )N	variablesr   rr   s      r   
get_valueszMultiRangeBar.get_values  s    K +1r1r   c                   t        j                  | j                  |||            }t        j                  | j                  |||            }||j	                  |      |j	                  |      z   z  }| j                  ||      }t        |      }|r|rd}	d}
d}t        | j                  |      D ]`  \  }}t        j                   ||||            }|j	                  |      dk(  sJ |
|z  }
t        |
|z  |z        }||z  }||z  }|	||z  z  }	b nAt        j                  | j                  |||            }|j	                  |      dk(  sJ ||z  }	||	z   |z   S )rd  r!   r   r   )r   r>   r`  ra  r=  r  sumzipr6  r9   r:  )rF   r   r   r   rf  r`  ra  r   
values_summiddlevalues_accumulatedwidth_accumulatedr<   r:   
item_widthr:  s                   r   rQ   zMultiRangeBar.__call__  sw    $$TYYxu%EF%%djj4&GH$$T*X-@-@-GGG40[
ZF!" !!$T\\6!: .#..vhe/LM**62a777"e+" !3j!@5!HI
//
!Z/!*v--. ((8T5)IJD&&t,111E\Ff}u$$r   Nr   rj  rk  )rW   rX   rY   rZ   rG   r  rQ   r   r   r   r  r    s;    H
2  %& %  % 	 %r   r  c                      e Zd Z	 ddZddZy)MultiProgressBarc           	     Z    t        j                  | f|t        t        |            d| y )N)r   r6  )r  rG   listreversed)rF   r   r6  r.   s       r   rG   zMultiProgressBar.__init__  s4     		
'*+	
 		
r   c                   dgt        | j                        z  }|d   | j                     xs g D ]  }t        |t        t
        f      s|\  }}t        |      t        |      z  }d|cxk  rdk  sn t        d|       |t        |      dz
  z  }t	        |      }|dz  }	||xx   d|	z
  z  cc<   |	s||dz   xx   |	z  cc<    | j                  rt        t        |            }|S )Ng        r  r   r   z1Range value needs to be in the range [0..1], got )
r#   r6  r   r   r9   r  r   rb  r  r  )
rF   r   r   rangesr:   progress_valueprogress_maxrange_posfracs
             r   r  zMultiProgressBar.get_values  s    T\\**+&tyy17R 	(Eec5\2/4,n-l0CC??  '# 
 c&kAo.Ff+CA:D3K1t8#KsQw4'#	(& >>(6*+Fr   N)    ▁▂▃▄▅▆▇█r   )rW   rX   rY   rG   r  r   r   r   r  r    s     ,
r   r  c                  $    e Zd ZdZdZdZdZdZdZy)GranularMarkersu    ▏▎▍▌▋▊▉█r  u    ▖▌▛█u    ░▒▓█u    ⡀⡄⡆⡇⣇⣧⣷⣿z .oON)	rW   rX   rY   smoothbarsnakefade_indotsgrowing_circlesr   r   r   r  r    s     (F
%CEG&DOr   r  c                  H    e Zd ZdZej
                  ddfdZ	 d	 	 	 	 	 ddZy)GranularBaru  A progressbar that can display progress at a sub-character granularity
    by using multiple marker characters.

    Examples of markers:
     - Smooth: ` ▏▎▍▌▋▊▉█` (default)
     - Bar: ` ▁▂▃▄▅▆▇█`
     - Snake: ` ▖▌▛█`
     - Fade in: ` ░▒▓█`
     - Dots: ` ⡀⡄⡆⡇⣇⣧⣷⣿`
     - Growing circles: ` .oO`

    The markers can be accessed through GranularMarkers. GranularMarkers.dots
    for example
    rh  c                ~    || _         t        |      | _        t        |      | _        t	        j
                  | fi | y)ai  Creates a customizable progress bar.

        markers - string of characters to use as granular progress markers. The
                  first character should represent 0% and the last 100%.
                  Ex: ` .oO`.
        left - string or callable object to use as a left border
        right - string or callable object to use as a right border
        N)r6  r   r`  ra  r   rG   )rF   r6  r`  ra  r.   s        r   rG   zGranularBar.__init__  s6     $T*	%e,
$$T4V4r   c                   t        j                  | j                  |||            }t        j                  | j                  |||            }||j	                  |      |j	                  |      z   z  }|j
                  }|t        j                  ur-t        j                  t        |      dkD  r|j                  |z  }nd}||z  }| j                  d   t        |      z  }	t        |dz  t        | j                        dz
  z        x}
r|	| j                  |
   z  }	t        j                  |	      }	|t        |	      |j	                  |	      z
  z  }|	j                  || j                  d         }	||	z   |z   S )Nr   r   r   )r   r>   r`  ra  r=  r7   r
   r8   typingcastr  r:   r6  r9   r#   re  )rF   r   r   r   r`  ra  r7   percent	num_charsr<   
marker_idxs              r   rQ   zGranularBar.__call__,  sS    $$TYYxu%EF%%djj4&GH$$T*X-@-@-GGG&&	T///E9-1nny0GGeO	b!C	N2i!mDLL0AA0EFGG:Gdll:..F&&v. 	Vx226:::eT\\!_5f}u$$r   Nr   rk  )rW   rX   rY   rZ   r  r  rG   rQ   r   r   r   r  r    sC    "  &&	52 	 %& %  % 	 %r   r  c                  2    e Zd ZdZd Z	 	 d	 	 	 	 	 	 	 ddZy)FormatLabelBarz0A bar which has a formatted label in the center.c                ^    t        j                  | |fi | t        j                  | fi | y r   )r   rG   r^  r   s      r   rG   zFormatLabelBar.__init__R  s(    T64V4T$V$r   Nc                2   t         j                  | |||      }t        j                  | |||d      }|j                  |      }t	        ||z
  dz        }||z   }	| j                  |d | |      | j                  ||      z   | j                  ||	d  |      z   S )Nr+   F)rf  r    )r   rQ   r^  r=  r9   r   )
rF   r   r   r   r,   centerr  
center_lencenter_leftcenter_rights
             r   rQ   zFormatLabelBar.__call__V  s     %%dHd6%Jll44elD ((0
5:-23"Z/ L[!   	   LM"	
r   r   Nr   r   r   rT   r   r9   r,   FormatStringr%  r   r   r   r  r  O  s=    :% #
&
 
 	

 
r   r  c                  @     e Zd ZdZddZ	 	 d	 	 	 	 	 	 	 d fdZ xZS )PercentageLabelBarz:A bar which displays the current percentage in the center.c                d    t        j                  | |fd|i| t        j                  | |fi | y )NrL  )rJ  rG   r  rM  s       r   rG   zPercentageLabelBar.__init__z  s1    D&:R:6:f77r   c                *    t         |   ||||      S )Nr+   )r   rQ   )rF   r   r   r   r,   r   s        r   rQ   zPercentageLabelBar.__call__~  s     w$fEEr   )z%(percentage)2d%%rQ  r  r  )rW   rX   rY   rZ   rG   rQ   r   r   s   @r   r  r  u  sI    D8 #F&F F 	F
 F Fr   r  c                  4    e Zd ZdZ	 	 	 ddZ	 d	 	 	 	 	 ddZy)VariablezDisplays a custom variable.c                    || _         || _        || _        t        j	                  | |       t        j                  | fi | y)z2Creates a Variable associated with the given name.r  N)r,   r   	precisionr{  rG   rp   )rF   r   r,   r   r  r.   s         r   rG   zVariable.__init__  s?     
"t$/D+F+r   Nc                   |d   | j                      }|j                         }||d<   | j                   |d<   | j                  |d<   | j                  |d<   	 t	        |      }d} |j
                  d
i ||d<    | j
                  j
                  d
i |S # t        t        f$ r- |r dj
                  d
i ||d<   nd	| j                  z  |d<   Y Ww xY w)Nr  r:   r   r   r  z{value:{width}.{precision}}formatted_valuez{value:{width}}-r   )r   r   r   r  r  r,   rL   r   )rF   r   r   r,   r:   contextr   s          r   rQ   zVariable.__call__  s     [!$)),))+ ))::#~~	> %LE/C)3)>g)>G%& "t{{!!,G,, :& 	>-E->-E-E ..)* .14::-=)*	>s   "B 9CC)z{name}: {formatted_value}      r   r   r%  r   r   r   r  r    s;    %
 +,& '+	-&- - $	-r   r  c                      e Zd ZdZy)DynamicMessagez@Kept for backwards compatibility, please use `Variable` instead.N)rW   rX   rY   rZ   r   r   r   r  r    s    Jr   r  c                  d    e Zd ZdZ ej
                  d      Z	 	 d	dZ	 d
	 	 	 	 	 ddZd Z	d Z
y)CurrentTimezEWidget which displays the current (date)time with seconds resolution.r   r   c                n    || _         t        j                  | fd|i| t        j                  | fi | y r   )microsecondsrC   rG   r   )rF   r,   r  r.   s       r   rG   zCurrentTime.__init__  s7     )""4AA&A((88r   Nc                    | j                         |d<   | j                         |d<   t        j                  | |||      S )Ncurrent_timecurrent_datetimer+   )r  r  rC   rQ   rI   s       r   rQ   zCurrentTime.__call__  sE      $002^#'#8#8#:  ))$$v)NNr   c                ~    t         j                   j                         }| j                  s|j                  d      }|S )Nr   )microsecond)r   r   r  r   )rF   r   s     r   r  zCurrentTime.current_datetime  s4    ##%  ++!+,C
r   c                >    | j                         j                         S r   )r  time)rF   s    r   r  zCurrentTime.current_time  s    $$&++--r   )zCurrent Time: %(current_time)sFr   r   )rW   rX   rY   rZ   r   r   r   rG   rQ   r  r  r   r   r   r  r    sX    O!x!!!,H 09 '+		O&	O 	O $		O.r   r  c            
          e Zd ZU dZej
                  Zded<   dZded<   dZ	ded<   ej                  Zded	<   dZded
<   dZded<   ded<   ddddej
                  ddej                  ddf
	 ddZ	 	 d	 	 	 	 	 ddZy)JobStatusBaru.  
    Widget which displays the job status as markers on the bar.

    The status updates can be given either as a boolean or as a string. If it's
    a string, it will be displayed as-is. If it's a boolean, it will be
    displayed as a marker (default: '█' for success, 'X' for failure)
    configurable through the `success_marker` and `failure_marker` parameters.

    Args:
        name: The name of the variable to use for the status updates.
        left: The left border of the bar.
        right: The right border of the bar.
        fill: The fill character of the bar.
        fill_left: Whether to fill the bar from the left or the right.
        success_fg_color: The foreground color to use for successful jobs.
        success_bg_color: The background color to use for successful jobs.
        success_marker: The marker to use for successful jobs.
        failure_fg_color: The foreground color to use for failed jobs.
        failure_bg_color: The background color to use for failed jobs.
        failure_marker: The marker to use for failed jobs.
    zterminal.Color | Nonesuccess_fg_colorNsuccess_bg_coloru   █r   success_markerfailure_fg_colorfailure_bg_colorXfailure_markerz	list[str]job_markersrh  ri  Tc                6   t         j                  | |       || _        g | _        t	        |      | _        t	        |      | _        t	        |      | _        || _        || _	        || _
        |	| _        |
| _        || _        t        j                  | f||||d| y )N)r`  ra  r:  rb  )r{  rG   r   r  r   r`  ra  r:  r  r  r  r  r  r  r^  )rF   r   r`  ra  r:  rb  r  r  r  r  r  r  r.   s                r   rG   zJobStatusBar.__init__   s     	tT*	$T*	%e,
$T*	 0 0, 0 0,	
	
 	
r   c                   t        j                  | j                  |||            }t        j                  | j                  |||            }||j	                  |      |j	                  |      z   z  }|d   j                  | j                        }|r3|0|du r%| j                  }| j                  }	| j                  }
n/|du r%| j                  }| j                  }	| j                  }
n|}d x}	}
t        j                  |      }|	r|	j                  |      }|
r|
j                  |      }| j                  j!                  |       dj#                  | j                        }||j	                  |      z  }t        j                  | j%                  |||            }| j'                  ||z  |      }| j(                  r||z  }n||z   }nd}||z   |z   S )Nr  TFr!   )r   r>   r`  ra  r=  r   r   r  r  r  r  r  r  rg   rh   r  r   joinr:  r   rb  )rF   r   r   r   rf  r`  ra  statusr<   fg_colorbg_colorr:  s               r   rQ   zJobStatusBar.__call__%  s    $$TYYxu%EF%%djj4&GH$$T*X-@-@-GGG$($5$9$9$))$DV'~,,00005,,0000&**8**62F!V,!V,##F+WWT--.FX((00E((8T5)IJD%%dUlD9D~~$Ff}u$$r   )r   r   rj  rk  )rW   rX   rY   rZ   r   greenr  rj   r  r  redr  r  r  rG   rQ   r   r   r   r  r    s    , /5ll+:.2+2NC.4jj+8.2+2NC
 #
#
R .%&.% .% 	.%r   r  r   )U
__future__r   r   r   r   r2   loggingr  r   python_utilsr   r   r   r!   r	   r
   r   r   r   TYPE_CHECKINGr  r   r   	getLoggerrW   rN   dater   MAX_DATEr  MAX_TIMEMAX_DATETIMEDictr   AnyrT   Optionalr  TypeVarr   r   r(   r%   rA   ABCrC   r\   	TypedDictrf   rl   ABCMetarp   r   r   r   r   r   r   r   r   r
  r  r'  r0  r4  RotatingMarkerrB  rF  rJ  rS  r^  rm  rq  rt  r{  r  r  r  r  r  r  r  r  r  r  r   r   r   <module>r     s   " 
       6 6 / / 2			8	$====  $$zz#uyy.!s#FNN38 %*/ /d%sww %P6f&& 6
36## 3
V*!S[[ V*r* ,4jCKK 4'H#Z 'HT2K0 2^/*ckk ^/BP@% P@f
# 
B&P#| &PR)P3 )PX&H * &HR@D)+B @DFP-| P.2, 2l  H H   0"L* 00K3&j K3\;%
 ;%|
 
>#%#. #%L
(* 
@ 3%C 3%l(} (V E%% E%P#
[# #
LF^ F&-- - --`KX K".#%< ".Jr%3 r%r   