/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__/utils.cpython-313.pyc (36915B)
j/qXSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK J r SSK J r J r Jr SSKJrJr SSKJr SSKJrJrJr SSKJr SrS rS r\R:"\5r\R@\\ \ \4r!S.S jr"S r#S r$Sr%S/Sjr&Sr'Sr(S0Sjr)"SS5r*"SS5r+"SS5r,"SS5r-"SS5r."SS5r/"SS 5r0"S!S"\15r2"S#S$5r3"S%S&\35r4"S'S(5r5S)r6S*r7SS+KJ8r9 S-r8g!\:a S,r9Nf=f)1N) defaultdict)IncompleteReadErrorReadTimeoutErrorResponseStreamingError)DEFAULT_CHECKSUM_ALGORITHMAwsChunkedWrapperis_s3express_bucket) SOCKET_ERROR fallocate rename_file)FULL_OBJECT_CHECKSUM_ARGSi'liPcDSRS[U555$)Nc3j# UH)n[R"[R5v M+ g7fN)randomchoicestring hexdigits).0_s C/usr/lib/rads/venv/lib/python3.13/site-packages/s3transfer/utils.py (random_file_extension..6s$N ZZ!!"# KK1 K ZZs 2A AcUR URS:Xa [S5eU=RS-slUR(a URS:XaUR 5 SSS5 g!,(df  g=f)zDecrement the count by onerz,Counter is at zero. It cannot dip below zeror9N)rrrrrr{s r decrementCountCallbackInvoker.decrements] ZZ{{a"B KK1 K!!dkkQ&6 ZZs A"A88 BcUR SUlURS:XaUR5 SSS5 g!,(df  g=f)zFinalize the counter Once finalized, the counter never be incremented and the callback can be invoked once the count reaches zero TrN)rrrrr{s rfinalizeCountCallbackInvoker.finalizes3 ZZ!%D {{a ZZs (> A )rrrrN) rjrkrlrmrrhpropertyrrrrrnrUr rrrs/ #  ! !r rcT\rSrSrSrSrSrSSjrSrSr S r S r S r S r S rg)OSUtilsic@[RRU5$r)ospathgetsizerffilenames r get_file_sizeOSUtils.get_file_sizeswwx((r c,[RXX4SS9$)NF)enable_callbacks) ReadFileChunk from_filename)rfr start_byter5rNs ropen_file_chunk_readerOSUtils.open_file_chunk_readers!** $E+  r Nc [UUUUSUS9$)NF)rNrclose_callbacks)r)rffileobj chunk_sizefull_file_sizerNrs r#open_file_chunk_reader_from_fileobj+OSUtils.open_file_chunk_reader_from_fileobj s#   "+   r c[X5$r)open)rfrmodes rr OSUtils.opens H##r cR[R"U5 g![a gf=f)z+Remove a file, noop if file does not exist.N)rremoveOSErrorrs r remove_fileOSUtils.remove_file!s%  IIh    s  &&c[X5 gr)r )rfcurrent_filename new_filenames rr OSUtils.rename_file*s $3r cn[RRU5(dg[R"U5Rn[R "U5(ag[R "U5(ag[R"U5(ag[R"U5(agg)zChecks to see if a file is a special UNIX file. It checks if the file is a character special device, block special device, FIFO, or socket. :param filename: Name of the file :returns: True if the file is a special file. False, if is not. FT) rrexistsstatst_modeS_ISCHRS_ISBLKS_ISFIFOS_ISSOCK)clsrrs ris_special_fileOSUtils.is_special_file-syww~~h''wwx (( <<   <<   ==   ==  r c.[R[5-n[RR U5n[RR U5nUSUR [U5- U-n[RRX55$r) rextseprrdirnamebasename_MAX_FILENAME_LENlenr)rfrsuffixrname temp_filenames rget_temp_filenameOSUtils.get_temp_filenameJsn244wwx(ww)Ct55F CDvM ww||D00r cURUS5n[X25 SSS5 g!,(df  g=f![a URU5 ef=f)Nwb)rr rr)rfrr5fs rallocateOSUtils.allocateQsJ 8T*a!"+**    X &  s: ): 7::ArUr)rjrkrlrmrrrrrrr rrrrnrUr rrrs:)   "$4:1r rcl\rSrSrSS\4SjrSr\S5rSSjr S r SS jr S r S r S rSrSrg)DeferredOpenFileiZrrbcBXlSUlX lX0lX@lg)aA class that defers the opening of a file till needed This is useful for deferring opening of a file till it is needed in a separate thread, as there is a limit of how many open files there can be in a single thread for most operating systems. The file gets opened in the following methods: ``read()``, ``seek()``, and ``__enter__()`` :type filename: str :param filename: The name of the file to open :type start_byte: int :param start_byte: The byte to seek to when the file is opened. :type mode: str :param mode: The mode to use to open the file :type open_function: function :param open_function: The function to use to open the file N) _filename_fileobj _start_byte_mode_open_function)rfrrr open_functions rrhDeferredOpenFile.__init__[s!*" % +r cURcbURURUR5UlURS:wa&URR UR5 gggNr)rrrrrseekr{s r_open_if_needed DeferredOpenFile._open_if_neededvsX ==  // KDM1$ ""4#3#34% !r cUR$r)rr{s rrDeferredOpenFile.name|s ~~r NcXUR5 URRU5$r)rrread)rfamounts rrDeferredOpenFile.reads# }}!!&))r cZUR5 URRU5 gr)rrwrite)rfdatas rrDeferredOpenFile.writes   D!r cZUR5 URRX5 gr)rrr)rfwherewhences rrDeferredOpenFile.seeks   5)r chURc UR$URR5$r)rrtellr{s rrDeferredOpenFile.tells+ == ## #}}!!##r c\UR(aURR5 ggr)rcloser{s rrDeferredOpenFile.closes == MM   ! r c&UR5 U$r)rr{s r __enter__DeferredOpenFile.__enter__s  r c$UR5 grrrfrxr*s r__exit__DeferredOpenFile.__exit__  r )rrrrrrr)rjrkrlrmrrhrrrrrrrrrr rnrUr rrrZsJ,-D,65 *"*$ "r rc\rSrSrSSjr\SSj5rSrSSjrSr Sr S r S r SS jr S rS rSrSrSrSrSrg)riNcXlURR5UlURURUURUS9UlSUlX@lUc/UlXPlX`lUcX`lgg)a Given a file object shown below:: |___________________________________________________| 0 | | full_file_size |----chunk_size---| f.tell() :type fileobj: file :param fileobj: File like object :type chunk_size: int :param chunk_size: The max chunk size to read. Trying to read pass the end of the chunk size will behave like you've reached the end of the file. :type full_file_size: int :param full_file_size: The entire content length associated with ``fileobj``. :type callbacks: A list of function(amount_read) :param callbacks: Called whenever data is read from this object in the order provided. :type enable_callbacks: boolean :param enable_callbacks: True if to run callbacks. Otherwise, do not run callbacks :type close_callbacks: A list of function() :param close_callbacks: Called when close is called. The function should take no arguments. )requested_sizeractual_file_sizerN) rrr_calculate_file_size_size _amount_read _callbacks_callbacks_enabled_close_callbacks)rfrrrrNrrs rrhReadFileChunk.__init__sT ==--/.. MM%''+ /  #   DO"2 /  "$3 ! #r c[US5nURU5 [R"UR 55R nU"XcXtU5$)aConvenience factory function to create from a filename. :type start_byte: int :param start_byte: The first byte from which to start reading. :type chunk_size: int :param chunk_size: The max chunk size to read. Trying to read pass the end of the chunk size will behave like you've reached the end of the file. :type full_file_size: int :param full_file_size: The entire content length associated with ``fileobj``. :type callbacks: function(amount_read) :param callbacks: Called whenever data is read from this object. :type enable_callbacks: bool :param enable_callbacks: Indicate whether to invoke callback during read() calls. :rtype: ``ReadFileChunk`` :return: A new instance of ``ReadFileChunk`` r)rrrfstatfilenost_size)rrrrrNrr file_sizes rrReadFileChunk.from_filenamesGD 4  zHHQXXZ(00 1)8HIIr c XC- n[XR5$r)min)rfrrrrmax_chunk_sizes rr"ReadFileChunk._calculate_file_sizes*6>22r cZ[URUR- S5nUcUnO [X!5nURR U5nU=R[ U5- slURb0UR(a[UR[ U55 U$r) maxrrrrrrrrrW)rfr amount_leftamount_to_readrs rrReadFileChunk.reads$**t'8'88!< >(N 5N}}!!.1 SY& ?? &4+B+B %doos4y A r cUR5 [URS5(aURR5 gg)Nr-)enable_callbackr&rr-r{s rr-!ReadFileChunk.signal_transferrings5  4=="7 8 8 MM - - / 9r cUR5 [URS5(aURR5 gg)Nr%)disable_callbackr&rr%r{s rr%%ReadFileChunk.signal_not_transferrings5  4=="; < < MM 1 1 3 =r cSUlgNTrr{s rr(ReadFileChunk.enable_callbacks "&r cSUlg)NFr/r{s rr+ReadFileChunk.disable_callback!s "'r c6US;a[SUS35eXR- nUS:XaXR- nOUS:XaXR- nURR [ XR55 URbuUR(ad[ [XR- UR5S5n[URUR5nX4- n[URUS9 [ XR- S5Ulg)N)rr9zinvalid whence (z, should be 0, 1 or 2)r9r4rrS) ValueErrorrrrrrr#rrrrW)rfrr bounded_wherebounded_amount_readrs rrReadFileChunk.seek$s  "/x7MNO O !!! Q; && &E q[ ZZ E 3u&6&678 ?? &4+B+BE,<,<$rr rFrnrUr rrrss ;4z  $J$JL3 0 4 '(=0 !r rc(\rSrSrSrSSjrSrSrg)StreamReaderProgressi\z r )rrLr)rjrkrlrmrrhrrnrUr rrJrJ\sF! r rJc\rSrSrSrg)NoResourcesAvailableikrUN)rjrkrlrmrnrUr rrRrRksr rRc*\rSrSrSrSSjrSrSrg) TaskSemaphoreioc:[R"U5Ulg)zaA semaphore for the purpose of limiting the number of tasks :param count: The size of semaphore N)r Semaphore _semaphorerfcounts rrhTaskSemaphore.__init__ps $--e4r c[RSU5 URRU5(d[ SUS35eg)aAcquire the semaphore :param tag: A tag identifying what is acquiring the semaphore. Note that this is not really needed to directly use this class but is needed for API compatibility with the SlidingWindowSemaphore implementation. :param block: If True, block until it can be acquired. If False, do not block and raise an exception if cannot be acquired. :returns: A token (can be None) to use when releasing the semaphore Acquiring %sCannot acquire tag ''N)loggerdebugrWacquirerR)rftagblockings rraTaskSemaphore.acquirewsA  ^S)&&x00&)=cU!'DE E1r cn[RSUSU35 URR5 g)aDRelease the semaphore :param tag: A tag identifying what is releasing the semaphore :param acquire_token: The token returned from when the semaphore was acquired. Note that this is not really needed to directly use this class but is needed for API compatibility with the SlidingWindowSemaphore implementation. zReleasing acquire /N)r_r`rWrelease)rfrb acquire_tokens rrgTaskSemaphore.releases.  )#a ?@ !r )rWNT)rjrkrlrmrhrargrnrUr rrTrTos5F "r rTc4\rSrSrSrSrSrS SjrSrSr g) SlidingWindowSemaphoreiaA semaphore used to coordinate sequential resource access. This class is similar to the stdlib BoundedSemaphore: * It's initialized with a count. * Each call to ``acquire()`` decrements the counter. * If the count is at zero, then ``acquire()`` will either block until the count increases, or if ``blocking=False``, then it will raise a NoResourcesAvailable exception indicating that it failed to acquire the semaphore. The main difference is that this semaphore is used to limit access to a resource that requires sequential access. For example, if I want to access resource R that has 20 subresources R_0 - R_19, this semaphore can also enforce that you only have a max range of 10 at any given point in time. You must also specify a tag name when you acquire the semaphore. The sliding window semantics apply on a per tag basis. The internal count will only be incremented when the minimum sequence number for a tag is released. cXl[[5Ul0Ul[ R "5Ul[ R"UR5Ul 0Ul gr) rrr1_tag_sequences_lowest_sequencerrr Condition _condition_pending_releaserXs rrhSlidingWindowSemaphore.__init__sH )#. "^^% #--djj9 "r chUR URsSSS5 $!,(df  g=frrr{s rr$SlidingWindowSemaphore.current_counts ZZ;;ZZrc<[RSU5 URR5 URS:XaRU(d[ SUS35eURS:Xa,URR 5 URS:XaM,URUnUS:XaX0RU'URU==S- ss'U=RS-slUURR5 $!URR5 f=f)Nr\rr]r^r9) r_r`rqrarrRwaitrnrorg)rfrbrcsequence_numbers rraSlidingWindowSemaphore.acquires ^S) ! &{{a.1EcU!/LMM++*,,.++*#11#6O!#-<%%c*    $ ) $ KK1 K" OO # # %DOO # # %sA C?AC??DcUn[RSX5 URR5 XR;a[ SU35eURUnUR UU:XaUR U==S- ss'U=RS- slURR5 URRU/5nU(a]UR UUS:Xa=UR5 UR U==S- ss'U=RS- slOOU(aM]OvUR UUs=:aU:aKO OHURRU/5RU5 URURSS9 O[ SUSU35eURR5 g!URR5 f=f) NzReleasing acquire %s/%sz"Attempted to release unknown tag: r9T)reversez-Attempted to release unknown sequence number z for tag: )r_r`rqrarnr5rornotifyrrgetpop setdefaultrIsortrg)rfrbrhrx max_sequencequeueds rrgSlidingWindowSemaphore.releases' .E ! &--- #EcU!KLL..s3L$$S)_<%%c*a/* q &&(..223;,,S1VBZ? --c2a72 q(  f&&s+oL L%%00b9@@#%%c*///= C&'z#8 OO # # %DOO # # %sDG 9A7G G')rqrrrorrrnNrj) rjrkrlrmrrhrrargrnrUr rrlrls,#&,$&r rlc:\rSrSr\\\4SjrSSjrSr Sr Sr g) ChunksizeAdjusteric(XlX lX0lgr)max_sizemin_size max_parts)rfrrrs rrhChunksizeAdjuster.__init__s !  "r NcPUnUbURX25nURU5$)azGet a chunksize close to current that fits within all S3 limits. :type current_chunksize: int :param current_chunksize: The currently configured chunksize. :type file_size: int or None :param file_size: The size of the file to upload. This might be None if the object being transferred has an unknown size. :returns: A valid chunksize that fits within configured limits. )_adjust_for_max_parts_adjust_for_chunksize_limits)rfcurrent_chunksizer chunksizes radjust_chunksize"ChunksizeAdjuster.adjust_chunksizes0&  229HI00;;r c XR:a2[RSURSUS35 UR$XR:a2[RSURSUS35 UR$U$)Nz5Chunksize greater than maximum chunksize. Setting to  from .z2Chunksize less than minimum chunksize. Setting to )rr_r`r)rfrs rr.ChunksizeAdjuster._adjust_for_chunksize_limitss }} , LL"mm_F3D2EQH ==  . LL"mm_F3D2EQH == $ $r cBUn[[R"U[U5- 55nX@R:aAUS-n[[R"U[U5- 55nX@R:aMAX1:wa[ R SUSUS35 U$)Nr4zPChunksize would result in the number of parts exceeding the maximum. Setting to rr)r1r2r3r4rr_r`)rfrrrr=s rr'ChunksizeAdjuster._adjust_for_max_parts"s%  )eI.>">?@ ..( NIDIIi% 2B&BCDI..(  ) LL''0k8I7J!M  r )rrrr) rjrkrlrmMAX_SINGLE_UPLOAD_SIZEMIN_UPLOAD_CHUNKSIZE MAX_PARTSrhrrrrnrUr rrrs!(% #<"% r rc>[U5(a SU;aSUS'ggg)z This function has been deprecated, but is kept for backwards compatibility. This function is subject to removal in a future release. ChecksumAlgorithmcrc32Nr )bucket extra_argss radd_s3express_defaultsr3s+ 6""':*'L*1 &'(M"r cp^[U4Sj[55(agTRS[5 g)z@Set the default algorithm to CRC32 if not specified by the user.c3,># UH oT;v M g7frrU)rchecksumrs rr1set_default_checksum_algorithm..?s L2Khz !2KsNr)anyrrr)rs`rset_default_checksum_algorithmr=s* L2K LLL-/IJr )create_nested_clientc&UR"U0UD6$r create_client)sessionrxr*s rrrKs$$d5f55r c [X40UD6$rr)r service_namer*s rrrOs  9& 99r )r)NN);rJloggingr2rrsocketrrr collectionsrbotocore.exceptionsrrrbotocore.httpchecksumrrbotocore.utilsr s3transfer.compatr r r s3transfer.constantsrrrr getLoggerrjr_timeoutS3_RETRYABLE_DOWNLOAD_ERRORSrr%r-r7rBrQrWr`rbrprrrrrJ ExceptionrRrTrlrrrrr ImportErrorrUr rrsd # P.BB:  '$   8 $ NN  O/'3 26<: :"<@2 & &77&/!/!dUUp@@F||~   9 """"J_&]_&D::z2K6D: 666sD D)(D)