1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Ë
ê^iÒ1ãóЗddlmZddlmZddlmZddlmZddlm    Z    ddl
m Z m Z m Z mZddlmZmZdd    lmZmZmZGd
„d «ZGd „d «ZeeefZe eZGd„d«Zy)é)Ú annotations)Úaliases)Úsha256)Údumps)Úsub)ÚAnyÚIteratorÚListÚTupleé)ÚRE_POSSIBLE_ENCODING_INDICATIONÚTOO_BIG_SEQUENCE)Ú    iana_nameÚis_multi_byte_encodingÚ unicode_rangecó˜—eZdZ        d                                                    dd„Zdd„Zdd„Zedd„«Zdd„Zdd„Z    dd„Z
edd    „«Z ed d
„«Z ed!d „«Z ed!d „«Zed d „«Zedd„«Zedd„«Zedd„«Zedd„«Zedd„«Zed"d„«Zed#d„«Zed!d„«Zed d„«Zed d„«Zd$d%d„Zedd„«Zy)&Ú CharsetMatchNcó¬—||_||_||_||_||_d|_g|_d|_d|_d|_    ||_
||_ y)Nç) Ú_payloadÚ    _encodingÚ_mean_mess_ratioÚ
_languagesÚ_has_sig_or_bomÚ_unicode_rangesÚ_leavesÚ_mean_coherence_ratioÚ_output_payloadÚ_output_encodingÚ_stringÚ_preemptive_declaration)ÚselfÚpayloadÚguessed_encodingÚmean_mess_ratioÚhas_sig_or_bomÚ    languagesÚdecoded_payloadÚpreemptive_declarations        õlH:\项目\archive\测试组\脚本\Change_password\venv_build\Lib\site-packages\charset_normalizer/models.pyÚ__init__zCharsetMatch.__init__s_€ð 'ˆŒ à.ˆŒØ'6ˆÔØ,5ˆŒØ%3ˆÔØ15ˆÔà+-ˆŒ Ø,/ˆÔ"à-1ˆÔØ,0ˆÔà#2ˆŒ à3IˆÕ$ócóܗt|t«s)t|t«rt|«|jk(Sy|j|jk(xr|j
|j
k(S)NF)Ú
isinstancerÚstrrÚencodingÚ fingerprint©r"Úothers  r*Ú__eq__zCharsetMatch.__eq__*sV€Ü˜%¤Ô.ܘ%¤Ô%Ü  Ó'¨4¯=©=Ñ8Ð8ØØ}‰} §¡Ñ.ÒX°4×3CÑ3CÀu×GXÑGXÑ3XÐXr,cóÞ—t|t«st‚t|j|jz
«}t|j
|j
z
«}|dkr|dkDr|j
|j
kDS|dkrS|dkrNt |j«tk\r|j|jkS|j|jkDS|j|jkS)zQ
        Implemented to make sorted available upon CharsetMatches items.
        g{®Gáz„?g{®Gáz”?)
r.rÚ
ValueErrorÚabsÚchaosÚ    coherenceÚlenrrÚmulti_byte_usage)r"r3Úchaos_differenceÚcoherence_differences    r*Ú__lt__zCharsetMatch.__lt__1sʀô˜%¤Ô.ÜÐ ä"% d§j¡j°5·;±;Ñ&>Ó"?ÐÜ&)¨$¯.©.¸5¿?¹?Ñ*JÓ&KÐð ˜dÒ "Ð';¸dÒ'BØ—>‘> E§O¡OÑ3Ð 3Ø  Ò $Ð)=ÀÒ)Eô4—=‘=Ó!Ô%5Ò5Ø—z‘z E§K¡KÑ/Ð/Ø×(Ñ(¨5×+AÑ+AÑAÐ Aàz‰z˜EŸK™KÑ'Ð'r,có\—dtt|««t|j«z z
S)Ngð?)r:r/Úraw©r"s r*r;zCharsetMatch.multi_byte_usageGs"€à”cœ#˜d›)“n¤s¨4¯8©8£}Ñ4Ñ5Ð5r,có~—|j€&t|j|jd«|_|jS)NÚstrict)r r/rrrAs r*Ú__str__zCharsetMatch.__str__Ks.€à <‰<РܘtŸ}™}¨d¯n©n¸hÓGˆDŒL؏|‰|Ðr,có<—d|j›d|j›dS)Nz<CharsetMatch 'z' bytes(z)>)r0r1rAs r*Ú__repr__zCharsetMatch.__repr__Qs"€Ø  §¡ ¨x¸×8HÑ8HÐ7IÈÐLÐLr,cóº—t|t«r||k(r$tdj|j««‚d|_|j j|«y)Nz;Unable to add instance <{}> as a submatch of a CharsetMatch)r.rr6ÚformatÚ    __class__r rÚappendr2s  r*Ú add_submatchzCharsetMatch.add_submatchTsO€Ü˜%¤Ô.°%¸4²-ÜØM×TÑTØ—O‘Oóóð 𠈌 Ø  ‰ ×јEÕ"r,có—|jS©N)rrAs r*r0zCharsetMatch.encoding_s €à~‰~Ðr,cóƗg}tj«D]G\}}|j|k(r|j|«Œ'|j|k(sŒ7|j|«ŒI|S)z‚
        Encoding name are known by many name, using this could help when searching for IBM855 when it's listed as CP855.
        )rÚitemsr0rJ)r"Ú also_known_asÚuÚps    r*Úencoding_aliaseszCharsetMatch.encoding_aliasescs^€ð
