/opt/cloudlinux/venv/lib/python3.11/site-packages/smmap/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/smmap/__pycache__/buf.cpython-311.pyc (7488B)
§
\goCÒåã ó2 — d Z ddlZdgZ G d„ d¦ « ZdS )zCModule with a simple buffer implementation using the memory manageré NÚSlidingWindowMapBufferc óz — e Zd ZdZdZddej dfd„Zd„ Zd„ Z d„ Z
d „ Zd
„ Zd„ Z
ddej dfd„Zd
„ Zd„ ZdS )r a A buffer like object which allows direct byte-wise object and slicing into
memory of a mapped file. The mapping is controlled by the provided cursor.
The buffer is relative, that is if you map an offset, index 0 will map to the
first byte at the offset you used during initialization or begin_access
**Note:** Although this type effectively hides the fact that there are mapped windows
underneath, it can unfortunately not be used in any non-pure python method which
needs a buffer or string)Ú_cÚ_sizeNr c ój — || _ |r'| ||||¦ « st d¦ « ‚dS dS )ae Initalize the instance to operate on the given cursor.
:param cursor: if not None, the associated cursor to the file you want to access
If None, you have call begin_access before using the buffer and provide a cursor
:param offset: absolute offset in bytes
:param size: the total size of the mapping. Defaults to the maximum possible size
From that point on, the __len__ of the buffer will be the given size or the file size.
If the size is larger than the mappable area, you can only access the actually available
area, although the length of the buffer is reported to be your given size.
Hence it is in your own interest to provide a proper size !
:param flags: Additional flags to be passed to os.open
:raise ValueError: if the buffer could not achieve a valid statezJFailed to allocate the buffer - probably the given offset is out of boundsN)r Úbegin_accessÚ
ValueError)ÚselfÚcursorÚoffsetÚsizeÚflagss ú[/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/smmap/buf.pyÚ__init__zSlidingWindowMapBuffer.__init__ sW € 𠈌Øð k˜$×+Ò+¨F°F¸DÀ%ÑHÔHð kÝÐiÑjÔjÐjð kð kð kð kó c ó. — | ¦ « d S ©N©Ú
end_access©r
s r Ú__del__zSlidingWindowMapBuffer.__del__( ó € Ø�ŠÑÔÐÐÐr c ó — | S r © r s r Ú __enter__z SlidingWindowMapBuffer.__enter__+ s € ؈r c ó. — | ¦ « d S r r )r
Úexc_typeÚ exc_valueÚ tracebacks r Ú__exit__zSlidingWindowMapBuffer.__exit__. r r c ó — | j S r )r r s r Ú__len__zSlidingWindowMapBuffer.__len__1 s
€ ØŒzÐr c óŒ — t |t ¦ « r)| |j pd|j p| j ¦ « S | j }| ¦ « sJ ‚|dk r
| j |z }| |¦ « s| |d¦ « |
¦ « || ¦ « z
S )Nr é )Ú
isinstanceÚsliceÚ__getslice__ÚstartÚstopr r Úis_validÚincludes_ofsÚ
use_regionÚbufferÚ ofs_begin)r
ÚiÚcs r Ú__getitem__z"SlidingWindowMapBuffer.__getitem__4 s° € Ý�a�ÑÔð IØ×$Ò$ Q¤W \°°1´6Ð3G¸T¼ZÑHÔHÐHØŒGˆØ�zŠz‰|Œ|ÐЈ|؈qŠ5ˆ5Ø”
˜Q‘ˆAØ�~Š~˜aÑ Ô ð Ø
�LŠL˜˜AÑÔÐà�xŠx‰zŒz˜!˜aŸkšk™mœmÑ+Ô,Ð,r c ó4 — | j }| ¦ « sJ ‚|dk r
| j |z }|t j k r| j }|dk r
| j |z }| ¦ « |k rN|| ¦ « k r6| ¦ « }| ¦ « ||z
||z
… S ||z
}|}t ¦ « }|r§| ||¦ « | ¦ « sJ ‚| ¦ « d |… }|t |¦ « z
}|t |¦ « z }t |d¦ « r| ¦ « }|
|¦ « |°§t ¦ « |¦ « S )Nr Útobytes)r r* r ÚsysÚmaxsizer. Úofs_endr- Úlistr, ÚlenÚhasattrr3 ÚappendÚbytesÚjoin) r
r/ Újr0 ÚbÚlÚofsÚmdÚds r r' z#SlidingWindowMapBuffer.__getslice__@ sv € ØŒGˆð �zŠz‰|Œ|ÐЈ|؈qŠ5ˆ5Ø”
˜Q‘ˆAØ•”ÒÐØ”
ˆA؈qŠ5ˆ5Ø”
˜Q‘ˆAØ
�KŠK‰MŒM˜QÒÐ Q¨¯ª©¬¢_ _Ø—’‘
”
ˆAØ—8’8‘:”:˜a !™e A¨¡E˜kÔ*Ð*à�A‘ˆA؈Cõ ‘”ˆBØð
Ø—’˜S !Ñ$Ô$Ð$Ø—z’z‘|”|Ð#Ð#�|Ø—H’H‘J”J˜r ˜r”N�Ø•s˜1‘v”v‘
�Ø•S˜‘V”V‘�õ ˜1˜iÑ(Ô(ð $ØŸ š ™œ�AØ— ’ ˜!‘”�ð ð
õ ‘7”7—<’< Ñ#Ô#Ð#r c ó< — |r|| _ | j �‹| j ¦ « rr| j |||¦ « ¦ « }|r@|| j ¦ « k r| j ¦ « |z
}|| _ |S dS )aU Call this before the first use of this instance. The method was already
called by the constructor in case sufficient information was provided.
For more information no the parameters, see the __init__ method
:param path: if cursor is None the existing one will be used.
:return: True if the buffer can be usedNF)r Ú
is_associatedr, r* Ú file_sizer )r
r r r
r Úress r r z#SlidingWindowMapBuffer.begin_accessd s¡ € ð ð ØˆDŒGð Œ7Ð 4¤7×#8Ò#8Ñ#:Ô#:ÐØ”'×$Ò$ V¨T°5Ñ9Ô9×BÒBÑDÔDˆCØð
"ð
˜$œ'×+Ò+Ñ-Ô-Ò-Ð-Øœ7×,Ò,Ñ.Ô.°Ñ7�Dà!�”
àˆJàˆur c óX — d| _ | j �| j ¦ « dS dS )a Call this method once you are done using the instance. It is automatically
called on destruction, and should be called just in time to allow system
resources to be freed.
Once you called end_access, you must call begin access before reusing this instance!r N)r r Úunuse_regionr s r r z!SlidingWindowMapBuffer.end_access€ s5 € 𠈌
ØŒ7ÐØŒG× Ò Ñ"Ô"Ð"Ð"Ð"ð Ðr c ó — | j S )zC:return: the currently set cursor which provides access to the data)r r s r r zSlidingWindowMapBuffer.cursor‹ s € àŒwˆr )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú __slots__r4 r5 r r r r r" r1 r' r r r r r r r r sä € € € € € ð ð ð€Ið
#¨1°3´;Àað kð kð kð kð"ð ð ðð ð ðð ð ðð ð ð
-ð
-ð
-ð $ð $ð $ðH #'¨q°s´{È!ð ð ð ð ð8#ð #ð #ðð ð ð ð r )rM r4 Ú__all__r r r r ú
rP sX ðØ IÐ IØ
€
€
€
à#Ð
$€ðFð Fð Fð Fð Fñ Fô Fð Fð Fð Fr