§
    SCÄjü  ã                   óŽ   — d dl Z d dlZd dlZd dlmZ dZdZdZdZ	  G d„ d¦  «        Z	 G d	„ d
e	¦  «        Z
 G d„ de	¦  «        ZdS )é    N)Ú
exceptionsé   g      ð?gš™™™™™¹?g       @c                   óZ   — e Zd ZdZeeeefd„Ze	d„ ¦   «         Z
e	d„ ¦   «         Zd„ Zd„ ZdS )Ú_BaseExponentialBackoffaø  An exponential backoff iterator base class.

    Args:
        total_attempts Optional[int]:
            The maximum amount of retries that should happen.
            The default value is 3 attempts.
        initial_wait_seconds Optional[int]:
            The amount of time to sleep in the first backoff. This parameter
            should be in seconds.
            The default value is 1 second.
        randomization_factor Optional[float]:
            The amount of jitter that should be in each backoff. For example,
            a value of 0.1 will introduce a jitter range of 10% to the
            current backoff period.
            The default value is 0.1.
        multiplier Optional[float]:
            The backoff multipler. This adjusts how much each backoff will
            increase. For example a value of 2.0 leads to a 200% backoff
            on each attempt. If the initial_wait is 1.0 it would look like
            this sequence [1.0, 2.0, 4.0, 8.0].
            The default value is 2.0.
    c                 óž   — |dk     rt          j        d|› �¦  «        ‚|| _        || _        | j        | _        || _        || _        d| _        d S )Né   z:total_attempts must be greater than or equal to 1 but was r   )r   ÚInvalidValueÚ_total_attemptsÚ_initial_wait_secondsÚ_current_wait_in_secondsÚ_randomization_factorÚ_multiplierÚ_backoff_count)ÚselfÚtotal_attemptsÚinitial_wait_secondsÚrandomization_factorÚ
multipliers        údC:\Projects\Historical\FacebookAutoPoster\venv\Lib\site-packages\google/auth/_exponential_backoff.pyÚ__init__z _BaseExponentialBackoff.__init__B   sj   € ð ˜AÒÐÝÔ)Ø]È^Ð]Ð]ñô ð ð  .ˆÔØ%9ˆÔ"à(,Ô(BˆÔ%à%9ˆÔ"Ø%ˆÔØˆÔÐÐó    c                 ó   — | j         S )z7The total amount of backoff attempts that will be made.)r
   ©r   s    r   r   z&_BaseExponentialBackoff.total_attemptsW   s   € ð Ô#Ð#r   c                 ó   — | j         S )z;The current amount of backoff attempts that have been made.)r   r   s    r   Úbackoff_countz%_BaseExponentialBackoff.backoff_count\   s   € ð Ô"Ð"r   c                 ó,   — d| _         | j        | _        d S )Nr   )r   r   r   r   s    r   Ú_resetz_BaseExponentialBackoff._reseta   s   € ØˆÔØ(,Ô(BˆÔ%Ð%Ð%r   c                 ón   — | j         | j        z  }t          j        | j         |z
  | j         |z   ¦  «        }|S ©N)r   r   ÚrandomÚuniform)r   Újitter_varianceÚjitters      r   Ú_calculate_jitterz)_BaseExponentialBackoff._calculate_jittere   s@   € ØÔ7¸$Ô:TÑTˆÝ”ØÔ)¨OÑ;ØÔ)¨OÑ;ñ
