
    Ng\	                        d dl Z d dlmZmZmZmZmZmZ 	 	 	 ddededee         deeedf         fd	Z	ddee
         dee
ddf         fd
Z	 ddee
ee         f         deeddf         fdZdeegef         deeddf         fdZdS )    N)AnyCallable	GeneratorIterableOptionalUnion      basefactor	max_valuereturnc              #   R   K   dV  d}	 || |z  z  }|||k     r
|V  |dz  }n|V  )ak  Generator for exponential decay.

    Args:
        base: The mathematical base of the exponentiation operation
        factor: Factor to multiply the exponentiation by.
        max_value: The maximum value to yield. Once the value in the
             true exponential sequence exceeds this, the value
             of max_value will forever after be yielded.
    Nr   Tr
    )r   r   r   nas        M/var/www/html/ai-engine/env/lib/python3.11/site-packages/backoff/_wait_gen.pyexpor      sY        
EEE	ATQYIGGGFAAOOO    c              #   J   K   dV  d}d}	 | || k     r|V  |||z   }}n| V  )zGenerator for fibonaccial decay.

    Args:
        max_value: The maximum value to yield. Once the value in the
             true fibonacci sequence exceeds this, the value
             of max_value will forever after be yielded.
    Nr
   r   )r   r   bs      r   fibor   "   sT       
EEE	A	AIGGGa!eqAAOOOr   intervalc              #      K   dV  	 t          |           }n$# t          $ r t          j        |           }Y nw xY w|D ]}|V  dS )z|Generator for constant intervals.

    Args:
        interval: A constant value to yield or an iterable of such values.
    N)iter	TypeError	itertoolsrepeat)r   itrvals      r   constantr!   7   sx       
EEE)8nn ) ) )x(()   				 s    99valuec              #   ,   K   dV }	  | |          V })a  Generator that is based on parsing the return value or thrown
        exception of the decorated method

    Args:
        value: a callable which takes as input the decorated
            function's return value or thrown exception and
            determines how long to wait
    Nr   )r"   
ret_or_excs     r   runtimer%   K   s0       J- 5,,,,
-r   )r	   r
   N)N)r
   )r   typingr   r   r   r   r   r   floatr   intr   r!   r%   r   r   r   <module>r)      s`       F F F F F F F F F F F F F F F F !% 
  uc4 	   6 HSM YsD$-G    , -. C%()udD !   (-SE5L!- udD !- - - - - -r   