ó
    Û°›j©l  ã                   óÚ  • S r SSKrSSKrSSKrSSKJr  SSKJrJrJ	r	J
r
  SSKJrJr  SSKJrJr  SrSSS	.r\R&                  " \5      rS)S
 jr " S S5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r  " S S 5      r! " S! S"5      r" " S# S$\5      r# " S% S&\5      r$ " S' S(5      r%g)*aC  Standard retry behavior.

This contains the default standard retry behavior.
It provides consistent behavior with other AWS SDKs.

The key base classes uses for retries:

    * ``BaseRetryableChecker`` - Use to check a specific condition that
    indicates a retry should happen.  This can include things like
    max attempts, HTTP status code checks, error code checks etc.
    * ``RetryBackoff`` - Use to determine how long we should backoff until
    we retry a request.  This is the class that will implement delay such
    as exponential backoff.
    * ``RetryPolicy`` - Main class that determines if a retry should
    happen.  It can combine data from a various BaseRetryableCheckers
    to make a final call as to whether or not a retry should happen.
    It then uses a ``BaseRetryBackoff`` to determine how long to delay.
    * ``RetryHandler`` - The bridge between botocore's event system
    used by endpoint.py to manage retries and the interfaces defined
    in this module.

This allows us to define an API that has minimal coupling to the event
based API used by botocore.

