
    d                         d Z ddlZddlZddZddZ G d dej                  Z G d d	ej                  Z G d
 dej                  Z G d deej                  Z G d deej	                  Z	d Z
dS )a  Python 'bz2_codec' Codec - bz2 compression encoding.

This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().

Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
    Nstrictc                 X    |dk    sJ t          j        |           t          |           fS Nr   )bz2compressleninputerrorss     %  /croot/python-split_1694437901252/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/python3.11/encodings/bz2_codec.py
bz2_encoder      s.    XLU,,    c                 X    |dk    sJ t          j        |           t          |           fS r   )r   
decompressr   r	   s     r   
bz2_decoder      s.    XN5!!3u::..r   c                       e Zd ZddZddZdS )Codecr   c                 "    t          ||          S N)r   selfr
   r   s      r   encodezCodec.encode       %(((r   c                 "    t          ||          S r   )r   r   s      r   decodezCodec.decode   r   r   Nr   )__name__
__module____qualname__r   r    r   r   r   r      s<        ) ) ) )) ) ) ) ) )r   r   c                   $    e Zd ZddZddZd ZdS )	IncrementalEncoderr   c                 T    |dk    sJ || _         t          j                    | _        d S r   )r   r   BZ2Compressorcompressobjr   r   s     r   __init__zIncrementalEncoder.__init__   s1    !!!!,..r   Fc                     |r6| j                             |          }|| j                                         z   S | j                             |          S r   )r%   r   flush)r   r
   finalcs       r   r   zIncrementalEncoder.encode#   sQ     	4 ))%00At'--////#,,U333r   c                 6    t          j                    | _        d S r   )r   r$   r%   r   s    r   resetzIncrementalEncoder.reset*   s    ,..r   Nr   F)r   r   r   r'   r   r.   r    r   r   r"   r"      sK        / / / /
4 4 4 4/ / / / /r   r"   c                   $    e Zd ZddZddZd ZdS )	IncrementalDecoderr   c                 T    |dk    sJ || _         t          j                    | _        d S r   )r   r   BZ2Decompressordecompressobjr&   s     r   r'   zIncrementalDecoder.__init__.   s1    !!!! 022r   Fc                 Z    	 | j                             |          S # t          $ r Y dS w xY w)N )r4   r   EOFError)r   r
   r*   s      r   r   zIncrementalDecoder.decode3   s@    	%00777 	 	 	22	s    
**c                 6    t          j                    | _        d S r   )r   r3   r4   r-   s    r   r.   zIncrementalDecoder.reset9   s     022r   Nr   r/   )r   r   r   r'   r   r.   r    r   r   r1   r1   -   sK        3 3 3 3
   3 3 3 3 3r   r1   c                       e Zd ZeZdS )StreamWriterNr   r   r   bytescharbuffertyper    r   r   r:   r:   <           NNNr   r:   c                       e Zd ZeZdS )StreamReaderNr;   r    r   r   r@   r@   ?   r>   r   r@   c            
      v    t          j        dt          t          t          t
          t          t          d          S )Nr   F)namer   r   incrementalencoderincrementaldecoderstreamwriterstreamreader_is_text_encoding)codecs	CodecInfor   r   r"   r1   r:   r@   r    r   r   getregentryrJ   D   s4    --!!	 	 	 	r   r   )__doc__rH   r   r   r   r   r"   r1   r:   r@   rJ   r    r   r   <module>rL      sH     



- - - -/ / / /) ) ) ) )FL ) ) )/ / / / /2 / / / 3 3 3 3 32 3 3 3    5&-       5&-   

 
 
 
 
r   