$&ˆ Ü—M‘M“Oò    (‰DˆAˆq؏}‰} Ò!Ø×$Ñ$ QÕ'Ø—‘ !Ó#Ø×$Ñ$ QÕ'ð        (ð
Ðr,có—|jSrM©rrAs r*ÚbomzCharsetMatch.bompó€à×#Ñ#Ð#r,có—|jSrMrUrAs r*Úbyte_order_markzCharsetMatch.byte_order_marktrWr,cóF—|jDcgc]}|d‘Œ    c}Scc}w)zÔ
        Return the complete list of possible languages found in decoded sequence.
        Usually not really useful. Returned list may be empty even if 'language' property return something != 'Unknown'.
        r©r)r"Úes  r*r'zCharsetMatch.languagesxs €ð #Ÿo™oÖ.˜!“Ò.Ð.ùÒ.s có—|jshd|jvryddlm}m}t |j «r||j «n||j «}t|«dk(sd|vry|dS|jddS)z’
        Most probable language found in decoded sequence. If none were detected or inferred, the property will return
        "Unknown".
        ÚasciiÚEnglishr)Úencoding_languagesÚmb_encoding_languagesz Latin BasedÚUnknown)rÚcould_be_from_charsetÚcharset_normalizer.cdr`rarr0r:)r"r`rar's    r*ÚlanguagezCharsetMatch.language€s‡€ð Šð˜$×4Ñ4Ñ4Ø ÷ Xô*¨$¯-©-Ô8ñ& d§m¡mÔ4á'¨¯ © Ó6ð ô 9‹~ Ò" m°yÑ&@Ø à˜Q‘<Ð à‰˜qÑ! !Ñ$Ð$r,có—|jSrM)rrAs r*r8zCharsetMatch.chaosœs€à×$Ñ$Ð$r,có@—|jsy|jddS)Nrrr r[rAs r*r9zCharsetMatch.coherence s €àŠØØ‰˜qÑ! !Ñ$Ð$r,có6—t|jdzd¬«S©Nédé)Úndigits)Úroundr8rAs r*Ú percent_chaoszCharsetMatch.percent_chaos¦s€äT—Z‘Z #Ñ%¨qÔ1Ð1r,có6—t|jdzd¬«Sri)rmr9rAs r*Úpercent_coherencezCharsetMatch.percent_coherenceªs€äT—^‘^ cÑ)°1Ô5Ð5r,có—|jS)z+
        Original untouched bytes.
        )rrAs r*r@zCharsetMatch.raw®s€ð
}‰}Ðr,có—|jSrM)rrAs r*ÚsubmatchzCharsetMatch.submatchµs €à|‰|Ðr,có2—t|j«dkDS©Nr)r:rrAs r*Ú has_submatchzCharsetMatch.has_submatch¹s€ä4—<‘<Ó  1Ñ$Ð$r,cóô—|j |jSt|«Dcgc] }t|«‘Œ}}tt    |Dchc]}|sŒ|’Œ    c}««|_|jScc}wcc}wrM)rr/rÚsortedÚlist)r"ÚcharÚdetected_rangesÚrs    r*Ú    alphabetszCharsetMatch.alphabets½sk€à × Ñ Ð +Ø×'Ñ'Ð 'äMPÐQUËYÖ,WÀT¬]¸4Õ-@Ð,WˆÐ,Wä%¤d°Ö+L°!Ê!ªAÒ+LÓ&MÓNˆÔØ×#Ñ#Ð#ùò-Xùâ+Ls¦A0ÁA5 ÁA5 cóp—|jg|jDcgc]}|j‘Œc}zScc}w)zÜ
        The complete list of encoding that output the exact SAME str result and therefore could be the originating
        encoding.
        This list does include the encoding available in property 'encoding'.
        )rrr0)r"Úms  r*rcz"CharsetMatch.could_be_from_charsetÇs,€ð—‘аt·|±|Ö"D°! 1§:£:Ò"DÑDÐDùÒ"Ds›3có6‡—‰j‰j|k7rr|‰_t‰«}‰j=‰jj«dvr!t    t
