+
    Nj2                        ^ RI Ht ^ RIHt ^ RIHt ^ RIHtHtH	t	H
t
 ^RIHtHt ^RIHtHtHt  ! R R4      t ! R	 R
4      t]
]]3,          t]	],          t ! R R4      tR# )    )annotations)aliases)sub)AnyIteratorListTuple)RE_POSSIBLE_ENCODING_INDICATIONTOO_BIG_SEQUENCE)	iana_nameis_multi_byte_encodingunicode_rangec                     ] tR t^tR3R R lltR R ltR R lt]R R	 l4       tR
 R lt	R R lt
R R lt]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R  R! l4       t]R" R# l4       t]R$ R% l4       t]R& R' l4       t]R( R) l4       t]R* R+ l4       t]R, R- l4       tR4R. R/ llt]R0 R1 l4       tR2tR# )5CharsetMatchNc               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )   payloadbytes | bytearrayguessed_encodingstrmean_mess_ratiofloathas_sig_or_bombool	languagesCoherenceMatchesdecoded_payload
str | Nonepreemptive_declaration )formats   "[/data/cameron/venvs/serve_omidlab/lib/python3.14/site-packages/charset_normalizer/models.py__annotate__CharsetMatch.__annotate__   sY     J J"J J 	J
 J $J $J !+J    c                	    Wn         W n        W0n        WPn        W@n        R V n        . V n        RV n        R V n        R V n	        W`n
        Wpn        R # )N        )_payload	_encoding_mean_mess_ratio
_languages_has_sig_or_bom_unicode_ranges_leaves_mean_coherence_ratio_output_payload_output_encoding_string_preemptive_declaration)selfr   r   r   r   r   r   r   s   &&&&&&&&r"   __init__CharsetMatch.__init__   sQ     ,3.'6,5%315+-,/"-1,0#23I$r%   c                    V ^8  d   QhRRRR/# r   otherobjectreturnr   r    )r!   s   "r"   r#   r$   (   s     Y YF Yt Yr%   c                	   \        V\        4      '       g1   \        V\        4      '       d   \        V4      V P                  8H  # R # V P                  VP                  8H  ;'       d    V P
                  VP
                  8H  # )F)
isinstancer   r   r   encodingfingerprintr4   r9   s   &&r"   __eq__CharsetMatch.__eq__(   s_    %..%%% '4==88}}.XX43C3CuGXGX3XXr%   c                    V ^8  d   QhRRRR/# r8   r    )r!   s   "r"   r#   r$   /   s     ( (F (t (r%   c                   \        V\        4      '       g   \        h\        V P                  VP                  ,
          4      p\        V P
                  VP
                  ,
          4      pVR8  d!   VR8  d   V P
                  VP
                  8  # VR8  dX   VR8:  dQ   \        V P                  4      \        8  d   V P                  VP                  8  # V P                  VP                  8  # V P                  VP                  8  # )zA
Implemented to make sorted available upon CharsetMatches items.
g{Gzt?g{Gz?)
r=   r   
ValueErrorabschaos	coherencelenr(   r   multi_byte_usage)r4   r9   chaos_differencecoherence_differences   &&  r"   __lt__CharsetMatch.__lt__/   s     %.."%djj5;;&>"?&)$..5??*J&K e#(<t(C>>EOO33%*>$*F 4==!%55zzEKK//((5+A+AAAzzEKK''r%   c                   V ^8  d   QhRR/# r   r;   r   r    )r!   s   "r"   r#   r$   F   s     6 6% 6r%   c                	l    R \        \        V 4      4      \        V P                  4      ,          ,
          # )g      ?)rI   r   rawr4   s   &r"   rJ   CharsetMatch.multi_byte_usageE   s"    c#d)ns488}455r%   c                   V ^8  d   QhRR/# r   r;   r   r    )r!   s   "r"   r#   r$   I   s       r%   c                	L   V P                   f   \        V P                  V P                  R4      V n         V P                  '       dT   V P                  R8X  dC   V P                   '       d1   V P                   ^ ,          R8X  d   V P                   R,          V n         V P                   # )Nstrictutf_7u   ﻿:   NN)r2   r   r(   r)   r,   rS   s   &r"   __str__CharsetMatch.__str__I   sq    <<t}}dnnhGDL
 $$$NNg-LLLLLOx/#||B/||r%   c                   V ^8  d   QhRR/# rV   r    )r!   s   "r"   r#   r$   Y   s     J J# Jr%   c                	<    R V P                    RV P                   R2# )z<CharsetMatch 'z' fp(z)>)r>   r?   rS   s   &r"   __repr__CharsetMatch.__repr__Y   s"     uT5E5E4FbIIr%   c                    V ^8  d   QhRRRR/# )r   r9   r   r;   Noner    )r!   s   "r"   r#   r$   \   s     	# 	#, 	#4 	#r%   c                	    \        V\        4      '       d   W8X  d%   \        R P                  VP                  4      4      hRVn        V P                  P                  V4       R# )z;Unable to add instance <{}> as a submatch of a CharsetMatchN)r=   r   rE   r!   	__class__r2   r.   appendr@   s   &&r"   add_submatchCharsetMatch.add_submatch\   sP    %..%-MTTOO  E"r%   c                   V ^8  d   QhRR/# rV   r    )r!   s   "r"   r#   r$   h   s      # r%   c                	    V P                   # N)r)   rS   s   &r"   r>   CharsetMatch.encodingg   s    ~~r%   c                   V ^8  d   QhRR/# r   r;   	list[str]r    )r!   s   "r"   r#   r$   l   s     
 
) 
r%   c                    . p\         P                  ! 4        FM  w  r#V P                  V8X  d   VP                  V4       K)  V P                  V8X  g   K<  VP                  V4       KO  	  V# )zr
Encoding name are known by many name, using this could help when searching for IBM855 when it's listed as CP855.
)r   itemsr>   re   )r4   also_known_asups   &   r"   encoding_aliasesCharsetMatch.encoding_aliasesk   sW    
 $&MMODA}}!$$Q'!#$$Q'	 $
 r%   c                   V ^8  d   QhRR/# r   r;   r   r    )r!   s   "r"   r#   r$   y   s     $ $T $r%   c                	    V P                   # rj   r,   rS   s   &r"   bomCharsetMatch.bomx       ###r%   c                   V ^8  d   QhRR/# rw   r    )r!   s   "r"   r#   r$   }   s     $ $ $r%   c                	    V P                   # rj   ry   rS   s   &r"   byte_order_markCharsetMatch.byte_order_mark|   r|   r%   c                   V ^8  d   QhRR/# rm   r    )r!   s   "r"   r#   r$      s     / /9 /r%   c                P    V P                    Uu. uF  q^ ,          NK  	  up# u upi )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+   )r4   es   & r"   r   CharsetMatch.languages   s$     #oo.o!o...s   #c                   V ^8  d   QhRR/# rV   r    )r!   s   "r"   r#   r$      s     % %# %r%   c                R   V P                   '       g}   RV P                  9   d   R# ^ RIHpHp \        V P                  4      '       d   V! V P                  4      MV! V P                  4      p\        V4      ^ 8X  g   RV9   d   R# V^ ,          # V P                   ^ ,          ^ ,          # )zz
Most probable language found in decoded sequence. If none were detected or inferred, the property will return
"Unknown".
asciiEnglish)encoding_languagesmb_encoding_languageszLatin BasedUnknown)r+   could_be_from_charsetcharset_normalizer.cdr   r   r   r>   rI   )r4   r   r   r   s   &   r"   languageCharsetMatch.language   s      $444  X *$--88 &dmm4'6  9~"my&@ Q<q!!$$r%   c                   V ^8  d   QhRR/# rP   r    )r!   s   "r"   r#   r$      s     % %u %r%   c                	    V P                   # rj   )r*   rS   s   &r"   rG   CharsetMatch.chaos   s    $$$r%   c                   V ^8  d   QhRR/# rP   r    )r!   s   "r"   r#   r$      s     % %5 %r%   c                	^    V P                   '       g   R # V P                   ^ ,          ^,          # )r'   r   rS   s   &r"   rH   CharsetMatch.coherence   s"    q!!$$r%   c                   V ^8  d   QhRR/# rP   r    )r!   s   "r"   r#   r$      s     2 2u 2r%   c                	>    \        V P                  ^d,          ^R7      # d   )ndigits)roundrG   rS   s   &r"   percent_chaosCharsetMatch.percent_chaos   s    TZZ#%q11r%   c                   V ^8  d   QhRR/# rP   r    )r!   s   "r"   r#   r$      s     6 65 6r%   c                	>    \        V P                  ^d,          ^R7      # r   )r   rH   rS   s   &r"   percent_coherenceCharsetMatch.percent_coherence   s    T^^c)155r%   c                   V ^8  d   QhRR/# )r   r;   r   r    )r!   s   "r"   r#   r$      s      & r%   c                    V P                   # )z
Original untouched bytes.
)r(   rS   s   &r"   rR   CharsetMatch.raw   s    
 }}r%   c                   V ^8  d   QhRR/# )r   r;   zlist[CharsetMatch]r    )r!   s   "r"   r#   r$      s      , r%   c                	    V P                   # rj   )r.   rS   s   &r"   submatchCharsetMatch.submatch   s    ||r%   c                   V ^8  d   QhRR/# rw   r    )r!   s   "r"   r#   r$      s     % %d %r%   c                	2    \        V P                  4      ^ 8  # r   )rI   r.   rS   s   &r"   has_submatchCharsetMatch.has_submatch   s    4<< 1$$r%   c                   V ^8  d   QhRR/# rm   r    )r!   s   "r"   r#   r$      s     $ $9 $r%   c                	   V P                   e   V P                   # \        V 4       Uu. uF  p\        V4      NK  	  pp\        \	        V Uu0 uF  q3'       g   K  VkK  	  up4      4      V n         V P                   # u upi u upi rj   )r-   r   r   sortedlist)r4   chardetected_rangesrs   &   r"   	alphabetsCharsetMatch.alphabets   sr    +'''MPQUY,WYT]4-@Y,W%d+L!!AA+L&MN### -X+Ls   A<	BBc                   V ^8  d   QhRR/# rm   r    )r!   s   "r"   r#   r$      s     E Ey Er%   c                z    V P                   .V P                   Uu. uF  qP                  NK  	  up,           # u upi )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'.
)r)   r.   r>   )r4   ms   & r"   r   "CharsetMatch.could_be_from_charset   s.     t||"D|!::|"DDD"Ds   8c                    V ^8  d   QhRRRR/# )r   r>   r   r;   bytesr    )r!   s   "r"   r#   r$      s     $ $s $ $r%   c                `  a  S P                   e   S P                   V8w  d   VS n         \        S 4      pS P                  eM   S P                  P                  4       R9  d.   \	        \
        V 3R lVR,          ^R7      pW2R,          ,           pVP                  VR4      S n        S P                  # )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.