é    N)ÚNEW_RETRIES_ENABLED)ÚConnectionErrorÚConnectTimeoutErrorÚHTTPClientErrorÚReadTimeoutError)ÚquotaÚspecial)ÚBaseRetryableCheckerÚBaseRetryBackoffé   é   ©Údynamodbzdynamodb-streamsc           
      óV  • U R                   R                  R                  nUR                  5       n[	        5       n[
        (       a¬  Uc  U[        ;   a
  [        U   nO	Uc  [        nU R                   R                  R                  SU 3[        U5      R                  SU 3S9  [        U5      n[        [        R                  " 5       U5      n[!        [#        [%        US9['        UUS9S9UUUS9nOM[        [        R                  " 5       5      n[!        [#        [%        U=(       d    [        S9['        5       S9UUS9nU R                   R                  R                  S	U 3UR(                  5        S
U 3nU R                   R                  R                  SU 3UR*                  US9  U$ )Nzrequest-created.zseed-max-attempts-)Ú	unique_id)Úmax_attempts)Úservice_nameÚthrottling_detector)Úretry_checkerÚretry_backoff)Úretry_policyÚretry_event_adapterÚretry_quotar   )r   r   r   zafter-call.zretry-config-zneeds-retry.)ÚmetaÚservice_modelÚ
service_idÚ	hyphenizeÚRetryEventAdapterr   Ú_SERVICE_MAX_ATTEMPTSÚDEFAULT_MAX_ATTEMPTSÚeventsÚregisterÚMaxAttemptsSeederÚseed_max_attemptsÚThrottlingErrorDetectorÚRetryQuotaCheckerr   Ú
RetryQuotaÚRetryHandlerÚRetryPolicyÚStandardRetryConditionsÚExponentialBackoffÚrelease_retry_quotaÚneeds_retry)	Úclientr   r   Úservice_event_namer   r   r   Úhandlerr   s	            ÚV/home/mande/repo/quber/.venv/lib/python3.13/site-packages/botocore/retries/standard.pyÚregister_retry_handlerr2   4   sÂ  € Ø—‘×*Ñ*×5Ñ5€JØ#×-Ñ-Ó/ÐÜ+Ó-ÐçÒàÑ Ø"Ô&;Ó;ä0Ð1CÑD‰LØÑ!Ü/ˆLð 	�‰×Ñ×#Ñ#ØÐ1Ð2Ð3Ü˜lÓ+×=Ñ=Ø*Ð+=Ð*>Ð?ð 	$ñ 	
ô
 6Ð6IÓJÐÜ'Ü×ÒÓÐ 3ó
ˆô Ü$Ü5Ø!-ñô 1Ø!3Ø(;ññ	ð !4Ø#Ø+ñ
‰ô (¬×(8Ò(8Ó(:Ó;ˆÜÜ$Ü5Ø!-×!EÔ1Eñô 1Ó2ñ	ð !4Ø#ñ	
ˆð ‡K�K×Ñ×ÑØ
Ð(Ð)Ð*¨K×,KÑ,Kôð  Ð 2Ð3Ð4€IØ
‡K�K×Ñ×ÑØ
Ð)Ð*Ð+Ø×ÑØð  ñ ð
 €Nó    c                   ó$   • \ rS rSrSrS rS rSrg)r#   éx   zþAdds the resolved max attempts to the retries context.

The ``max`` value is otherwise only added to the retries context by
``MaxAttemptsChecker`` when a retry is evaluated, which means it's
absent from the initial attempt's ``amz-sdk-request`` header.

c                 ó   • Xl         g ©N©Ú_max_attempts©Úselfr   s     r1   Ú__init__ÚMaxAttemptsSeeder.__init__�   ó   € Ø)Õr3   c                 óZ   • UR                   R                  S0 5      nU R                  US'   g )NÚretriesÚmax)ÚcontextÚ
setdefaultr9   )r;   ÚrequestÚkwargsÚretries_contexts       r1   r$   Ú#MaxAttemptsSeeder.seed_max_attempts„   s(   € Ø!Ÿ/™/×4Ñ4°YÀÓCˆØ!%×!3Ñ!3ˆ˜Òr3   r8   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r<   r$   Ú__static_attributes__© r3   r1   r#   r#   x   s   † ñò*õ4r3   r#   c                   óZ   • \ rS rSrSrS1S1SS1S.rS\R                  4S	 jrS
 r	S r
Srg)r(   é‰   z�Bridge between botocore's event system and this module.

This class is intended to be hooked to botocore's event system
as an event handler.
ÚReceiveMessageÚGetActivityTaskÚPollForActivityTaskÚPollForDecisionTask)ÚsqsÚsfnÚswfNc                 ó@   • Xl         X l        X0l        X@l        XPl        g r7   )Ú_retry_policyÚ_retry_event_adapterÚ_retry_quotaÚ_service_nameÚ_sleep)r;   r   r   r   r   Úsleeps         r1   r<   ÚRetryHandler.__init__™   s!   € ð *ÔØ$7Ô!Ø'ÔØ)ÔØ�r3   c                 ó®  • SnU R                   R                  " S0 UD6nU R                  R                  U5      (       aæ  U R                  R                  U5      (       a2  U R                  R                  U5      n[        R                  SU5        O©[        (       as  U R                  U5      (       a]  U R                  R                  U5      nU R                  U5        [        R                  S5        U R                   R                  U5        g[        R                  S5        O[        R                  S5        U R                   R                  U5        U$ )z.Connect as a handler to the needs-retry event.Nz1Retry needed, retrying request after delay of: %sz;Retry needed but retry quota reached, not retrying request.FzNot retrying request.rN   )rZ   Úcreate_retry_contextrY   Úshould_retryr[   Úacquire_retry_quotaÚcompute_retry_delayÚloggerÚdebugr   Ú_is_long_polling_operationr]   Ú!adapt_retry_response_from_context)r;   rE   Úretry_delayrB   Úpolling_delays        r1   r-   ÚRetryHandler.needs_retry§   s!  € àˆØ×+Ñ+×@Ò@ÑJÀ6ÑJˆØ×Ñ×*Ñ*¨7×3Ñ3ð × Ñ ×4Ñ4°W×=Ñ=Ø"×0Ñ0×DÑDÀWÓM�Ü—‘ØGØõ÷
 'Ò&Ø×6Ñ6°w×?Ñ?Ø(,×(:Ñ(:×(NÑ(NØ#ó)˜ð Ÿ™ MÔ2ÜŸ™ð4ôð ×1Ñ1×SÑSØ#ôð  %Ü—‘ð,õô
 �L‰LÐ0Ô1Ø×!Ñ!×CÑCÀGÔLØÐr3   c                 óÊ   • U R                   b  UR                  c  gU R                  R                  U R                   5      nUS L=(       a    UR                  R                  U;   $ ©NF)r\   Úoperation_modelÚ_LONG_POLLING_OPERATIONSÚgetÚname)r;   rB   Ú
