403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/s3transfer/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/s3transfer/__pycache__/bandwidth.cpython-314.pyc
+
[m�h�<���^RIt^RIt!RR]4t!RR4t!RR4t!RR	4t!R
R4t!RR
4t!RR4t	!RR4t
R#)�Nc�2aa�]tRt^toV3RltRtVtV;t#)�RequestExceededExceptionc�N<�WnW nRVRV2p\SV`
V4R#)a`Error when requested amount exceeds what is allowed

The request that raised this error should be retried after waiting
the time specified by ``retry_time``.

:type requested_amt: int
:param requested_amt: The originally requested byte amount

:type retry_time: float
:param retry_time: The length in time to wait to retry for the
    requested amount
zRequest amount z) exceeded the amount available. Retry in N)�
requested_amt�
retry_time�super�__init__)�selfrr�msg�	__class__s&&& ��6/usr/lib/python3/dist-packages/s3transfer/bandwidth.pyr	�!RequestExceededException.__init__s2���+��$���
��.W�Xb�Wc�d��
������rr)�__name__�
__module__�__qualname__�__firstlineno__r	�__static_attributes__�__classdictcell__�
__classcell__)r�
__classdict__s@@r
rrs�����rrc��]tRt^%tRtRtR#)�RequestTokenzDA token to pass as an identifier when consuming from the LeakyBucket�N)rrrr�__doc__rrrr
rr%s��N�rrc�,a�]tRt^+toRtRtRtVtR#)�	TimeUtilsc�,�\P!4#)zOGet the current time back

:rtype: float
:returns: The current time in seconds
)�time�r
s&r
r �TimeUtils.time,s���y�y�{�rc�.�\P!V4#)z_Sleep for a designated time

:type value: float
:param value: The time to sleep for in seconds
)r �sleep)r
�values&&r
r$�TimeUtils.sleep4s���z�z�%� � rrN)rrrrr r$rr�rs@r
rr+s�����!�!rrc�4a�]tRt^=toRRltRRltRtVtR#)�BandwidthLimiterNc�H�WnW nVf\4VnR#R#)z�Limits bandwidth for shared S3 transfers

:type leaky_bucket: LeakyBucket
:param leaky_bucket: The leaky bucket to use limit bandwidth

:type time_utils: TimeUtils
:param time_utils: Time utility to use for interacting with time.
N)�
_leaky_bucket�_time_utilsr)r
�leaky_bucket�
time_utilss&&&r
r	�BandwidthLimiter.__init__>s%��*��%����(�{�D��rc�v�\WPW P4pV'gVP4V#)a�Wraps a fileobj in a bandwidth limited stream wrapper

:type fileobj: file-like obj
:param fileobj: The file-like obj to wrap

:type transfer_coordinator: s3transfer.futures.TransferCoordinator
param transfer_coordinator: The coordinator for the general transfer
    that the wrapped stream is a part of

:type enabled: boolean
:param enabled: Whether bandwidth limiting should be enabled to start
)�BandwidthLimitedStreamr+r,�disable_bandwidth_limiting)r
�fileobj�transfer_coordinator�enabled�streams&&&& r
�get_bandwith_limited_stream�,BandwidthLimiter.get_bandwith_limited_streamLs6��(��'�'�)=�?O�?O�
����-�-�/��
r)r+r,�N)T)rrrrr	r7rrr's@r
r)r)=s����+��rr)c�pa�]tRt^ctoRRltRtRtRtRtRt	Rt
RR	ltR
tRt
RtR
tRtVtR#)r1Nc��WnW nW0nW@nVf\	4VnRVn\
4Vn^VnWPn	R#)aLimits bandwidth for reads on a wrapped stream

:type fileobj: file-like object
:param fileobj: The file like object to wrap

:type leaky_bucket: LeakyBucket
:param leaky_bucket: The leaky bucket to use to throttle reads on
    the stream

:type transfer_coordinator: s3transfer.futures.TransferCoordinator
param transfer_coordinator: The coordinator for the general transfer
    that the wrapped stream is a part of

