
    d	                         d Z ddlZddlZej        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j
                  Z
d ZdS )z
Python 'utf-32' Codec
    Nstrictc                 .    t          j        | |d          S )NT)codecsutf_32_decode)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/utf_32.pydecoder
   
   s    vt444    c                   0    e Zd Zd	dZd
dZd Zd Zd ZdS )IncrementalEncoderr   c                 T    t           j                            | |           d | _        d S N)r   r   __init__encoderselfr   s     r	   r   zIncrementalEncoder.__init__   s&    !**4888r   Fc                     | j         Ut          j        || j                  d         }t          j        dk    rt          j        | _         nt          j        | _         |S |                      || j                  d         S )Nr   little)r   r   utf_32_encoder   sys	byteorderutf_32_le_encodeutf_32_be_encode)r   r   finalresults       r	   encodezIncrementalEncoder.encode   sf    <)%==a@F}((%6%6M||E4;//22r   c                 R    t           j                            |            d | _        d S r   )r   r   resetr   r   s    r	   r   zIncrementalEncoder.reset   s$    !''---r   c                     | j         dndS )N   r   )r   r    s    r	   getstatezIncrementalEncoder.getstate    s    
 \)q1r   c                     |r	d | _         d S t          j        dk    rt          j        | _         d S t          j        | _         d S Nr   )r   r   r   r   r   r   r   states     r	   setstatezIncrementalEncoder.setstate'   s>     	7DLLL}((%6%6r   Nr   )F)__name__
__module____qualname__r   r   r   r#   r(    r   r	   r   r      si           3 3 3 3  2 2 27 7 7 7 7r   r   c                   .    e Zd ZddZd Zd Zd Zd ZdS )	IncrementalDecoderr   c                 T    t           j                            | |           d | _        d S r   )r   BufferedIncrementalDecoderr   decoderr   s     r	   r   zIncrementalDecoder.__init__1   s&    )224@@@r   c                    | j         dt          j        ||d|          \  }}}|dk    rt          j        | _         n-|dk    rt          j        | _         n|dk    rt          d          ||fS |                      || j        |          S )Nr         %UTF-32 stream does not start with BOM)r2   r   utf_32_ex_decodeutf_32_le_decodeutf_32_be_decodeUnicodeErrorr   )r   r   r   r   outputconsumedr   s          r	   _buffer_decodez!IncrementalDecoder._buffer_decode5   s    <'vq%@@ *VXyB%6a%6Q"#JKKKH%%||E4;666r   c                 R    t           j                            |            d | _        d S r   )r   r1   r   r2   r    s    r	   r   zIncrementalDecoder.resetB   s$    )//555r   c                     t           j                            |           d         }| j        |dfS t	          t
          j        dk    | j        t           j        u k              }||fS )Nr   r"   big)r   r1   r#   r2   intr   r   r:   )r   r'   addstates      r	   r#   zIncrementalDecoder.getstateF   sk     1::4@@C
 <1:.(??A B Bx  r   c                 8   t           j                            | |           |d         }|dk    r/t          j        dk    rt           j        nt           j        | _        d S |dk    r/t          j        dk    rt           j        nt           j        | _        d S d | _        d S )Nr5   r   rA   )r   r1   r(   r   r   r:   r9   r2   r&   s     r	   r(   zIncrementalDecoder.setstateT   s    )224???aA::"}55 #33!'!8 LLL aZZ"}55 #33!'!8 LLL  DLLLr   Nr)   )r*   r+   r,   r   r>   r   r#   r(   r-   r   r	   r/   r/   0   sd           7 7 7  ! ! !         r   r/   c                   $    e Zd ZddZd ZddZdS )StreamWriterr   c                 V    d | _         t          j                            | ||           d S r   )r   r   rF   r   )r   streamr   s      r	   r   zStreamWriter.__init__d   s*    $$T66:::::r   c                 R    t           j                            |            d | _        d S r   )r   rF   r   r   r    s    r	   r   zStreamWriter.reseth   s$    !!$'''r   c                     | j         Jt          j        ||          }t          j        dk    rt          j        | _         nt          j        | _         |S |                      ||          S r%   )r   r   r   r   r   r   r   )r   r   r   r   s       r	   r   zStreamWriter.encodel   sX    <)%88F}((%6%6M<<v...r   Nr)   )r*   r+   r,   r   r   r   r-   r   r	   rF   rF   c   sK        ; ; ; ;  	/ 	/ 	/ 	/ 	/ 	/r   rF   c                       e Zd Zd ZddZdS )StreamReaderc                 l    t           j                            |            	 | `d S # t          $ r Y d S w xY wr   )r   rL   r   r
   AttributeErrorr    s    r	   r   zStreamReader.resety   sI    !!$'''	 	 	 	DD	s   % 
33r   c                     t          j        ||dd          \  }}}|dk    rt           j        | _        n-|dk    rt           j        | _        n|dk    rt          d          ||fS )Nr   Fr4   r5   r6   r7   )r   r8   r9   r
   r:   r;   )r   r   r   objectr=   r   s         r	   r
   zStreamReader.decode   sn    #E61e<< 	&9?? 1DKK!^^ 1DKKq[[FGGG!!r   Nr)   )r*   r+   r,   r   r
   r-   r   r	   rL   rL   w   s7          	" 	" 	" 	" 	" 	"r   rL   c            	      t    t          j        dt          t          t          t
          t          t                    S )Nzutf-32)namer   r
   incrementalencoderincrementaldecoderstreamreaderstreamwriter)r   	CodecInfor   r
   r   r/   rL   rF   r-   r   r	   getregentryrX      s1    --!!   r   r)   )__doc__r   r   r   r   r
   r   r1   r/   rF   rL   rX   r-   r   r	   <module>rZ      s            
	5 5 5 5!7 !7 !7 !7 !72 !7 !7 !7F1  1  1  1  1 : 1  1  1 f/ / / / /6& / / /(" " " " "6& " " ",	 	 	 	 	r   