https://t.me/RX1948
Server : nginx/1.24.0
System : Linux ip-172-31-33-48 6.14.0-1011-aws #11~24.04.1-Ubuntu SMP Fri Aug 1 02:07:25 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
Directory :  /lib/python3/dist-packages/botocore/retries/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/botocore/retries/__pycache__/adaptive.cpython-312.pyc
�

P��eo���ddlZddlZddlZddlmZmZmZeje�Z	d�Z
Gd�d�ZGd�d�Zy)�N)�bucket�standard�
throttlingc���tj�}tjd|j	���}tj
d|��}t
|�}tjtj���}t|||||��}|jjjd|j�|jjjd|j�|S)	Nr)�starting_max_rate�
start_time�)�max_rate�clock)�retry_event_adapter)�
rate_adjustor�rate_clocker�token_bucket�throttling_detectorrzbefore-sendzneeds-retry)r�Clockr�CubicCalculator�current_time�TokenBucket�RateClockerr�ThrottlingErrorDetector�RetryEventAdapter�ClientRateLimiter�meta�events�register�on_sending_request�on_receiving_response)�clientrr
rrr�limiters       �;/usr/lib/python3/dist-packages/botocore/retries/adaptive.py�register_retry_handlerr!
s����L�L�N�E��.�.���(:�(:�(<��M��%�%�q��>�L��u�%�L�"�:�:�$�6�6�8��� �#�!�!�/���G��K�K�������"�"���K�K�������%�%���N�c�"�eZdZdZd�Zd�Zd�Zy)rg@c��||_||_||_||_||_d|_t
j�|_y)NF)	�_rate_adjustor�
_rate_clocker�
_token_bucket�_throttling_detector�_clock�_enabled�	threading�Lock�_lock)�selfr
rrrrs      r �__init__zClientRateLimiter.__init__)s@��,���)���)���$7��!������
��^�^�%��
r"c�R�|jr|jj�yy�N)r*r'�acquire)r.�request�kwargss   r rz$ClientRateLimiter.on_sending_request9s ���=�=����&�&�(�r"c�j�|jj�}|jj�}|j5|j
jdi|��s|jj|�}n~|js|}n t||jj�}|jj||�}tjd|||jj �d|_	t||j"|z�|j_ddd�y#1swYyxYw)NzfThrottling response received, new send rate: %s measured rate: %s, token bucket capacity available: %sT�)r&�recordr)rr-r(�is_throttling_errorr%�success_receivedr*�minr'r
�error_received�logger�debug�available_capacity�_MAX_RATE_ADJUST_SCALE)r.r4�
measured_rate�	timestamp�new_rate�rate_to_uses      r rz'ClientRateLimiter.on_receiving_response>s
���*�*�1�1�3�
��K�K�,�,�.�	�
�Z�Z�	�@�4�,�,�@�@�J�6�J��.�.�?�?�	�J���}�}�"/�K�"%�%�t�'9�'9�'B�'B�#�K� �.�.�=�=��������$��!��&�&�9�9�
�!%��
�*-��$�5�5�
�E�+�D���'�-	�	�	�s
�CD)�)D2N)�__name__�
__module__�__qualname__r?r/rrr6r"r rr&s�� ��&� )�
r"rc�<�eZdZdZdZdZeefd�Zdd�Zed��Z	y)	rz7Tracks the rate at which a client is sending a request.g�������?g�?c��||_d|_||_tj|jj��|_d|jz|_d|_	tj�|_y)Nrr	)
r)�_measured_rate�
_smoothing�math�floorr�_last_bucket�_TIME_BUCKET_RANGE�_time_bucket_scale�_countr+r,r-)r.r�	smoothing�time_bucket_ranges    r r/zRateClocker.__init__cs`��������#��� �J�J�t�{�{�'?�'?�'A�B���"#�d�&=�&=�"=�������^�^�%��
r"c��|j5|jj�}tj||j
z�|j
z}|xj|z
c_||jkDrd|jt||jz
�z}||jz|jd|jz
zz|_
d|_||_|jcddd�S#1swYyxYw)Nr	r)r-r)rrKrLrOrPrM�floatrJrI)r.�amount�tr�current_rates     r r7zRateClocker.recordqs���
�Z�Z�	'����(�(�*�A��
�
�1�t�6�6�6�7��)�)�*�
�
�K�K�6�!�K���)�)�)�#�{�{�U�6�D�<M�<M�3M�-N�N��'3�d�o�o�'E��'�'�1�t���+>�?�'��#� ���$*��!��&�&�	'�	'�	'�s�CC4�4C=c��|jSr1)rI)r.s r r@zRateClocker.measured_rate�s���"�"�"r"N)r	)
rDrErF�__doc__�_DEFAULT_SMOOTHINGrNr/r7�propertyr@r6r"r rr\s7��A�����
%�,�	&�'�"�#��#r"r)
�loggingrKr+�botocore.retriesrrr�	getLoggerrDr<r!rrr6r"r �<module>r_s@�����9�9�	��	�	�8�	$���83�3�l(#�(#r"

https://t.me/RX1948 - 2025