Ë
    Dü´j¾‹  ã                  ón  — U d dl mZ d dlZd dlmZ d dlmZ d dlmZ ddl	m
Z
mZmZmZ ddlmZmZmZmZmZ dd	lmZ dd
lmZmZ ddlmZmZmZmZmZmZ  ej@                  d«      Z! ejD                  «       Z#e#jI                   ejJ                  d«      «        e&ed„ ¬«      Z'de(d<   	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z)	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z*	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z+	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z,y)é    )ÚannotationsN)Ú	lru_cache)ÚPathLike)ÚBinaryIOé   )Úcoherence_ratioÚencoding_languagesÚmb_encoding_languagesÚmerge_coherence_ratios)ÚIANA_SUPPORTEDÚIANA_SUPPORTED_SIMILARÚTOO_BIG_SEQUENCEÚTOO_SMALL_SEQUENCEÚTRACE)Ú
mess_ratio)ÚCharsetMatchÚCharsetMatches)Úany_specified_encodingÚcut_sequence_chunksÚ	iana_nameÚidentify_sig_or_bomÚis_multi_byte_encodingÚshould_strip_sig_or_bomÚcharset_normalizerz)%(asctime)s | %(levelname)s | %(message)sc                ó   — t        | «       S ©N)r   ©Úencodings    úT/root/workspace/ytshorts/venv/lib/python3.12/site-packages/charset_normalizer/api.pyú<lambda>r    .   s   € Ô-CÀHÓ-MÐ)M€ ó    )Úkeyz	list[str]ÚIANA_SUPPORTED_MB_FIRSTc
                óf  — t        | t        t        f«      s#t        dj	                  t        | «      «      «      ‚|rBt        j                  }
t        j                  t        «       t        j                  t        «       t        | «      }|dk(  r_t        j                  d«       |r.t        j                  t        «       t        j                  
«       t        t!        | dddg d«      g«      S |�Dt        j#                  t        d	d
j%                  |«      «       |D �cg c]  }t'        |d«      ‘Œ }}ng }|�Dt        j#                  t        dd
j%                  |«      «       |D �cg c]  }t'        |d«      ‘Œ }}ng }|||z  k  r!t        j#                  t        d|||«       d}|}|dkD  r||z  |k  rt)        ||z  «      }t        | «      t*        k  }t        | «      t,        k\  }|rt        j#                  t        d|«       n|rt        j#                  t        d|«       g }|rt/        | «      nd}|�,|j1                  |«       t        j#                  t        d|«       t3        «       }g }g }t3        «       } t5        d¬«      t6        «      } t5        d¬«      t8        «      }d}t3        «       }d}d}d}d}d}d}t        «       }t        «       } t;        | «      \  }!}"|!�7|j=                  d|!«       t        j#                  t        dt        |"«      |!«       |j1                  d«       d|vr|j1                  d«       |t>        z   D �]  }#|r|#|vrŒ|r|#|v rŒ|#|v rŒ|jA                  |#«       d}$|!|#k(  }%|%xr tC        |#«      }&|#dv r|%st        j#                  t        d|#«       Œ`|#dv r|%st        j#                  t        d|#«       Œ‚|#|v rt        j#                  t        d|#«       Œ¢	 tE        |#«      }'|r[|'st3        tK        |#«      «      }(nt3        tM        |#«      «      }(|(jO                  |«      st        j#                  t        d|#|(|«       �Œ|r&|'s$||k\  rt        j#                  t        d|#||«       �Œ3|r|'st        j#                  t        d|#«       �ŒT|' xr | })	 |r5|'s3tQ        |&s| dt)        d«       n| t        |"«      t)        d«       |#¬«       nC|)sA|#d k(  r|%rtQ        | |#¬«      }$|$r+|$d   d!k(  r#|$dd }$ntQ        |&s| n| t        |"«      d |#¬«      }$tW        |%sdn
t        |"«      |t)        ||z  «      «      }+|'xr |$duxr t        |$«      |k  },|,rt        j#                  t        d#|#«       t)        t        |+«      d$z  «      }-tY        |-d%«      }-d}.d}/g }0g }1	 t[        | |#|+||%|&|"|'|$|)«
      D ]`  }2|0j1                  |2«       |1j1                   ||2||xr dt        |«      cxk  xr d%k  nc «      «       |1d&   |k\  r|.dz  }.|.|-k\  s|%sŒ]|&rŒ` n |1rt]        |1«      t        |1«      z  nd}3|/s.|r,|'s*|3|k  r%|.|-k  r 	 | t)        d)«      d j_                  |#d*¬+«       |3|k\  s|.|-k\  r³|j1                  |#«       |#t`        v r|jc                  t`        |#   «       t        j#                  t        d-|#|.te        |3d.z  d/¬0«      «       |	rS|#dd|d1d2fv rJ|/sH|$€"	 tQ        |&s| n| t        |"«      d |#¬«      }$|rd}$t!        | |#||%g |$|¬4«      }4|#|k(  r|4}n
