Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
bz2.cpython-314.pyc154 linesDownload Raw Back to __pycache__
1+
2��i�.���Rt.ROtRt^RIHt^RIHt^RIt^RI	t	^RI3HtHt^t
^t!RR]P4tRRltR
R	ltR4tR#)z�Interface to the libbzip2 compression library.5 6This module provides a file interface, classes for incremental7(de)compression, and functions for one-shot (de)compression.8�BZ2Filez%Nadeem Vawda <nadeem.vawda@gmail.com>)�open)�_streamsN)�
BZ2Compressor�BZ2Decompressorc��a�]tRt^toRtRR^	/RlltRt]R4t]R4t	]R4t9RtR	tR10t
RtRRltRR
ltRRltRtRRltRRltRtRt]P03RltRtRtVtR#)ra,A file object providing transparent bzip2 (de)compression.11 12A BZ2File can act as a wrapper for an existing file object, or refer13directly to a named file on disk.14 15Note that BZ2File provides a *binary* file interface - data read is16returned as bytes, and data to be written should be given as bytes.17�
compresslevelc�8�RVnRVnRVn^Tu;8:d^	8:gM\R4hVR9d18Rp\pMoVR9dRp\19p\
V4VnMOVR9dRp\20p\
V4VnM/VR9dRp\21p\
V4VnM\RV:24h\V\\\P34'd\W4VnR	VnW@nM<\VR224'g\VR4'dWnW@nM\R4hVP\8XdI\ P"!VP\$\&R
7p\(P*!V4VnR#^VnR#)a�Open a bzip2-compressed file.23 24If filename is a str, bytes, or PathLike object, it gives the25name of the file to be opened. Otherwise, it should be a file26object, which will be used to read or write the compressed data.27 28mode can be 'r' for reading (default), 'w' for (over)writing,29'x' for creating exclusively, or 'a' for appending. These can30equivalently be given as 'rb', 'wb', 'xb', and 'ab'.31 32If mode is 'w', 'x' or 'a', compresslevel can be a number between 133and 9 specifying the level of compression: 1 produces the least34compression, and 9 (default) produces the most compression.35 36If mode is 'r', the input file may be the concatenation of37multiple compressed streams.38NFz%compresslevel must be between 1 and 9�rb�wb�xb�ab�Invalid mode: T�read�writez6filename must be a str, bytes, file or PathLike object)�trailing_error)��rr39)�wr)�xr)�ar
)�_fp�_closefp�_mode�40ValueError�41_MODE_READ�_MODE_WRITEr�_compressor�42isinstance�str�bytes�os�PathLike�
_builtin_open�hasattr�	TypeErrorr�DecompressReaderr�OSError�io�BufferedReader�_buffer�_pos)�self�filename�moder�	mode_code�raws&&&$  �43Lib\bz2.py�__init__�BZ2File.__init__%sN��$�����
���44��]�'�a�'��D�E�E��?�"��D�"�I�
�[�
 ��D�#�I�,�]�;�D��
�[�
 ��D�#�I�,�]�;�D��
�[�
 ��D�#�I�,�]�;�D���4�9�:�:��h��e�R�[�[� 9�:�:�$�X�4�D�H� �D�M�"�J�
�X�v�
&�
&�'�(�G�*D�*D��H�"�J��T�U�U��:�:��#��+�+�D�H�H���9�C��,�,�S�1�D�L��D�I�c��VP'dR#VP\8XdVPP	4MOVP\458Xd;VPPVPP44RVnVP'dVPP	4RVnRVn46RVnR# RTnRTn47RTni;i TP'dTPP	4RTnRTn48RTni RTnRTn49RTni;i;i)z�Flush and close the file.50 51May be called more than once without error. Once the file is52closed, any other operation on it will raise a ValueError.53NF)�closedrrr*�closerrrr�flushr�r,s&r1r7�
BZ2File.closeas����;�;�;��
	$��z�z�Z�'����"�"�$����{�*������t�/�/�5�5�7�8�#'�� �
$��=�=�=��H�H�N�N�$���� %��
�#���� ��� %��
�#����

$��=�=�=��H�H�N�N�$���� %��
�#���� ��� %��
�#���s0�A?C3�,C�C0�3E�5,D7�!E�7E�Ec��VPRJ#)zTrue if this file is closed.N)rr9s&r1r6�BZ2File.closedxs���x�x�4��r4c�N�VP4VPP#)N)�_check_not_closedr�namer9s&r1r?�BZ2File.name}s����� ��x�x�}�}�r4c�4�VP\8XdR#R#)rr54)rrr9s&r1r.�BZ2File.mode�s���z�z�[�0�t�:�d�:r4c�V�VP4VPP4#)z3Return the file descriptor for the underlying file.)r>r�filenor9s&r1rD�BZ2File.fileno�s����� ��x�x��� � r4c�f�VP4;'dVPP4#)z)Return whether the file supports seeking.)�readabler*�seekabler9s&r1rH�BZ2File.seekable�s#���}�}��:�:�4�<�<�#8�#8�#:�:r4c�H�VP4VP\8H#)z/Return whether the file was opened for reading.)r>rrr9s&r1rG�BZ2File.readable�s����� ��z�z�Z�'�'r4c�H�VP4VP\8H#)z/Return whether the file was opened for writing.)r>rrr9s&r1�writable�BZ2File.writable�s����� ��z�z�[�(�(r4c�X�VP4VPPV4#)z�Return buffered data without advancing the file position.55 56Always returns at least one byte of data, unless at EOF.57The exact number of bytes returned is unspecified.58)�_check_can_readr*�peek)r,�ns&&r1rQ�BZ2File.peek�s'��	
�����|�|� � ��#�#r4c�X�VP4VPPV4#)z�Read up to size uncompressed bytes from the file.59 60If size is negative or omitted, read until EOF is reached.61Returns b'' if the file is already at EOF.62)rPr*r�r,�sizes&&r1r�BZ2File.read�s%��	
�����|�|� � ��&�&r4c��VP4V^8d\PpVPP	V4#)z�Read up to size uncompressed bytes, while trying to avoid63making multiple reads from the underlying stream. Reads up to a64buffer's worth of data if size is negative.65 66Returns b'' if the file is at EOF.67)rPr(�DEFAULT_BUFFER_SIZEr*�read1rUs&&r1rZ�
BZ2File.read1�s7��	
�����!�8��)�)�D��|�|�!�!�$�'�'r4c�X�VP4VPPV4#)zBRead bytes into b.68 69Returns the number of bytes read (0 for EOF).70)rPr*�readinto)r,�bs&&r1r]�BZ2File.readinto�s%��71	
�����|�|�$�$�Q�'�'r4c���\V\4'g.\VR4'g\R4hVP	4pVP4VPPV4#)z�Read a line of uncompressed bytes from the file.72 73The terminating newline (if present) is retained. If size is74non-negative, no more than size bytes will be read (in which75case the line may be incomplete). Returns b'' if already at EOF.76�	__index__�Integer argument expected)r�intr$r%rarPr*�readlinerUs&&r1rd�BZ2File.readline�sW���$��$�$��4��-�-�� ;�<�<��>�>�#�D������|�|�$�$�T�*�*r4c���\V\4'g.\VR4'g\R4hVP	4pVP4VPPV4#)z�Read a list of lines of uncompressed bytes from the file.77 78size can be specified to control the number of lines read: no79further lines will be read once the total size of the lines read80so far equals or exceeds size.81rarb)rrcr$r%rarPr*�	readlinesrUs&&r1rg�BZ2File.readlines�sW���$��$�$��4��-�-�� ;�<�<��>�>�#�D������|�|�%�%�d�+�+r4c�B�VP4\V\\34'd
\	V4pM\V4pVPpVPPV4pVPPV4V;PV,
unV#)z�Write a byte string to the file.82 83Returns the number of uncompressed bytes written, which is84always the length of data in bytes. Note that due to buffering,85the file on disk may not reflect the data written until close()86is called.87)�_check_can_writerr �	bytearray�len�88memoryview�nbytesr�compressrrr+)r,�data�length�89compresseds&&  r1r�
BZ2File.write�sy��	
�����d�U�I�.�/�/���Y�F��d�#�D��[�[�F��%�%�.�.�t�4�90������z�"��	�	�V��	��
r4c�@�\PPW4#)z�Write a sequence of byte strings to the file.91 92Returns the number of uncompressed bytes written.93seq can be any iterable yielding byte strings.94 95Line separators are not added between the written byte strings.96)r�97BaseStream�98writelines)r,�seqs&&r1rv�BZ2File.writelines�s���"�"�-�-�d�8�8r4c�X�VP4VPPW4#)a�Change the file position.99 100The new position is specified by offset, relative to the101position indicated by whence. Values for whence are:102 103    0: start of stream (default); offset must not be negative104    1: current stream position105    2: end of stream; offset must not be positive106 107Returns the new file position.108 109Note that seeking is emulated, so depending on the parameters,110this operation may be extremely slow.111)�_check_can_seekr*�seek)r,�offset�whences&&&r1r{�BZ2File.seek�s%��	
�����|�|� � ��0�0r4c��VP4VP\8XdVPP	4#VP112#)z!Return the current file position.)r>rrr*�tellr+r9s&r1r��BZ2File.tells7����� ��:�:��#��<�<�$�$�&�&��y�y�r4)r*rrrrr+N)r)�)�����)�__name__�113__module__�__qualname__�__firstlineno__�__doc__r2r7�propertyr6r?r.rDrHrGrMrQrrZr]rdrgrrvr(�SEEK_SETr{r��__static_attributes__�__classdictcell__)�
__classdict__s@r1rrs������:�A�:�x$�.� �� ������;��;�!�114;�(�115)�116 117$�'�118(�(�+�,��*9�#%�+�+�1�$�r4c�B�RV9dRV9d\RV:24hM-Ve\R4hVe\R4hVe\R4hVPRR4p\WVR7pRV9d.\P!V4p\P119!WsWE4#V#)	a�Open a bzip2-compressed file in binary or text mode.120 121The filename argument can be an actual filename (a str, bytes, or122PathLike object), or an existing file object to read from or write123to.124 125The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or126"ab" for binary mode, or "rt", "wt", "xt" or "at" for text mode.127The default mode is "rb", and the default compresslevel is 9.128 129For binary mode, this function is equivalent to the BZ2File130constructor: BZ2File(filename, mode, compresslevel). In this case,131the encoding, errors and newline arguments must not be provided.132 133For text mode, a BZ2File object is created, and wrapped in an134io.TextIOWrapper instance with the specified encoding, error135handling behavior, and line ending(s).136 137�tr^rz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moder)r)r�replacerr(�
text_encoding�
TextIOWrapper)r-r.r�encoding�errors�newline�bz_mode�binary_files&&&&&&  r1rrs���*�d�{��$�;��4�9�:�:�����O�P�P����M�N�N����N�O�O��l�l�3��#�G��(�=�I�K�138�d�{��#�#�H�-������v�G�G��r4c�d�\V4pVPV4VP4,#)z�Compress a block of data.139 140compresslevel, if given, must be a number between 1 and 9.141 142For incremental compression, use a BZ2Compressor object instead.143)rror8)rpr�comps&& r1roroAs(����'�D��=�=�������-�-r4c��.pV'dY\4pVPV4pTPT4TP'g\R4hTPpK`RPV4# \dT'dK'hi;i)zbDecompress a block of data.144 145For incremental decompression, use a BZ2Decompressor object instead.146zACompressed data ended before the end-of-stream marker was reachedr4)r�147decompressr'�append�eofr�unused_data�join)rp�results�decomp�ress&   r1r�r�Ls���148�G�149� �"��	��#�#�D�)�C�	���s���z�z�z��@�A�
A��!�!���8�8�G�����	����		�s�A4�4B�150B)rrrrror�)r151�	NNN)r�)r��__all__�152__author__�builtinsrr#�compression._commonrr(r!�_bz2rrrrrurror��r4r1�<module>r�sX���-��5�153�*�(�	�	�/��154���z�h�!�!�z�z'�T.�r4
codekingpro/portable-devtools · Team Ai