/usr/lib/rads/venv/lib/python3.13/site-packages/s3transfer/__pycache__
NameSizeModeActions
bandwidth.cpython-313.pyc179660644editdlrm
compat.cpython-313.pyc27020644editdlrm
constants.cpython-313.pyc6880644editdlrm
copies.cpython-313.pyc111430644editdlrm
crt.cpython-313.pyc428680644editdlrm
delete.cpython-313.pyc25350644editdlrm
download.cpython-313.pyc314410644editdlrm
exceptions.cpython-313.pyc19370644editdlrm
futures.cpython-313.pyc287040644editdlrm
manager.cpython-313.pyc262910644editdlrm
processpool.cpython-313.pyc414160644editdlrm
subscribers.cpython-313.pyc36730644editdlrm
tasks.cpython-313.pyc137110644editdlrm
upload.cpython-313.pyc314740644editdlrm
utils.cpython-313.pyc369150644editdlrm
__init__.cpython-313.pyc343430644editdlrm
Edit: /usr/lib/rads/venv/lib/python3.13/site-packages/s3transfer/__pycache__/bandwidth.cpython-313.pyc (17966B)
j<SSKrSSKr"SS\5r"SS5r"SS5r"SS 5r"S S 5r"S S 5r"SS5r "SS5r g)Nc(^\rSrSrU4SjrSrU=r$)RequestExceededExceptioncL>XlX lSUSU3n[TU] U5 g)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_timesuper__init__)selfrrmsg __class__s G/usr/lib/rads/venv/lib/python3.13/site-packages/s3transfer/bandwidth.pyr !RequestExceededException.__init__s2+$ .WXbWcd rr)__name__ __module__ __qualname____firstlineno__r __static_attributes__ __classcell__)r s@rrrs rrc\rSrSrSrSrg) RequestToken%zDA token to pass as an identifier when consuming from the LeakyBucketN)rrrr__doc__rrrrrr%sNrrc \rSrSrSrSrSrg) TimeUtils+c,[R"5$)zOGet the current time back :rtype: float :returns: The current time in seconds )timer s rr!TimeUtils.time,s yy{rc.[R"U5$)z_Sleep for a designated time :type value: float :param value: The time to sleep for in seconds )r!sleep)r values rr%TimeUtils.sleep4s zz%  rrN)rrrrr!r%rrrrrr+s !rrc*\rSrSrSSjrSSjrSrg)BandwidthLimiter=NcBXlX lUc[5Ulgg)zLimits 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 rr BandwidthLimiter.__init__>s%*%  ({D  rct[XRX R5nU(dUR5 U$)aWraps 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 fileobjtransfer_coordinatorenabledstreams rget_bandwith_limited_stream,BandwidthLimiter.get_bandwith_limited_streamLs6( '')=?O?O   - - / r)r,r-N)T)rrrrr r8rrrrr)r)=s +6:rr)ch\rSrSrSSjrSrSrSrSrSr S r SS jr S r S r S rSrSrg)r2cNcXlX lX0lX@lUc[ 5UlSUl[ 5UlSUlXPl g)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 NTr) _fileobjr,_transfer_coordinatorr-r_bandwidth_limiting_enabledr_request_token _bytes_seen_bytes_threshold)r r4r.r5r/bytes_thresholds rr BandwidthLimitedStream.__init__dsK0 )%9"%  ({D +/(*n /rcSUlg)z0Enable bandwidth limiting on reads to the streamTNr@r"s renable_bandwidth_limiting0BandwidthLimitedStream.enable_bandwidth_limitings +/(rcSUlg)z1Disable bandwidth limiting on reads to the streamFNrGr"s rr31BandwidthLimitedStream.disable_bandwidth_limitings +0(rcDUR(dURRU5$U=RU- slURUR:aURRU5$UR 5 URRU5$)zXRead a specified amount Reads will only be throttled if bandwidth limiting is enabled. )r@r>readrBrC_consume_through_leaky_bucket)r amounts rrMBandwidthLimitedStream.reads //==%%f- - F"   d33 3==%%f- - **,}}!!&))rcURR(d9URRURUR 5 SUlgURRe![ a/nURRUR5 SnAOSnAff=fURR(dMNp)Nr) r? exceptionr,consumerBrArr-r%r)r es rrN4BandwidthLimitedStream._consume_through_leaky_buckets ,,66 5""**$$d&9&9$% ,,66 6, 5  &&q||44 5,,666s7A++ B$5%BB$c$UR5 g)z6Signal that data being read is being transferred to S3N)rHr"s rsignal_transferring*BandwidthLimitedStream.signal_transferrings &&(rc$UR5 g)z:Signal that data being read is not being transferred to S3N)r3r"s rsignal_not_transferring.BandwidthLimitedStream.signal_not_transferrings '')rc:URRX5 gr:)r>seek)r wherewhences rr]BandwidthLimitedStream.seeks 5)rc6URR5$r:)r>tellr"s rrbBandwidthLimitedStream.tells}}!!##rcUR(a!UR(aUR5 URR 5 gr:)r@rBrNr>closer"s rreBandwidthLimitedStream.closes1  + +0@0@  . . 0 rcU$r:rr"s r __enter__ BandwidthLimitedStream.__enter__s rc$UR5 gr:)re)r argskwargss r__exit__BandwidthLimitedStream.__exit__s  r)r@rBrCr>r,rAr-r?)Ni)r)rrrrr rHr3rMrNrWrZr]rbrerhrmrrrrr2r2csG " !0F01*(7$)**$rr2cB\rSrSrS SjrSrSrSrSrSr S r g) LeakyBucketNc[U5UlX lUc[5Ul[R "5UlX0lUc[5UlX@l Uc[5Ul gg)aA 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 threadingLock_lock _rate_trackerBandwidthRateTracker_consumption_schedulerConsumptionScheduler)r max_rater/ rate_trackerconsumption_schedulers rr LeakyBucket.__init__sf.x%  ({D ^^% )  !5!7D &;# (*>*@D ' )rcUR URR5nURR U5(aUR XU5sSSS5 $UR X5(aURXU5 OURX5sSSS5 $SSS5 g!,(df  g=f)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) rwr-r!rz is_scheduled,_release_requested_amt_for_scheduled_request_projected_to_exceed_max_rate!_raise_request_exceeded_exception_release_requested_amtr amt request_tokentime_nows rrSLeakyBucket.consumes$ZZ'',,.H**77 FFHHZ 33CBB66223AZZZsA B0#9B00 B>cTURRX5nX0R:$r:)rxget_projected_ratert)r rrprojected_rates rr)LeakyBucket._projected_to_exceed_max_rates%++>>sM..rcZURRU5 URX5$r:)rzprocess_scheduled_consumptionrrs rr8LeakyBucket._release_requested_amt_for_scheduled_requests. ##AA  **399rc|U[UR5- nURRXU5n[ XS9e)Nr)rsrtrzschedule_consumptionr)r rrrallocated_timers rr-LeakyBucket._raise_request_exceeded_exception#sBuT^^4400EE  '  rc<URRX5 U$r:)rxrecord_consumption_rate)r rrs rr"LeakyBucket._release_requested_amt,s 223A r)rzrwrtrxr-)NNN) rrrrr rSrrrrrrrrrprps." !AFB>/: rrpc,\rSrSrSrSrSrSrSrg)r{i1c 0UlSUlg)z*Schedules when to consume a desired amountrN _tokens_to_scheduled_consumption _total_waitr"s rr ConsumptionScheduler.__init__2s02-rcXR;$)zIndicates 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 rr!ConsumptionScheduler.is_scheduled7s====rc|U=RU- slURUS.URU'UR$)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_durationtime_to_consume)rr)r rrrs rr)ConsumptionScheduler.schedule_consumption@sA& O+!--.8 --e4rc|URRU5n[URUS- S5Ulg)zProcesses 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. rrN)rpopmaxr)r rscheduled_retrys rr2ConsumptionScheduler.process_scheduled_consumptionZs=??CCEJ   /@A A1 rrN) rrrrr rrrrrrrr{r{1s > 4  rr{cF\rSrSrS Sjr\S5rSrSrSr Sr Sr g ) ryigc,XlSUlSUlg)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 rr BandwidthRateTracker.__init__hs !rc6URcgUR$)zUThe current transfer rate :rtype: float :returns: The current tracked transfer rate )rrr"s r current_rate!BandwidthRateTracker.current_ratexs ?? "!!!rc@URcgURX5$)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_rater rtime_at_consumptions rr'BandwidthRateTracker.get_projected_rates' ?? ">>   rcrURcX lSUlgURX5UlX lg)zRecord 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)rrrrs rr,BandwidthRateTracker.record_consumption_rates; ?? "1O!$D  !LL  .rcHX R- nUS::a [S5$X- $)Nrinf)rrs)r rr time_deltas r_calculate_rate$BandwidthRateTracker._calculate_rates*(??: ? < !!rc|URX5nURU-SUR- UR--$)N)rrr)r rrnew_rates rr?BandwidthRateTracker._calculate_exponential_moving_average_rates;''A{{X%T[[Drsk y(  !!$##LnnbZZz3 3 lNONOr