
    2iL&              !          S SK r S SKrS SKrS SKJrJrJrJrJrJ	r	  S SK
JrJrJrJr  S SKJr  S SKJrJr  S SKJrJrJrJrJrJrJrJr  \R:                  4SS\SSSS\R<                  \R>                  S.	S	\S
\\   S\\\       S\\\!      S\	\S4   S\	\\\   S4   S\	\\\   S4   S\	\\\   S4   S\S\ S\ S\S\\/\4   4S jjjr"SS\S SSSSS\R<                  \R>                  S.S	\S\\\#      S\\\       S\\\!      S\	\S4   S\\#   S\	\\\   S4   S\	\\\   S4   S\	\\\   S4   S\$S\S\ S\ S\S\\/\4   4S jjr%g)    N)AnyCallableIterableOptionalTypeUnion)_prepare_logger_config_handlers_log_backoff_log_giveup)full_jitter)_async_sync)
_CallableT_Handler	_Jitterer_MaybeCallable_MaybeLogger_MaybeSequence
_Predicate_WaitGeneratorbackoff)		max_triesmax_timejitter
on_success
on_backoff	on_giveuploggerbackoff_log_levelgiveup_log_levelwait_gen	predicater   r   r   r   r   r   r   r    r!   wait_gen_kwargsreturnc       	         @   ^ ^^^^^^^^^	^
^ U	U
UUUUUUUUU U4S jnU$ )a	  Returns decorator for backoff and retry triggered by predicate.

Args:
    wait_gen: A generator yielding successive wait times in
        seconds.
    predicate: A function which when called on the return value of
        the target function will trigger backoff when considered
        truthily. If not specified, the default behavior is to
        backoff on falsey return values.
    max_tries: The maximum number of attempts to make before giving
        up. In the case of failure, the result of the last attempt
        will be returned. The default value of None means there
        is no limit to the number of tries. If a callable is passed,
        it will be evaluated at runtime and its return value used.
    max_time: The maximum total amount of time to try for before
        giving up. If this time expires, the result of the last
        attempt will be returned. If a callable is passed, it will
        be evaluated at runtime and its return value used.
    jitter: A function of the value yielded by wait_gen returning
        the actual time to wait. This distributes wait times
        stochastically in order to avoid timing collisions across
        concurrent clients. Wait times are jittered by default
        using the full_jitter function. Jittering may be disabled
        altogether by passing jitter=None.
    on_success: Callable (or iterable of callables) with a unary
        signature to be called in the event of success. The
        parameter is a dict containing details about the invocation.
    on_backoff: Callable (or iterable of callables) with a unary
        signature to be called in the event of a backoff. The
        parameter is a dict containing details about the invocation.
    on_giveup: Callable (or iterable of callables) with a unary
        signature to be called in the event that max_tries
        is exceeded.  The parameter is a dict containing details
        about the invocation.
    logger: Name of logger or Logger object to log to. Defaults to
        'backoff'.
    backoff_log_level: log level for the backoff event. Defaults to "INFO"
    giveup_log_level: log level for the give up event. Defaults to "ERROR"
    **wait_gen_kwargs: Any additional keyword args specified will be
        passed to wait_gen when it is initialized.  Any callable
        args will first be evaluated and their return values passed.
        This is useful for runtime configuration.
c                   > [        T5      m[        T
5      m
[        T[        TTS9m[        T	[        TTS9m	[        R
                  " U 5      (       a  [        R                  nO[        R                  nU" U TTTTTT
TT	TS9
$ )Ndefault_handlerr   	log_level)r   r   r   r   r   r   r$   )	r	   r
   r   r   asyncioiscoroutinefunctionr   retry_predicater   )targetretryr    r!   r   r   r   r   r   r   r   r#   r"   r$   s     L/home/james-whalen/.local/lib/python3.13/site-packages/backoff/_decorator.pydecorateon_predicate.<locals>.decorateS   s     !(%j1
%('	

 %'&	
	 &&v..**E))E!!+
 	
     )r"   r#   r   r   r   r   r   r   r   r    r!   r$   r1   s   ```````````` r0   on_predicater5      s    p"
 "
 "
J Or3   c                     g)NFr4   )es    r0   <lambda>r8      s    5r3   T)r   r   r   giveupr   r   r   raise_on_giveupr   r    r!   	exceptionr9   r:   c                H   ^ ^^^^^^^^^	^
^^^ UUUUUU
UUUUUU	U U4S jnU$ )a	  Returns decorator for backoff and retry triggered by exception.

