404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.135.201.101: ~ $
3

m�da�*�@szddlZddlmZddlmZmZddlmZddlm	Z	m
Z
mZmZddl
mZddlmZmZmZdd	lmZdd
lmZddlmZmZmZmZmZee
ed�d
d�Zee
ed�dd�Ze�ee
ed�dd��Z e�ee
ed�dd��Z!d)e
ee"e
ed�dd�Z#ee
ee$d�dd�Z%ee
ed�dd�Z&e
eed �d!d"�Z'ed#d$�d*ee$eeed&�d'd(��Z(dS)+�N)�IncrementalDecoder)�Counter�OrderedDict)�	lru_cache)�Dict�List�Optional�Tuple�)�FREQUENCIES)�KO_NAMES�TOO_SMALL_SEQUENCE�ZH_NAMES)� is_suspiciously_successive_range)�CoherenceMatches)�is_accentuated�is_latin�is_multi_byte_encoding�is_unicode_range_secondary�
unicode_range)�	iana_name�returncs�t|�rtd��tjdj|��j}|dd�}i�d�xltdd�D]^}|jt|g��}|r@t	|�}|dkrjq@t
|�d	kr@|�kr�d�|<�|d
7<�d
7�q@Wt��fdd��D��S)
zF
    Return associated unicode ranges in a single byte code page.
    z.Function not supported on multi-byte code pagezencodings.{}�ignore)�errorsr�@�NFr
cs g|]}�|�dkr|�qS)g333333�?�)�.0�character_range)�character_count�seen_rangesr�/usr/lib/python3.6/cd.py�
<listcomp>2sz*encoding_unicode_range.<locals>.<listcomp>)r�IOError�	importlib�
import_module�formatr�range�decode�bytesrr�sorted)r�decoder�p�i�chunkrr)rr r!�encoding_unicode_ranges(
r/)�
primary_rangercCsDg}x:tj�D].\}}x$|D]}t|�|kr|j|�PqWqW|S)z>
    Return inferred languages used with a unicode range.
    )r�itemsr�append)r0�	languages�language�
characters�	characterrrr!�unicode_range_languages9s


r7cCs>t|�}d}x|D]}d|kr|}PqW|dkr6dgSt|�S)z�
    Single-byte encoding language association. Some code page are heavily linked to particular language(s).
    This function does the correspondence.
    NZLatinzLatin Based)r/r7)rZunicode_rangesr0Zspecified_rangerrr!�encoding_languagesHs
r8cCsb|jd�s&|jd�s&|jd�s&|dkr,dgS|jd�s>|tkrFddgS|jd	�sX|tkr^d
gSgS)z�
    Multi-byte encoding language association. Some code page are heavily linked to particular language(s).
    This function does the correspondence.
    Zshift_�
iso2022_jpZeuc_j�cp932ZJapaneseZgbZChinesezClassical Chinese�
iso2022_krZKorean)�
startswithrr)rrrr!�mb_encoding_languages\s


r=F)r5�ignore_non_latinrc
s�g}d}x�D]}t|�rd}PqWx�tj�D]�\}}d}d}x8|D]0}	|dkr\t|	�r\d}|dkrDt|	�dkrDd}qDW|r�|dkr�q.|dkr�|r�q.t|�}
t�fdd�|D��}||
}|dkr.|j||f�q.Wt|dd�dd�}d	d�|D�S)
zE
    Return associated languages associated to given characters.
    FTcsg|]}|�kr|�qSrr)r�c)r5rr!r"�sz&alphabet_languages.<locals>.<listcomp>g�������?cSs|dS)Nr
r)�xrrr!�<lambda>�sz$alphabet_languages.<locals>.<lambda>)�key�reversecSsg|]}|d�qS)rr)rZcompatible_languagerrr!r"�s)rrr1r�lenr2r*)
r5r>r3Zsource_have_accentsr6r4Zlanguage_charactersZtarget_have_accentsZtarget_pure_latinZlanguage_characterrZcharacter_match_count�ratior)r5r!�alphabet_languagesqs4

rF)r4�ordered_charactersrcs6|tkrtdj|���d}�x|D�]}|t|kr6q"t|dt|j|��}t|t|j|�d�}|d|j|���||j|�d���fdd�|D�jd�}�fdd�|D�jd�}t|�dkr�|dkr�|d	7}q"t|�dkr�|dkr�|d	7}q"|t|�d
k�s|t|�d
kr"|d	7}q"q"W|t|�S)aN
    Determine if a ordered characters list (by occurrence from most appearance to rarest) match a particular language.
    The result is a ratio between 0. (absolutely no correspondence) and 1. (near perfect fit).
    Beware that is function is not strict on the match in order to ease the detection. (Meaning close match is 1.)
    z{} not availablerNcsg|]}|�k�qSrr)r�e)�characters_beforerr!r"�sz1characters_popularity_compare.<locals>.<listcomp>Tcsg|]}|�k�qSrr)rrH)�characters_afterrr!r"�s�r
