选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
U e5dDã@s®dZddgZddlmZddlZddlZddlZddlZddlZej dkrXddl Z dZ n ddl Z dZ ej ejBZd Ze r~d Znd Zd d „ZGdd„dƒZdZGdd„dƒZdS)z–Provides shared memory for direct access across processes. The API of this package is currently provisional. Refer to the documentation for details. Ú SharedMemoryÚ ShareableListé)ÚpartialNÚntFTéz/psm_Zwnsm_cCs"tttƒd}tt |¡}|S)z6Create a random filename for the shared memory object.é)Ú_SHM_SAFE_NAME_LENGTHÚlenÚ_SHM_NAME_PREFIXÚsecretsZ token_hex)ÚnbytesÚname©rú5/usr/lib64/python3.8/multiprocessing/shared_memory.pyÚ_make_filename&src@sŒeZdZdZdZdZdZdZej Z dZ e r.dndZ ddd „Zd d „Zd d „Zdd„Zedd„ƒZedd„ƒZedd„ƒZdd„Zdd„ZdS)rañCreates a new shared memory block or attaches to an existing shared memory block. Every shared memory block is assigned a unique name. This enables one process to create a shared memory block with a particular name so that a different process can attach to that same shared memory block using that same name. As a resource for sharing data across processes, shared memory blocks may outlive the original process that created them. When one process no longer needs access to a shared memory block that might still be needed by other processes, the close() method should be called. When a shared memory block is no longer needed by any process, the unlink() method should be called to ensure proper cleanup.Néÿÿÿÿi€TFrc Csl|dkstdƒ‚|r0ttjB|_|dkr0tdƒ‚|dkrL|jtj@sLtdƒ‚t�rH|dkr tƒ}ztj ||j|j d�|_ Wnt k r’YqZYnX||_ qÎqZn.|jr®d|n|}tj ||j|j d�|_ ||_ z<|ræ|ræt |j |¡t |j ¡}|j}t |j |¡|_Wn tk �r*| ¡‚YnXddlm}||j d ƒ�n|�rþ|dk�r^tƒn|}t tjtjtj|d ?d @|d @|¡}zXt ¡}|tjk�rÌ|dk �rÄt t j!t "t j!¡|tjƒ‚nW¢�qNtjd ||d �|_W5t |¡X||_ �qV�qNnX||_ t #tj$d|¡}zt %|tj$ddd¡} W5t |¡Xt &| ¡}tjd ||d �|_||_'t(|jƒ|_)dS)Nrz!'size' must be a positive integerz4'size' must be a positive number different from zeroz&'name' can only be None if create=True)Úmodeú/é)ÚregisterÚ shared_memoryé lÿÿr)ZtagnameF)*Ú ValueErrorÚ_O_CREXÚosÚO_RDWRÚ_flagsÚO_EXCLÚ _USE_POSIXrÚ _posixshmemZshm_openÚ_modeÚ_fdÚFileExistsErrorÚ_nameÚ_prepend_leading_slashÚ ftruncateÚfstatÚst_sizeÚmmapÚ_mmapÚOSErrorÚunlinkÚresource_trackerrÚ_winapiZCreateFileMappingZINVALID_HANDLE_VALUEZNULLZPAGE_READWRITEZ CloseHandleZ GetLastErrorZERROR_ALREADY_EXISTSÚerrnoZEEXISTÚstrerrorZOpenFileMappingZ FILE_MAP_READZ MapViewOfFileZVirtualQuerySizeÚ_sizeÚ memoryviewÚ_buf) Úselfr ÚcreateÚsizeZstatsrZ temp_nameZh_mapZlast_error_codeZp_bufrrrÚ__init__Is¦ ý  ý   ú   ü  ýû  zSharedMemory.__init__cCs&z | ¡Wntk r YnXdS©N)Úcloser*©r3rrrÚ__del__µs zSharedMemory.__del__cCs|j|jd|jffS)NF)Ú __class__r r5r9rrrÚ __reduce__»s ýþzSharedMemory.__reduce__cCs|jj›d|j›d|j›d�S)Nú(z, size=ú))r;Ú__name__r r5r9rrrÚ__repr__ÅszSharedMemory.__repr__cCs|jS)z4A memoryview of contents of the shared memory block.)r2r9rrrÚbufÈszSharedMemory.bufcCs.|j}tr*|jr*|j d¡r*|jdd…}|S)z4Unique name that identifies the shared memory block.rrN)r#rr$Ú startswith)r3Z reported_namerrrr Ís   zSharedMemory.namecCs|jS)zSize in bytes.)r0r9rrrr5ÖszSharedMemory.sizecCsX|jdk r|j ¡d|_|jdk r4|j ¡d|_trT|jdkrTt |j¡d|_dS)zkCloses access to the shared memory from this instance but does not destroy the shared memory block.Nrr)r2Úreleaser)r8rr!rr9rrrr8Ûs     zSharedMemory.closecCs2tr.|jr.ddlm}t |j¡||jdƒdS)z÷Requests that the underlying shared memory block be destroyed. In order to ensure proper cleanup of resources, unlink should be called once (and only once) across all processes which have access to the shared memory block.r)Ú unregisterrN)rr#r,rDrZ shm_unlink)r3rDrrrr+ès   zSharedMemory.unlink)NFr)r?Ú __module__Ú __qualname__Ú__doc__r#r!r)r2rrrr rr$r6r:r<r@ÚpropertyrAr r5r8r+rrrrr0s(  l     Úutf8c @seZdZdZedededededdj diZ dZ d d „d d „d d „d d „dœZ e dd„ƒZd6ddœdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zed$d%„ƒZed&d'„ƒZed(d)„ƒZed*d+„ƒZed,d-„ƒZed.d/„ƒZed0d1„ƒZd2d3„Z d4d5„Z!dS)7ra‰Pattern for a mutable list-like object shareable via a shared memory block. It differs from the built-in list type in that these lists can not change their overall length (i.e. no append, insert, etc.) Because values are packed into a memoryview as bytes, the struct packing format for any storable value must require no more than 8 characters to describe its format.ÚqÚdzxxxxxxx?z%dsNzxxxxxx?xécCs|Sr7r©ÚvaluerrrÚ ózShareableList.cCs| d¡ t¡S©Nó)ÚrstripÚdecodeÚ _encodingrMrrrrO rPcCs | d¡SrQ)rSrMrrrrO rPcCsdSr7r)Z_valuerrrrO rP)rrrécCs:t|ttdjfƒsdSt|tƒr$dSt|tƒr2dSdSdS)z´Used in concert with _back_transforms_mapping to convert values into the appropriate Python objects when retrieving them from the list as well as when storing them.NrrrrV)Ú isinstanceÚstrÚbytesr;rMrrrÚ_extract_recreation_codes  z&ShareableList._extract_recreation_code©r csr|dk rv‡fdd„|Dƒ}t|ƒˆ_t‡fdd„|Dƒƒˆ_‡fdd„|Dƒ}t dˆjd |¡ˆjˆj ¡}nd}|dk r–|dkr–t |ƒˆ_ nt |d |d �ˆ_ |dk �rNt ‰tj dˆjˆj jd ˆjfˆjžŽtj d |¡ˆj jˆjf‡fd d„|DƒžŽtj ˆjˆj jˆjf‡fd d„|DƒžŽtj ˆj ˆj jˆjf|žŽn tˆƒˆ_t ˆjˆj jd¡ˆ_dS)NcsPg|]H}t|ttfƒs$ˆjt|ƒn&ˆjt|ƒˆjt|ƒˆjdf‘qS)r)rWrXrYÚ_types_mappingÚtypeÚ _alignmentr ©Ú.0Úitemr9rrÚ s ü ÿ ÿz*ShareableList.__init__..c3s0|](}|ddkrˆjnt|dd…ƒVqdS)rÚsN)r^Úint)r`Úfmtr9rrÚ *sÿz)ShareableList.__init__..csg|]}ˆ |¡‘qSr)rZr_r9rrrb.srJÚrLT)r4r5rc3s&|]}t|tƒr| ˆ¡n|VqdSr7)rWrXÚencode©r`Úv©Ú_encrrrfMsc3s|]}| ˆ¡VqdSr7)rhrirkrrrfSs)r Ú _list_lenÚtupleÚ_allocated_bytesÚstructZcalcsizeÚ_format_size_metainfoÚjoinÚ_format_packing_metainfoÚ_format_back_transform_codesrÚshmrUÚ pack_intorAÚ_offset_data_startÚ_offset_packing_formatsÚ_offset_back_transform_codesÚ unpack_from)r3Zsequencer Z_formatsZ_recreation_codesZrequested_sizer)rlr3rr6sz ú  þ  ÿÿþýÿ  üûýüýüýü ýzShareableList.__init__cCsj|dkr |n||j}||jks*|jdkr2tdƒ‚t d|jj|j|d¡d}| d¡}| t ¡}|S)z>Gets the packing format for a single value stored in the list.rú Requested position out of range.Ú8srLrR) rmÚ IndexErrorrprzrurArxrSrTrU)r3ÚpositionrjreÚ fmt_as_strrrrÚ_get_packing_formatds ýü  z!ShareableList._get_packing_formatcCs\|dkr |n||j}||jks*|jdkr2tdƒ‚t d|jj|j|¡d}|j|}|S)z9Gets the back transformation function for a single value.rr{Úb)rmr}rprzrurAryÚ_back_transforms_mapping)r3r~Útransform_codeZtransform_functionrrrÚ_get_back_transformtsýü z!ShareableList._get_back_transformcCs~|dkr |n||j}||jks*|jdkr2tdƒ‚t d|jj|j|d| t¡¡|  |¡}t d|jj|j ||¡dS)zvSets the packing format and back transformation code for a single value in the list at the specified position.rr{r|rLr�N) rmr}rprvrurArxrhrUrZry)r3r~rrNrƒrrrÚ!_set_packing_format_and_transform„s  ü üz/ShareableList._set_packing_format_and_transformcCsjz6|jt|jd|…ƒ}t | |¡|jj|¡\}Wntk rRtdƒ‚YnX|  |¡}||ƒ}|S)Nzindex out of range) rwÚsumrorprzr€rurAr}r„)r3r~ÚoffsetrjZback_transformrrrÚ __getitem__›sÿý  zShareableList.__getitem__cCsæz&|jt|jd|…ƒ}| |¡}Wntk rBtdƒ‚YnXt|ttfƒsf|jt |ƒ}|}nZt|tƒrz|  t ¡n|}t |ƒ|j|kr˜t dƒ‚|ddkrª|}n|jt|j|f}| |||¡t ||jj||¡dS)Nzassignment index out of rangez(bytes/str item exceeds available storagerrc)rwr†ror€r}rWrXrYr\r]rhrUr rr…rprvrurA)r3r~rNr‡Zcurrent_formatZ new_formatZ encoded_valuerrrÚ __setitem__¬s6ÿÿ ÿ ÿýzShareableList.__setitem__cCst|j|jjd�dfS)Nr[r)rr;rur r9rrrr<ÊszShareableList.__reduce__cCst d|jjd¡dS)NrJr)rprzrurAr9rrrÚ__len__ÍszShareableList.__len__cCs"|jj›dt|ƒ›d|jj›d�S)Nr=z, name=r>)r;r?Úlistrur r9rrrr@ÐszShareableList.__repr__csd ‡fdd„tˆjƒDƒ¡S)z>The struct packing format used by all currently stored values.rgc3s|]}ˆ |¡VqdSr7)r€)r`Úir9rrrfÖsz'ShareableList.format..)rrÚrangermr9rr9rÚformatÓsÿzShareableList.formatcCs |j›d�S)z=The struct packing format used for metainfo on storage sizes.rJ©rmr9rrrrqÚsz#ShareableList._format_size_metainfocCs d|jS)z?The struct packing format used for the values' packing formats.r|r�r9rrrrsßsz&ShareableList._format_packing_metainfocCs d|jS)z?The struct packing format used for the values' back transforms.r�r�r9rrrrtäsz*ShareableList._format_back_transform_codescCs|jddS)NrrLr�r9rrrrwész ShareableList._offset_data_startcCs|jt|jƒSr7)rwr†ror9rrrrxísz%ShareableList._offset_packing_formatscCs|j|jdS)NrL)rxrmr9rrrryñsz*ShareableList._offset_back_transform_codescst‡fdd„|DƒƒS)zCL.count(value) -> integer -- return number of occurrences of value.c3s|]}ˆ|kVqdSr7r)r`ÚentryrMrrrføsz&ShareableList.count..)r†)r3rNrrMrÚcountõszShareableList.countcCs4t|ƒD]\}}||kr|Sqt|›d�ƒ‚dS)zpL.index(value) -> integer -- return first index of value. Raises ValueError if the value is not present.z not in this containerN)Ú enumerater)r3rNr~r�rrrÚindexús zShareableList.index)N)"r?rErFrGrdÚfloatÚboolrXrYr;r\r^r‚Ú staticmethodrZr6r€r„r…rˆr‰r<rŠr@rHrŽrqrsrtrwrxryr‘r“rrrrrös^ úü F       )rGÚ__all__Ú functoolsrr(rr.rpr r r-rrÚO_CREATrrrr rrrUrrrrrÚs,    E