c                  < V P                   V P                  4       ^ ,          V P                  4       ^,           P                  V P                  4       ^ ,          \	        SP
                  4      P                  RR4      4      # )r   _-)stringspanreplacegroupsr   r1   )r   r4   s   &r"   <lambda>%CharsetMatch.output.<locals>.<lambda>   sW    ahhqvvx{QVVXa[AII
1!$"7"78@@cJr%   :Ni    N)count:i    NNr   )zutf-8utf8utf_8)r1   r   r3   lowerr   r
   encoder0   )r4   r>   decoded_stringpatched_headers   f&  r"   outputCharsetMatch.output   s    
   (D,A,AX,M$,D! YN,,80066812 "%3 #5)" "02G!G#1#8#89#MD ###r%   c                   V ^8  d   QhRR/# r   r;   intr    )r!   s   "r"   r#   r$      s      S r%   c                *    \        \        V 4      4      # )zM
Retrieve a hash fingerprint of the decoded payload, used for deduplication.
)hashr   rS   s   &r"   r?   CharsetMatch.fingerprint   s    
 CIr%   )r)   r,   r+   r.   r/   r*   r1   r0   r(   r3   r2   r-   )NN)r   )__name__
__module____qualname____firstlineno__r5   rA   rM   propertyrJ   r[   r_   rf   r>   rt   rz   r   r   r   rG   rH   r   r   rR   r   r   r   r   r   r?   __static_attributes__r    r%   r"   r   r      s~   J8Y(, 6 6 J	#   
 
 $ $ $ $ / / % %6 % % % %
 2 2 6 6     % % $ $ E E$:  r%   r   c                  ~    ] tR t^tRtRR R lltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltRtR# )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                   V ^8  d   QhRR/# )r   resultszlist[CharsetMatch] | Noner    )r!   s   "r"   r#   CharsetMatches.__annotate__  s     O O 9 Or%   c                	H    V'       d   \        V4      V n        R # . V n        R # rj   )r   _results)r4   r   s   &&r"   r5   CharsetMatches.__init__  s    ?FF7OBr%   c                   V ^8  d   QhRR/# )r   r;   zIterator[CharsetMatch]r    )r!   s   "r"   r#   r     s     ! !0 !r%   c              #  	:   "   V P                    R j  xL
  R #  L5irj   r   rS   s   &r"   __iter__CharsetMatches.__iter__  s     ==  s   c                    V ^8  d   QhRRRR/# )r   itemz	int | strr;   r   r    )r!   s   "r"   r#   r   	  s      	 l r%   c                    \        V\        4      '       d   V P                  V,          # \        V\        4      '       d4   \	        VR4      pV P                   F  pWP
                  9   g   K  Vu # 	  \        h)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=   r   r   r   r   r   KeyError)r4   r   results   && r"   __getitem__CharsetMatches.__getitem__	  s_    
 dC  ==&&dC  T5)D--777!M ( r%   c                   V ^8  d   QhRR/# r   r    )r!   s   "r"   r#   r     s     " " "r%   c                	,    \        V P                  4      # rj   rI   r   rS   s   &r"   __len__CharsetMatches.__len__  s    4==!!r%   c                   V ^8  d   QhRR/# rw   r    )r!   s   "r"   r#   r     s     & &$ &r%   c                	2    \        V P                  4      ^ 8  # r   r   rS   s   &r"   __bool__CharsetMatches.__bool__  s    4==!A%%r%   c                    V ^8  d   QhRRRR/# )r   r   r   r;   rb   r    )r!   s   "r"   r#   r     s     . .< .D .r%   c                   \        V\        4      '       g.   \        RP                  \	        VP
                  4      4      4      h\        VP                  4      \        8  d`   V P                   FO  pVP                  VP                  8X  g   K   VP                  VP                  8X  g   K=  VP                  V4        R# 	  V P                  P                  V4       \        V P                  4      V n	        R# )zf
Insert a single match. Will be inserted accordingly to preserve sort.
Can be inserted as a submatch.
z-Cannot append instance '{}' to CharsetMatchesN)r=   r   rE   r!   r   rd   rI   rR   r   r   r?   rG   rf   re   r   )r4   r   matchs   && r"   re   CharsetMatches.append  s    
 $--?FF'  txx=++$$(8(88U[[DJJ=V&&t, ' 	T"t}}-r%   c                   V ^8  d   QhRR/# r   r;   zCharsetMatch | Noner    )r!   s   "r"   r#   r   1  s        )  r%   c                P    V P                   '       g   R# V P                   ^ ,          # )zA
Simply return the first match. Strict equivalent to matches[0].
Nr   rS   s   &r"   bestCharsetMatches.best1  s     }}}}}Qr%   c                   V ^8  d   QhRR/# r   r    )r!   s   "r"   r#   r   9  s      * r%   c                "    V P                  4       # )z@
Redundant method, call the method best(). Kept for BC reasons.
)r  rS   s   &r"   firstCharsetMatches.first9  s     yy{r%   r   rj   )r   r   r   r   __doc__r5   r   r   r   r   re   r  r  r   r    r%   r"   r   r      s5    
O!"&.(  r%   r   c                  D    ] tR tRtR R lt]R R l4       tR R ltRtR	# )
CliDetectionResultiD  c               D    V ^8  d   QhRRRRRRRRRRR	RR
RRRRRRRRR/# )r   pathr   r>   r   rt   rn   alternative_encodingsr   r   r   r   rG   r   rH   unicode_pathis_preferredr    )r!   s   "r"   r#   CliDetectionResult.__annotate__E  sx     / // / $	/
  )/ / / / / / !/ /r%   c                	    Wn         Wn        W n        W0n        W@n        WPn        W`n        Wpn        Wn        Wn	        Wn
        R # rj   )r  r  r>   rt   r  r   r   r   rG   rH   r  )r4   r  r>   rt   r  r   r   r   rG   rH   r  r  s   &&&&&&&&&&&&r"   r5   CliDetectionResult.__init__E  s@     	(4$,+;0E"%$-$2!
 )".r%   c                   V ^8  d   QhRR/# )r   r;   zdict[str, Any]r    )r!   s   "r"   r#   r  `  s     
 
. 
r%   c                	   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  RV P                  RV P                  R	V P                  R
V P                  /# r  r>   rt   r  r   r   r   rG   rH   r  r  r  rS   s   &r"   __dict__CliDetectionResult.__dict___  s{     DII 5 5#T%?%?d11TZZD--D--
 	
r%   c                   V ^8  d   QhRR/# rV   r    )r!   s   "r"   r#   r  o  s     A A Ar%   c                	8    ^ RI Hp V! V P                  R^R7      # )r   )dumpsT)ensure_asciiindent)jsonr  r  )r4   r  s   & r"   to_jsonCliDetectionResult.to_jsono  s    T]]a@@r%   )r   r  rG   rH   r>   rt   r   r  r   r  r  N)	r   r   r   r   r5   r   r  r  r   r    r%   r"   r	  r	  D  s'    /4 
 
A Ar%   r	  N)
__future__r   encodings.aliasesr   rer   typingr   r   r   r	   constantr
   r   utilsr   r   r   r   r   r   r   CoherenceMatchr   r	  r    r%   r"   <module>r&     s^    " %  - - G C Co od@ @F sEz"' .A .Ar%   