HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/charset_normalizer/__pycache__/utils.cpython-37.pyc
B

�b\$�@s,yddlZWnek
r(ddlZYnXddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZmZmZmZmZddlmZdd	lmZmZmZmZmZmZe
ed
�eed�dd
��Ze
ed
�eed�dd��Ze
ed
�eeed�dd��Z e
ed
�eed�dd��Z!eed�dd�Z"e
ed
�eed�dd��Z#e
ed
�eed�dd��Z$e
ed
�eed�dd��Z%e
ed
�eed�dd��Z&e
ed
�eed�dd��Z'eed�d d!�Z(e
ed
�eed�d"d#��Z)e
ed
�eed�d$d%��Z*e
ed
�eed�d&d'��Z+e
ed
�eed�d(d)��Z,e
ed
�eed�d*d+��Z-e
e.e�d
�eed,�d-d.��Z/dNe0e1eed0�d1d2�Z2e
d3d
�eed4�d5d6��Z3e0eeee0fd7�d8d9�Z4eed:�d;d<�Z5dOeeed>�d?d@�Z6eeedA�dBdC�Z7eee8dD�dEdF�Z9eeedD�dGdH�Z:dIej;dJfee1eddK�dLdM�Z<dS)P�N)�IncrementalDecoder)�aliases)�	lru_cache)�findall)�List�Optional�Set�Tuple�Union)�MultibyteIncrementalDecoder�)�ENCODING_MARKS�IANA_SUPPORTED_SIMILAR�RE_POSSIBLE_ENCODING_INDICATION�UNICODE_RANGES_COMBINED�UNICODE_SECONDARY_RANGE_KEYWORD�UTF8_MAXIMAL_ALLOCATION)�maxsize)�	character�returncCsTyt�|�}Wntk
r"dSXd|kpRd|kpRd|kpRd|kpRd|kpRd|kS)NFz
WITH GRAVEz
WITH ACUTEzWITH CEDILLAzWITH DIAERESISzWITH CIRCUMFLEXz
WITH TILDE)�unicodedata�name�
ValueError)r�description�r�I/opt/alt/python37/lib/python3.7/site-packages/charset_normalizer/utils.py�is_accentuatedsrcCs.t�|�}|s|S|�d�}tt|dd��S)N� r�)rZ
decomposition�split�chr�int)rZ
decomposed�codesrrr�
remove_accent*s


r#cCs.t|�}x t��D]\}}||kr|SqWdS)zK
    Retrieve the Unicode range official name from a single character.
    N)�ordr�items)rZ
character_ord�
range_nameZ	ord_rangerrr�
unicode_range5s
r'cCs,yt�|�}Wntk
r"dSXd|kS)NFZLATIN)rrr)rrrrr�is_latinCs
r(cCs(y|�d�Wntk
r"dSXdS)N�asciiFT)�encode�UnicodeEncodeError)rrrr�is_asciiLs
r,cCs2t�|�}d|krdSt|�}|dkr*dSd|kS)N�PTFZPunctuation)r�categoryr')r�character_category�character_rangerrr�is_punctuationTs
r1cCs:t�|�}d|ksd|krdSt|�}|dkr2dSd|kS)N�S�NTFZForms)rr.r')rr/r0rrr�	is_symbolcs
r4cCst|�}|dkrdSd|kS)NFZ	Emoticons)r')rr0rrr�is_emoticonrsr5cCs&|��s|dkrdSt�|�}d|kS)N>�<�|�>�;�+�,T�Z)�isspacerr.)rr/rrr�is_separator|s
r>cCs|��|��kS)N)�islower�isupper)rrrr�is_case_variable�srAcCst�|�}|dkS)NZCo)rr.)rr/rrr�is_private_use_only�s
rBcCs,yt�|�}Wntk
r"dSXd|kS)NFZCJK)rrr)r�character_namerrr�is_cjk�s
rDcCs,yt�|�}Wntk
r"dSXd|kS)NFZHIRAGANA)rrr)rrCrrr�is_hiragana�s
rEcCs,yt�|�}Wntk
r"dSXd|kS)NFZKATAKANA)rrr)rrCrrr�is_katakana�s
rFcCs,yt�|�}Wntk
r"dSXd|kS)NFZHANGUL)rrr)rrCrrr�	is_hangul�s
rGcCs,yt�|�}Wntk
r"dSXd|kS)NFZTHAI)rrr)rrCrrr�is_thai�s
rH)r&rcst�fdd�tD��S)Nc3s|]}|�kVqdS)Nr)�.0�keyword)r&rr�	<genexpr>�sz-is_unicode_range_secondary.<locals>.<genexpr>)�anyr)r&r)r&r�is_unicode_range_secondary�srM�)�sequence�search_zonercCs�t|t�st�t|�}tt|dt||��jddd��}t|�dkrHdSxJ|D]B}|���	dd�}x,t
��D] \}}||kr�|S||krl|SqlWqNWdS)zW
    Extract using ASCII-only decoder any specified encoding in the first n-bytes.
    Nr)�ignore)�errorsr�-�_)�
isinstance�bytes�	TypeError�lenrr�min�decode�lower�replacerr%)rOrPZseq_len�resultsZspecified_encoding�encoding_alias�
encoding_ianarrr�any_specified_encoding�s 

r`�)rrcCs |dkptt�d�|��jt�S)zQ
    Verify is a specific encoding is a multi byte one based on it IANA name
    >	�utf_8�	utf_32_be�utf_16�	utf_32_le�utf_7�	utf_8_sig�utf_32�	utf_16_le�	utf_16_bezencodings.{})�
issubclass�	importlib�
import_module�formatrr)rrrr�is_multi_byte_encoding�s
ro)rOrcCsJxDtD]<}t|}t|t�r"|g}x|D]}|�|�r(||fSq(WqWdS)z9
    Identify and extract SIG/BOM in given sequence.
    )N�)r
rUrV�
startswith)rO�
iana_encodingZmarksZmarkrrr�identify_sig_or_bom�s



rs)rrrcCs|dkS)N>rhrdr)rrrrr�should_strip_sig_or_bomsrtT)�cp_name�strictrcCsL|���dd�}x$t��D]\}}|||gkr|SqW|rHtd�|���|S)NrSrTz Unable to retrieve IANA for '{}')r[r\rr%rrn)rurvr^r_rrr�	iana_namesrw)�decoded_sequencercCs8t�}x(|D] }t|�}|dkr"q|�|�qWt|�S)N)�setr'�add�list)rxZrangesrr0rrr�
range_scans
r|)�iana_name_a�iana_name_brc	Cs�t|�st|�rdSt�d�|��j}t�d�|��j}|dd�}|dd�}d}x6td�D]*}t|g�}|�|�|�|�krZ|d7}qZW|dS)	Ngzencodings.{}rQ)rRr�r�)rorlrmrnr�rangerVrZ)	r}r~Z	decoder_aZ	decoder_bZid_aZid_bZcharacter_match_count�iZ
to_be_decodedrrr�
cp_similarity+s


r�cCs|tko|t|kS)z�
    Determine if two code page are at least 80% similar. IANA_SUPPORTED_SIMILAR dict was generated using
    the function cp_similarity.
    )r)r}r~rrr�
is_cp_similar@sr��charset_normalizerz)%(asctime)s | %(levelname)s | %(message)s)r�level�
format_stringrcCs:t�|�}|�|�t��}|�t�|��|�|�dS)N)�logging�	getLogger�setLevel�
StreamHandler�setFormatter�	Formatter�
addHandler)rr�r��logger�handlerrrr�set_logging_handlerKs


r�)rN)T)=�unicodedata2r�ImportErrorrlr��codecsrZencodings.aliasesr�	functoolsr�rer�typingrrrr	r
Z_multibytecodecrZconstantr
rrrrr�str�boolrr#r'r(r,r1r4r5r>rArBrDrErFrGrHrXrMrVr!r`rorsrtrwr|�floatr�r��INFOr�rrrr�<module>sr