o
    7?e]                     @   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< qY[[de	fddZ
edZde	defddZdS )zEncoding related utilities.    Nz\t	   z\n
   z\r   z\""   z\''   z\\\   c                 C      g | ]}t |qS  chr.0ir	   r	   ^/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/google/protobuf/text_encoding.py
<listcomp>+       r      c                 C      g | ]}d | qS z\%03or	   r   r	   r	   r   r   0   r       c                 C   r   r	   r
   r   r	   r	   r   r   1   r      c                 C   r   r   r	   r   r	   r	   r   r   2   r   returnc                    s`   t | t}|r|r| tS |rtndd  |r$d 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>L   s    zCEscape.<locals>.<lambda> c                 3       | ]	}t  | V  qd S r   )_cescape_unicode_to_strr   cZord_r	   r   	<genexpr>N       zCEscape.<locals>.<genexpr>c                 3   r   r   )_cescape_byte_to_strr   r    r	   r   r!   O   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])r*   c                 C   s*   dd }t || }|dddS )zUnescape 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   Z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*   r1   resultr	   r	   r   	CUnescapeU   s   		r8   )__doc__rer'   ranger   itemsbytestringr#   r%   r+   compiler3   bytesr8   r	   r	   r	   r   <module>   s.   