operationss      r1   rg   Ú'RetryHandler._is_long_polling_operationÏ   s`   € ð ×ÑÑ%¨×)@Ñ)@Ñ)HØØ×2Ñ2×6Ñ6°t×7IÑ7IÓJˆ
à˜dÐ"÷ ;Ø×'Ñ'×,Ñ,°
Ñ:ð	
r3   )rZ   rY   r[   r\   r]   )rH   rI   rJ   rK   rL   ro   Útimer^   r<   r-   rg   rM   rN   r3   r1   r(   r(   ‰   sB   † ñð !Ð!Ø!Ð"Ø%Ð'<Ð=ñ Ðð Ø�j‰jôò&õP	
r3   r(   c                   ó$   • \ rS rSrSrS rS rSrg)r   éÛ   ac  Adapter to existing retry interface used in the endpoints layer.

This existing interface for determining if a retry needs to happen
is event based and used in ``botocore.endpoint``.  The interface has
grown organically over the years and could use some cleanup.  This
adapter converts that interface into the interface used by the
new retry strategies.

c           	      ób   • US   nUc  SnSnOUu  p4[        US   US   UUUS   US   S   S9nU$ )	z+Create context based on needs-retry kwargs.ÚresponseNÚattemptsÚ	operationÚcaught_exceptionÚrequest_dictrB   )Úattempt_numberrn   Úhttp_responseÚparsed_responser{   Úrequest_context)ÚRetryContext)r;   rE   rx   r~   r   rB   s         r1   ra   Ú&RetryEventAdapter.create_retry_contextæ   se   € à˜*Ñ%ˆØÑð
 !ˆMØ"‰Oà-5Ñ*ˆMô Ø! *Ñ-Ø" ;Ñ/Ø'Ø+Ø#Ð$6Ñ7Ø" >Ñ2°9Ñ=ñ
ˆð ˆr3   c                 ó–   • UR                  5       nUR                  b,  UR                  R                  S0 5      R                  U5        gg)z/Modify response back to user back from context.NÚResponseMetadata)Úget_retry_metadatar   rC   Úupdate)r;   rB   Úmetadatas      r1   rh   Ú3RetryEventAdapter.adapt_retry_response_from_contextÿ   sH   € ð
 ×-Ñ-Ó/ˆØ×"Ñ"Ñ.Ø×#Ñ#×.Ñ.Ð/AÀ2ÓF×MÑMØõð /r3   rN   N)rH   rI   rJ   rK   rL   ra   rh   rM   rN   r3   r1   r   r   Û   s   † ñòõ2	r3   r   c                   ó>   • \ rS rSrSr     S	S jrS rS rS rSr	g)
r�   i  aQ  Normalize a response that we use to check if a retry should occur.

This class smoothes over the different types of responses we may get
from a service including:

    * A modeled error response from the service that contains a service
      code and error message.
    * A raw HTTP response that doesn't contain service protocol specific
      error keys.
    * An exception received while attempting to retrieve a response.
      This could be a ConnectionError we receive from our HTTP layer which
      could represent that we weren't able to receive a response from
      the service.

This class guarantees that at least one of the above attributes will be
non None.

This class is meant to provide a read-only view into the properties
associated with a possible retryable response.  None of the properties
are meant to be modified directly.