|#dk(  r|4}n|4}�ŒÝ|)r	 tQ        |&s| n| t        |"«      d |#¬«      }$t        j#                  t        d5|#te        |3d.z  d/¬0«      «       |'stK        |#«      }5ntM        |#«      }5|5rt        j#                  t        d6|#|5«       g }6|#dk7  r7|5rd7j%                  |5«      nd}7|0D ]  }2 ||2||7«      }8|6j1                  |8«       Œ tg        |6«      }9|9rt        j#                  t        d8|9|#«       t!        | |#|3|%|9|r|#|ddfv r|$nd|¬4«      }:|j1                  |:«       |r|'s
|3d9k  r|dz  }|#|ddfv ry|3d:k  rt|3dk(  r^t        j                  d;|:jh                  «       |r.t        j                  t        «       t        j                  
«       t        |:g«      c S | j1                  |:«       t        | «      r€|�||v rzd|v rvd|v rr| jk                  «       };|;€J ‚t        j                  d;|;jh                  «       |r.t        j                  t        «       t        j                  
«       t        |;g«      c S |sW|'sU|9rtY        d<„ |9D «       d¬=«      nd}<|<d>k\  r8d|v r4d|v r0d(}|jc                  |5«       t        j#                  t        d?|#|3|<«       |s\|'rZ|,rX|$�Vt        |$«      |d@z  k  rE|#dAvrAd|v r=d|v r9d(}t        j#                  t        dB|#|3t        |$«      |t        |$«      |z  d.z  «       |#|!k(  s�ŒÊt        j                  dC|#«       |r.t        j                  t        «       t        j                  
«       t        ||#   g«      c S  t        |«      dk(  rÆ|s|s|rt        j#                  t        dD«       |r2t        j                  dE|jh                  «       |j1                  |«       nr|r|�|r|r|jl                  |jl                  k7  s|�'t        j                  dF«       |j1                  |«       n(|r&t        j                  dG«       |j1                  |«       |r<t        j                  dH|jk                  «       jh                  t        |«      dz
  «       nt        j                  dI«       |r.t        j                  t        «       t        j                  
