404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.216.212.231: ~ $
3

m�daC�@s<ddlmZddlmZmZddlmZmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZGdd�d�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Z ee!ee!e"d�dd�Z#edd�d#e!e$e"e$d�d d!��Z%d"S)$�)�	lru_cache)�List�Optional�)�COMMON_SAFE_ASCII_CHARACTERS�UNICODE_SECONDARY_RANGE_KEYWORD)�is_accentuated�is_ascii�is_case_variable�is_cjk�is_emoticon�	is_hangul�is_hiragana�is_katakana�is_latin�is_punctuation�is_separator�	is_symbol�is_thai�
remove_accent�
unicode_rangec@sPeZdZdZeed�dd�Zedd�dd�Zdd�d	d
�Ze	e
d�dd��ZdS)
�MessDetectorPluginzy
    Base abstract class used for mess detection plugins.
    All detectors MUST extend and implement given methods.
    )�	character�returncCst�dS)z@
        Determine if given character should be fed in.
        N)�NotImplementedError)�selfr�r�/usr/lib/python3.6/md.py�eligibleszMessDetectorPlugin.eligibleNcCst�dS)z�
        The main routine to be executed upon character.
        Insert the logic in witch the text would be considered chaotic.
        N)r)rrrrr�feed$szMessDetectorPlugin.feed)rcCst�dS)zB
        Permit to reset the plugin to the initial state.
        N)r)rrrr�reset+szMessDetectorPlugin.resetcCst�dS)z�
        Compute the chaos ratio based on what your feed() has seen.
        Must NOT be lower than 0.; No restriction gt 0.
        N)r)rrrr�ratio1szMessDetectorPlugin.ratio)�__name__�
__module__�__qualname__�__doc__�str�boolrrr �property�floatr!rrrrrsrc@sZeZdZdd�dd�Zeed�dd�Zedd�dd	�Zdd�d
d�Ze	e
d�dd
��ZdS)� TooManySymbolOrPunctuationPluginN)rcCs"d|_d|_d|_d|_d|_dS)NrF)�_punctuation_count�
_symbol_count�_character_count�_last_printable_charZ_frenzy_symbol_in_word)rrrr�__init__;s
z)TooManySymbolOrPunctuationPlugin.__init__)rrcCs|j�S)N)�isprintable)rrrrrrCsz)TooManySymbolOrPunctuationPlugin.eligiblecCsp|jd7_||jkrf|tkrft|�r8|jd7_n.|j�dkrft|�rft|�dkrf|jd7_||_dS)NrF�)	r-r.rrr+�isdigitrrr,)rrrrrrFs
z%TooManySymbolOrPunctuationPlugin.feedcCsd|_d|_d|_dS)Nr)r+r-r,)rrrrr Xsz&TooManySymbolOrPunctuationPlugin.resetcCs0|jdkrdS|j|j|j}|dkr,|SdS)Nrgg333333�?)r-r+r,)rZratio_of_punctuationrrrr!]s


z&TooManySymbolOrPunctuationPlugin.ratio)r"r#r$r/r&r'rrr r(r)r!rrrrr*:sr*c@sZeZdZdd�dd�Zeed�dd�Zedd�dd	�Zdd�d
d�Ze	e
d�dd
��ZdS)�TooManyAccentuatedPluginN)rcCsd|_d|_dS)Nr)r-�_accentuated_count)rrrrr/jsz!TooManyAccentuatedPlugin.__init__)rrcCs|j�S)N)�isalpha)rrrrrrnsz!TooManyAccentuatedPlugin.eligiblecCs(|jd7_t|�r$|jd7_dS)Nr)r-rr4)rrrrrrqszTooManyAccentuatedPlugin.feedcCsd|_d|_dS)Nr)r-r4)rrrrr wszTooManyAccentuatedPlugin.resetcCs*|jdkrdS|j|j}|dkr&|SdS)Nrggffffff�?)r-r4)rZratio_of_accentuationrrrr!{s
zTooManyAccentuatedPlugin.ratio)r"r#r$r/r&r'rrr r(r)r!rrrrr3isr3c@sZeZdZdd�dd�Zeed�dd�Zedd�dd	�Zdd�d
d�Ze	e
d�dd
��ZdS)�UnprintablePluginN)rcCsd|_d|_dS)Nr)�_unprintable_countr-)rrrrr/�szUnprintablePlugin.__init__)rrcCsdS)NTr)rrrrrr�szUnprintablePlugin.eligiblecCs@|j�dkr.|j�dkr.|dkr.|jd7_|jd7_dS)NF�r)�isspacer0r7r-)rrrrrr�s
zUnprintablePlugin.feedcCs
d|_dS)Nr)r7)rrrrr �szUnprintablePlugin.resetcCs|jdkrdS|jd|jS)Nrg�)r-r7)rrrrr!�s
zUnprintablePlugin.ratio)r"r#r$r/r&r'rrr r(r)r!rrrrr6�s	r6c@sZeZdZdd�dd�Zeed�dd�Zedd�dd	�Zdd�d
d�Ze	e
d�dd
��ZdS)�SuspiciousDuplicateAccentPluginN)rcCsd|_d|_d|_dS)Nr)�_successive_countr-�_last_latin_character)rrrrr/�sz(SuspiciousDuplicateAccentPlugin.__init__)rrcCs|j�ot|�S)N)r5r)rrrrrr�sz(SuspiciousDuplicateAccentPlugin.eligiblecCst|jd7_|jdk	rjt|�rjt|j�rj|j�rJ|jj�rJ|jd7_t|�t|j�krj|jd7_||_dS)Nr)r-r=r�isupperr<r)rrrrrr�s