ô 
ˆð
 ˆr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_DEFAULT_RETRY_TOTAL_ATTEMPTSÚ!_DEFAULT_INITIAL_INTERVAL_SECONDSÚ_DEFAULT_RANDOMIZATION_FACTORÚ_DEFAULT_MULTIPLIERr   Úpropertyr   r   r   r$   © r   r   r   r   *   s—   € € € € € ðð ð2 5Ø>Ø:Ø&ð ð  ð  ð  ð* ð$ð $ñ „Xð$ð ð#ð #ñ „Xð#ðCð Cð Cðð ð ð ð r   r   c                   ó.   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zˆ xZS )ÚExponentialBackoffzvAn exponential backoff iterator. This can be used in a for loop to
    perform requests with exponential backoff.
    c                 óH   •—  t          t          | ¦  «        j        |i |¤Ž d S r   )Úsuperr0   r   ©r   ÚargsÚkwargsÚ	__class__s      €r   r   zExponentialBackoff.__init__t   s,   ø€ Ø0�Õ  $Ñ'Ô'Ô0°$ÐA¸&ÐAÐAÐAÐAÐAr   c                 ó.   — |                       ¦   «          | S r   ©r   r   s    r   Ú__iter__zExponentialBackoff.__iter__w   ó   € Ø�Š‰ŒˆØˆr   c                 óü   — | j         | j        k    rt          ‚| xj         dz  c_         | j         dk    r| j         S |                      ¦   «         }t	          j        |¦  «         | xj        | j        z  c_        | j         S ©Nr   )r   r
   ÚStopIterationr$   ÚtimeÚsleepr   r   ©r   r#   s     r   Ú__next__zExponentialBackoff.__next__{   s…   € ØÔ $Ô"6Ò6Ð6ÝÐØÐÔ˜qÑ ÐÔàÔ !Ò#Ð#ØÔ&Ð&à×'Ò'Ñ)Ô)ˆåŒ
�6ÑÔÐàÐ%Ô%¨Ô)9Ñ9Ð%Ô%ØÔ"Ð"r   )r%   r&   r'   r(   r   r9   rA   Ú__classcell__©r6   s   @r   r0   r0   o   se   ø€ € € € € ðð ðBð Bð Bð Bð Bðð ð ð#ð #ð #ð #ð #ð #ð #r   r0   c                   ó.   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zˆ xZS )ÚAsyncExponentialBackoffz‚An async exponential backoff iterator. This can be used in a for loop to
    perform async requests with exponential backoff.
    c                 óH   •—  t          t          | ¦  «        j        |i |¤Ž d S r   )r2   rE   r   r3   s      €r   r   z AsyncExponentialBackoff.__init__�   s,   ø€ Ø5�Õ% tÑ,Ô,Ô5°tÐF¸vÐFÐFÐFÐFÐFr   c                 ó.   — |                       ¦   «          | S r   r8   r   s    r   Ú	__aiter__z!AsyncExponentialBackoff.__aiter__“   r:   r   c              ƒ   ó  K  — | j         | j        k    rt          ‚| xj         dz  c_         | j         dk    r| j         S |                      ¦   «         }t	          j        |¦  «        ƒ d {V —† | xj        | j        z  c_        | j         S r<   )r   r
   ÚStopAsyncIterationr$   Úasyncior?   r   r   r@   s     r   Ú	__anext__z!AsyncExponentialBackoff.__anext__—   s›   è è € ØÔ $Ô"6Ò6Ð6Ý$Ð$ØÐÔ˜qÑ ÐÔàÔ !Ò#Ð#ØÔ&Ð&à×'Ò'Ñ)Ô)ˆåŒm˜FÑ#Ô#Ð#Ð#Ð#Ð#Ð#Ð#Ð#àÐ%Ô%¨Ô)9Ñ9Ð%Ô%ØÔ"Ð"r   )r%   r&   r'   r(   r   rH   rL   rB   rC   s   @r   rE   rE   ‹   se   ø€ € € € € ðð ðGð Gð Gð Gð Gðð ð ð#ð #ð #ð #ð #ð #ð #r   rE   )rK   r    r>   Úgoogle.authr   r)   r*   r+   r,   r   r0   rE   r.   r   r   ú<module>rN      sê   ðð €€€Ø €€€Ø €€€à "Ð "Ð "Ð "Ð "Ð "ð !"Ð ð %(Ð !ð !$Ð ð Ð ððBð Bð Bð Bð Bñ Bô Bð BðJ#ð #ð #ð #ð #Ð0ñ #ô #ð #ð8#ð #ð #ð #ð #Ð5ñ #ô #ð #ð #ð #r   