
    g\	                         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y)    N)AnyCallable	GeneratorIterableOptionalUnionbasefactor	max_valuereturnc              #   T   K   d d}	 || |z  z  }|||k  r
| |dz  }n| w)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       )r	   r
   r   nas        F/var/www/openai/venv/lib/python3.12/site-packages/backoff/_wait_gen.pyexpor      sE       
	A
TQYIGFAO s   &(c              #   L   K   d d}d}	 | || k  r| |||z   }}n|  w)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   "   s@      
	A	A
IGa!eqAO s   "$intervalc              #      K   d 	 t        |       }|D ]  }|  y# t        $ r t        j                  |       }Y ,w xY ww)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   sJ      
)8n 	   )x()s#   A AA AA  Avaluec              #   *   K   d}	  | |      }w)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   s"      J
 ,,
 s   )   r   N)N)r   )r   typingr   r   r   r   r   r   floatr   intr   r   r#   r       r   <module>r)      s     F F !%
  uc4 	6HSM YsD$-G , -.C%()udD !(-SE5L!- udD !-r(   