<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
†Üäh	  ã               @   s
  d Z ddlZddlZdd„ eddƒD ƒ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 ƒdd„ eddƒD ƒ dd„ eddƒD ƒ Zded< ded	< d
ed< ded< ded< ded< dd„ ZejdƒZdd„ eddƒD ƒdd„ eddƒD ƒ Z	dd„ Z
dS )zEncoding related utilities.é    Nc             C   s   g | ]}t |ƒ‘qS © )Úchr)Ú.0Úir   r   ú#/usr/lib/python3.6/text_encoding.pyú
<listcomp>%   s    r   é   z\té	   z\né
   z\ré   z\'é'   z\"é"   z\\é\   c             C   s   g | ]}d | ‘qS )z\%03or   )r   r   r   r   r   r   /   s    é    c             C   s   g | ]}t |ƒ‘qS r   )r   )r   r   r   r   r   r   0   s    é   c             C   s   g | ]}d | ‘qS )z\%03or   )r   r   r   r   r   r   1   s    c                sL   t | tjƒrtndd„ ‰ |r4dj‡ fdd„| D ƒƒS dj‡ fdd„| D ƒƒS )a-  Escape a bytes string for use in an ascii protocol buffer.

  text.encode('string_escape') does not seem to satisfy our needs as it
  encodes unprintable characters using two-digit hex escapes whereas our
  C++ unescaping function allows hex escapes to be any length.  So,
  "1".encode('string_escape') ends up being "\x011", which will be
  decoded in C++ as a single-character string with char code 0x11.

  Args:
    text: A byte string to be escaped
    as_utf8: Specifies if result should be returned in UTF-8 encoding
  Returns:
    Escaped string
  c             S   s   | S )Nr   )Úxr   r   r   Ú<lambda>L   s    zCEscape.<locals>.<lambda>Ú c             3   s   | ]}t ˆ |ƒ V  qd S )N)Ú_cescape_utf8_to_str)r   Úc)ÚOrdr   r   ú	<genexpr>N   s    zCEscape.<locals>.<genexpr>c             3   s   | ]}t ˆ |ƒ V  qd S )N)Ú_cescape_byte_to_str)r   r   )r   r   r   r   O   s    )Ú
isinstanceÚsixZstring_typesÚordÚjoin)ÚtextZas_utf8r   )r   r   ÚCEscape;   s    r   z"(\\+)x([0-9a-fA-F])(?![0-9a-fA-F])c             C   s   g | ]}t |ƒ‘qS r   )r   )r   r   r   r   r   r   S   s    c             C   s   g | ]}d | ‘qS )z\%03or   )r   r   r   r   r   r   T   s    c             C   sP   dd„ }t j|| ƒ}ttkr&|jdƒS djdd„ |D ƒƒ}|jdƒjdƒjd	ƒS )
zDUnescape a text string with C-style escape sequences to UTF-8 bytes.c             S   s4   t | jdƒƒd@ r*| jdƒd | jdƒ S | jdƒS )Né   Zx0é   r   )ÚlenÚgroup)Úmr   r   r   Ú
ReplaceHexZ   s    zCUnescape.<locals>.ReplaceHexZstring_escaper   c             s   s   | ]}t t|ƒ V  qd S )N)Ú_cescape_highbit_to_strr   )r   r   r   r   r   r   g   s    zCUnescape.<locals>.<genexpr>ÚasciiZunicode_escapeZraw_unicode_escape)Ú_CUNESCAPE_HEXÚsubÚstrÚbytesÚdecoder   Úencode)r   r$   Úresultr   r   r   Ú	CUnescapeW   s    	

r.   )Ú__doc__Úrer   Úranger   r   r   Úcompiler'   r%   r.   r   r   r   r   Ú<module>   s,   &