g�������?)r�
ValueErrorr&�index�countrD)r4rGZcharacter_approved_countr6Zcharacters_before_sourceZcharacters_after_sourceZbefore_match_countZafter_match_countr)rJrIr!�characters_popularity_compare�s:rO)�decoded_sequencercCs�t�}x�|D]�}|j�dkrqt|�}|dkr0qd}x |D]}t||�dkr:|}Pq:W|dkrb|}||krx|j�||<q|||j�7<qWt|j��S)a
    Given a decoded text sequence, return a list of str. Unicode range / alphabet separation.
    Ex. a text containing English/Latin with a bit a Hebrew will return two items in the resulting list;
    One containing the latin letters and the other hebrew.
    FN)r�isalpharr�lower�list�values)rPZlayersr6rZlayer_target_rangeZdiscovered_rangerrr!�alpha_unicode_split�s(

rU)�resultsrcCs�t�}g}xD|D]<}x6|D].}|\}}||kr:|g||<q||j|�qWqWx4|D],}|j|tt||�t||�d�f�qVWt|dd�dd�S)z�
    This function merge results previously given by the function coherence_ratio.
    The return type is the same as coherence_ratio.
    rKcSs|dS)Nr
r)r@rrr!rA sz(merge_coherence_ratios.<locals>.<lambda>T)rBrC)rr2�round�sumrDr*)rVZper_language_ratios�merge�resultZ
sub_resultr4rErrr!�merge_coherence_ratioss"




r[i)�maxsize皙�����?)rP�	threshold�lg_inclusionrcCs�g}g}d}d}|dk	r"|jd�}d|kr8d}|jd�x�t|�D]�}t|�}|j�}	tdd�|	D��}
|
tkrrqBd	d�|	D�}xZ|p�t||�D]H}t||�}
|
|kr�q�n|
d
kr�|d7}|j	|t
|
d�f�|d
kr�Pq�WqBWt|dd�dd�S)z�
    Detect ANY language that can be identified in given sequence. The sequence will be analysed by layers.
    A layer = Character extraction by alphabets/ranges.
    FrN�,zLatin BasedTcSsg|]\}}|�qSrr)rr?�orrr!r"=sz#coherence_ratio.<locals>.<listcomp>cSsg|]\}}|�qSrr)rr?rarrr!r"Bsg�������?r
rK�cSs|dS)Nr
r)r@rrr!rAUsz!coherence_ratio.<locals>.<lambda>)rBrC)�split�removerUr�most_commonrXr
rFrOr2rWr*)rPr^r_rVZlg_inclusion_listr>Zsufficient_match_countZlayerZsequence_frequenciesrerZpopular_character_orderedr4rErrr!�coherence_ratio#s8	


rf)F)r]N))r$�codecsr�collectionsrr�	functoolsrZtypingrrrr	ZassetsrZconstantrr
rZmdrZmodelsrZutilsrrrrr�strr/r7r8r=�boolrF�floatrOrUr[rfrrrr!�<module>s0	%
/:'

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 1.54 KB 0644
__init__.cpython-36.pyc File 1.54 KB 0644
api.cpython-36.opt-1.pyc File 9.35 KB 0644
api.cpython-36.pyc File 9.35 KB 0644
cd.cpython-36.opt-1.pyc File 7.96 KB 0644
cd.cpython-36.pyc File 7.96 KB 0644
constant.cpython-36.opt-1.pyc File 16.51 KB 0644
constant.cpython-36.pyc File 16.51 KB 0644
legacy.cpython-36.opt-1.pyc File 3.18 KB 0644
legacy.cpython-36.pyc File 3.18 KB 0644
md.cpython-36.opt-1.pyc File 14.4 KB 0644
md.cpython-36.pyc File 14.4 KB 0644
models.cpython-36.opt-1.pyc File 12.84 KB 0644
models.cpython-36.pyc File 12.84 KB 0644
utils.cpython-36.opt-1.pyc File 7.32 KB 0644
utils.cpython-36.pyc File 7.32 KB 0644
version.cpython-36.opt-1.pyc File 197 B 0644
version.cpython-36.pyc File 197 B 0644