Nc                 ód   • Xl         X l        X0l        X@l        XPl        Uc  0 nX`l        0 U l        g r7   )r}   rn   r   r~   r{   r€   Ú_retry_metadata)r;   r}   rn   r   r~   r{   r€   s          r1   r<   ÚRetryContext.__init__&  sA   € ð -ÔØ.Ôð  /Ôà*Ôð !1Ôð
 Ñ"Ø ˆOØ.ÔØ!ˆÕr3   c                 ó¤   • U R                   c  gU R                   R                  S0 5      n[        U[        5      (       d  gUR                  S5      $ )zwCheck if there was a parsed response with an error code.

If we could not find any error codes, ``None`` is returned.

NÚErrorÚCode)r   rp   Ú
isinstanceÚdict)r;   Úerrors     r1   Úget_error_codeÚRetryContext.get_error_codeE  sJ   € ð ×ÑÑ'ØØ×$Ñ$×(Ñ(¨°"Ó5ˆÜ˜%¤×&Ñ&ØØ�y‰y˜Ó Ð r3   c                 ó<   • U R                   R                  " S0 UD6  g)zÚAdd key/value pairs to the retry metadata.

This allows any objects during the retry process to add
metadata about any checks/validations that happened.

This gets added to the response metadata in the retry handler.

NrN   )r‹   r†   )r;   rE   s     r1   Úadd_retry_metadataÚRetryContext.add_retry_metadataR  s   € ð 	×Ñ×#Ò#Ñ- fÓ-r3   c                 ó6   • U R                   R                  5       $ r7   )r‹   Úcopy©r;   s    r1   r…   ÚRetryContext.get_retry_metadata]  s   € Ø×#Ñ#×(Ñ(Ó*Ð*r3   )r‹   r}   r{   r~   rn   r   r€   )NNNNN)
rH   rI   rJ   rK   rL   r<   r“   r–   r…   rM   rN   r3   r1   r�   r�     s,   † ñð4 ØØØØô"ò>!ò	.õ+r3   r�   c                   ó&   • \ rS rSrS rS rS rSrg)r)   ia  c                 ó   • Xl         X l        g r7   )Ú_retry_checkerÚ_retry_backoff)r;   r   r   s      r1   r<   ÚRetryPolicy.__init__b  s   € Ø+ÔØ+Õr3   c                 ó8   • U R                   R                  U5      $ r7   )rž   Úis_retryable©r;   rB   s     r1   rb   ÚRetryPolicy.should_retryf  ó   € Ø×"Ñ"×/Ñ/°Ó8Ð8r3   c                 ó8   • U R                   R                  U5      $ r7   )rŸ   Údelay_amountr£   s     r1   rd   ÚRetryPolicy.compute_retry_delayi  r¥   r3   )rŸ   rž   N)rH   rI   rJ   rK   r<   rb   rd   rM   rN   r3   r1   r)   r)   a  s   † ò,ò9õ9r3   r)   c                   óx   • \ rS rSrSrSrSrSrSSS.rS	S
0S	S
0S.r	S\
R                  SS4S jrS rS rS rSrg)r+   im  é   é   zx-amz-retry-afteré   é   gš™™™™™©?)Úthrottling_base_scaleÚnon_throttling_base_scaler¯   gš™™™™™™?r   Nc                 óV   • U R                   U l        Xl        X l        X0l        X@l        g r7   )Ú_BASEÚ_baseÚ_max_backoffÚ_randomr\   Ú_throttling_detector)r;   Úmax_backoffÚrandomr   r   s        r1   r<   ÚExponentialBackoff.__init__}  s&   € ð —Z‘ZˆŒ
Ø'ÔØŒØ)ÔØ$7Õ!r3   c                 ó°  • [         (       a‹  U R                  5       [        U R                  U5      U R                  UR
                  S-
  -  -  U R                  5      -  nU R                  U5      nUb"  [        U[        X0R                  U-   5      5      $ U$ U R                  5       [        U R                  UR
                  S-
  -  U R                  5      -  $ )zàCalculates delay based on exponential backoff.

This class implements truncated binary exponential backoff
with jitter::

    t_i = rand(0, 1) * min(2 ** attempt, MAX_BACKOFF)

where ``i`` is the request attempt (0 based).

r­   )
r   r´   ÚminÚ_get_base_scaler²   r}   r³   Ú_get_retry_after_delayrA   Ú_RETRY_AFTER_MAX_ADDITIONAL)r;   rB   Út_iÚretry_afters       r1   r§   ÚExponentialBackoff.delay_amountŠ  sÐ   € ÷ ÒØ—,‘,“.¤3Ø×$Ñ$ WÓ-Ø—:‘: '×"8Ñ"8¸1Ñ"<Ñ=ñ?à×!Ñ!ó$ñ ˆCð ×5Ñ5°gÓ>ˆKØÑ&äØÜ˜×%EÑ%EÈÑ%KÓLóð ð
 ˆJà—<‘<“>¤CØ—‘ × 6Ñ 6¸Ñ :Ñ;Ø×!Ñ!ó%ñ ð r3   c                 ó  • U R                   (       a/  U R                   R                  U5      (       a  U R                  S   $ U R                  U R                  ;   a  U R                  U R                     S   $ U R                  S   $ )Nr®   r¯   )rµ   Ú is_throttling_error_from_contextÚ_DEFAULT_BACKOFF_CONFIGr\   Ú_SERVICE_BACKOFF_CONFIGr£   s     r1   r»   Ú"ExponentialBackoff._get_base_scale¯  s„   € à×%×%Ø×)Ñ)×JÑJØ÷ñ ð ×/Ñ/Ð0GÑHÐHØ×Ñ ×!=Ñ!=Ó=Ø×/Ñ/°×0BÑ0BÑCØ+ñð ð ×+Ñ+Ð,GÑHÐHr3   c                 óF  • UR                   c  g UR                   R                  R                  U R                  5      nUc  g  [	        U5      S-  nUS:  a  [        S5      eU$ ! [
        [        4 a,  n[        R                  SU R                  UU5         S nAg S nAff = f)Ng     @�@r   zNegative retry-after valuez0Invalid %s header value: %s, ignoring. Error: %s)	r~   Úheadersrp   Ú_RETRY_AFTER_HEADERÚintÚ
ValueErrorÚOverflowErrorre   rf   )r;   rB   Úretry_after_msÚvalueÚes        r1   r¼   Ú)ExponentialBackoff._get_retry_after_delay½  s¥   € Ø× Ñ Ñ(ØØ ×.Ñ.×6Ñ6×:Ñ:Ø×$Ñ$ó
ˆð Ñ!Øð	Ü˜Ó'¨&Ñ0ˆEØ�q‹yÜ Ð!=Ó>Ð>ØˆLøÜœMÐ*ó 	Ü�L‰LØBØ×(Ñ(ØØô	ô ûð	ús   Á A$ Á$B Á4"BÂB )r²   r³   r´   r\   rµ   )rH   rI   rJ   rK   r±   Ú_MAX_BACKOFFrÈ   r½   rÃ   rÄ   r·   r<   r§   r»   r¼   rM   rN   r3   r1   r+   r+   m  sj   † Ø€EØ€LØ-ÐØ"#Ðð "#Ø%)ñÐð 1°%Ð8Ø8¸%Ð@ñÐð Ø�}‰}ØØ ô8ò#òJIõr3   r+   c                   ó    • \ rS rSrS rS rSrg)ÚMaxAttemptsCheckeriÔ  c                 ó   • Xl         g r7   r8   r:   s     r1   r<   ÚMaxAttemptsChecker.__init__Õ  r>   r3   c                 ó:  • UR                   U R                  :  nUR                  R                  S5      nU(       a)  [	        UR                  SS5      U R                  5      US'   U(       d/  [
        R                  SU R                  5        UR                  SS9  U$ )Nr@   rA   r   zMax attempts of %s reached.T)ÚMaxAttemptsReached)r}   r9   r€   rp   rA   re   rf   r–   )r;   rB   Úunder_max_attemptsrF   s       r1   r¢   ÚMaxAttemptsChecker.is_retryableØ  sŠ   € Ø$×3Ñ3°d×6HÑ6HÑHÐØ!×1Ñ1×5Ñ5°iÓ@ˆÞÜ%(Ø×#Ñ# E¨1Ó-¨t×/AÑ/Aó&ˆO˜EÑ"ö "Ü�L‰LÐ6¸×8JÑ8JÔKØ×&Ñ&¸$Ð&Ñ?Ø!Ð!r3   r8   N©rH   rI   rJ   rK   r<   r¢   rM   rN   r3   r1   rÒ   rÒ   Ô  s   † ò*õ
"r3   rÒ   c                   óB   • \ rS rSr/ SQr/ SQr\\4r   SS jr	S r
Srg)	ÚTransientRetryableCheckeriå  )ÚRequestTimeoutÚRequestTimeoutExceptionÚPriorRequestNotComplete)iô  iö  i÷  iø  Nc                 óŽ   • Uc  U R                   S S  nUc  U R                  S S  nUc  U R                  nXl        X l        X0l        g r7   )Ú_TRANSIENT_ERROR_CODESÚ_TRANSIENT_STATUS_CODESÚ_TRANSIENT_EXCEPTION_CLSÚ_transient_error_codesÚ_transient_status_codesÚ_transient_exception_cls)r;   Útransient_error_codesÚtransient_status_codesÚtransient_exception_clss       r1   r<   Ú"TransientRetryableChecker.__init__ñ  sV   € ð !Ñ(Ø$(×$?Ñ$?ÁÐ$BÐ!Ø!Ñ)Ø%)×%AÑ%AÁ!Ð%DÐ"Ø"Ñ*Ø&*×&CÑ&CÐ#Ø&;Ô#Ø'=Ô$Ø(?Õ%r3   c                 ó   • UR                  5       U R                  ;   a  gUR                  b%  UR                  R                  U R                  ;   a  gUR
                  b   [        UR
                  U R                  5      $ g)NTF)r“   rã   r~   Ústatus_coderä   r{   r�   rå   r£   s     r1   r¢   Ú&TransientRetryableChecker.is_retryable  sy   € Ø×!Ñ!Ó# t×'BÑ'BÓBØØ× Ñ Ñ,à×%Ñ%×1Ñ1Ø×/Ñ/ó0ð Ø×#Ñ#Ñ/ÜØ×(Ñ(¨$×*GÑ*Góð ð r3   )rã   rå   rä   )NNN)rH   rI   rJ   rK   rà   rá   r   r   râ   r<   r¢   rM   rN   r3   r1   rÛ   rÛ   å  s6   † òÐò
 3ÐàØð Ðð #Ø#Ø $ô	@õ r3   rÛ   c                   ó,   • \ rS rSr/ SQrSS jrS rSrg)ÚThrottledRetryableCheckeri  )Ú
ThrottlingÚThrottlingExceptionÚThrottledExceptionÚRequestThrottledExceptionÚTooManyRequestsExceptionÚ&ProvisionedThroughputExceededExceptionÚTransactionInProgressExceptionÚRequestLimitExceededÚBandwidthLimitExceededÚLimitExceededExceptionÚRequestThrottledÚSlowDownrÞ   ÚEC2ThrottledExceptionNc                 ó4   • Uc  U R                   S S  nXl        g r7   )Ú_THROTTLED_ERROR_CODESÚ_throttled_error_codes)r;   Úthrottled_error_codess     r1   r<   Ú"ThrottledRetryableChecker.__init__%  s   € Ø Ñ(Ø$(×$?Ñ$?ÁÐ$BÐ!Ø&;Õ#r3   c                 ó<   • UR                  5       U R                  ;   $ r7   )r“   rþ   r£   s     r1   r¢   Ú&ThrottledRetryableChecker.is_retryable*  s   € ð ×%Ñ%Ó'¨4×+FÑ+FÑFÐFr3   )rþ   r7   )rH   rI   rJ   rK   rý   r<   r¢   rM   rN   r3   r1   rî   rî     s   † òÐô"<õ
Gr3   rî   c                   ó$   • \ rS rSrSrS rS rSrg)ÚModeledRetryableCheckeri0  z0Check if an error has been modeled as retryable.c                 ó"   • [        5       U l        g r7   )ÚModeledRetryErrorDetectorÚ_error_detectorrš   s    r1   r<   Ú ModeledRetryableChecker.__init__3  s   € Ü8Ó:ˆÕr3   c                 ód   • UR                  5       nUc  gU R                  R                  U5      S L$ rm   )r“   r  Údetect_error_type)r;   rB   Ú
error_codes      r1   r¢   Ú$ModeledRetryableChecker.is_retryable6  s5   € Ø×+Ñ+Ó-ˆ
ØÑØØ×#Ñ#×5Ñ5°gÓ>ÀdÐJÐJr3   )r  N)rH   rI   rJ   rK   rL   r<   r¢   rM   rN   r3   r1   r  r  0  s   † Ù:ò;õKr3   r  c                   ó&   • \ rS rSrSrSrSrS rSrg)r  i=  z<Checks whether or not an error is a modeled retryable error.ÚTRANSIENT_ERRORÚTHROTTLING_ERRORc                 óÌ  • UR                  5       nUR                  nUb  UR                  (       d  gUR                   H£  nUR                  R	                  S5      c  M!  UR                  R	                  S0 5      R	                  S5      =(       d    UR
                  nX%:X  d  Mf  UR                  S   R	                  S5      (       a  U R                  s  $ U R                  s  $    g)a  Detect the error type associated with an error code and model.

This will either return:

    * ``self.TRANSIENT_ERROR`` - If the error is a transient error
    * ``self.THROTTLING_ERROR`` - If the error is a throttling error
    * ``None`` - If the error is neither type of error.

NÚ	retryabler’   ÚcodeÚ
throttling)r“   rn   Úerror_shapesr‡   rp   rq   r  r  )r;   rB   r  Úop_modelÚshapeÚerror_code_to_checks         r1   r
  Ú+ModeledRetryErrorDetector.detect_error_typeG  s¼   € ð ×+Ñ+Ó-ˆ
Ø×*Ñ*ˆØÑ 8×#8×#8ØØ×*Ô*ˆEØ�~‰~×!Ñ! +Ó.Ó:ð —N‘N×&Ñ& w°Ó3×7Ñ7¸Ó?×MÀ5Ç:Á:ð $ð Õ4Ø—~‘~ kÑ2×6Ñ6°|×DÑDØ#×4Ñ4Ò4Ø×/Ñ/Ò/ò +r3   rN   N)	rH   rI   rJ   rK   rL   r  r  r
  rM   rN   r3   r1   r  r  =  s   † ÙFð (€OØ)Ðõ
0r3   r  c                   ó&   • \ rS rSrS rS rS rSrg)r%   ib  c                 óL   • [        5       U l        [        5       U l        Xl        g r7   )r  Ú_modeled_error_detectorrî   Ú_fixed_error_code_detectorrZ   )r;   r   s     r1   r<   Ú ThrottlingErrorDetector.__init__c  s   € Ü'@Ó'BˆÔ$Ü*CÓ*EˆÔ'Ø$7Õ!r3   c                 ó\   • U R                   R                  " S0 UD6nU R                  U5      $ )NrN   )rZ   ra   rÂ   )r;   rE   rB   s      r1   Úis_throttling_errorÚ+ThrottlingErrorDetector.is_throttling_errori  s,   € Ø×+Ñ+×@Ò@ÑJÀ6ÑJˆØ×4Ñ4°WÓ=Ð=r3   c                 óª   • U R                   R                  U5      (       a  gU R                  R                  U5      nX R                  R                  :H  $ )NT)r  r¢   r  r
  r  )r;   rB   Ú
error_types      r1   rÂ   Ú8ThrottlingErrorDetector.is_throttling_error_from_contextm  sG   € Ø×*Ñ*×7Ñ7¸×@Ñ@ØØ×1Ñ1×CÑCÀGÓLˆ
Ø×9Ñ9×JÑJÑJÐJr3   )r  r  rZ   N)rH   rI   rJ   rK   r<   r  rÂ   rM   rN   r3   r1   r%   r%   b  s   † ò8ò>õKr3   r%   c                   ó*   • \ rS rSrSr\4S jrS rSrg)r*   it  z•Concrete class that implements the standard retry policy checks.

Specifically:

    not max_attempts and (transient or throttled or modeled_retry)

c           
      óÞ   • [        U5      U l        [        [        5       [	        5       [        5       [        [        R                  " 5       [        R                  " 5       /5      /5      U l	        g r7   )
rÒ   Ú_max_attempts_checkerÚOrRetryCheckerrÛ   rî   r  r	   ÚRetryIDPCommunicationErrorÚRetryDDBChecksumErrorÚ_additional_checkersr:   s     r1   r<   Ú StandardRetryConditions.__init__}  sZ   € ô &8¸Ó%EˆÔ"Ü$2ä)Ó+Ü)Ó+Ü'Ó)Üä×:Ò:Ó<Ü×5Ò5Ó7ðóð	
ó%
ˆÕ!r3   c                 ó|   • U R                   R                  U5      =(       a    U R                  R                  U5      $ r7   )r&  r¢   r*  r£   s     r1   r¢   Ú$StandardRetryConditions.is_retryable�  s7   € Ø×)Ñ)×6Ñ6Øó
÷ >à×'Ñ'×4Ñ4°WÓ=ð	>r3   )r*  r&  N)	rH   rI   rJ   rK   rL   r    r<   r¢   rM   rN   r3   r1   r*   r*   t  s   † ñð %9ô 
õ$>r3   r*   c                   ó    • \ rS rSrS rS rSrg)r'  i•  c                 ó   • Xl         g r7   ©Ú	_checkers)r;   Úcheckerss     r1   r<   ÚOrRetryChecker.__init__–  s   € Ø!�r3   c                 óB   ^• [        U4S jU R                   5       5      $ )Nc              3   óD   >#   • U  H  oR                  T5      v •  M     g 7fr7   )r¢   )Ú.0ÚcheckerrB   s     €r1   Ú	<genexpr>Ú.OrRetryChecker.is_retryable.<locals>.<genexpr>š  s   øé € ÐOÂ°W×'Ñ'¨×0Ð0Âùs   ƒ )Úanyr1  r£   s    `r1   r¢   ÚOrRetryChecker.is_retryable™  s   ø€ ÜÔOÀÇÂÓOÓOÐOr3   r0  NrÙ   rN   r3   r1   r'  r'  •  s   † ò"õPr3   r'  c                   óR   • \ rS rSrSrSrSrSrSr\	\
4rSS jrS rS	 rS
 rS rSrg)r&   i�  r¬   é   r­   é
   Nc                 ó*   • Xl         X l        S U l        g r7   )Ú_quotarµ   Ú_last_amount_acquired)r;   r   r   s      r1   r<   ÚRetryQuotaChecker.__init__«  s   € ØŒØ$7Ô!à%)ˆÕ"r3   c                 óX  • [         (       a0  U R                  U5      (       a  U R                  nO<U R                  nO/U R	                  U5      (       a  U R
                  nOU R                  nU R                  R                  U5      nU(       a  X!R                  S'   gUR                  SS9  g)NÚretry_quota_capacityT)ÚRetryQuotaReachedF)r   Ú_is_throttling_errorÚ_THROTTLING_RETRY_COSTÚ_RETRY_COST_V2Ú_is_timeout_errorÚ_TIMEOUT_RETRY_REQUESTÚ_RETRY_COSTr@  Úacquirer€   r–   )r;   rB   Úcapacity_amountÚsuccesss       r1   rc   Ú%RetryQuotaChecker.acquire_retry_quota±  s–   € ßÒØ×(Ñ(¨×1Ñ1Ø"&×"=Ñ"=‘à"&×"5Ñ"5‘à×%Ñ% g×.Ñ.Ø"&×"=Ñ"=‘à"&×"2Ñ"2�Ø—+‘+×%Ñ% oÓ6ˆÞð ?N×#Ñ#Ð$:Ñ;ØØ×"Ñ"°TÐ"Ñ:Ør3   c                 óT   • U R                   c  gU R                   R                  U5      $ rm   )rµ   rÂ   r£   s     r1   rF  Ú&RetryQuotaChecker._is_throttling_errorÆ  s-   € Ø×$Ñ$Ñ,ØØ×(Ñ(×IÑIØó
ð 	
r3   c                 óB   • [        UR                  U R                  5      $ r7   )r�   r{   Ú_TIMEOUT_EXCEPTIONSr£   s     r1   rI  Ú#RetryQuotaChecker._is_timeout_errorÍ  s   € Ü˜'×2Ñ2°D×4LÑ4LÓMÐMr3   c                 óÞ   • Uc  g UR                   nSUs=::  a  S:  aP  O  g SU;  a&  U R                  R                  U R                  5        g US   nU R                  R                  U5        g g )NéÈ   i,  rD  )rë   r@  ÚreleaseÚ_NO_RETRY_INCREMENT)r;   rB   r~   rE   rë   rM  s         r1   r,   Ú%RetryQuotaChecker.release_retry_quotaÑ  sg   € ð Ñ ØØ#×/Ñ/ˆØ�+Õ# Ö#Ø%¨WÓ4Ø—‘×#Ñ# D×$<Ñ$<Õ=à")Ð*@Ñ"A�Ø—‘×#Ñ# OÕ4ð $r3   )rA  r@  rµ   r7   )rH   rI   rJ   rK   rK  rH  rX  rG  rJ  r   r   rS  r<   rc   rF  rI  r,   rM   rN   r3   r1   r&   r&   �  sD   † Ø€KØ€NØÐØÐØÐØ.Ð0@ÐAÐô*òò*
òNõ5r3   r&   r7   )&rL   Úloggingr·   rt   Úbotocore.configproviderr   Úbotocore.exceptionsr   r   r   r   Úbotocore.retriesr   r	   Úbotocore.retries.baser
   r   r    r   Ú	getLoggerrH   re   r2   r#   r(   r   r�   r)   r+   rÒ   rÛ   rî   r  r  r%   r*   r'  r&   rN   r3   r1   Ú<module>r`     s  ðñó4 Û Û õ
 8÷ó ÷ ,ß HàÐ àØñÐ ð 
×	Ò	˜8Ó	$€ôA÷H4ñ 4÷"O
ñ O
÷d-ñ -÷fP+ñ P+÷f	9ñ 	9ôdÐ)ô dôN"Ð-ô "ô")Ð 4ô )ôXGÐ 4ô Gô>
KÐ2ô 
K÷"0ñ "0÷JKñ Kô$>Ð2ô >ôBPÐ)ô P÷E5ò E5r3   