ˆfd„|ddd¬«}||ddz}|j |d«‰_‰jS)z®
        Method to get re-encoded bytes payload using given target encoding. Default to UTF-8.
        Any errors will be simply ignored by the encoder NOT replaced.
        N)zutf-8Úutf8Úutf_8cóî•—|j|j«d|j«dj|j«dt    ‰j
«jdd««S)Nrr Ú_ú-)ÚstringÚspanÚreplaceÚgroupsrr)rr"s €r*ú<lambda>z%CharsetMatch.output.<locals>.<lambda>ßsYø€˜aŸh™h q§v¡v£x°¡{°Q·V±V³X¸a±[ÐA×IÑIØŸ™›
 1™ Ü! $×"7Ñ"7Ó8×@Ñ@ÀÀcÓJó€r,i r )Úcountrˆ)rr/r!Úlowerrr Úencoder)r"r0Údecoded_stringÚpatched_headers`   r*ÚoutputzCharsetMatch.outputÐs¬ø€ð
×  Ñ  Ð (¨D×,AÑ,AÀXÒ,MØ$,ˆDÔ !Ü  ›YˆNà×,Ñ,Ð8Ø×0Ñ0×6Ñ6Ó8Ø1ñ2ô"%Ü3óð# 5 DÐ)Øô"ð"0°.ÀÀÐ2GÑ!Gà#1×#8Ñ#8¸À9Ó#MˆDÔ  à×#Ñ#Ð#r,cóP—t|j««j«S)zw
        Retrieve the unique SHA256 computed using the transformed (re-encoded) payload. Not the original one.
        )rrÚ    hexdigestrAs r*r1zCharsetMatch.fingerprintís€ô
d—k‘k“mÓ$×.Ñ.Ó0Ð0r,)NN)r#Úbytesr$r/r%Úfloatr&Úboolr'ÚCoherenceMatchesr(ú
str | Noner)r—)r3ÚobjectÚreturnr•)r™r”©r™r/)r3rr™ÚNone)r™ú    list[str]©r™r•)r™r“)r™zlist[CharsetMatch])r‚)r0r/r™r“)Ú__name__Ú
__module__Ú __qualname__r+r4r>Úpropertyr;rDrFrKr0rSrVrYr'rer8r9rnrpr@rsrvr}rcrr1©r,r*rr sÑ„ð'+Ø-1ðJàðJððJðð    Jð
ð Jð $ð Jð$ðJð!+óJó8Yó(ð,ò6óð6óó Mó    #ðòóððò
óð
ðò$óð$ðò$óð$ðò/óð/ðò%óð%ð6ò%óð%ðò%óð%ð
ò2óð2ðò6óð6ðòóðð òóððò%óð%ðò$óð$ðòEóðEô$ð:ò1óñ1r,rcóR—eZdZdZd d d„Zd d„Zdd„Zdd„Zdd„Zdd„Z    dd    „Z
dd
„Z y)ÚCharsetMatchesz³
    Container with every CharsetMatch items ordered by default from most probable to the less one.
    Act like a list(iterable) but does not implements all related methods.
    Ncó8—|rt|«|_yg|_yrM)rxÚ_results)r"Úresultss  r*r+zCharsetMatches.__init__ûs€Ù?F¬F°7«Oˆ ÈBˆ r,c#ó8K—|jEd{–—†y7Œ­wrM©r¦rAs r*Ú__iter__zCharsetMatches.__iter__þsèø€Ø—=‘=× Ò ús ‚’“cóʗt|t«r|j|St|t«r/t    |d«}|jD]}||j
vsŒ|cSt ‚)z¸
        Retrieve a single item either by its position or encoding name (alias may be used here).
        Raise KeyError upon invalid index or encoding not present in results.
        F)r.Úintr¦r/rrcÚKeyError)r"ÚitemÚresults   r*Ú __getitem__zCharsetMatches.__getitem__s`€ô