:type time_utils: TimeUtils
:param time_utils: The time utility to use for interacting with time
NT)
�_fileobjr+�_transfer_coordinatorr,r�_bandwidth_limiting_enabledr�_request_token�_bytes_seen�_bytes_threshold)r
r3r-r4r.�bytes_thresholds&&&&&&r
r	�BandwidthLimitedStream.__init__dsK��0 �
�)��%9�"�%����(�{�D��+/��(�*�n������ /�rc��RVnR#)z0Enable bandwidth limiting on reads to the streamTN�r>r!s&r
�enable_bandwidth_limiting�0BandwidthLimitedStream.enable_bandwidth_limiting�s
��+/��(rc��RVnR#)z1Disable bandwidth limiting on reads to the streamFNrEr!s&r
r2�1BandwidthLimitedStream.disable_bandwidth_limiting�s
��+0��(rc�P�VP'gVPPV4#V;PV,
unVPVP8dVPPV4#VP4VPPV4#)zXRead a specified amount

Reads will only be throttled if bandwidth limiting is enabled.
)r>r<�readr@rA�_consume_through_leaky_bucket)r
�amounts&&r
rK�BandwidthLimitedStream.read�s���
�/�/�/��=�=�%�%�f�-�-�	
���F�"�����d�3�3�3��=�=�%�%�f�-�-��*�*�,��}�}�!�!�&�)�)rc�V�VPP'g;VPPVPVP
4^VnR#VPPh \d1pTPPTP4Rp?K�Rp?ii;i)rN)
r=�	exceptionr+�consumer@r?rr,r$r)r
�es& r
rL�4BandwidthLimitedStream._consume_through_leaky_bucket�s����,�,�6�6�6�
5��"�"�*�*��$�$�d�&9�&9��$%�� ���,�,�6�6�6��,�
5�� � �&�&�q�|�|�4�4��
5�s�7A-�-B(�8%B#�#B(c�&�VP4R#)z6Signal that data being read is being transferred to S3N)rFr!s&r
�signal_transferring�*BandwidthLimitedStream.signal_transferring�s���&�&�(rc�&�VP4R#)z:Signal that data being read is not being transferred to S3N)r2r!s&r
�signal_not_transferring�.BandwidthLimitedStream.signal_not_transferring�s���'�'�)rc�<�VPPW4R#r9)r<�seek)r
�where�whences&&&r
r[�BandwidthLimitedStream.seek�s���
�
���5�)rc�6�VPP4#r9)r<�tellr!s&r
r`�BandwidthLimitedStream.tell�s���}�}�!�!�#�#rc��VP'd#VP'dVP4VPP	4R#r9)r>r@rLr<�closer!s&r
rc�BandwidthLimitedStream.close�s7���+�+�+��0@�0@�0@�
�.�.�0��
�
���rc��V#r9rr!s&r
�	__enter__� BandwidthLimitedStream.__enter__�s���rc�&�VP4R#r9)rc)r
�args�kwargss&*,r
�__exit__�BandwidthLimitedStream.__exit__�s���
�
�r)r>r@rAr<r+r?r,r=)Ni)r)rrrrr	rFr2rKrLrUrXr[r`rcrfrkrrr's@r
r1r1csG����!0�F0�1�*�(7�$)�*�*�$����rr1c�Ha�]tRt^�toR	RltRtRtRtRtRt	Rt
VtR#)
�LeakyBucketNc���\V4VnW nVf\4Vn\P
!4VnW0nVf\4VnW@n	Vf\4Vn	R#R#)a�A leaky bucket abstraction to limit bandwidth consumption

:type rate: int
:type rate: The maximum rate to allow. This rate is in terms of
    bytes per second.

:type time_utils: TimeUtils
:param time_utils: The time utility to use for interacting with time

:type rate_tracker: BandwidthRateTracker
:param rate_tracker: Tracks bandwidth consumption

:type consumption_scheduler: ConsumptionScheduler
:param consumption_scheduler: Schedules consumption retries when
    necessary
N)�float�	_max_rater,r�	threading�Lock�_lock�
_rate_tracker�BandwidthRateTracker�_consumption_scheduler�ConsumptionScheduler)r
�max_rater.�rate_tracker�consumption_schedulers&&&&&r
r	�LeakyBucket.__init__�sf��.�x����%����(�{�D���^�^�%��
�)����!5�!7�D��&;�#� �(�*>�*@�D�'�)rc��VP;_uu_4VPP4pVPP	V4'dVPWV4uuRRR4#VP
W4'dVPWV4MVPW4uuRRR4#RRR4R# +'giR#;i)aConsume an a requested amount

:type amt: int
:param amt: The amount of bytes to request to consume

:type request_token: RequestToken
:param request_token: The token associated to the consumption
    request that is used to identify the request. So if a
    RequestExceededException is raised the token should be used
    in subsequent retry consume() request.

:raises RequestExceededException: If the consumption amount would
    exceed the maximum allocated bandwidth

:rtype: int
:returns: The amount consumed
N)	rtr,r rw�is_scheduled�,_release_requested_amt_for_scheduled_request�_projected_to_exceed_max_rate�!_raise_request_exceeded_exception�_release_requested_amt�r
�amt�
request_token�time_nows&&& r
rQ�LeakyBucket.consume�s���$�Z�Z�Z��'�'�,�,�.�H��*�*�7�7�
�F�F��H�H�����Z��3�3�C�B�B��6�6�����2�2�3�A��Z���Z�Z�Z�s�A
B=�-:B=�=C	c�T�VPPW4pW0P8�#r9)ru�get_projected_raterq)r
r�r��projected_rates&&& r
r��)LeakyBucket._projected_to_exceed_max_rates%���+�+�>�>�s�M�����.�.rc�Z�VPPV4VPW4#r9)rw�process_scheduled_consumptionr�r�s&&&&r
r�8LeakyBucket._release_requested_amt_for_scheduled_requests.��	
�#�#�A�A��	
��*�*�3�9�9rc��V\VP4,pVPPWV4p\	WR7h)r)rprqrw�schedule_consumptionr)r
r�r�r��allocated_timers&&&&  r
r��-LeakyBucket._raise_request_exceeded_exception#sB���u�T�^�^�4�4���0�0�E�E���
�
�'��
�	
rc�<�VPPW4V#r9)ru�record_consumption_rate)r
r�r�s&&&r
r��"LeakyBucket._release_requested_amt,s�����2�2�3�A��
r)rwrtrqrur,)NNN)rrrrr	rQr�rr�r�rrr's@r
rnrn�s+����!A�FB�>/�:�
��rrnc�8a�]tRtRtoRtRtRtRtRtVt	R#)rxi1c�"�/Vn^VnR#)z*Schedules when to consume a desired amountN�� _tokens_to_scheduled_consumption�_total_waitr!s&r
r	�ConsumptionScheduler.__init__2s��02��-���rc��WP9#)z�Indicates if a consumption request has been scheduled

