a
    Sicx  ã                   @   sæ   d Z ddlZi Zded< ded< ded< d	ed
< ded< ded< dd„ eddƒD ƒZe ¡ D ]\ZZeee< q\dd„ eddƒD ƒdd„ eddƒD ƒ dd„ eddƒD ƒ Ze ¡ D ]\ZZeee< q²[[dd„ Z	e 
d¡Zdd„ ZdS )zEncoding related utilities.é    Nz\té	   z\né
   z\ré   z\"é"   z\'é'   z\\é\   c                 C   s   g | ]}t |ƒ‘qS © ©Úchr©Ú.0Úir   r   úY/var/www/html/django/DPS/env/lib/python3.9/site-packages/google/protobuf/text_encoding.pyÚ
<listcomp>+   ó    r   é   c                 C   s   g | ]}d | ‘qS ©z\%03or   r   r   r   r   r   0   r   é    c                 C   s   g | ]}t |ƒ‘qS r   r	   r   r   r   r   r   1   r   é   c                 C   s   g | ]}d | ‘qS r   r   r   r   r   r   r   2   r   c                    s`   t | tƒ}|r|r|  t¡S |r$tndd„ ‰ |rHd ‡ fdd„| D ƒ¡S d ‡ fdd„| D ƒ¡S )am  Escape a bytes string for use in an text protocol buffer.

  Args:
    text: A byte string to be escaped.
    as_utf8: Specifies if result may contain non-ASCII characters.
        In Python 3 this allows unescaped non-ASCII Unicode characters.
        In Python 2 the return value will be valid UTF-8 rather than only ASCII.
  Returns:
    Escaped string (str).
  c                 S   s   | S ©Nr   )Úxr   r   r   Ú<lambda>M   r   zCEscape.<locals>.<lambda>Ú c                 3   s   | ]}t ˆ |ƒ V  qd S r   )Ú_cescape_unicode_to_str©r   Úc©Zord_r   r   Ú	<genexpr>O   r   zCEscape.<locals>.<genexpr>c                 3   s   | ]}t ˆ |ƒ V  qd S r   )Ú_cescape_byte_to_strr   r   r   r   r   P   r   )Ú
isinstanceÚstrÚ	translateÚ_cescape_chr_to_symbol_mapÚordÚjoin)ÚtextZas_utf8Ztext_is_unicoder   r   r   ÚCEscape8   s    

r&   z"(\\+)x([0-9a-fA-F])(?![0-9a-fA-F])c                 C   s*   dd„ }t  || ¡}| d¡ d¡ d¡S )z”Unescape a text string with C-style escape sequences to UTF-8 bytes.

  Args:
    text: The data to parse in a str.
  Returns:
    A byte string.
  c                 S   s4   t |  d¡ƒd@ r*|  d¡d |  d¡ S |  d¡S )Né   Úx0é   r   )ÚlenÚgroup)Úmr   r   r   Ú
ReplaceHex`   s    zCUnescape.<locals>.ReplaceHexzutf-8Úunicode_escapeZraw_unicode_escape)Ú_CUNESCAPE_HEXÚsubÚencodeÚdecode)r%   r-   Úresultr   r   r   Ú	CUnescapeV   s    
	
ÿýr4   )Ú__doc__Úrer"   Úranger   ÚitemsÚbyteÚstringr   r&   Úcompiler/   r4   r   r   r   r   Ú<module>   s,   
ÿþ