z$SuspiciousDuplicateAccentPlugin.feedcCsd|_d|_d|_dS)Nr)r<r-r=)rrrrr �sz%SuspiciousDuplicateAccentPlugin.resetcCs|jdkrdS|jd|jS)Nrgr1)r-r<)rrrrr!�s
z%SuspiciousDuplicateAccentPlugin.ratio)r"r#r$r/r&r'rrr r(r)r!rrrrr;�s
r;c@sZeZdZdd�dd�Zeed�dd�Zedd�dd	�Zdd�d
d�Ze	e
d�dd
��ZdS)�SuspiciousRangeN)rcCsd|_d|_d|_dS)Nr)�"_suspicious_successive_range_countr-�_last_printable_seen)rrrrr/�szSuspiciousRange.__init__)rrcCs|j�S)N)r0)rrrrrr�szSuspiciousRange.eligiblecCsx|jd7_|j�s&t|�s&|tkr0d|_dS|jdkrD||_dSt|j�}t|�}t||�rn|jd7_||_dS)Nr)r-r9rrrAr� is_suspiciously_successive_ranger@)rr�unicode_range_a�unicode_range_brrrr�s

zSuspiciousRange.feedcCsd|_d|_d|_dS)Nr)r-r@rA)rrrrr �szSuspiciousRange.resetcCs.|jdkrdS|jd|j}|dkr*dS|S)Nrgr1g�������?)r-r@)rZratio_of_suspicious_range_usagerrrr!�s
zSuspiciousRange.ratio)r"r#r$r/r&r'rrr r(r)r!rrrrr?�sr?c@sZeZdZdd�dd�Zeed�dd�Zedd�dd	�Zdd�d
d�Ze	e
d�dd
��ZdS)�SuperWeirdWordPluginN)rcCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrF�)�_word_count�_bad_word_count�_is_current_word_bad�_foreign_long_watchr-�_bad_character_count�_buffer�_buffer_accent_count)rrrrr/�szSuperWeirdWordPlugin.__init__)rrcCsdS)NTr)rrrrrrszSuperWeirdWordPlugin.eligiblecCs�|j�r�dj|j|g�|_t|�r0|jd7_|jdkr�t|�dkr�t|�dkr�t|�dkr�t	|�dkr�t
|�dkr�t|�dkr�d|_dS|js�dS|j�s�t
|�s�t|�o�|j�rT|jd7_t|j�}|j|7_|dkr�|j|dkr�d|_|dk�r|j�rd|_|j�r@|jd7_|jt|j�7_d|_d|_d|_d|_n6|d
k�r�|j�dk�r�t|��r�d|_|j|7_dS)NrFrFT�g�(\���?�r�<�>�-�=>rRrSrQrP)r5�joinrLrrMrJrrr
rrrr9rrrG�lenr-rIrHrKr2r)rrZ
buffer_lengthrrrrsH



zSuperWeirdWordPlugin.feedcCs.d|_d|_d|_d|_d|_d|_d|_dS)NrFFr)rLrIrJrHrGr-rK)rrrrr :szSuperWeirdWordPlugin.resetcCs|jdkrdS|j|jS)N�
g)rGrKr-)rrrrr!Cs
zSuperWeirdWordPlugin.ratio)r"r#r$r/r&r'rrr r(r)r!rrrrrE�s/	rEc@s^eZdZdZdd�dd�Zeed�dd�Zedd�d	d
�Zdd�dd�Z	e
ed�d
d��ZdS)�CjkInvalidStopPluginu�
    GB(Chinese) based encoding often render the stop incorrectly when the content does not fit and
    can be easily detected. Searching for the overuse of '丅' and '丄'.
    N)rcCsd|_d|_dS)Nr)�_wrong_stop_count�_cjk_character_count)rrrrr/QszCjkInvalidStopPlugin.__init__)rrcCsdS)NTr)rrrrrrUszCjkInvalidStopPlugin.eligiblecCs4|dkr|jd7_dSt|�r0|jd7_dS)N�丅�丄r)rZr[)rXrrY)rrrrrrXs
