/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__/download.cpython-313.pyc (31441B)
j{SSKrSSKrSSKrSSKJr SSKJr SSKJrJ r J r SSK J r SSK JrJr SSKJrJrJrJrJrJrJrJrJr \R4"\5r"SS 5r"S S \5r"S S \5r"SS\5r "SS\ 5r!"SS\5r""SS\5r#"SS\#5r$"SS\5r%"SS\5r&"SS\5r'"SS\5r("S S!\5r)"S"S#5r*"S$S%5r+g)&N) ClientErrorseekable)RetriesExceededErrorS3DownloadFailedErrorS3ValidationErrorIN_MEMORY_DOWNLOAD_TAG)SubmissionTaskTask) S3_RETRYABLE_DOWNLOAD_ERRORSCountCallbackInvokerDeferredOpenFileFunctionContainerStreamReaderProgresscalculate_num_partscalculate_range_parameter get_callbacksinvoke_progress_callbackscR\rSrSrSrSr\S5rSrSr Sr Sr S r S r S rg ) DownloadOutputManager*aBase manager class for handling various types of files for downloads This class is typically used for the DownloadSubmissionTask class to help determine the following: * Provides the fileobj to write to downloads to * Get a task to complete once everything downloaded has been written The answers/implementations differ for the various types of file outputs that may be accepted. All implementations must subclass and override public methods from this class. c(XlX lX0lgN)_osutil_transfer_coordinator _io_executor)selfosutiltransfer_coordinator io_executors F/usr/lib/rads/venv/lib/python3.13/site-packages/s3transfer/download.py__init__DownloadOutputManager.__init__8s %9"'c[S5e)a5Determines if the target for the download is compatible with manager :param download_target: The target for which the upload will write data to. :param osutil: The os utility to be used for the transfer :returns: True if the manager can handle the type of target specified otherwise returns False. zmust implement is_compatible()NotImplementedErrorclsdownload_targetrs r" is_compatible#DownloadOutputManager.is_compatible=s""BCCr%cg)zGet the tag (if any) to associate all GetObjectTasks :rtype: s3transfer.futures.TaskTag :returns: The tag to associate all GetObjectTasks with Nrs r"get_download_task_tag+DownloadOutputManager.get_download_task_tagKs r%c[S5e)zGet file-like object to use for io writes in the io executor :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The future associated with upload request returns: A file-like object to write to z*must implement get_fileobj_for_io_writes()r'rtransfer_futures r"get_fileobj_for_io_writes/DownloadOutputManager.get_fileobj_for_io_writesSs""NOOr%cpURRURURXU55 g)zQueue IO write for submission to the IO executor. This method accepts an IO executor and information about the downloaded data, and handles submitting this to the IO executor. This method may defer submission to the IO executor if necessary. N)rsubmitrget_io_write_taskrfileobjdataoffsets r"queue_file_io_task(DownloadOutputManager.queue_file_io_task]s0 ""))   t55gVL r%c2[URUUUS.S9$)aGet an IO write task for the requested set of data This task can be ran immediately or be submitted to the IO executor for it to run. :type fileobj: file-like object :param fileobj: The file-like object to write to :type data: bytes :param data: The data to write out :type offset: integer :param offset: The offset to write the data to in the file-like object :returns: An IO task to be used to write data to a file-like object )r<r=r> main_kwargs) IOWriteTaskrr;s r"r:'DownloadOutputManager.get_io_write_taskjs("  & &"   r%c[S5e)aqGet the final io task to complete the download This is needed because based on the architecture of the TransferManager the final tasks will be sent to the IO executor, but the executor needs a final task for it to signal that the transfer is done and all done callbacks can be run. :rtype: s3transfer.tasks.Task :returns: A final task to completed in the io executor z"must implement get_final_io_task()r'r0s r"get_final_io_task'DownloadOutputManager.get_final_io_tasks""FGGr%c[USURRS9nURR UR 5 U$)Nwb)mode open_function)rropenradd_failure_cleanupclose)rfilenamefs r"_get_fileobj_from_filename0DownloadOutputManager._get_fileobj_from_filenames<  4t||/@/@  ""66qww?r%)rrrN)__name__ __module__ __qualname____firstlineno____doc__r# classmethodr,r1r6r?r:rGrR__static_attributes__r/r%r"rr*sB (  D DP   4 Hr%rcJ^\rSrSrU4Sjr\S5rSrSrSr Sr U=r $)DownloadFilenameOutputManagercP>[TU]XU5 SUlSUlSUlgr)superr#_final_filename_temp_filename _temp_fileobj)rrr r! __class__s r"r#&DownloadFilenameOutputManager.__init__s* {C#"!r%c"[U[5$r) isinstancestrr)s r"r,+DownloadFilenameOutputManager.is_compatibles/3//r%cURRRnX lURR U5UlUR5UlUR$r) meta call_argsr<r`rget_temp_filenamera_get_temp_fileobjrb)rr5r<s r"r67DownloadFilenameOutputManager.get_fileobj_for_io_writessS!&&0088&"ll<[TU]XU5 Uc [5nX@l[R "5Ulgr)r_r# DeferQueue _defer_queue threadingLock_io_submit_lockrrr r! defer_queuercs r"r#)DownloadNonSeekableOutputManager.__init__s6 {C  $,K'(~~/r%c[US5$)Nwrite)hasattrr)s r"r,.DownloadNonSeekableOutputManager.is_compatibles00r%c[$rr r0s r"r16DownloadNonSeekableOutputManager.get_download_task_tags%%r%cBURRR$rrr4s r"r6:DownloadNonSeekableOutputManager.get_fileobj_for_io_writess##--555r%c([URS9$rrr0s r"rG2DownloadNonSeekableOutputManager.get_final_io_tasks'!%!;!;  r%c>UR URRX25nUH2nUSn[R SUSU5 [ TU]XU5 M4 SSS5 g!,(df  g=f)Nr=z%Queueing IO offset %s for fileobj: %sr>)rrrequest_writesloggerdebugr_r?)rr<r=r>writesrrcs r"r?3DownloadNonSeekableOutputManager.queue_file_io_tasksk  ! !&&55fCFV} ;(O *7&A " ! !s AA++ A9c0[URUUS.S9$)N)r<r=rB)IOStreamingWriteTaskrr;s r"r:2DownloadNonSeekableOutputManager.get_io_write_tasks##  & &"  r%)rrr)rTrUrVrWr#rYr,r1r6rGr?r:rZrwrxs@r"rrs>EI011&6 B  r%rcJ^\rSrSrSU4Sjjr\S5rSrSrSr U=r $)$DownloadSpecialFilenameOutputManageric4>[TU]XX45 SUlgr)r_r#_fileobjrs r"r#-DownloadSpecialFilenameOutputManager.__init__s   +  r%cR[U[5=(a URU5$r)rfrgis_special_filer)s r"r,2DownloadSpecialFilenameOutputManager.is_compatible s&/3/ F4J4J 5  r%cURRRnURU5UlUR$r)rjrkr<rRr)rr5rPs r"r6>DownloadSpecialFilenameOutputManager.get_fileobj_for_io_writess5"''119977A }}r%cD[URSSUR0S9$)NTr<)r rqrC) IOCloseTaskrrr0s r"rG6DownloadSpecialFilenameOutputManager.get_final_io_tasks'!%!;!;"DMM2  r%)rr) rTrUrVrWr#rYr,r6rGrZrwrxs@r"rrs.EI     r%rcB\rSrSrSrSrS SjrSrSrSr S r S r g) DownloadSubmissionTaski z/Task for submitting tasks to execute a downloadc[[[[/nURR R nUHnURXB5(dMUs $ [SUS[U5S35e)aRetrieves a class for managing output for a download :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The transfer future for the request :type osutil: s3transfer.utils.OSUtils :param osutil: The os utility associated to the transfer :rtype: class of DownloadOutputManager :returns: The appropriate class to use for managing a specific type of input for downloads. zOutput z of type: z is not supported.) rr\rzrrjrkr<r, RuntimeErrortype)rr5rdownload_manager_resolver_chainr<download_manager_clss r" _get_download_output_manager_cls7DownloadSubmissionTask._get_download_output_manager_cls#sz 1 ) ) , + '"&&0088$C #11'BB++%DgYjg7I J  r%Nc URRbURRcUR"SURRR URRR S.URRRD6nURRUS5 URRURS55 URXc5"X0RU5n URRUR:aURUUUUUU UU5 gURUUUUUU UU5 g)a :param client: The client associated with the transfer manager :type config: s3transfer.manager.TransferConfig :param config: The transfer config associated with the transfer manager :type osutil: s3transfer.utils.OSUtil :param osutil: The os utility associated to the transfer manager :type request_executor: s3transfer.futures.BoundedExecutor :param request_executor: The request executor associated with the transfer manager :type io_executor: s3transfer.futures.BoundedExecutor :param io_executor: The io executor associated with the transfer manager :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The transfer future associated with the transfer request that tasks are being submitted for :type bandwidth_limiter: s3transfer.bandwidth.BandwidthLimiter :param bandwidth_limiter: The bandwidth limiter to use when downloading streams NBucketKey ContentLengthETagr/)rjsizeetag head_objectrkbucketkey extra_argsprovide_transfer_sizeprovide_object_etaggetrrmultipart_threshold_submit_download_request_submit_ranged_download_request) rclientconfigrrequest_executorr!r5bandwidth_limiterresponsedownload_output_managers r"_submitDownloadSubmissionTask._submit?sOJ  % % -##((0))&++55<<#((2266"&&00;;H  6 6)   4 4X\\&5I J"&"G"G # ,,k#;    $ $v'A'A A  ) ) '!   0 0 '! r%c URRn URU5n [US5n UR 5n UR 5n UR RU[UR UU RU RU U RU URUURUS. U /S9U S9 g)Nprogress) rrrr<r callbacks max_attemptsr io_chunksizerr rCdone_callbackstag)rjrkr6rr1rGrr9ImmediatelyWriteIOGetObjectTaskrrrnum_download_attemptsr)rrrrrr!rr5rrkr<progress_callbacksget_object_tag final_tasks r"r/DownloadSubmissionTask._submit_download_requests$((22 *CC   +?JG1FFH->>@  ""))  +%)%?%?$'..$==&"+"6"6!3$*$@$@/F$*$7$7): !+|  % * r%c URRn [US5n URU5n URn [ URR U 5n UR5n[URXe55n[U 5Hn[U UU 5nSU0nURRbURRUS'URU R5 UR5 UR R#U[%UR UU R&U R(U UU UR*UU -UUR,US. UR./S9US9 M UR15 g)NrRangeIfMatch) rrrr<rrr start_indexrrrrr)rjrkrr6multipart_chunksizerrr1r&_get_final_io_task_submission_callbackrangerrupdater incrementrr9 GetObjectTaskrrrr decrementfinalize)rrrrrr!rr5rrkrr< part_size num_partsrfinalize_download_invokerirange_parameterrs r"r6DownloadSubmissionTask._submit_ranged_download_requests$((22 +?JG*CC   .. '(<(<(A(A9M 1FFH%9  7 7' % ! y!A71iO J##((4(7(<(<(A(A 9%   i22 3 % / / 1  & & - - )-)C)C"("+"2"2(}}#*&0%7(.(D(D'(9}3J(.(;(;-> !%>$G$G#H"#' . "H "**,r%cbUR5n[URRX#5$r)rGrrr9)rdownload_managerr!rs r"r=DownloadSubmissionTask._get_final_io_task_submission_callbacks0&779   & & - -{  r%cBX!-nX#S- :XaSnOXA-S- nSUSU3nU$)Nzbytes=-r/)rr part_indexr start_range end_range range_params r"_calculate_range_param-DownloadSubmissionTask._calculate_range_params> , Q &I#/!3I{m1YK8 r%r/r) rTrUrVrWrXrrrrrrrZr/r%r"rr s.9 HQf0 dH-T r%rc.\rSrSrSSjrSrSrSrg)ri!Nc Sn [U5Hn U nUR"SX#S.UD6nURURS5URS55 [ USU5nU (aU R UUR 5n[UU 5nUHGnUR R5(d$URUUUU5 U[U5- nMF g g [%U 5e![aInURRS05RS5nUS:Xa[S US US 35eeSnAf[a3n[R!S UU US S9 Un [#XjW- 5 SnAGMmSnAff=f)a^Downloads an object and places content into io queue :param client: The client to use when calling GetObject :param bucket: The bucket to download from :param key: The key to download from :param fileobj: The file handle to write content to :param exta_args: Any extra arguments to include in GetObject request :param callbacks: List of progress callbacks to invoke on download :param max_attempts: The number of retries to do when downloading :param download_output_manager: The download output manager associated with the current download. :param io_chunksize: The size of each io chunk to read from the download stream and queue in the io queue. :param start_index: The location in the file to start writing the content of the key to. :param bandwidth_limiter: The bandwidth limiter to use when throttling the downloading of data in streams. Nrr ContentRangeBodyErrorCodePreconditionFailedzContents of stored object "z " in bucket "z" did not match expected ETag.zCRetrying exception caught (%s), retrying request, (attempt %s / %s)T)exc_infor/)r get_object_validate_content_rangerrget_bandwith_limited_streamrDownloadChunkIteratordone _handle_iolenrrrr rrrr)rrrrr<rrrrrrrlast_exceptionr current_indexrstreaming_bodychunkschunke error_codes r"_mainGetObjectTask._main"s@|$A<  + !,,!.8,,NN7+LL0"6V$i"%)EE*D,F,F# /~|L#E 55::<<3#!)  &U3 $G%|#>225 ZZ^^GR8<^\rSrSrSrSU4SjjrSrSrU=r$)rizA NOOP task to serve as an indicator that the download is complete Note that the default for is_final is set to True because this should always be the last task. c(>[TU]UUUUUS9 g)N)r rCpending_main_kwargsrrq)r_r#)rr rCrArrqrcs r"r#!CompleteDownloadNOOPTask.__init__s& !5# 3)  r%cgrr/r0s r"rCompleteDownloadNOOPTask._mains r%r/)NNNT) rTrUrVrWrXr#rrZrwrxs@r"rrs%     r%rc*\rSrSrSrSrSr\rSrg)ric*XlX lSUlg)zIterator to chunk out a downloaded S3 stream :param body: A readable file-like object :param chunksize: The amount to read each time rN_body _chunksize _num_reads)rbody chunksizes r"r#DownloadChunkIterator.__init__s  #r%cU$rr/r0s r"__iter__DownloadChunkIterator.__iter__s r%cURRUR5nU=RS- slU(aU$URS:XaU$[ 5e)Nr)rHreadrIrJ StopIteration)rrs r"__next__DownloadChunkIterator.__next__sI 0 1 L __ ! Lor%rGN) rTrUrVrWr#rOrTnextrZr/r%r"rrs  Dr%rc$\rSrSrSrSrSrSrg)riaIO queue that defers write requests until they are queued sequentially. This class is used to track IO data for a *single* fileobj. You can send data to this queue, and it will defer any IO write requests until it has the next contiguous block available (starting at 0). c./Ul0UlSUlg)Nr)_writes_pending_offsets _next_offsetr0s r"r#DeferQueue.__init__ s "r%c$U[U5-UR::a/$/nXR:aURU- nX$SnURnXR;a8URUn[U5[U5::a/$X RU'O/[R"UR U5 X RU'UR (aUR SUR:Xa[R "UR 5nURUnURXgS.5 URU U=R[U5- slUR (aUR SUR:XaMU$)aRequest any available writes given new incoming data. You call this method by providing new data along with the offset associated with the data. If that new data unlocks any contiguous writes that can now be submitted, this method will return all applicable writes. This is done with 1 method call so you don't have to make two method calls (put(), get()) which acquires a lock each method call. Nr)r>r=)rr[rZheapqheappushrYheappopappend)rr>r=r seen_bytes queued_datanext_write_offset next_writes r"rDeferQueue.request_writes%sW CI !2!2 2 I %% %**V3J $D&&F ** *//7K4yC ,,  15%%f- NN4<< 0,0 ! !& )llt||A$2C2CC % dll ; ../@AJ MM%6K L%%&78   Z 0  llt||A$2C2CC  r%)r[rZrYN)rTrUrVrWrXr#rrZr/r%r"rrs :r%r),r^loggingrbotocore.exceptionsrs3transfer.compatrs3transfer.exceptionsrrrs3transfer.futuresr s3transfer.tasksr r s3transfer.utilsr rrrrrrrr getLoggerrTrrr\rzrrrrrrDrrrrrrrr/r%r"ros +& 61      8 $nnb%$9%P $9 ", '<, ^ +K :~^~BxDxv m  $  4  9t 9$ t 6