dœCÔ  Ø—=‘= Ñ&Ð &Ü dœCÔ  Ü˜T 5Ó)ˆDØŸ-™-ò "Ø˜6×7Ñ7Ò7Ø!’Mð "ôˆr,có,—t|j«SrM©r:r¦rAs r*Ú__len__zCharsetMatches.__len__s€Ü4—=‘=Ó!Ð!r,có2—t|j«dkDSrur²rAs r*Ú__bool__zCharsetMatches.__bool__s€Ü4—=‘=Ó! AÑ%Ð%r,cóΗt|t«s-tdjt    |j
«««‚t |j«tkrW|jD]H}|j|jk(sŒ|j|jk(sŒ7|j|«y|jj|«t|j«|_    y)z~
        Insert a single match. Will be inserted accordingly to preserve sort.
        Can be inserted as a submatch.
        z-Cannot append instance '{}' to CharsetMatchesN)r.rr6rHr/rIr:r@rr¦r1r8rKrJrx)r"r®Úmatchs   r*rJzCharsetMatches.appends³€ô
˜$¤ Ô-ÜØ?×FÑFܘŸ™Ó'óóð ô ˆtx‰x‹=Ô+Ò +ØŸ™ò Ø×$Ñ$¨×(8Ñ(8Ó8¸U¿[¹[ÈDÏJÉJÓ=VØ×&Ñ& tÔ,Ùð ð      ‰ ×јTÔ"ܘtŸ}™}Ó-ˆ r,có:—|jsy|jdS)zQ
        Simply return the first match. Strict equivalent to matches[0].
        Nrr©rAs r*ÚbestzCharsetMatches.best)s€ð}Š}ØØ}‰}˜QÑÐr,có"—|j«S)zP
        Redundant method, call the method best(). Kept for BC reasons.
        )r¹rAs r*ÚfirstzCharsetMatches.first1s€ðy‰y‹{Ðr,rM)r§zlist[CharsetMatch] | None)r™zIterator[CharsetMatch])r®z    int | strr™r)r™r¬r)r®rr™r›)r™zCharsetMatch | None) ržrŸr Ú__doc__r+rªr°r³rµrJr¹r»r¢r,r*r¤r¤õs0„ñô
Oó!ó ó"ó&ó.ó( ôr,r¤cóZ—eZdZ                                                                                        dd„Zedd„«Zdd„Zy)ÚCliDetectionResultc óž—||_|
|_||_||_||_||_||_||_||_|    |_    | |_
yrM) ÚpathÚ unicode_pathr0rSÚalternative_encodingsrer}r&r8r9Ú is_preferred) r"rÀr0rSrÂrer}r&r8r9rÁrÃs             r*r+zCliDetectionResult.__init__=sV€ðˆŒ    Ø(4ˆÔØ$,ˆŒ Ø+;ˆÔØ0EˆÔ"Ø%ˆŒ Ø$-ˆŒØ$2ˆÔØ!ˆŒ
Ø )ˆŒØ".ˆÕr,c óú—|j|j|j|j|j|j
|j |j|j|j|jdœ S)N© rÀr0rSrÂrer}r&r8r9rÁrÃrÅrAs r*Ú__dict__zCliDetectionResult.__dict__Wse€ð—I‘IØŸ ™ Ø $× 5Ñ 5Ø%)×%?Ñ%?ØŸ ™ ØŸ™Ø"×1Ñ1Ø—Z‘ZØŸ™Ø ×-Ñ-Ø ×-Ñ-ñ 
ð     
r,có2—t|jdd¬«S)NTé)Ú ensure_asciiÚindent)rrÆrAs r*Úto_jsonzCliDetectionResult.to_jsongs€ÜT—]‘]°¸aÔ@Ð@r,N)rÀr/r0r—rSrœrÂrœrer/r}rœr&r•r8r”r9r”rÁr—rÃr•)r™zdict[str, Any]rš)ržrŸr r+r¡rÆrËr¢r,r*r¾r¾<s„ð/àð/ðð/ð$ð    /ð
 )ð /ð ð /ðð/ðð/ðð/ðð/ð!ð/ðó/ð4ò 
óð 
ôAr,r¾N)Ú
__future__rÚencodings.aliasesrÚhashlibrÚjsonrÚrerÚtypingrr    r
r Úconstantr rÚutilsrrrrr¤r/r”ÚCoherenceMatchr–r¾r¢r,r*ú<module>rÕsdðÝ"å%ÝÝÝß-Ó-çGßCÑC÷e1ñe1÷P@ñ@ðFs˜EzÑ"€Ø˜Ñ'Ð÷,Aò,Ar,