:type token: RequestToken
:param token: The token associated to the consumption
    request that is used to identify the request.
)r�)r
�tokens&&r
r~�!ConsumptionScheduler.is_scheduled7s���=�=�=�=rc��V;PV,
unRVPRV/VPV&VP#)aLSchedules a wait time to be able to consume an amount

:type amt: int
:param amt: The amount of bytes scheduled to be consumed

:type token: RequestToken
:param token: The token associated to the consumption
    request that is used to identify the request.

:type time_to_consume: float
:param time_to_consume: The desired time it should take for that
    specific request amount to be consumed in regardless of previously
    scheduled consumption requests

:rtype: float
:returns: The amount of time to wait for the specific request before
    actually consuming the specified amount.
�
wait_duration�time_to_consume)r�r�)r
r�r�r�s&&&&r
r��)ConsumptionScheduler.schedule_consumption@sE��&	
���O�+���T�-�-���8
��-�-�e�4����rc��VPPV4p\VPVR,,
^4VnR#)z�Processes a scheduled consumption request that has completed

:type token: RequestToken
:param token: The token associated to the consumption
    request that is used to identify the request.
r�N)r��pop�maxr�)r
r��scheduled_retrys&& r
r��2ConsumptionScheduler.process_scheduled_consumptionZs=���?�?�C�C�E�J�������/@�A�A�1�
��rr�N)
rrrrr	r~r�r�rrr's@r
rxrx1s�����
>� �4

�

rrxc�Ra�]tRtRtoR
Rlt]R4tRtRtRt	Rt
RtVtR	#)rvigc�.�WnRVnRVnR#)aZTracks the rate of bandwidth consumption

:type a: float
:param a: The constant to use in calculating the exponentional moving
    average of the bandwidth rate. Specifically it is used in the
    following calculation:

    current_rate = alpha * new_rate + (1 - alpha) * current_rate

    This value of this constant should be between 0 and 1.
N)�_alpha�
_last_time�
_current_rate)r
�alphas&&r
r	�BandwidthRateTracker.__init__hs�������!��rc�:�VPfR#VP#)zUThe current transfer rate

:rtype: float
:returns: The current tracked transfer rate
�)r�r�r!s&r
�current_rate�!BandwidthRateTracker.current_ratexs���?�?�"���!�!�!rc�D�VPfR#VPW4#)a"Get the projected rate using a provided amount and time

:type amt: int
:param amt: The proposed amount to consume

:type time_at_consumption: float
:param time_at_consumption: The proposed time to consume at

:rtype: float
:returns: The consumption rate if that amt and time were consumed
r�)r��*_calculate_exponential_moving_average_rate�r
r��time_at_consumptions&&&r
r��'BandwidthRateTracker.get_projected_rate�s'���?�?�"���>�>��
�	
rc�x�VPfW nRVnR#VPW4VnW nR#)z�Record the consumption rate based off amount and time point

:type amt: int
:param amt: The amount that got consumed

:type time_at_consumption: float
:param time_at_consumption: The time at which the amount was consumed
Nr�)r�r�r�r�s&&&r
r��,BandwidthRateTracker.record_consumption_rate�s;���?�?�"�1�O�!$�D���!�L�L��
���.�rc�Z�W P,
pV^8:d\R4#W,#)r�inf)r�rp)r
r�r��
time_deltas&&& r
�_calculate_rate�$BandwidthRateTracker._calculate_rate�s*��(�?�?�:�
���?�
��<���!�!rc��VPW4pVPV,^VP,
VP,,#)�)r�r�r�)r
r�r��new_rates&&& r
r��?BandwidthRateTracker._calculate_exponential_moving_average_rate�s;���'�'��A���{�{�X�%��T�[�[��D�<N�<N�(N�N�Nr)r�r�r�N)g�������?)
rrrrr	�propertyr�r�r�r�r�rrr's@r
rvrvgs9����"� �"��"�
�$.�$"�O�Orrv)rrr �	Exceptionrrrr)r1rnrxrvrrr
�<module>r�sk�����y��(	�	�!�!�$#�#�Ln�n�bZ�Z�z3
�3
�lNO�NOr

Youez - 2016 - github.com/yon3zu
LinuXploit