zCjkInvalidStopPlugin.feedcCsd|_d|_dS)Nr)rXrY)rrrrr _szCjkInvalidStopPlugin.resetcCs|jdkrdS|j|jS)N�g)rYrX)rrrrr!cs
zCjkInvalidStopPlugin.ratio)
r"r#r$r%r/r&r'rrr r(r)r!rrrrrWKsrWc@sZeZdZdd�dd�Zeed�dd�Zedd�dd	�Zdd�d
d�Ze	e
d�dd
��ZdS)�ArchaicUpperLowerPluginN)rcCs.d|_d|_d|_d|_d|_d|_d|_dS)NFrT)�_buf�_character_count_since_last_sep�_successive_upper_lower_count�#_successive_upper_lower_count_finalr-�_last_alpha_seen�_current_ascii_only)rrrrr/ksz ArchaicUpperLowerPlugin.__init__)rrcCsdS)NTr)rrrrrrxsz ArchaicUpperLowerPlugin.eligiblecCs$|j�ot|�}|dk}|r�|jdkr�|jdkrV|j�dkrV|jdkrV|j|j7_d|_d|_d|_d|_|j	d7_	d|_dS|jdkr�t
|�dkr�d|_|jdk	r�|j�r�|jj�s�|j�r�|jj�r�|jdkr�|jd7_d|_q�d|_nd|_|j	d7_	|jd7_||_dS)NFr�@rTr1)
r5r
r_r2rcrar`rbr^r-r	r>�islower)rrZis_concernedZ	chunk_seprrrr{s8




zArchaicUpperLowerPlugin.feedcCs.d|_d|_d|_d|_d|_d|_d|_dS)NrFT)r-r_r`rarbr^rc)rrrrr �szArchaicUpperLowerPlugin.resetcCs|jdkrdS|j|jS)Nrg)r-ra)rrrrr!�s
zArchaicUpperLowerPlugin.ratio)r"r#r$r/r&r'rrr r(r)r!rrrrr]js
*	r])rCrDrcCsT|dks|dkrdS||kr dSd|kr4d|kr4dSd|ksDd|krHdS|jd�|jd�}}x"|D]}|tkrrqd||krddSqdW|dk|dk}}|s�|r�d	|ks�d	|kr�dS|r�|r�dSd
|ks�d
|k�r�d	|ks�d	|kr�dS|dkp�|dk�r�dSd	|k�s d	|k�s |dk�rP|dk�rPd|k�s4d|k�r8dSd
|k�sLd
|k�rPdSdS)za
    Determine if two Unicode range seen next to each other can be considered as suspicious.
    NTFZLatinZ	Emoticons� �Hiragana�KatakanaZCJKZHangulzBasic LatinZPunctuationZForms)rgrh)rgrh)rhrg)rhrg)�splitr)rCrDZkeywords_range_aZkeywords_range_bZelZrange_a_jp_charsZrange_b_jp_charsrrrrB�sL


rBi)�maxsize皙�����?F)�decoded_sequence�maximum_threshold�debugrcCs�dd�tj�D�}t|�}d}|dkr,d}n|dkr:d}nd}xzt|td	|��D]f\}}x |D]}	|	j|�r^|	j|�q^W|d	kr�||d	ks�||d
krPtdd�|D��}||krPPqPW|r�x|D]}
t|
j	|
j
�q�Wt|d�S)
zw
    Compute a mess ratio given a decoded bytes sequence. The maximum threshold does stop the computation earlier.
    cSsg|]
}|��qSrr)�.0Zmd_classrrr�
<listcomp>�szmess_ratio.<locals>.<listcomp>gi� ird�rrcSsg|]
}|j�qSr)r!)ro�dtrrrrps�)r�__subclasses__rU�zip�rangerr�sum�print�	__class__r!�round)rlrmrnZ	detectorsZlengthZmean_mess_ratioZ!intermediary_mean_mess_ratio_calcr�indexZdetectorrsrrr�
mess_ratio�s*	


r}N)rkF)&�	functoolsrZtypingrrZconstantrrZutilsrr	r
rrr
rrrrrrrrrrr*r3r6r;r?rErWr]r&r'rBr)r}rrrr�<module>s"D"/$6PM<

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