Args:
    wait_gen: A generator yielding successive wait times in
        seconds.
    exception: An exception type (or tuple of types) which triggers
        backoff.
    max_tries: The maximum number of attempts to make before giving
        up. Once exhausted, the exception will be allowed to escape.
        The default value of None means there is no limit to the
        number of tries. If a callable is passed, it will be
        evaluated at runtime and its return value used.
    max_time: The maximum total amount of time to try for before
        giving up. Once expired, the exception will be allowed to
        escape. If a callable is passed, it will be
        evaluated at runtime and its return value used.
    jitter: A function of the value yielded by wait_gen returning
        the actual time to wait. This distributes wait times
        stochastically in order to avoid timing collisions across
        concurrent clients. Wait times are jittered by default
        using the full_jitter function. Jittering may be disabled
        altogether by passing jitter=None.
    giveup: Function accepting an exception instance and
        returning whether or not to give up. Optional. The default
        is to always continue.
    on_success: Callable (or iterable of callables) with a unary
        signature to be called in the event of success. The
        parameter is a dict containing details about the invocation.
    on_backoff: Callable (or iterable of callables) with a unary
        signature to be called in the event of a backoff. The
        parameter is a dict containing details about the invocation.
    on_giveup: Callable (or iterable of callables) with a unary
        signature to be called in the event that max_tries
        is exceeded.  The parameter is a dict containing details
        about the invocation.
    raise_on_giveup: Boolean indicating whether the registered exceptions
        should be raised on giveup. Defaults to `True`
    logger: Name or Logger object to log to. Defaults to 'backoff'.
    backoff_log_level: log level for the backoff event. Defaults to "INFO"
    giveup_log_level: log level for the give up event. Defaults to "ERROR"
    **wait_gen_kwargs: Any additional keyword args specified will be
        passed to wait_gen when it is initialized.  Any callable
        args will first be evaluated and their return values passed.
        This is useful for runtime configuration.
c                 
  > [        T5      m[        T5      m[        T
[        TTS9m
[        T[        TTS9m[        R
                  " U 5      (       a  [        R                  nO[        R                  nU" U TTT	TTTTT
TTTS9$ )Nr(   )	r   r   r   r9   r   r   r   r:   r$   )	r	   r
   r   r   r+   r,   r   retry_exceptionr   )r.   r/   r    r;   r9   r!   r   r   r   r   r   r   r   r:   r"   r$   s     r0   r1   on_exception.<locals>.decorate   s     !(%j1
%('	

 %'&	
	 &&v..**E))E!!++
 	
r3   r4   )r"   r;   r   r   r   r9   r   r   r   r:   r   r    r!   r$   r1   s   `````````````` r0   on_exceptionr@   {   s    x$
 $
 $
N Or3   )&r+   loggingoperatortypingr   r   r   r   r   r   backoff._commonr	   r
   r   r   backoff._jitterr   r   r   r   backoff._typingr   r   r   r   r   r   r   r   not_INFOERRORintfloatr5   	Exceptionboolr@   r4   r3   r0   <module>rN      s      A A  ( !	 	 	 /7mm] =A=A2=IMIMHL(1*1,,)0]> ]&sO] %^C%89] $N5$9:	]
 y$/] #8Xh-?#EF] #8Xh-?#EF] "(HX,>"DE] &] %(] $'] %(] -5j\:5M,N]F =A=A2=1@IMIMHL)-(1*1,,)0c> c*4	?;c %^C%89c $N5$9:	c
 y$/c $I.c #8Xh-?#EFc #8Xh-?#EFc "(HX,>"DEc #'c &c %(c $'c %(c -5j\:5M,Ncr3   