«       |S c c}w c c}w # tF        tH        f$ r t        j#                  t        d|#«       Y �Œ²w xY w# tR        tT        f$ rQ}*t        |*tT        «      s%t        j#                  t        d"|#tQ        |*«      «       |j1                  |#«       Y d}*~*�	Œd}*~*ww xY w# tR        tT        f$ rr}*|)r<t        j#                  t        d"|#tQ        |*«      «       |j1                  |#«       Y d}*~*�	Œft        j#                  t        d'|#tQ        |*«      «       |-}.d(}/Y d}*~*�ŒÀd}*~*ww xY w# tR        $ rA}*t        j#                  t        d,|#tQ        |*«      «       |j1                  |#«       Y d}*~*�	Œâd}*~*ww xY w# tR        tT        f$ r t        j#                  t        d3|#«       Y �
Œw xY w# tR        tT        f$ rA}*t        j#                  t        d"|#tQ        |*«      «       |j1                  |#«       Y d}*~*�
Œfd}*~*ww xY w)Jaf  
    Given a raw bytes sequence, return the best possibles charset usable to render str objects.
    If there is no results, it is a strong indicator that the source is binary/not text.
    By default, the process will extract 5 blocks of 512o each to assess the mess and coherence of a given sequence.
    And will give up a particular code page after 20% of measured mess. Those criteria are customizable at will.

    The preemptive behavior DOES NOT replace the traditional detection workflow, it prioritize a particular code page
    but never take it for granted. Can improve the performance.

    You may want to focus your attention to some code page or/and not others, use cp_isolation and cp_exclusion for that
    purpose.

    This function will strip the SIG in the payload/sequence every time except on UTF-16, UTF-32.
    By default the library does not setup any handler other than the NullHandler, if you choose to set the 'explain'
    toggle to True it will alter the logger configuration to add a StreamHandler that is suitable for debugging.
    Custom logging format and handler can be set manually.
    z3Expected object of type bytes or bytearray, got: {}r   z<Encoding detection on empty bytes, assuming utf_8 intention.Úutf_8g        FÚ Nz`cp_isolation is set. use this flag for debugging purpose. limited list of encoding allowed : %s.z, zacp_exclusion is set. use this flag for debugging purpose. limited list of encoding excluded : %s.z^override steps (%i) and chunk_size (%i) as content does not fit (%i byte(s) given) parameters.r   z>Trying to detect encoding from a tiny portion of (%i) byte(s).zIUsing lazy str decoding because the payload is quite large, (%i) byte(s).z@Detected declarative mark in sequence. Priority +1 given for %s.)Úmaxsizeé   zIDetected a SIG or BOM mark on first %i byte(s). Priority +1 given for %s.Úascii>   Úutf_16Úutf_32z\Encoding %s won't be tested as-is because it require a BOM. Will try some sub-encoder LE/BE.>   Úutf_7zREncoding %s won't be tested as-is because detection is unreliable without BOM/SIG.zY%s is deemed too similar to a code page that was already considered unsuited. Continuing!z2Encoding %s does not provide an IncrementalDecoderzbSkipping %s: definitive match already found, this encoding targets different languages (%s vs %s).zXSkipping %s: already accumulated %d same-family results after definitive match (cap=%d).zCSkipping single-byte %s: multi-byte definitive match already found.g    €„Ar   r,   u   ï»¿z9Code page %s does not fit given bytes sequence at ALL. %szpCode page %s is a multi byte encoding table and it appear that at least one character was encoded using n-bytes.é   é   éÿÿÿÿzaLazyStr Loading: After MD chunk decode, code page %s does not fit given bytes sequence at ALL. %sTg     jè@Ústrict)Úerrorsz^LazyStr Loading: After final lookup, code page %s does not fit given bytes sequence at ALL. %szc%s was excluded because of initial chaos probing. Gave up %i time(s). Computed mean chaos is %f %%.éd   é   )Úndigitsr*   r+   z>%s does not decode the whole payload: fallback entry withheld.)Úpreemptive_declarationz=%s passed initial chaos probing. Mean measured chaos is %f %%z&%s should target any language(s) of %sú,z We detected language %s using %sg{®Gáz”?çš™™™™™¹?z.Encoding detection: %s is most likely the one.c              3  ó&   K  — | ]	  \  }}|–— Œ y ­wr   © )Ú.0Ú_Úvs      r   ú	<genexpr>zfrom_bytes.<locals>.<genexpr>À  s   è ø€ Ò4™4˜1˜a”QÑ4ùs   ‚)Údefaultg      à?zyDefinitive match found: %s (chaos=%.3f, coherence=%.2f). Encodings targeting different language families will be skipped.g\�Âõ(\ï?>	   r,   r%   r*   r+   Ú	utf_16_beÚ	utf_16_leÚ	utf_32_beÚ	utf_32_leÚ	utf_8_sigzjMulti-byte definitive match: %s (chaos=%.3f, decoded=%d/%d=%.1f%%). Single-byte encodings will be skipped.zoEncoding detection: %s is most likely the one as we detected a BOM or SIG within the beginning of the sequence.zONothing got out of the detection process. Using ASCII/UTF-8/Specified fallback.z7Encoding detection: %s will be used as a fallback matchz:Encoding detection: utf_8 will be used as a fallback matchz:Encoding detection: ascii will be used as a fallback matchz]Encoding detection: Found %s as plausible (best-candidate) for content. With %i alternatives.z=Encoding detection: Unable to determine any suitable charset.)7Ú
isinstanceÚ	bytearrayÚbytesÚ	TypeErrorÚformatÚtypeÚloggerÚlevelÚ
addHandlerÚexplain_handlerÚsetLevelr   ÚlenÚdebugÚremoveHandlerr   r   ÚlogÚjoinr   Úintr   r   r   ÚappendÚsetr   r   r   r   Úinsertr#   Úaddr   r   ÚModuleNotFoundErrorÚImportErrorr	   r
   ÚintersectionÚstrÚUnicodeDecodeErrorÚLookupErrorÚrangeÚmaxr   ÚsumÚdecoder   ÚupdateÚroundr   r   ÚbestÚfingerprint)=Ú	sequencesÚstepsÚ
chunk_sizeÚ	thresholdÚcp_isolationÚcp_exclusionÚpreemptive_behaviourÚexplainÚlanguage_thresholdÚenable_fallbackÚprevious_logger_levelÚlengthÚcpÚis_too_small_sequenceÚis_too_large_sequenceÚprioritized_encodingsÚspecified_encodingÚtestedÚtested_but_hard_failureÚtested_but_soft_failureÚsoft_failure_skipÚcached_mess_ratioÚcached_coherence_ratioÚdefinitive_match_foundÚdefinitive_target_languagesÚ post_definitive_sb_success_countÚPOST_DEFINITIVE_SB_CAPÚmb_definitive_match_foundÚfallback_asciiÚfallback_u8Úfallback_specifiedÚresultsÚearly_stop_resultsÚsig_encodingÚsig_payloadÚencoding_ianaÚdecoded_payloadÚbom_or_sig_availableÚstrip_sig_or_bomÚis_multi_byte_decoderÚenc_languagesÚdeferred_decodingÚeÚr_Úmulti_byte_bonusÚmax_chunk_gave_upÚearly_stop_countÚlazy_str_hard_failureÚ	md_chunksÚ	md_ratiosÚchunkÚmean_mess_ratioÚfallback_entryÚtarget_languagesÚ	cd_ratiosÚlg_inclusionÚchunk_languagesÚcd_ratios_mergedÚcurrent_matchÚprobable_resultÚbest_coherences=                                                                r   Ú
from_bytesr¤   2   s³  € ô< �i¤)¬UÐ!3Ô4ÜØA×HÑHÜ�Y“óó
ð 	
ñ Ü%+§\¡\ÐÜ×Ñœ/Ô*Ü�‰œÔä�i“.€Fà�‚{Ü�‰ÐSÔTÙÜ× Ñ ¤Ô1Ü�O‰OÐ1Ô2Üœ|¨I°wÀÀUÈBÐPRÓSÐTÓUÐUàÐÜ�
‰
Üð5à�I‰I�lÓ#ô		
ð 8DÖD°œ	 " eÕ,ÐDˆÑDàˆàÐÜ�
‰
Üð6à�I‰I�lÓ#ô		
ð 8DÖD°œ	 " eÕ,ÐDˆÑDàˆà�*˜uÑ$Ò%Ü�
‰
ÜØlØØØô	
ð ˆØˆ
àˆq‚y�V˜e‘^ jÒ0Ü˜ %™Ó(ˆ
ä"% i£.Ô3EÑ"EÐÜ"% i£.Ô4DÑ"DÐáÜ�
‰
ÜØLØõ	
ñ
 
Ü�
‰
ÜØWØô	
ð (*Ðñ .BÔ˜yÔ)Àtð ð Ð%Ø×$Ñ$Ð%7Ô8Ü�
‰
ÜØNØô	
ô “u€FØ)+ÐØ)+ÐÜ"%£%Ðð 0œ	¨$Ô/´
Ó;ÐØ4œY¨tÔ4´_ÓEÐð $)ÐÜ,/«EÐð -.Ð$Ø"#Ðð ',Ðà*.€NØ'+€KØ.2Ðä,Ó.€Gä)7Ó)9Ðä 3°IÓ >Ñ€L�+àÐØ×$Ñ$ Q¨Ô5Ü�
‰
ÜØWÜ�ÓØô		
ð × Ñ  Ô)àÐ+Ñ+Ø×$Ñ$ WÔ-à.Ô1HÑHó V<ˆÙ˜M°Ñ=Øá˜M¨\Ñ9Øà˜FÑ"Øà�
‰
�=Ô!à&*ˆØ%1°]Ñ%BÐØ!5ò "
Ô:QØó;
Ðð Ð0Ñ0Ñ9MÜ�J‰JÜØnØôð
 Ø˜IÑ%Ñ.BÜ�J‰JÜØdØôð
 ð Ð-Ñ-Ü�J‰JÜØkØôð
 ð	Ü*@ÀÓ*OÐ!ñ "Ù(Ü #Ô$6°}Ó$EÓ F‘ä #Ô$9¸-Ó$HÓ I�Ø ×-Ñ-Ð.IÔJÜ—
‘
ÜØxØ!Ø!Ø/ôñ ñ #Ù)Ø0Ð4JÒJä�J‰JÜØjØØ0Ø&ôñ ñ
 %Ñ-BÜ�J‰JÜØUØôñ
 ð &Ð%ÒCÐ.CÐ*Cð 	ð*	Ù$Ñ-BÜñ  0ð " +¤C¨£IÑ.à&¤s¨;Ó'7¼#¸d»)ÐDà*öñ 'ð ! GÒ+Ñ0DÜ&)Ø!Ø!.ô'�Oñ '¨?¸1Ñ+=ÀÒ+IØ*9¸!¸"Ð*=™ä&)ñ $4ñ &à!*¬3¨{Ó+;Ð+=Ð!>à!.ô'�Oô& Ù)‰A¬s°;Ó/?ØÜ�˜‘Óó
ˆð "ò .Ø tÐ+ò.ä�OÓ$ vÑ-ð 	ñ Ü�J‰JÜð-àô	ô "%¤S¨£W¨q¡[Ó!1ÐäÐ 1°1Ó5ÐØ !ÐØ %Ðà!ˆ	Øˆ	ð5	)Ü,ØØØØØ$Ø ØØ%ØØ!óò �ð × Ñ  Ô'à× Ñ Ù%ØØ!ØÒ? A¬¨\Ó):Ö$?¸aÔ$?óôð ˜R‘= IÒ-Ø$¨Ñ)Ð$à$Ð(9Ò9Ú(Ò1Aáð9ñl EN¤ Y£´#°i³.Ò!@ÐSVˆñ
 &Ù%Ù)Ø )Ò+Ø Ð#4Ò4ð
Øœ#˜d›)˜+Ð&×-Ñ-¨mÀHÐ-ÔMð ˜iÒ'Ð+;Ð?PÒ+PØ#×*Ñ*¨=Ô9ØÔ 6Ñ6Ø!×(Ñ(Ô)?ÀÑ)NÔOÜ�J‰JÜð0àØ Ü�o¨Ñ+°QÔ7ôñ  Ø!Ø˜WÐ&8¸(ÀHÐMñNá-ð #Ð*ð!Ü*-ñ (8ñ !*à%.¬s°;Ó/?Ð/AÐ%Bà%2ô+˜ñ -à*.˜ä!-ØØ!ØØ(ØØ#Ø+=ô"�ð !Ð$6Ò6Ø)7Ñ&Ø" gÒ-Ø%3‘Nà"0�KÙáðÜ"%ñ  0ñ "à&¤s¨;Ó'7Ð'9Ð:à*ô#�ô$ 	�
‰
ÜØKØÜ�/ CÑ'°Ô3ô		
ñ %Ü*<¸]Ó*KÑä4°]ÓCÐáÜ�J‰JÜØ8ØØ ô	ð ˆ	ð ˜GÒ#ñ /?�—‘Ð)Ô*ÀDð ð #ò 2�Ù"8ØØ&Ø ó#�ð × Ñ  Õ1ð2ô 2°)Ó<ÐáÜ�J‰JÜØ2Ø Øô	ô %ØØØØ Øñ .Ø$Ð);¸WÀgÐ(NÑNñ  ð
 à#5ô
ˆð" 	�‰�}Ô%ñ #Ù)Ø $Ò&à,°Ñ1Ð,ð Ð0°'¸7ÐCÑCØ #Ò%ð  #Ò%Ü—‘ØDØ!×*Ñ*ôñ Ü×(Ñ(¬Ô9Ü—O‘OÐ$9Ô:Ü% } oÓ6Ò6à×%Ñ% mÔ4ô Ð"Ô#Ø#Ð+Ð/AÀVÑ/KØ˜6Ñ!Ø˜6Ñ!à0×5Ñ5Ó7ˆOØ"Ð.Ð.Ð.Ü�L‰LØ@Ø×(Ñ(ôñ Ü×$Ñ$¤_Ô5Ü—‘Ð 5Ô6ä! ?Ð"3Ó4Ò4ñ &Ñ.Cñ $ô Ñ4Ð#3Ô4¸cÕBàð ð
  Ò$¨°FÑ):¸wÈ&Ñ?PØ)-Ð&Ø+×2Ñ2Ð3CÔDÜ—
‘
Üð PØ!Ø#Ø"ôñ *Ù%Ù ØÐ+Ü�OÓ$ v°¡}Ò4Øð
ñð ˜6Ñ!Ø˜6Ñ!à(,Ð%Ü�J‰JÜØ|ØØÜ�OÓ$ØÜ�OÓ$ vÑ-°Ñ3ôð ˜LÔ(Ü�L‰Lð1àôñ
 Ü×$Ñ$¤_Ô5Ü—‘Ð 5Ô6Ü! 7¨=Ñ#9Ð":Ó;Ò;ðmV<ôp ˆ7ƒ|�qÒÙ™.Ñ,>Ü�J‰JÜØaôñ
 Ü�L‰LØIØ"×+Ñ+ôð �N‰NÐ-Õ.á˜^Ð3áÙ"Ø×+Ñ+¨~×/IÑ/IÒIàÐ'ä�L‰LÐUÔVØ�N‰N˜;Õ'ÙÜ�L‰LÐUÔVØ�N‰N˜>Ô*áÜ�‰ØkØ�L‰L‹N×#Ñ#Ü�‹L˜1Ñõ	
ô 	�‰ÐTÔUáÜ×Ñœ_Ô-Ü�‰Ð-Ô.à€Nùòw Eùò Eøôx $¤[Ð1ò 	Ü�J‰JÜØDØôò
 ð	ûôH #¤KÐ0ò 		Ü˜a¤Ô-Ü—
‘
ÜØOØ!Ü˜“Fô	ð $×*Ñ*¨=Ô9Ýûð		ûôN Üð
ò 	)ñ !ô —
‘
ÜØOØ!Ü˜“Fô	ð (×.Ñ.¨}Ô=ÝÜ�J‰JÜØsØÜ�A“ô	ð  1ÐØ$(Ö!ûð/	)ûôL &ò Ü—
‘
ÜØtØ!Ü˜“Fô	ð (×.Ñ.¨}Ô=ÝûðûôV /´Ð<ò !ÜŸ
™
Ü!Ø\Ø)ôò
 !ð!ûôP '¬Ð4ò Ü—
‘
ÜØOØ!Ü˜“Fô	ð (×.Ñ.¨}Ô=Ýûðús¥   Äo Å%oÏ(o
Ò"A:o;Ö#A0qØqØqÙs"Ût/Ü%u ï
*o8ï7o8ï;qð
Aqñqñsñ-8sò+)sósó"	t,ó+6t'ô't,ô/*uõuõ v0õ/6v+ö+v0c
                óF   — t        | j                  «       |||||||||	«
      S )z†
    Same thing than the function from_bytes but using a file pointer that is already ready.
    Will not close the file pointer.
    )r¤   Úread)
Úfprh   ri   rj   rk   rl   rm   rn   ro   rp   s
             r   Úfrom_fpr¨   *  s5   € ô  Ø
�‰‹	ØØØØØØØØØóð r!   c
                ón   — t        | d«      5 }
t        |
|||||||||	«
      cddd«       S # 1 sw Y   yxY w)z•
    Same thing than the function from_bytes but with one extra step. Opening and reading given file path in binary mode.
    Can raise IOError.
    ÚrbN)Úopenr¨   )Úpathrh   ri   rj   rk   rl   rm   rn   ro   rp   r§   s              r   Ú	from_pathr­   H  sK   € ô  
ˆd�DÓ	ð 
˜RÜØØØØØØØ ØØØó
÷
÷ 
ò 
ús   �+«4c
                óê   — t        | t        t        f«      rt        | |||||||||	¬«
      }
|
 S t        | t        t
        f«      rt        | |||||||||	¬«
      }
|
 S t        | |||||||||	¬«
      }
|
 S )a)  
    Detect if the given input (file, bytes, or path) points to a binary file. aka. not a string.
    Based on the same main heuristic algorithms and default kwargs at the sole exception that fallbacks match
    are disabled to be stricter around ASCII-compatible but unlikely to be a string.
    )	rh   ri   rj   rk   rl   rm   rn   ro   rp   )rD   r\   r   r­   rF   rE   r¤   r¨   )Úfp_or_path_or_payloadrh   ri   rj   rk   rl   rm   rn   ro   rp   Úguessess              r   Ú	is_binaryr±   g  sÇ   € ô" Ð'¬#¬x¨Ô9ÜØ!ØØ!ØØ%Ø%Ø!5ØØ1Ø+ô
ˆðZ ˆ;ÐôC 
ØäÜð	
ô
ô Ø!ØØ!ØØ%Ø%Ø!5ØØ1Ø+ô
ˆð4 ˆ;Ðô Ø!ØØ!ØØ%Ø%Ø!5ØØ1Ø+ô
ˆð ˆ;Ðr!   )	é   é   çš™™™™™É?NNTFr7   T)rg   zbytes | bytearrayrh   rT   ri   rT   rj   Úfloatrk   úlist[str] | Nonerl   r¶   rm   Úboolrn   r·   ro   rµ   rp   r·   Úreturnr   )r§   r   rh   rT   ri   rT   rj   rµ   rk   r¶   rl   r¶   rm   r·   rn   r·   ro   rµ   rp   r·   r¸   r   )r¬   zstr | bytes | PathLikerh   rT   ri   rT   rj   rµ   rk   r¶   rl   r¶   rm   r·   rn   r·   ro   rµ   rp   r·   r¸   r   )	r²   r³   r´   NNTFr7   F)r¯   z!PathLike | str | BinaryIO | bytesrh   rT   ri   rT   rj   rµ   rk   r¶   rl   r¶   rm   r·   rn   r·   ro   rµ   rp   r·   r¸   r·   )-Ú
__future__r   ÚloggingÚ	functoolsr   Úosr   Útypingr   Úcdr   r	   r
   r   Úconstantr   r   r   r   r   Úmdr   Úmodelsr   r   Úutilsr   r   r   r   r   r   Ú	getLoggerrJ   ÚStreamHandlerrM   ÚsetFormatterÚ	FormatterÚsortedr#   Ú__annotations__r¤   r¨   r­   r±   r9   r!   r   ú<module>rÉ      s×  ðÞ "ã Ý Ý Ý ÷ó ÷õ õ ß 0÷÷ ð 
ˆ×	Ñ	Ð/Ó	0€Ø'�'×'Ñ'Ó)€Ø × Ñ Ø€G×ÑÐAÓBôñ &,ØÑMô&Ð ˜ó ð ØØØ%)Ø%)Ø!%ØØ #Ø ðuØ ðuàðuð ðuð ð	uð
 #ðuð #ðuð ðuð ðuð ðuð ðuð óuðt ØØØ%)Ø%)Ø!%ØØ #Ø ðØðàðð ðð ð	ð
 #ðð #ðð ðð ðð ðð ðð óð@ ØØØ%)Ø%)Ø!%ØØ #Ø ð
Ø
 ð
àð
ð ð
ð ð	
ð
 #ð
ð #ð
ð ð
ð ð
ð ð
ð ð
ð ó
ðB ØØØ%)Ø%)Ø!%ØØ #Ø!ð?Ø<ð?àð?ð ð?ð ð	?ð
 #ð?ð #ð?ð ð?ð ð?ð ð?ð ð?ð 
ô?r!   