Ë
    eQêjÚ  ã                   óÈ  — d dl Z d dlZd dlmZmZ ddlmZmZmZm	Z	m
Z
mZmZmZmZmZmZ  ed«      Zej$                  e j                   fdedeegef   deg ef   d	eegdf   d
eg ef   defd„Zeej$                  e j                   fdeg ef   ded	eegdf   d
eg ef   def
d„Zej$                  e j                   fdedeegef   deg ef   d	eegdf   d
eg ef   defd„Zy)é    N)ÚCallableÚTypeVaré   )ÚBackoffÚDEFAULT_BACKOFFÚDEFAULT_RETRYÚDEFAULT_RETRY_AFTER_BACKOFFÚ_delayÚis_conflictÚis_retry_after_responseÚis_too_many_requestsÚretry_after_backoffÚretry_after_max_retriesÚretry_after_secondsÚTÚbackoffÚ	retriableÚfnÚ
sleep_funcÚrandom_funcÚreturnc                 óî   — | j                   }| j                  }d}|dkD  r	  |«       S |‚# t        $ r:} ||«      s‚ |}|dk(  rY d}~|‚t        ||| |«      \  }	}} ||	«       Y d}~nd}~ww xY w|dkD  rŒVŒO)z�Run ``fn`` and retry while ``retriable`` returns True.

    This is a 1:1 implementation of
    ``k8s.io/client-go/util/retry.OnError``.
    Nr   r   )ÚstepsÚdurationÚ	Exceptionr
   )
r   r   r   r   r   r   r   Ú
last_errorÚerrorÚdelays
             ú[/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/kubernetes/utils/retry.pyÚon_errorr    )   s�   € ð �M‰M€EØ×Ñ€HØ€JØ
�!Š)ð	Ù“4ˆKð Ðøô ò 
	Ù˜UÔ#ØØˆJà˜ŠzÛð Ðô	 &,Ø�x ¨+ó&7Ñ"ˆE�8˜Uá�u×Ñûð
	úð �!‹)øs   ¡* ª	A-³A(Á	A(Á(A-c                 ó(   — t        |t        | ||«      S )a  Run ``fn`` and retry on HTTP 409 Conflict responses.

    This is a 1:1 implementation of
    ``k8s.io/client-go/util/retry.RetryOnConflict``. Callers should re-read the
    object inside ``fn`` before each write attempt, so every retry uses the
    latest resource version.
    )r    r   )r   r   r   r   s       r   Úretry_on_conflictr"   K   s   € ô �Gœ[¨"¨j¸+ÓFÐFó    c                 ó  — | j                   }| j                  }d}|dkD  r	  |«       S |‚# t        $ rN} ||«      s‚ |}|dk(  rY d}~|‚t        ||| |«      \  }	}}t	        |«      }
|
�|
|	kD  r|
}	 ||	«       Y d}~nd}~ww xY w|dkD  rŒjŒc)a0  Run ``fn`` with client-go REST Retry-After sleep semantics.

    This is a 1:1 implementation of the wait selection in
    ``k8s.io/client-go/rest.WithRetry``: if the retriable response carries a
    valid ``Retry-After`` header, that delay is used; otherwise the supplied
    backoff delay is used.
    Nr   r   )r   r   r   r
   r   )r   r   r   r   r   r   r   r   r   r   Úretry_afters              r   Úon_retry_after_errorr&   \   s¹   € ð �M‰M€EØ×Ñ€HØ€JØ
�!Š)ð	Ù“4ˆKð  Ðøô ò 	Ù˜UÔ#ØØˆJà˜ŠzÛð Ðô &,Ø�x ¨+ó&7Ñ"ˆE�8˜Uä-¨eÓ4ˆKØÐ&¨;¸Ò+>Ø#�Ù�u×Ñûð	úð �!‹)øs   ¡* ª	B³A<Á	.A<Á<B)ÚrandomÚtimeÚtypingr   r   Ú_retry_baser   r   r   r	   r
   r   r   r   r   r   r   r   Úsleepr   ÚboolÚfloatr    r"   r&   © r#   r   ú<module>r/      s‚  ðó Û ß $÷÷ ÷ ñ ñ ˆCƒL€ð +/¯*©*Ø'-§}¡}ñØðà˜˜ TÐ)Ñ*ðð 	��Q�‰ðð ˜%˜ $˜Ñ'ð	ð
 ˜"˜e˜)Ñ$ðð óðH %Ø*.¯*©*Ø'-§}¡}ñ	GØ��Q�‰ðGàðGð ˜%˜ $˜Ñ'ðGð ˜"˜e˜)Ñ$ð	Gð
 óGð* +/¯*©*Ø'-§}¡}ñ$Øð$à˜˜ TÐ)Ñ*ð$ð 	��Q�‰ð$ð ˜%˜ $˜Ñ'ð	$ð
 ˜"˜e˜)Ñ$ð$ð ô$r#   