ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- PKd]1Y; ; +idna/__pycache__/codec.cpython-38.opt-1.pycnu[U .e @sddlmZmZmZmZmZddlZddlZedZ Gdddej Z Gdddej Z Gd d d ej ZGd d d e ejZGd dde ejZddZdS))encodedecodealabelulabel IDNAErrorNu [.。.。]c@s eZdZdddZdddZdS) CodecstrictcCs.|dkrtd||sdSt|t|fSNr Unsupported error handling "{0}"r)rformatrlenselfdataerrorsr:/usr/lib/python3.8/site-packages/pip/_vendor/idna/codec.pyr s z Codec.encodecCs.|dkrtd||sdSt|t|fSr )rrrrrrrrrs z Codec.decodeN)r )r )__name__ __module__ __qualname__rrrrrrrs rc@seZdZddZdS)IncrementalEncoderc Cs|dkrtd||sdSt|}d}|rV|dsDd}|d=n|sV|d=|rVd}g}d}|D]*}|t||r|d7}|t|7}qbd||}|t|7}||fS) Nr r r r .rr)rr_unicode_dots_resplitappendrrjoin rrrfinallabelsZ trailing_dotresultsizeZlabelrrr_buffer_encodes0  z!IncrementalEncoder._buffer_encodeN)rrrr%rrrrrsrc@seZdZddZdS)IncrementalDecoderc Cs|dkrtd||sdSt|tr4t|}nt|}t|d|d}d}|r~|dsld}|d=n|s~|d=|r~d}g}d}|D]*}|t||r|d 7}|t |7}qd ||}|t |7}||fS) Nr r r asciirr rrr) rr isinstanceZunicoderrstrrrrrr rrr_buffer_decode?s8     z!IncrementalDecoder._buffer_decodeN)rrrr*rrrrr&>sr&c@s eZdZdS) StreamWriterNrrrrrrrr+gsr+c@s eZdZdS) StreamReaderNr,rrrrr-jsr-c Cs tjdtjtjttttdS)NZidna)namerrincrementalencoderincrementaldecoder streamwriter streamreader) codecs CodecInforrrrr&r+r-rrrr getregentrymsr5)Zcorerrrrrr3recompilerrBufferedIncrementalEncoderrBufferedIncrementalDecoderr&r+r-r5rrrrs !)PKd]6P)idna/__pycache__/intranges.cpython-38.pycnu[U ʗReY@sdZddlZddlmZmZeeeedfdddZeeedd d Zeeeefd d d Zeeedfe dddZ dS)a  Given a list of integers, made up of (hopefully) a small number of long runs of consecutive integers, compute a representation of the form ((start1, end1), (start2, end2) ...). Then answer the question "was x present in the original list?" in time O(log(# runs)). N)ListTuple.)list_returncCst|}g}d}tt|D]b}|dt|krJ||||ddkrJq||d|d}|t|d|dd|}qt|S)aRepresent a list of integers as a sequence of ranges: ((start_0, end_0), (start_1, end_1), ...), such that the original integers are exactly those x such that start_i <= x < end_i for some i. Ranges are encoded as single integers (start << 32 | end), not as tuples. r)sortedrangelenappend _encode_rangetuple)r sorted_listranges last_writei current_ranger/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/idna/intranges.pyintranges_from_list sr)startendrcCs |d>|BS)N r)rrrrrr sr )rrcCs|d?|d@fS)Nrlr)rrrr _decode_range#sr)int_rrcCszt|d}t||}|dkrNt||d\}}||krF|krNnndS|t|krvt||\}}||krvdSdS)z=Determine if `int_` falls into one of the ranges in `ranges`.rrTF)r bisect bisect_leftrr )rrtuple_posleftright_rrrintranges_contain's   r#) __doc__rtypingrrintrr rboolr#rrrrs PKd]x,idna/__pycache__/package_data.cpython-38.pycnu[U ʗRe@sdZdS)z3.3N) __version__rr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/idna/package_data.pyPKd]6+1#1#*idna/__pycache__/core.cpython-38.opt-1.pycnu[U .e-@s>ddlmZddlZddlZddlZddlZddlmZdZdZ e dZ ej ddkr`e ZeZGd d d eZGd d d eZGd ddeZGdddeZddZddZddZddZddZddZd7ddZd d!Zd"d#Zd$d%Zd&d'Z d8d(d)Z!d*d+Z"d,d-Z#d.d/Z$d9d1d2Z%d:d3d4Z&d;d5d6Z'dS)<)idnadataN)intranges_contain sxn--u [.。.。]c@seZdZdZdS) IDNAErrorz7 Base exception for all IDNA-encoding related problems N__name__ __module__ __qualname____doc__r r 9/usr/lib/python3.8/site-packages/pip/_vendor/idna/core.pyrsrc@seZdZdZdS) IDNABidiErrorz= Exception when bidirectional requirements are not satisfied Nrr r r rrsrc@seZdZdZdS)InvalidCodepointz> Exception when a disallowed or unallocated codepoint is used Nrr r r rrsrc@seZdZdZdS)InvalidCodepointContextzE Exception when the codepoint is not valid in the context it is used Nrr r r rrsrcCs0tt|}|dkr,tt|s,td|S)Nrz Unknown character in unicodedata) unicodedataZ combiningunichrname ValueError)cpvr r r_combining_class$s rcCstt|tj|S)N)rordrZscripts)rZscriptr r r _is_script+srcCs |dS)Npunycode)encodesr r r _punycode.srcCs d|S)Nz U+{0:04X})formatrr r r_unot1sr!cCst|dkrdSdS)N?FTlenlabelr r rvalid_label_length5s r'cCst||rdndkrdSdS)NFTr#)r& trailing_dotr r rvalid_string_length<sr+Fc Cs^d}t|dD]:\}}t|}|dkrd}q|dkrd}q|sZtddS)NFrz3Unknown directionality in label {0} at position {1})RALANTr)r-r.Lz>First codepoint in label {0} must be directionality L, R or AL) r-r.r/ENESCSETONBNNSMzHInvalid direction for codepoint at position {0} in a right-to-left label)r-r.r1r/r7)r/r1z2Can not mix numeral types in a right-to-left label)r0r1r2r3r4r5r6r7zHInvalid direction for codepoint at position {0} in a left-to-right label)r0r1z0Label ends with illegal codepoint directionality) enumeraterZ bidirectionalrr repr) r&Z check_ltrZ bidi_labelidxr directionZrtlZ valid_endingZ number_typer r r check_bidiCsP       r<cCs"t|dddkrtddS)NrMz0Label begins with an illegal combining characterT)rcategoryrr%r r rcheck_initial_combinersr?cCs<|dddkrtd|ddks0|ddkr8tdd S) Nz--z4Label has disallowed hyphens in 3rd and 4th positionr-z)Label must not start or end with a hyphenT)rr%r r rcheck_hyphen_oks rDcCstd||krtddS)NNFCz%Label must be in Normalization Form C)r normalizerr%r r r check_nfcsrGcCs4t||}|dkr|dkr8tt||dtkr8dSd}t|dddD]B}tjt||}|tdkrrqL|tdtd fkrLd}qqL|sdSd}t|dt|D]B}tjt||}|tdkrq|td td fkrd}qq|S|d kr,|dkr(tt||dtkr(dSdSdSdS) Ni rrTFrCTr0Dr-i )rr_virama_combining_classrangerZ joining_typesgetr$)r&poscp_valueokiZ joining_typer r rvalid_contextjs<     rQcCst||}|dkrdd|kr0t|dkr`nn,t||ddkr`t||ddkr`dSdS|dkr|t|dkrt|dkrt||ddSdS|d ks|d kr|dkrt||dd SdS|d kr|D]6}|d krqt|ds t|ds t|drdSqdSd|kr.dkrhnn6|D],}dt|krVdkr6nndSq6dSd|krdkrnn6|D],}dt|krdkrnndSqdSdS)NrrlTFiuZGreekiiZHebrewi0u・ZHiraganaZKatakanaZHani`iiii)rr$r)r&rMZ exceptionrNrr r rvalid_contextos>  ( "    rTc CsLt|ttfr|d}t|dkr,tdt|t|t|t |D]\}}t |}t |t j drpqLqLt |t j drz,t||stdt||dt|Wn2tk rtdt||dt|YnXqLt |t j d r t||s>td t||dt|qLtd t||dt|qLt|dS) Nzutf-8rz Empty LabelZPVALIDZCONTEXTJz-Joiner {0} not allowed at position {1} in {2}rz?Unknown codepoint adjacent to joiner {0} at position {1} in {2}ZCONTEXTO0Codepoint {0} not allowed at position {1} in {2}z0Codepoint {0} at position {1} of {2} not allowed) isinstancebytes bytearraydecoder$rrGrDr?r8rrrZcodepoint_classesrQrr r!r9rrTrr<)r&rMrrNr r r check_labels<       rZcCs~z(|d}t|t|s$td|WStk r<YnX|sJtdt|}t|t|}t|}t|sztd|S)NasciizLabel too longzNo Input) rulabelr'rUnicodeEncodeErrorunicoderZr_alabel_prefixr%r r ralabel s" r`cCst|ttfs>z|d}Wn tk r<t||YSX|}|trb|t td}nt|| dS| d}t||S)Nr[r) rVrWrXrr]rZlower startswithr_r$rYr%r r rr\#s    r\Tc Cs(ddlm}d}zt|D]\}}t|}||dkr8|nt||dfd}|d} t|dkrj|dnd} | d ks| d kr|r| d kr|s| dkr||7}q| dk r| d ks| d kr|r| d kr|r|| 7}q| d krtqtd|WStk r"t d t ||dt |YnXdS)zBRe-map the characters in the string according to UTS46 processing.r) uts46datar,Zrr@NVrI3r=IrErU) rcr8rbisectZ bisect_leftr$ IndexErrorrrFrr r!r9) Zdomain std3_rules transitionalrcoutputrMcharZ code_pointZuts46rowZstatusZ replacementr r r uts46_remap8sV   roc Cst|ttfr|d}|r(t|||}d}g}|r@|d}n t|}|rX|dgkr`td|ddkrv|d=d}|D]$}t|}|r| |qztdqz|r| d d |}t ||std |S) Nr[F.r, Empty domainrCT Empty label.zDomain too long) rVrWrXrYrosplit_unicode_dots_rerr`appendjoinr+) rstrictuts46rkrlr*resultlabelsr&r r rrTs2          rcCst|ttfr|d}|r(t||d}d}g}|s@t|}n |d}|rX|dgkr`td|dsr|d=d}|D]$}t|}|r| |qvtdqv|r| dd |S) Nr[Frpr,rqrCTrr) rVrWrXrYrorvrurr\rwrx)rryrzrkr*r{r|r&r r rrYss,       rY)F)F)TF)FFFF)FFF)(r,rrirresysZ intrangesrrJr_compilerv version_infostrr^chrr UnicodeErrorrrrrrrrr!r'r+r<r?rDrGrQrTrZr`r\rorrYr r r rsB    < , )   PKd]2Jc&c&$idna/__pycache__/core.cpython-38.pycnu[U ʗRe1@sddlmZddlZddlZddlZddlmZmZddlm Z dZ dZ e dZ Gd d d eZGd d d eZGd ddeZGdddeZeedddZeeedddZeedddZeedddZeeefedddZeeefeedd d!ZdBeeed#d$d%Zeedd&d'Zeedd(d)Zeddd*d+Z eeed,d-d.Z!dCeeeed/d0d1Z"eeee#fddd2d3Z$eedd4d5Z%eeee#fedd6d7Z&dDeeeed9d:d;Z'dEeeee#feeeeed<d=d>Z(dFeeee#feeeed?d@dAZ)dS)G)idnadataN)UnionOptional)intranges_contain sxn--u [.。.。]c@seZdZdZdS) IDNAErrorz7 Base exception for all IDNA-encoding related problems N__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/idna/core.pyr src@seZdZdZdS) IDNABidiErrorz= Exception when bidirectional requirements are not satisfied Nr rrrrrsrc@seZdZdZdS)InvalidCodepointz> Exception when a disallowed or unallocated codepoint is used Nr rrrrrsrc@seZdZdZdS)InvalidCodepointContextzE Exception when the codepoint is not valid in the context it is used Nr rrrrrsr)cpreturncCs0tt|}|dkr,tt|s,td|S)Nrz Unknown character in unicodedata) unicodedata combiningchrname ValueError)rvrrr_combining_class s r)rscriptrcCstt|tj|S)N)rordrscripts)rrrrr _is_script'sr)srcCs |dS)Npunycode)encoder rrr _punycode*sr$cCs d|S)NzU+{:04X})formatr#rrr_unot-sr&)labelrcCst|dkrdSdS)N?FTlenr'rrrvalid_label_length1s r,)r' trailing_dotrcCst||rdndkrdSdS)NFTr))r'r-rrrvalid_string_length7sr0F)r' check_ltrrc Cs^d}t|dD]:\}}t|}|dkrd}q|dkrd}q|sZtddS)NFrz1Unknown directionality in label {} at position {})RALANTr)r3r4Lz=First codepoint in label {} must be directionality L, R or AL) r3r4r5ENESCSETONBNNSMzGInvalid direction for codepoint at position {} in a right-to-left label)r3r4r7r5r=)r5r7z2Can not mix numeral types in a right-to-left label)r6r7r8r9r:r;r<r=zGInvalid direction for codepoint at position {} in a left-to-right label)r6r7z0Label ends with illegal codepoint directionality) enumerater bidirectionalrr%repr) r'r1 bidi_labelidxr directionrtl valid_ending number_typerrr check_bidi=sP       rGcCs"t|dddkrtddS)NrMz0Label begins with an illegal combining characterT)rcategoryrr+rrrcheck_initial_combinerxsrJcCs<|dddkrtd|ddks0|ddkr8tdd S) Nz--z4Label has disallowed hyphens in 3rd and 4th positionr-z)Label must not start or end with a hyphenT)rr+rrrcheck_hyphen_ok~s rOcCstd||krtddS)NNFCz%Label must be in Normalization Form C)r normalizerr+rrr check_nfcsrR)r'posrcCs4t||}|dkr|dkr8tt||dtkr8dSd}t|dddD]B}tjt||}|tdkrrqL|tdtd fkrLd}qqL|sdSd}t|dt|D]B}tjt||}|tdkrq|td td fkrd}qq|S|d kr,|dkr(tt||dtkr(dSdSdSdS) Ni rrTFrNTr6Dr3i )rr_virama_combining_classranger joining_typesgetr*)r'rScp_valueoki joining_typerrrvalid_contextjs<     r^)r'rS exceptionrcCst||}|dkrdd|kr0t|dkr`nn,t||ddkr`t||ddkr`dSdS|dkr|t|dkrt|dkrt||ddSdS|d ks|d kr|dkrt||dd SdS|d kr|D]6}|d krqt|ds t|ds t|drdSqdSd|kr.dkrhnn6|D],}dt|krVdkr6nndSq6dSd|krdkrnn6|D],}dt|krdkrnndSqdSdS)NrrlTFiuGreekiiHebrewi0u・HiraganaKatakanaHani`iiii)rr*r)r'rSr_rZrrrrvalid_contextos@  ( "    rgc CsLt|ttfr|d}t|dkr,tdt|t|t|t |D]\}}t |}t |t j drpqLqLt |t j drz,t||stdt||dt|Wn2tk rtdt||dt|YnXqLt |t j d r t||s>td t||dt|qLtd t||dt|qLt|dS) Nzutf-8rz Empty LabelPVALIDCONTEXTJz*Joiner {} not allowed at position {} in {}rzrrrcodepoint_classesr^rr%r&r@rrgrrG)r'rSrrZrrr check_labels<       rqcCs~z(|d}t|t|s$td|WStk r<YnX|sJtdt|}t|t|}t|}t|sztd|S)NasciizLabel too longzNo Input) r"ulabelr,rUnicodeEncodeErrorstrrqr$_alabel_prefixr' label_bytesrrralabels" rycCst|ttfs@z|d}WqDtk r<t||YSXn|}|}|tr|t td}|srt d| dddkrt dnt|| dSz| d}Wnt k rt dYnXt||S)Nrrz5Malformed A-label, no Punycode eligible content foundrNrMz"A-label must not end with a hyphenr!zInvalid A-label) rlrmrnr"rtrqlower startswithrvr*rro UnicodeErrorrwrrrrss,    rsT)domain std3_rules transitionalrc Cs(ddlm}d}t|D]\}}t|}z||dkr:|nt||dfd}|d} d} t|dkrp|d} | d ks| d kr|r| d kr|s| dkr||7}n@| dk r| d ks| d kr|r| d kr|r|| 7}n| d krtWqtk rtdt ||dt |YqXqt d|S)zBRe-map the characters in the string according to UTS46 processing.r) uts46datar2ZNrKVrU3rHIrkrP) rr>rbisect bisect_leftr* IndexErrorrr%r&r@rrQ) r}r~rroutputrSchar code_pointuts46rowstatus replacementrrr uts46_remap4sZ      r)r strictuts46r~rrc Cst|ttfr|d}|r(t|||}d}g}|r@|d}n t|}|rX|dgkr`td|ddkrv|d=d}|D]$}t|}|r| |qztdqz|r| d d |}t ||std |S) NrrF.r2 Empty domainrNT Empty label.zDomain too long) rlrmrnrorsplit_unicode_dots_rerryappendjoinr0) r rrr~rr-resultlabelsr'rrrr"Ts2          r")r rrr~rcCszt|ttfr|d}Wntk r8tdYnX|rJt||d}d}g}|sbt|}n |d}|rz|dgkrtd|ds|d=d}|D]$}t |}|r| |qtd q|r| dd |S) NrrzInvalid ASCII in A-labelFrr2rrNTr) rlrmrnroUnicodeDecodeErrorrrrrrsrr)r rrr~r-rrr'rrrrors2      ro)F)F)TF)FFFF)FFF)*r2rrrretypingrr intrangesrrVrvcompilerr|rrrrintrruboolrrmr$r&r,r0rGrJrOrRr^rgrnrqryrsrr"rorrrrs<   ;+* $PKd]|5)}})idna/__pycache__/uts46data.cpython-38.pycnu[U ʗRep@sddlmZmZmZdZeeeeefeeeeffdddZeeeeefeeeeffdddZeeeeefeeeeffddd Z eeeeefeeeeffdd d Z eeeeefeeeeffdd d Z eeeeefeeeeffdddZ eeeeefeeeeffdddZ eeeeefeeeeffdddZeeeeefeeeeffdddZeeeeefeeeeffdddZeeeeefeeeeffdddZeeeeefeeeeffdddZeeeeefeeeeffdddZeeeeefeeeeffdddZeeeeefeeeeffdd d!Zeeeeefeeeeffdd"d#Zeeeeefeeeeffdd$d%Zeeeeefeeeeffdd&d'Zeeeeefeeeeffdd(d)Zeeeeefeeeeffdd*d+Zeeeeefeeeeffdd,d-Zeeeeefeeeeffdd.d/Zeeeeefeeeeffdd0d1Zeeeeefeeeeffdd2d3Zeeeeefeeeeffdd4d5Zeeeeefeeeeffdd6d7Z eeeeefeeeeffdd8d9Z!eeeeefeeeeffdd:d;Z"eeeeefeeeeffddd?Z$eeeeefeeeeffdd@dAZ%eeeeefeeeeffddBdCZ&eeeeefeeeeffddDdEZ'eeeeefeeeeffddFdGZ(eeeeefeeeeffddHdIZ)eeeeefeeeeffddJdKZ*eeeeefeeeeffddLdMZ+eeeeefeeeeffddNdOZ,eeeeefeeeeffddPdQZ-eeeeefeeeeffddRdSZ.eeeeefeeeeffddTdUZ/eeeeefeeeeffddVdWZ0eeeeefeeeeffddXdYZ1eeeeefeeeeffddZd[Z2eeeeefeeeeffdd\d]Z3eeeeefeeeeffdd^d_Z4eeeeefeeeeffdd`daZ5eeeeefeeeeffddbdcZ6eeeeefeeeeffddddeZ7eeeeefeeeeffddfdgZ8eeeeefeeeeffddhdiZ9eeeeefeeeeffddjdkZ:eeeeefeeeeffddldmZ;eeeeefeeeeffddndoZeeeeefeeeeffddtduZ?eeeeefeeeeffddvdwZ@eeeeefeeeeffddxdyZAeeeeefeeeeffddzd{ZBeeeeefeeeeffdd|d}ZCeeeeefeeeeffdd~dZDeeeeefeeeeffdddZEeeeeefeeeeffdddZFeeeeefeeeeffdddZGeeeeefeeeeffdddZHeeeeefeeeeffdddZIeeeeefeeeeffdddZJeeeeefeeeeffdddZKeeeeefeeeeffdddZLeeeeefeeeeffdddZMeeeeefeeeeffdddZNeeeeefeeeeffdddZOeeeeefeeeeffdddZPeeeeefeeeeffdddZQeeeeefeeeeffdddZReeeeefeeeeffdddZSeeeeefeeeeffdddZTeeeeefeeeeffdddZUeeeeefeeeeffdddZVeeeeefeeeeffdddZWeXeee e e e e eeeeeeeeeeeeeeeeeee e!e"e#e$e%e&e'e(e)e*e+e,e-e.e/e0e1e2e3e4e5e6e7e8e9e:e;e<e=e>e?e@eAeBeCeDeEeFeGeHeIeJeKeLeMeNeOePeQeReSeTeUeVeWZYdS))ListTupleUnionz14.0.0)returncdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)r3)r)r)r)r)r)r)r)r) r) r) r) r) r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r) r)!r)"r)#r)$r)%r)&r)'r)(r))r)*r)+r),r)-V).r4)/r)0r4)1r4)2r4)3r4)4r4)5r4)6r4)7r4)8r4)9r4):r);r)<r)=r)>r)?r)@r)AMa)BrIb)CrIc)DrId)ErIe)FrIf)GrIg)HrIh)IrIi)JrIj)KrIk)LrIl)MrIm)NrIn)OrIo)PrIp)QrIq)RrIr)SrIs)TrIt)UrIu)VrIv)WrIw)XrIx)YrIy)ZrIz)[r)\r)]r)^r)_r)`r)ar4)br4)cr4rrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/idna/uts46data.py_seg_0 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)dr4)er4)fr4)gr4)hr4)ir4)jr4)kr4)lr4)mr4)nr4)or4)pr4)qr4)rr4)sr4)tr4)ur4)vr4)wr4)xr4)yr4)zr4){r)|r)}r)~r)r)X)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r )r4)r4)r4)r4)r4)r4)r4)ru ̈)r4)rIrJ)r4)r4)I)r4)r ̄)r4)r4)rI2)rIr)r ́)rIμ)r4)r4)ru ̧)rI1)rIrf)r4)rIu1⁄4)rIu1⁄2)rIu3⁄4)r4)rIà)rIá)rIâ)rIã)rIä)rIå)rIæ)rIçrrrrr_seg_1ssrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)rIè)rIé)rIê)rIë)rIì)rIí)rIî)rIï)rIð)rIñ)rIò)rIó)rIô)rIõ)rIö)r4)rIø)rIù)rIú)rIû)rIü)rIý)rIþ)Dss)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)r4)rIuā)ir4)irIuă)ir4)irIuą)ir4)irIuć)ir4)irIuĉ)i r4)i rIuċ)i r4)i rIuč)i r4)irIuď)ir4)irIuđ)ir4)irIuē)ir4)irIuĕ)ir4)irIuė)ir4)irIuę)ir4)irIuě)ir4)irIuĝ)ir4)irIuğ)ir4)i rIuġ)i!r4)i"rIuģ)i#r4)i$rIuĥ)i%r4)i&rIħ)i'r4)i(rIuĩ)i)r4)i*rIuī)i+r4rrrrr_seg_2srPcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i,rIuĭ)i-r4)i.rIuį)i/r4)i0rIui̇)i1r4)i2rIZij)i4rIuĵ)i5r4)i6rIuķ)i7r4)i9rIuĺ)i:r4)i;rIuļ)i<r4)i=rIuľ)i>r4)i?rIul·)iArIuł)iBr4)iCrIuń)iDr4)iErIuņ)iFr4)iGrIuň)iHr4)iIrIuʼn)iJrIŋ)iKr4)iLrIuō)iMr4)iNrIuŏ)iOr4)iPrIuő)iQr4)iRrIœ)iSr4)iTrIuŕ)iUr4)iVrIuŗ)iWr4)iXrIuř)iYr4)iZrIuś)i[r4)i\rIuŝ)i]r4)i^rIuş)i_r4)i`rIuš)iar4)ibrIuţ)icr4)idrIuť)ier4)ifrIuŧ)igr4)ihrIuũ)iir4)ijrIuū)ikr4)ilrIuŭ)imr4)inrIuů)ior4)iprIuű)iqr4)irrIuų)isr4)itrIuŵ)iur4)ivrIuŷ)iwr4)ixrIÿ)iyrIuź)izr4)i{rIuż)i|r4)i}rIuž)i~r4)irIrn)ir4)irIɓ)irIuƃ)ir4)irIuƅ)ir4)irIɔ)irIuƈ)ir4)irIɖ)irIɗ)irIuƌ)ir4)irIǝ)irIə)irIɛ)irIuƒ)ir4)irIɠrrrrr_seg_3Csr\cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIɣ)ir4)irIɩ)irIɨ)irIuƙ)ir4)irIɯ)irIɲ)ir4)irIɵ)irIuơ)ir4)irIuƣ)ir4)irIuƥ)ir4)irIʀ)irIuƨ)ir4)irIʃ)ir4)irIuƭ)ir4)irIʈ)irIuư)ir4)irIʊ)irIʋ)irIuƴ)ir4)irIuƶ)ir4)irIʒ)irIuƹ)ir4)irIuƽ)ir4)irIudž)irIZlj)irIZnj)irIuǎ)ir4)irIuǐ)ir4)irIuǒ)ir4)irIuǔ)ir4)irIuǖ)ir4)irIuǘ)ir4)irIuǚ)ir4)irIuǜ)ir4)irIuǟ)ir4)irIuǡ)ir4)irIuǣ)ir4)irIuǥ)ir4)irIuǧ)ir4)irIuǩ)ir4)irIuǫ)ir4)irIuǭ)ir4)irIuǯ)ir4)irIZdz)irIuǵ)ir4)irIuƕ)irIuƿ)irIuǹ)ir4)irIuǻ)ir4)irIuǽ)ir4)irIuǿ)ir4)irIuȁ)ir4)irIuȃ)ir4)irIuȅ)ir4)irIuȇ)ir4)irIuȉ)i r4)i rIuȋ)i r4)i rIuȍrrrrr_seg_4sricdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i r4)irIuȏ)ir4)irIuȑ)ir4)irIuȓ)ir4)irIuȕ)ir4)irIuȗ)ir4)irIuș)ir4)irIuț)ir4)irIuȝ)ir4)irIuȟ)ir4)i rIuƞ)i!r4)i"rIȣ)i#r4)i$rIuȥ)i%r4)i&rIuȧ)i'r4)i(rIuȩ)i)r4)i*rIuȫ)i+r4)i,rIuȭ)i-r4)i.rIuȯ)i/r4)i0rIuȱ)i1r4)i2rIuȳ)i3r4)i:rIuⱥ)i;rIuȼ)i<r4)i=rIuƚ)i>rIuⱦ)i?r4)iArIuɂ)iBr4)iCrIuƀ)iDrIʉ)iErIʌ)iFrIuɇ)iGr4)iHrIuɉ)iIr4)iJrIuɋ)iKr4)iLrIuɍ)iMr4)iNrIuɏ)iOr4)irIrX)irIɦ)irIr\)irIrl)irIuɹ)irIuɻ)irIuʁ)irIrv)irIrz)ir4)iru ̆)iru ̇)iru ̊)iru ̨)iru ̃)iru ̋)ir4)irIr])irIr`)irIrn)irIrx)irIuʕ)ir4)i@rIù)iArIú)iBr4)iCrIu̓)iDrIǘ)iErIι)iFr4)iOr)iPr4)iprIuͱ)iqr4)irrIuͳ)isr4)itrIuʹ)iur4)ivrIuͷ)iwr4rrrrr_seg_5srocdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ixr)izru ι)i{r4)i~r;)irIuϳ)ir)irr)ir ̈́)irIά)irI·)irIέ)irIή)irIί)ir)irIό)ir)irIύ)irIώ)ir4)irIα)irIβ)irIγ)irIδ)irIε)irIζ)irIη)irIθ)irIrn)irIκ)irIλ)irIr)irIν)irIξ)irIο)irIπ)irIρ)ir)irIσ)irIτ)irIυ)irIφ)irIχ)irIψ)irIω)irIuϊ)irIϋ)ir4)ir,r)ir4)irIuϗ)irIr{)irIr)irIr)irIrx)irIr)irIr)irIr)ir4)irIuϙ)ir4)irIuϛ)ir4)irIϝ)ir4)irIuϟ)ir4)irIuϡ)ir4)irIuϣ)ir4)irIuϥ)ir4)irIuϧ)ir4)irIuϩ)ir4)irIuϫ)ir4)irIuϭ)ir4)irIuϯ)ir4)irIr)irIr)irIr)ir4)irIr)irIr~)ir4)irIuϸ)ir4)irIr)irIuϻ)ir4)irIuͻ)irIuͼ)irIuͽ)irIuѐ)irIuё)irIuђrrrrr_seg_6{srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIuѓ)irIuє)irIuѕ)irIuі)irIuї)irIuј)i rIuљ)i rIuњ)i rIuћ)i rIuќ)i rIuѝ)irIuў)irIuџ)irIuа)irIuб)irIв)irIuг)irIд)irIuе)irIuж)irIuз)irIuи)irIuй)irIuк)irIuл)irIuм)irIн)irIо)irIuп)i rIuр)i!rIс)i"rIт)i#rIuу)i$rIuф)i%rIuх)i&rIuц)i'rIuч)i(rIuш)i)rIuщ)i*rIъ)i+rIuы)i,rIь)i-rIuэ)i.rIuю)i/rIuя)i0r4)i`rIuѡ)iar4)ibrIѣ)icr4)idrIuѥ)ier4)ifrIuѧ)igr4)ihrIuѩ)iir4)ijrIuѫ)ikr4)ilrIuѭ)imr4)inrIuѯ)ior4)iprIuѱ)iqr4)irrIuѳ)isr4)itrIuѵ)iur4)ivrIuѷ)iwr4)ixrIuѹ)iyr4)izrIuѻ)i{r4)i|rIuѽ)i}r4)i~rIuѿ)ir4)irIuҁ)ir4)irIuҋ)ir4)irIuҍ)ir4)irIuҏ)ir4)irIuґ)ir4)irIuғ)ir4)irIuҕ)ir4)irIuҗ)ir4)irIuҙ)ir4)irIuқ)ir4)irIuҝ)ir4rrrrr_seg_7srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIuҟ)ir4)irIuҡ)ir4)irIuң)ir4)irIuҥ)ir4)irIuҧ)ir4)irIuҩ)ir4)irIuҫ)ir4)irIuҭ)ir4)irIuү)ir4)irIuұ)ir4)irIuҳ)ir4)irIuҵ)ir4)irIuҷ)ir4)irIuҹ)ir4)irIuһ)ir4)irIuҽ)ir4)irIuҿ)ir4)ir)irIuӂ)ir4)irIuӄ)ir4)irIuӆ)ir4)irIuӈ)ir4)irIuӊ)ir4)irIuӌ)ir4)irIuӎ)ir4)irIuӑ)ir4)irIuӓ)ir4)irIuӕ)ir4)irIuӗ)ir4)irIuә)ir4)irIuӛ)ir4)irIuӝ)ir4)irIuӟ)ir4)irIuӡ)ir4)irIuӣ)ir4)irIuӥ)ir4)irIuӧ)ir4)irIuө)ir4)irIuӫ)ir4)irIuӭ)ir4)irIuӯ)ir4)irIuӱ)ir4)irIuӳ)ir4)irIuӵ)ir4)irIuӷ)ir4)irIuӹ)ir4)irIuӻ)ir4)irIuӽ)ir4)irIuӿ)ir4)irIuԁ)ir4)irIuԃrrrrr_seg_8KsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir4)irIuԅ)ir4)irIuԇ)ir4)irIuԉ)i r4)i rIuԋ)i r4)i rIuԍ)i r4)irIuԏ)ir4)irIuԑ)ir4)irIuԓ)ir4)irIuԕ)ir4)irIuԗ)ir4)irIuԙ)ir4)irIuԛ)ir4)irIuԝ)ir4)irIuԟ)ir4)i rIuԡ)i!r4)i"rIuԣ)i#r4)i$rIuԥ)i%r4)i&rIuԧ)i'r4)i(rIuԩ)i)r4)i*rIuԫ)i+r4)i,rIuԭ)i-r4)i.rIuԯ)i/r4)i0r)i1rIuա)i2rIuբ)i3rIuգ)i4rIuդ)i5rIuե)i6rIuզ)i7rIuէ)i8rIuը)i9rIuթ)i:rIuժ)i;rIuի)i<rIuլ)i=rIuխ)i>rIuծ)i?rIuկ)i@rIuհ)iArIuձ)iBrIuղ)iCrIuճ)iDrIuմ)iErIuյ)iFrIuն)iGrIuշ)iHrIuո)iIrIuչ)iJrIuպ)iKrIuջ)iLrIuռ)iMrIuս)iNrIuվ)iOrIuտ)iPrIuր)iQrIuց)iRrIuւ)iSrIuփ)iTrIuք)iUrIuօ)iVrIuֆ)iWr)iYr4)irIuեւ)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4rrrrr_seg_9srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iurIuاٴ)ivrIuوٴ)iwrIۇٴ)ixrIuيٴ)iyr4)ir)ir4)ir)ir4)iKr)iMr4)ir)ir4)ir)ir4)i.r)i0r4)i?r)i@r4)i\r)i^r4)i_r)i`r4)ikr)ipr4)ir)ir4)ir)ir4)iX rIuक़)iY rIuख़)iZ rIuग़)i[ rIuज़)i\ rIuड़)i] rIuढ़)i^ rIuफ़)i_ rIuय़)i` r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i rIuড়)i rIuঢ়)i r)i rIuয়)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i) r)i* r4)i1 r)i2 r4)i3 rIuਲ਼)i4 r)i5 r4)i6 rIuਸ਼)i7 r)i8 r4)i: r)i< r4)i= r)i> r4)iC r)iG r4)iI r)iK r4)iN r)iQ r4)iR r)iY rIuਖ਼)iZ rIuਗ਼)i[ rIuਜ਼)i\ r4)i] rrrrrr_seg_10srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i^ rIuਫ਼)i_ r)if r4)iw r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i) r)i* r4)i1 r)i2 r4)i4 r)i5 r4)i: r)i< r4)iE r)iG r4)iI r)iK r4)iN r)iU r4)iX r)i\ rIuଡ଼)i] rIuଢ଼)i^ r)i_ r4)id r)if r4)ix r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i) r)i* r4rrrrr_seg_11srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i: r)i< r4)iE r)iF r4)iI r)iJ r4)iN r)iU r4)iW r)iX r4)i[ r)i] r4)i^ r)i` r4)id r)if r4)ip r)iw r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)iE r)iF r4)iI r)iJ r4)iP r)iT r4)id r)if r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)ir4)i3rIuํา)i4r4)i;r)i?r4)i\r)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)irIuໍາ)ir4rrrrr_seg_12srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)irIuຫນ)irIuຫມ)ir4)ir)ir4)i rIu་)i r4)iCrIuགྷ)iDr4)iHr)iIr4)iMrIuཌྷ)iNr4)iRrIuདྷ)iSr4)iWrIuབྷ)iXr4)i\rIuཛྷ)i]r4)iirIuཀྵ)ijr4)imr)iqr4)isrIuཱི)itr4)iurIuཱུ)ivrIuྲྀ)iwrIu ྲཱྀ)ixrIuླྀ)iyrIu ླཱྀ)izr4)irIuཱྀ)ir4)irIuྒྷ)ir4)ir)ir4)irIuྜྷ)ir4)irIuྡྷ)ir4)irIuྦྷ)ir4)irIuྫྷ)ir4)irIuྐྵ)ir4)ir)ir4)ir)ir4)ir)ir4)ir)irIuⴧ)ir)irIuⴭ)ir)ir4)irIნ)ir4)i_r)iar4)iIr)iJr4)iNr)iPr4)iWr)iXr4)iYr)iZr4)i^r)i`r4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4rrrrr_seg_13SsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir)ir4)i[r)i]r4)i}r)ir4)ir)ir4)ir)irIuᏰ)irIuᏱ)irIuᏲ)irIuᏳ)irIuᏴ)irIuᏵ)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)i7r)i@r4)iTr)i`r4)imr)inr4)iqr)irr4)itr)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)i r)ir)ir)ir4)ir)i r4)iyr)ir4)ir)ir4)ir)ir4)ir)i r4)i,r)i0r4)i<r)i@r4)iAr)iDr4)inr)ipr4)iur)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)i_r)i`r4)i}r)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)iMr)iPr4)ir)ir4)ir)ir4)i8r)i;r4)iJr)iMr4)irIrrrrrr_seg_14srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIr)irIr)irIr)irIr)irIr)irIr)irIꙋ)ir)irIuა)irIuბ)irIuგ)irIuდ)irIuე)irIuვ)irIuზ)irIuთ)irIuი)irIuკ)irIuლ)irIuმ)irIr)irIuო)irIuპ)irIuჟ)irIuრ)irIuს)irIuტ)irIuუ)irIuფ)irIuქ)irIuღ)irIuყ)irIuშ)irIuჩ)irIuც)irIuძ)irIuწ)irIuჭ)irIuხ)irIuჯ)irIuჰ)irIuჱ)irIuჲ)irIuჳ)irIuჴ)irIuჵ)irIuჶ)irIuჷ)irIuჸ)irIuჹ)irIuჺ)ir)irIuჽ)irIuჾ)irIuჿ)ir4)ir)ir4)ir)ir4)i,rIrJ)i-rIr)i.rIrL)i/r4)i0rIrP)i1rIrR)i2rIrX)i3rIrV)i4rIrX)i5rIrZ)i6rIr\)i7rIr^)i8rIr`)i9rIrb)i:rIrd)i;r4)i<rIrf)i=rIrj)i>rIrh)i?rIrl)i@rIrp)iArIrr)iBrIrv)iCrIrJ)iDrIɐ)iErIɑ)iFrIuᴂ)iGrIrL)iHrIrP)iIrIrR)iJrIrY)iKrIrZ)iLrIɜ)iMrIrV)iNr4)iOrIr^)iPrIrb)iQrIrQ)iRrIrf)iSrIrUrrrrr_seg_15#srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iTrIuᴖ)iUrIuᴗ)iVrIrh)iWrIrp)iXrIrr)iYrIuᴝ)iZrIr`)i[rIrt)i\rIuᴥ)i]rIr{)i^rIr|)i_rIr})i`rIr)iarIr)ibrIrZ)icrIrl)idrIrr)ierIrt)ifrIr{)igrIr|)ihrIr)iirIr)ijrIr)ikr4)ixrIr)iyr4)irIɒ)irIrN)irIuɕ)irIr)irIr)irIrT)irIuɟ)irIɡ)irIɥ)irIr_)irIr^)irIɪ)irIuᵻ)irIʝ)irIuɭ)irIuᶅ)irIuʟ)irIɱ)irIuɰ)irIra)irIuɳ)irIuɴ)irIrb)irIuɸ)irIʂ)irIrd)irIuƫ)irIrk)irIrf)irIuᴜ)irIrg)irIrl)irIr|)irIuʐ)irIuʑ)irIrh)irIr)ir4)irIuḁ)ir4)irIuḃ)ir4)irIuḅ)ir4)irIuḇ)ir4)irIuḉ)i r4)i rIuḋ)i r4)i rIuḍ)i r4)irIuḏ)ir4)irIuḑ)ir4)irIuḓ)ir4)irIuḕ)ir4)irIuḗ)ir4)irIuḙ)ir4)irIuḛ)ir4)irIuḝ)ir4)irIuḟ)ir4)i rIuḡ)i!r4)i"rIuḣ)i#r4rrrrr_seg_16srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i$rIuḥ)i%r4)i&rIuḧ)i'r4)i(rIuḩ)i)r4)i*rIuḫ)i+r4)i,rIuḭ)i-r4)i.rIuḯ)i/r4)i0rIuḱ)i1r4)i2rIuḳ)i3r4)i4rIuḵ)i5r4)i6rIuḷ)i7r4)i8rIuḹ)i9r4)i:rIuḻ)i;r4)i<rIuḽ)i=r4)i>rIuḿ)i?r4)i@rIuṁ)iAr4)iBrIuṃ)iCr4)iDrIuṅ)iEr4)iFrIuṇ)iGr4)iHrIuṉ)iIr4)iJrIuṋ)iKr4)iLrIuṍ)iMr4)iNrIuṏ)iOr4)iPrIuṑ)iQr4)iRrIuṓ)iSr4)iTrIuṕ)iUr4)iVrIuṗ)iWr4)iXrIuṙ)iYr4)iZrIuṛ)i[r4)i\rIuṝ)i]r4)i^rIuṟ)i_r4)i`rIṡ)iar4)ibrIuṣ)icr4)idrIuṥ)ier4)ifrIuṧ)igr4)ihrIuṩ)iir4)ijrIuṫ)ikr4)ilrIuṭ)imr4)inrIuṯ)ior4)iprIuṱ)iqr4)irrIuṳ)isr4)itrIuṵ)iur4)ivrIuṷ)iwr4)ixrIuṹ)iyr4)izrIuṻ)i{r4)i|rIuṽ)i}r4)i~rIuṿ)ir4)irIuẁ)ir4)irIuẃ)ir4)irIuẅ)ir4)irIuẇ)ir4rrrrr_seg_17srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIuẉ)ir4)irIuẋ)ir4)irIuẍ)ir4)irIuẏ)ir4)irIuẑ)ir4)irIuẓ)ir4)irIuẕ)ir4)irIuaʾ)irIr)ir4)irIr-)ir4)irIuạ)ir4)irIuả)ir4)irIuấ)ir4)irIuầ)ir4)irIuẩ)ir4)irIuẫ)ir4)irIuậ)ir4)irIuắ)ir4)irIuằ)ir4)irIuẳ)ir4)irIuẵ)ir4)irIuặ)ir4)irIuẹ)ir4)irIuẻ)ir4)irIuẽ)ir4)irIuế)ir4)irIuề)ir4)irIuể)ir4)irIuễ)ir4)irIuệ)ir4)irIuỉ)ir4)irIuị)ir4)irIuọ)ir4)irIuỏ)ir4)irIuố)ir4)irIuồ)ir4)irIuổ)ir4)irIuỗ)ir4)irIuộ)ir4)irIuớ)ir4)irIuờ)ir4)irIuở)ir4)irIuỡ)ir4)irIuợ)ir4)irIuụ)ir4)irIuủ)ir4)irIuứ)ir4)irIuừ)ir4)irIuử)ir4)irIuữ)ir4)irIuựrrrrr_seg_18[srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir4)irIuỳ)ir4)irIuỵ)ir4)irIuỷ)ir4)irIuỹ)ir4)irIuỻ)ir4)irIuỽ)ir4)irIuỿ)ir4)irIuἀ)i rIuἁ)i rIuἂ)i rIuἃ)i rIuἄ)i rIuἅ)irIuἆ)irIuἇ)ir4)ir)irIuἐ)irIuἑ)irIuἒ)irIuἓ)irIuἔ)irIuἕ)ir)i r4)i(rIuἠ)i)rIuἡ)i*rIuἢ)i+rIuἣ)i,rIuἤ)i-rIuἥ)i.rIuἦ)i/rIuἧ)i0r4)i8rIuἰ)i9rIuἱ)i:rIuἲ)i;rIuἳ)i<rIuἴ)i=rIuἵ)i>rIuἶ)i?rIuἷ)i@r4)iFr)iHrIuὀ)iIrIuὁ)iJrIuὂ)iKrIuὃ)iLrIuὄ)iMrIuὅ)iNr)iPr4)iXr)iYrIuὑ)iZr)i[rIuὓ)i\r)i]rIuὕ)i^r)i_rIuὗ)i`r4)ihrIuὠ)iirIuὡ)ijrIuὢ)ikrIuὣ)ilrIuὤ)imrIuὥ)inrIuὦ)iorIuὧ)ipr4)iqrIrr)irr4)isrIrt)itr4)iurIru)ivr4)iwrIrv)ixr4)iyrIrw)izr4)i{rIrx)i|r4)i}rIry)i~r)irIἀι)irIἁι)irIἂι)irIἃι)irIἄι)irIἅι)irIἆι)irIἇιrrrrr_seg_19srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIἠι)irIἡι)irIἢι)irIἣι)irIἤι)irIἥι)irIἦι)irIἧι)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIὠι)irIὡι)irIὢι)irIὣι)irIὤι)irIὥι)irIὦι)irIὧι)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)ir4)irIuὰι)irIαι)irIuάι)ir)ir4)irIuᾶι)irIuᾰ)irIuᾱ)irIuὰ)irIrr)irIr)ir ̓)irIrn)irr)iru ͂)iru ̈͂)irIuὴι)irIηι)irIuήι)ir)ir4)irIuῆι)irIuὲ)irIrt)irIuὴ)irIru)irIr)iru ̓̀)iru ̓́)iru ̓͂)ir4)irIuΐ)ir)ir4)irIuῐ)irIuῑ)irIuὶ)irIrv)ir)iru ̔̀)iru ̔́)iru ̔͂)ir4)irIuΰ)ir4)irIuῠ)irIuῡ)irIuὺ)irIrx)irIuῥ)iru ̈̀)irrq)ir`)ir)irIuὼι)irIωι)irIuώι)ir)ir4rrrrr_seg_20+srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIuῶι)irIuὸ)irIrw)irIuὼ)irIry)irIr)irr)iru ̔)ir)i rr)i r)i r,)i r)i r4)i rIu‐)i r4)i ru ̳)i r4)i$ r)i' r4)i( r)i/ rr)i0 r4)i3 rIu′′)i4 rIu ′′′)i5 r4)i6 rIu‵‵)i7 rIu ‵‵‵)i8 r4)i< rz!!)i= r4)i> r ̅)i? r4)iG rz??)iH rz?!)iI rz!?)iJ r4)iW rIu ′′′′)iX r4)i_ rr)i` r)ia r)id r)ie r)ip rI0)iq rIrZ)ir r)it rI4)iu rI5)iv rI6)iw rI7)ix rI8)iy rI9)iz r+)i{ rI−)i| r=)i} r()i~ r))i rIrd)i rIr)i rIr)i rIr)i rIr)i rIr)i rIr)i rIr)i rIr)i rIr)i rIr)i rr)i rIr)i rr)i rr)i rr)i r)i rIrJ)i rIrR)i rIrf)i rIrx)i rIrY)i rIrX)i rIr^)i rIr`)i rIrb)i rIrd)i rIrh)i rIrn)i rIrp)i r)i r4)i rIrs)i r4)i r)i r4)i r)i!rza/c)i!rza/s)i!rIrN)i!rIu°c)i!r4rrrrr_seg_21srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i!rzc/o)i!rzc/u)i!rIrZ)i!r4)i !rIu°f)i !rIrV)i !rIrX)i!rIrO)i!rIrZ)i!rIr`)i!r4)i!rIrd)i!rIno)i!r4)i!rIrh)i!rIrj)i!rIrl)i!r4)i !rIsm)i!!rItel)i"!rItm)i#!r4)i$!rIr|)i%!r4)i&!rIr)i'!r4)i(!rIr|)i)!r4)i*!rIr^)i+!rIr)i,!rIrL)i-!rIrN)i.!r4)i/!rIrR)i1!rIrT)i2!r)i3!rIrb)i4!rIrf)i5!rIא)i6!rIuב)i7!rIuג)i8!rIד)i9!rIrZ)i:!r4)i;!rIfax)id?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i}!rIrN)i~!rIrP)i!rIrb)i!r4)i!r)i!r4)i!rIu0⁄3)i!r4)i!r)i!r4)i,"rIu∫∫)i-"rIu ∫∫∫)i."r4)i/"rIu∮∮)i0"rIu ∮∮∮)i1"r4)i`"r)ia"r4)in"r)ip"r4)i)#rI〈)i*#rI〉)i+#r4)i'$r)i@$r4)iK$r)i`$rIr)ia$rIr)ib$rIr)ic$rIr)id$rIr)ie$rIr)if$rIr)ig$rIr)ih$rIr)ii$rI10)ij$rIZ11)ik$rIZ12)il$rIZ13)im$rIZ14)in$rIZ15)io$rIZ16)ip$rIZ17)iq$rIZ18)ir$rIZ19)is$rIZ20)it$rz(1))iu$rz(2))iv$rz(3))iw$rz(4))ix$rz(5))iy$rz(6))iz$rz(7))i{$rz(8))i|$rz(9))i}$rz(10))i~$rz(11))i$rz(12))i$rz(13))i$rz(14))i$rz(15))i$rz(16))i$rz(17))i$rz(18))i$rz(19))i$rz(20))i$r)i$r(a))i$r(b))i$r(c))i$r(d))i$r(e))i$r(f))i$r(g))i$r(h))i$r(i))i$r(j))i$r(k))i$r(l))i$r(m))i$r(n))i$r(o))i$r(p))i$r(q))i$r(r))i$r(s))i$r(t))i$r(u))i$r(v))i$r(w))i$r(x))i$r(y))i$r(z))i$rIrJ)i$rIrL)i$rIrN)i$rIrP)i$rIrR)i$rIrT)i$rIrVrrrrr_seg_23c srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i$rIrX)i$rIrZ)i$rIr\)i$rIr^)i$rIr`)i$rIrb)i$rIrd)i$rIrf)i$rIrh)i$rIrj)i$rIrl)i$rIrn)i$rIrp)i$rIrr)i$rIrt)i$rIrv)i$rIrx)i$rIrz)i$rIr|)i$rIrJ)i$rIrL)i$rIrN)i$rIrP)i$rIrR)i$rIrT)i$rIrV)i$rIrX)i$rIrZ)i$rIr\)i$rIr^)i$rIr`)i$rIrb)i$rIrd)i$rIrf)i$rIrh)i$rIrj)i$rIrl)i$rIrn)i$rIrp)i$rIrr)i$rIrt)i$rIrv)i$rIrx)i$rIrz)i$rIr|)i$rIr)i$r4)i *rIu ∫∫∫∫)i *r4)it*rz::=)iu*rz==)iv*rz===)iw*r4)i*rIu⫝̸)i*r4)it+r)iv+r4)i+r)i+r4)i,rIuⰰ)i,rIuⰱ)i,rIuⰲ)i,rIuⰳ)i,rIuⰴ)i,rIuⰵ)i,rIuⰶ)i,rIuⰷ)i,rIuⰸ)i ,rIuⰹ)i ,rIuⰺ)i ,rIuⰻ)i ,rIuⰼ)i ,rIuⰽ)i,rIuⰾ)i,rIuⰿ)i,rIuⱀ)i,rIuⱁ)i,rIuⱂ)i,rIuⱃ)i,rIuⱄ)i,rIuⱅ)i,rIuⱆ)i,rIuⱇ)i,rIuⱈ)i,rIuⱉ)i,rIuⱊ)i,rIuⱋ)i,rIuⱌ)i,rIuⱍ)i,rIuⱎ)i,rIuⱏ)i ,rIuⱐ)i!,rIuⱑ)i",rIuⱒ)i#,rIuⱓ)i$,rIuⱔ)i%,rIuⱕ)i&,rIuⱖ)i',rIuⱗ)i(,rIuⱘrrrrr_seg_24 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i),rIuⱙ)i*,rIuⱚ)i+,rIuⱛ)i,,rIuⱜ)i-,rIuⱝ)i.,rIuⱞ)i/,rIuⱟ)i0,r4)i`,rIuⱡ)ia,r4)ib,rIɫ)ic,rIuᵽ)id,rIɽ)ie,r4)ig,rIuⱨ)ih,r4)ii,rIuⱪ)ij,r4)ik,rIuⱬ)il,r4)im,rIr)in,rIr)io,rIr)ip,rIr)iq,r4)ir,rIuⱳ)is,r4)iu,rIuⱶ)iv,r4)i|,rIr\)i},rIrt)i~,rIuȿ)i,rIuɀ)i,rIuⲁ)i,r4)i,rIuⲃ)i,r4)i,rIuⲅ)i,r4)i,rIuⲇ)i,r4)i,rIuⲉ)i,r4)i,rIuⲋ)i,r4)i,rIuⲍ)i,r4)i,rIuⲏ)i,r4)i,rIuⲑ)i,r4)i,rIuⲓ)i,r4)i,rIuⲕ)i,r4)i,rIuⲗ)i,r4)i,rIuⲙ)i,r4)i,rIuⲛ)i,r4)i,rIuⲝ)i,r4)i,rIuⲟ)i,r4)i,rIuⲡ)i,r4)i,rIuⲣ)i,r4)i,rIuⲥ)i,r4)i,rIuⲧ)i,r4)i,rIuⲩ)i,r4)i,rIuⲫ)i,r4)i,rIuⲭ)i,r4)i,rIuⲯ)i,r4)i,rIuⲱ)i,r4)i,rIuⲳ)i,r4)i,rIuⲵ)i,r4)i,rIuⲷ)i,r4)i,rIuⲹ)i,r4)i,rIuⲻ)i,r4)i,rIuⲽ)i,r4)i,rIuⲿ)i,r4)i,rIuⳁ)i,r4)i,rIuⳃrrrrr_seg_253 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i,r4)i,rIuⳅ)i,r4)i,rIuⳇ)i,r4)i,rIuⳉ)i,r4)i,rIuⳋ)i,r4)i,rIuⳍ)i,r4)i,rIuⳏ)i,r4)i,rIuⳑ)i,r4)i,rIuⳓ)i,r4)i,rIuⳕ)i,r4)i,rIuⳗ)i,r4)i,rIuⳙ)i,r4)i,rIuⳛ)i,r4)i,rIuⳝ)i,r4)i,rIuⳟ)i,r4)i,rIuⳡ)i,r4)i,rIuⳣ)i,r4)i,rIuⳬ)i,r4)i,rIuⳮ)i,r4)i,rIuⳳ)i,r4)i,r)i,r4)i&-r)i'-r4)i(-r)i--r4)i.-r)i0-r4)ih-r)io-rIuⵡ)ip-r4)iq-r)i-r4)i-r)i-r4)i-r)i-r4)i-r)i-r4)i-r)i-r4)i-r)i-r4)i-r)i-r4)i-r)i-r4)i-r)i-r4)i-r)i-r4)i^.r)i.r4)i.r)i.r4)i.rIu母)i.r4)i.rIu龟)i.r)i/rI一)i/rIu丨)i/rIu丶)i/rIu丿)i/rI乙)i/rIu亅)i/rI二)i/rIu亠)i/rI人)i /rIu儿)i /rIu入)i /rI八)i /rIu冂)i /rIu冖)i/rIu冫)i/rIu几)i/rI凵)i/rIu刀)i/rI力)i/rIu勹)i/rIu匕)i/rIu匚rrrrr_seg_26 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i/rIu匸)i/rI十)i/rIu卜)i/rIu卩)i/rIu厂)i/rIu厶)i/rIu又)i/rIu口)i/rIu囗)i/rI土)i /rIu士)i!/rIu夂)i"/rIu夊)i#/rIu夕)i$/rIu大)i%/rI女)i&/rIu子)i'/rIu宀)i(/rIu寸)i)/rIu小)i*/rI尢)i+/rIu尸)i,/rI屮)i-/rIu山)i./rIu巛)i//rIu工)i0/rIu己)i1/rIu巾)i2/rIu干)i3/rIu幺)i4/rIu广)i5/rIu廴)i6/rI廾)i7/rIu弋)i8/rIu弓)i9/rIu彐)i:/rIu彡)i;/rIu彳)i/rIu戶)i?/rI手)i@/rIu支)iA/rIu攴)iB/rI文)iC/rIu斗)iD/rIu斤)iE/rIu方)iF/rIu无)iG/rI日)iH/rIu曰)iI/rI月)iJ/rI木)iK/rIu欠)iL/rIu止)iM/rI歹)iN/rIu殳)iO/rIu毋)iP/rIu比)iQ/rIu毛)iR/rIu氏)iS/rIu气)iT/rI水)iU/rI火)iV/rIu爪)iW/rIu父)iX/rIu爻)iY/rIu爿)iZ/rIu片)i[/rIu牙)i\/rIu牛)i]/rIu犬)i^/rIu玄)i_/rIu玉)i`/rIu瓜)ia/rIu瓦)ib/rIu甘)ic/rI生)id/rIu用)ie/rIu田)if/rIu疋)ig/rIu疒)ih/rIu癶)ii/rIu白)ij/rIu皮)ik/rIu皿)il/rIu目)im/rIu矛)in/rIu矢)io/rIu石)ip/rIu示)iq/rIu禸)ir/rIu禾)is/rIu穴)it/rI立)iu/rIu竹)iv/rIu米)iw/rIu糸)ix/rIu缶)iy/rIu网rrrrr_seg_27 sr0cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iz/rIu羊)i{/rI羽)i|/rI老)i}/rIu而)i~/rIu耒)i/rIu耳)i/rIu聿)i/rIu肉)i/rIu臣)i/rIu自)i/rIu至)i/rIu臼)i/rIu舌)i/rIu舛)i/rIu舟)i/rIu艮)i/rIu色)i/rIu艸)i/rIu虍)i/rIu虫)i/rIu血)i/rI行)i/rI衣)i/rIu襾)i/rI見)i/rIu角)i/rIu言)i/rIu谷)i/rIu豆)i/rI豕)i/rIu豸)i/rIu貝)i/rIu赤)i/rI走)i/rIu足)i/rIu身)i/rI車)i/rIu辛)i/rI辰)i/rIu辵)i/rIu邑)i/rIu酉)i/rIu釆)i/rI里)i/rI金)i/rIu長)i/rIu門)i/rIu阜)i/rIu隶)i/rIu隹)i/rIu雨)i/rIu靑)i/rIu非)i/rIu面)i/rIu革)i/rIu韋)i/rIu韭)i/rIu音)i/rIu頁)i/rIu風)i/rIu飛)i/rIu食)i/rIu首)i/rIu香)i/rIu馬)i/rIu骨)i/rIu高)i/rIu髟)i/rIu鬥)i/rIu鬯)i/rIu鬲)i/rIu鬼)i/rIu魚)i/rIu鳥)i/rIu鹵)i/rI鹿)i/rIu麥)i/rI麻)i/rIu黃)i/rIu黍)i/rIu黑)i/rI黹)i/rIu黽)i/rIu鼎)i/rIu鼓)i/rIu鼠)i/rI鼻)i/rIu齊)i/rIu齒)i/rI龍)i/rI龜)i/rIu龠)i/r)i0rr)i0r4)i0rI.)i0r4)i60rIu〒)i70r4)i80rIr rrrrr_seg_28k srCcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i90rIu卄)i:0rIu卅)i;0r4)i@0r)iA0r4)i0r)i0r4)i0ru ゙)i0ru ゚)i0r4)i0rIuより)i0r4)i0rIuコト)i1r)i1r4)i01r)i11rIᄀ)i21rIᄁ)i31rIᆪ)i41rIᄂ)i51rIᆬ)i61rIᆭ)i71rIᄃ)i81rIᄄ)i91rIᄅ)i:1rIᆰ)i;1rIᆱ)i<1rIᆲ)i=1rIᆳ)i>1rIᆴ)i?1rIᆵ)i@1rIᄚ)iA1rIᄆ)iB1rIᄇ)iC1rIᄈ)iD1rIᄡ)iE1rIᄉ)iF1rIᄊ)iG1rIᄋ)iH1rIᄌ)iI1rIᄍ)iJ1rIᄎ)iK1rIᄏ)iL1rIᄐ)iM1rIᄑ)iN1rIᄒ)iO1rIᅡ)iP1rIᅢ)iQ1rIᅣ)iR1rIᅤ)iS1rIᅥ)iT1rIᅦ)iU1rIᅧ)iV1rIᅨ)iW1rIᅩ)iX1rIᅪ)iY1rIᅫ)iZ1rIᅬ)i[1rIᅭ)i\1rIᅮ)i]1rIᅯ)i^1rIᅰ)i_1rIᅱ)i`1rIᅲ)ia1rIᅳ)ib1rIᅴ)ic1rIᅵ)id1r)ie1rIuᄔ)if1rIuᄕ)ig1rIuᇇ)ih1rIuᇈ)ii1rIuᇌ)ij1rIuᇎ)ik1rIuᇓ)il1rIuᇗ)im1rIuᇙ)in1rIuᄜ)io1rIuᇝ)ip1rIuᇟ)iq1rIuᄝ)ir1rIuᄞ)is1rIuᄠ)it1rIuᄢ)iu1rIuᄣ)iv1rIuᄧ)iw1rIuᄩ)ix1rIuᄫ)iy1rIuᄬ)iz1rIuᄭ)i{1rIuᄮ)i|1rIuᄯ)i}1rIuᄲ)i~1rIuᄶ)i1rIuᅀ)i1rIuᅇ)i1rIuᅌ)i1rIuᇱ)i1rIuᇲ)i1rIuᅗrrrrr_seg_29 srwcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i1rIuᅘ)i1rIuᅙ)i1rIuᆄ)i1rIuᆅ)i1rIuᆈ)i1rIuᆑ)i1rIuᆒ)i1rIuᆔ)i1rIuᆞ)i1rIuᆡ)i1r)i1r4)i1rIr)i1rIr)i1rI三)i1rI四)i1rI上)i1rI中)i1rI下)i1rIu甲)i1rIr)i1rIu丙)i1rIu丁)i1rI天)i1rIu地)i1rIr)i1r4)i1r)i1r4)i2ru(ᄀ))i2ru(ᄂ))i2ru(ᄃ))i2ru(ᄅ))i2ru(ᄆ))i2ru(ᄇ))i2ru(ᄉ))i2ru(ᄋ))i2ru(ᄌ))i 2ru(ᄎ))i 2ru(ᄏ))i 2ru(ᄐ))i 2ru(ᄑ))i 2ru(ᄒ))i2ru(가))i2ru(나))i2ru(다))i2ru(라))i2ru(마))i2ru(바))i2ru(사))i2ru(아))i2ru(자))i2ru(차))i2ru(카))i2ru(타))i2ru(파))i2ru(하))i2ru(주))i2ru(오전))i2ru(오후))i2r)i 2ru(一))i!2ru(二))i"2ru(三))i#2ru(四))i$2ru(五))i%2ru(六))i&2ru(七))i'2ru(八))i(2ru(九))i)2ru(十))i*2ru(月))i+2ru(火))i,2ru(水))i-2ru(木))i.2ru(金))i/2ru(土))i02ru(日))i12ru(株))i22ru(有))i32ru(社))i42ru(名))i52ru(特))i62ru(財))i72ru(祝))i82ru(労))i92ru(代))i:2ru(呼))i;2ru(学))i<2ru(監))i=2ru(企))i>2ru(資))i?2ru(協))i@2ru(祭))iA2ru(休))iB2ru(自))iC2ru(至))iD2rIu問)iE2rIu幼)iF2rIr'rrrrr_seg_30; sr~cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iG2rIu箏)iH2r4)iP2rIZpte)iQ2rI21)iR2rIZ22)iS2rIZ23)iT2rIZ24)iU2rIZ25)iV2rIZ26)iW2rI27)iX2rIZ28)iY2rIZ29)iZ2rIZ30)i[2rIZ31)i\2rIZ32)i]2rIZ33)i^2rIZ34)i_2rIZ35)i`2rIrD)ia2rIrG)ib2rIrJ)ic2rIrL)id2rIrT)ie2rIrU)if2rIrX)ig2rIrZ)ih2rIr[)ii2rIr])ij2rIr^)ik2rIr_)il2rIr`)im2rIra)in2rIu가)io2rIu나)ip2rIu다)iq2rIu라)ir2rIu마)is2rIu바)it2rIu사)iu2rIu아)iv2rIu자)iw2rIu차)ix2rIu카)iy2rIu타)iz2rIu파)i{2rIu하)i|2rIu참고)i}2rIu주의)i~2rIu우)i2r4)i2rIr)i2rIr)i2rIrx)i2rIry)i2rIu五)i2rI六)i2rIu七)i2rIr)i2rIu九)i2rIr )i2rIr))i2rIr-)i2rIr,)i2rIr*)i2rIr;)i2rIr!)i2rIr()i2rIu株)i2rI有)i2rI社)i2rIu名)i2rIu特)i2rIu財)i2rI祝)i2rIu労)i2rIu秘)i2rIu男)i2rIr")i2rIu適)i2rIu優)i2rIu印)i2rIu注)i2rIu項)i2rIu休)i2rIu写)i2rIu正)i2rIrz)i2rIr{)i2rIr|)i2rI左)i2rI右)i2rIu医)i2rIu宗)i2rIu学)i2rIu監)i2rIu企)i2rIu資)i2rIu協)i2rIu夜)i2rIZ36rrrrr_seg_31 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i2rIZ37)i2rI38)i2rI39)i2rIZ40)i2rIZ41)i2rIZ42)i2rIZ43)i2rIZ44)i2rIZ45)i2rIZ46)i2rIZ47)i2rI48)i2rI49)i2rIZ50)i2rIu1月)i2rIu2月)i2rIu3月)i2rIu4月)i2rIu5月)i2rIu6月)i2rIu7月)i2rIu8月)i2rIu9月)i2rIu10月)i2rIu11月)i2rIu12月)i2rIhg)i2rIZerg)i2rIZev)i2rIZltd)i2rIア)i2rIイ)i2rIウ)i2rIエ)i2rIオ)i2rIカ)i2rIキ)i2rIク)i2rIケ)i2rIコ)i2rIサ)i2rIシ)i2rIス)i2rIセ)i2rIソ)i2rIタ)i2rIチ)i2rIツ)i2rIテ)i2rIト)i2rIナ)i2rIニ)i2rIヌ)i2rIネ)i2rIノ)i2rIハ)i2rIヒ)i2rIフ)i2rIヘ)i2rIホ)i2rIマ)i2rIミ)i2rIム)i2rIメ)i2rIモ)i2rIヤ)i2rIユ)i2rIヨ)i2rIラ)i2rIリ)i2rIル)i2rIレ)i2rIロ)i2rIワ)i2rIuヰ)i2rIuヱ)i2rIヲ)i2rIu令和)i3rIu アパート)i3rIu アルファ)i3rIu アンペア)i3rIu アール)i3rIu イニング)i3rIu インチ)i3rIu ウォン)i3rIuエスクード)i3rIu エーカー)i 3rIu オンス)i 3rIu オーム)i 3rIu カイリ)i 3rIu カラット)i 3rIu カロリー)i3rIu ガロン)i3rIu ガンマ)i3rIuギガ)i3rIu ギニー)i3rIu キュリー)i3rIu ギルダー)i3rIuキロ)i3rIuキログラムrrrrr_seg_32 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i3rIuキロメートル)i3rIuキロワット)i3rIu グラム)i3rIuグラムトン)i3rIuクルゼイロ)i3rIu クローネ)i3rIu ケース)i3rIu コルナ)i3rIu コーポ)i3rIu サイクル)i 3rIuサンチーム)i!3rIu シリング)i"3rIu センチ)i#3rIu セント)i$3rIu ダース)i%3rIuデシ)i&3rIuドル)i'3rIuトン)i(3rIuナノ)i)3rIu ノット)i*3rIu ハイツ)i+3rIuパーセント)i,3rIu パーツ)i-3rIu バーレル)i.3rIuピアストル)i/3rIu ピクル)i03rIuピコ)i13rIuビル)i23rIuファラッド)i33rIu フィート)i43rIuブッシェル)i53rIu フラン)i63rIuヘクタール)i73rIuペソ)i83rIu ペニヒ)i93rIu ヘルツ)i:3rIu ペンス)i;3rIu ページ)i<3rIu ベータ)i=3rIu ポイント)i>3rIu ボルト)i?3rIuホン)i@3rIu ポンド)iA3rIu ホール)iB3rIu ホーン)iC3rIu マイクロ)iD3rIu マイル)iE3rIu マッハ)iF3rIu マルク)iG3rIuマンション)iH3rIu ミクロン)iI3rIuミリ)iJ3rIuミリバール)iK3rIuメガ)iL3rIu メガトン)iM3rIu メートル)iN3rIu ヤード)iO3rIu ヤール)iP3rIu ユアン)iQ3rIu リットル)iR3rIuリラ)iS3rIu ルピー)iT3rIu ルーブル)iU3rIuレム)iV3rIuレントゲン)iW3rIu ワット)iX3rIu0点)iY3rIu1点)iZ3rIu2点)i[3rIu3点)i\3rIu4点)i]3rIu5点)i^3rIu6点)i_3rIu7点)i`3rIu8点)ia3rIu9点)ib3rIu10点)ic3rIu11点)id3rIu12点)ie3rIu13点)if3rIu14点)ig3rIu15点)ih3rIu16点)ii3rIu17点)ij3rIu18点)ik3rIu19点)il3rIu20点)im3rIu21点)in3rIu22点)io3rIu23点)ip3rIu24点)iq3rIhpa)ir3rIda)is3rIau)it3rIbar)iu3rIov)iv3rIZpc)iw3rIdm)ix3rIZdm2)iy3rIZdm3rrrrr_seg_33s srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iz3rIiu)i{3rIu平成)i|3rIu昭和)i}3rIu大正)i~3rIu明治)i3rIu 株式会社)i3rIpa)i3rIna)i3rIuμa)i3rIma)i3rIka)i3rIkb)i3rImb)i3rIgb)i3rIcal)i3rIZkcal)i3rIpf)i3rInf)i3rIuμf)i3rIuμg)i3rIZmg)i3rIZkg)i3rIhz)i3rIkhz)i3rImhz)i3rIghz)i3rIthz)i3rIuμl)i3rIml)i3rIdl)i3rIkl)i3rIfm)i3rInm)i3rIuμm)i3rImm)i3rIcm)i3rIkm)i3rIZmm2)i3rIZcm2)i3rIm2)i3rIZkm2)i3rIZmm3)i3rIZcm3)i3rIZm3)i3rIZkm3)i3rIum∕s)i3rIum∕s2)i3rIr)i3rIkpa)i3rImpa)i3rIgpa)i3rIZrad)i3rIurad∕s)i3rIurad∕s2)i3rIZps)i3rIns)i3rIuμs)i3rIms)i3rIpv)i3rInv)i3rIuμv)i3rImv)i3rIkv)i3rIr)i3rIpw)i3rInw)i3rIuμw)i3rImw)i3rIkw)i3rIr)i3rIukω)i3rIumω)i3r)i3rIbq)i3rIcc)i3rIcd)i3rIuc∕kg)i3r)i3rIdb)i3rIgy)i3rIZha)i3rIhp)i3rIin)i3rIkk)i3rIr)i3rIkt)i3rIZlm)i3rIln)i3rIlog)i3rIlx)i3rIr)i3rImil)i3rIZmol)i3rIph)i3r)i3rIppm)i3rIpr)i3rIsr)i3rIsv)i3rIwbrrrrr_seg_34 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i3rIuv∕m)i3rIua∕m)i3rIu1日)i3rIu2日)i3rIu3日)i3rIu4日)i3rIu5日)i3rIu6日)i3rIu7日)i3rIu8日)i3rIu9日)i3rIu10日)i3rIu11日)i3rIu12日)i3rIu13日)i3rIu14日)i3rIu15日)i3rIu16日)i3rIu17日)i3rIu18日)i3rIu19日)i3rIu20日)i3rIu21日)i3rIu22日)i3rIu23日)i3rIu24日)i3rIu25日)i3rIu26日)i3rIu27日)i3rIu28日)i3rIu29日)i3rIu30日)i3rIu31日)i3rIZgal)i4r4)ir)ir4)iǤr)iФr4)i,r)i@rIuꙁ)iAr4)iBrIuꙃ)iCr4)iDrIuꙅ)iEr4)iFrIuꙇ)iGr4)iHrIuꙉ)iIr4)iJrIr)iKr4)iLrIuꙍ)iMr4)iNrIuꙏ)iOr4)iPrIuꙑ)iQr4)iRrIuꙓ)iSr4)iTrIuꙕ)iUr4)iVrIuꙗ)iWr4)iXrIuꙙ)iYr4)iZrIuꙛ)i[r4)i\rIuꙝ)i]r4)i^rIuꙟ)i_r4)i`rIuꙡ)iar4)ibrIuꙣ)icr4)idrIuꙥ)ier4)ifrIuꙧ)igr4)ihrIuꙩ)iir4)ijrIuꙫ)ikr4)ilrIuꙭ)imr4)irIuꚁ)ir4)irIuꚃ)ir4)irIuꚅ)ir4)irIuꚇ)ir4)irIuꚉ)ir4)irIuꚋ)ir4)irIuꚍ)ir4rrrrr_seg_35CsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIuꚏ)ir4)irIuꚑ)ir4)irIuꚓ)ir4)irIuꚕ)ir4)irIuꚗ)ir4)irIuꚙ)ir4)irIuꚛ)ir4)irIr)irIr)ir4)ir)ir4)i"rIuꜣ)i#r4)i$rIuꜥ)i%r4)i&rIꜧ)i'r4)i(rIuꜩ)i)r4)i*rIuꜫ)i+r4)i,rIuꜭ)i-r4)i.rIuꜯ)i/r4)i2rIuꜳ)i3r4)i4rIuꜵ)i5r4)i6rIuꜷ)i7r4)i8rIuꜹ)i9r4)i:rIuꜻ)i;r4)i<rIuꜽ)i=r4)i>rIuꜿ)i?r4)i@rIuꝁ)iAr4)iBrIuꝃ)iCr4)iDrIuꝅ)iEr4)iFrIuꝇ)iGr4)iHrIuꝉ)iIr4)iJrIuꝋ)iKr4)iLrIuꝍ)iMr4)iNrIuꝏ)iOr4)iPrIuꝑ)iQr4)iRrIuꝓ)iSr4)iTrIuꝕ)iUr4)iVrIuꝗ)iWr4)iXrIuꝙ)iYr4)iZrIuꝛ)i[r4)i\rIuꝝ)i]r4)i^rIuꝟ)i_r4)i`rIuꝡ)iar4)ibrIuꝣ)icr4)idrIuꝥ)ier4)ifrIuꝧ)igr4)ihrIuꝩ)iir4)ijrIuꝫ)ikr4)ilrIuꝭ)imr4)inrIꝯ)ior4)iprIr)iqr4)iyrIuꝺ)izr4)i{rIuꝼrrrrr_seg_36srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i|r4)i}rIuᵹ)i~rIuꝿ)ir4)irIuꞁ)ir4)irIuꞃ)ir4)irIuꞅ)ir4)irIuꞇ)ir4)irIuꞌ)ir4)irIr)ir4)irIuꞑ)ir4)irIuꞓ)ir4)irIuꞗ)ir4)irIuꞙ)ir4)irIuꞛ)ir4)irIuꞝ)ir4)irIuꞟ)ir4)irIuꞡ)ir4)irIuꞣ)ir4)irIuꞥ)ir4)irIuꞧ)ir4)irIuꞩ)ir4)irIrm)irIr)irIr)irIɬ)irIr)ir4)irIuʞ)irIuʇ)irIr)irIuꭓ)irIuꞵ)ir4)irIuꞷ)ir4)irIuꞹ)ir4)irIuꞻ)ir4)irIuꞽ)ir4)irIuꞿ)ir4)irIuꟁ)ir4)i§rIuꟃ)içr4)iħrIuꞔ)iŧrIr)iƧrIuᶎ)iǧrIuꟈ)iȧr4)iɧrIuꟊ)iʧr4)i˧r)iЧrIuꟑ)iѧr4)iҧr)iӧr4)iԧr)iէr4)i֧rIuꟗ)iקr4)iاrIuꟙ)i٧r4)iڧr)irIrN)irIrT)irIrj)irIuꟶ)ir4)irIrO)irIrR)ir4)i-r)i0r4)i:r)i@r4)ixr)ir4)iƨrrrrrr_seg_37srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iΨr4)iڨr)ir4)iTr)i_r4)i}r)ir4)iΩr)iϩr4)iکr)iީr4)ir)ir4)i7r)i@r4)iNr)iPr4)iZr)i\r4)iêr)i۪r4)ir)ir4)ir)i r4)ir)ir4)ir)i r4)i'r)i(r4)i/r)i0r4)i\rIr)i]rIuꬷ)i^rIr)i_rIuꭒ)i`r4)iirIuʍ)ijr4)ilr)iprIuᎠ)iqrIuᎡ)irrIuᎢ)isrIuᎣ)itrIuᎤ)iurIuᎥ)ivrIuᎦ)iwrIuᎧ)ixrIuᎨ)iyrIuᎩ)izrIuᎪ)i{rIuᎫ)i|rIuᎬ)i}rIuᎭ)i~rIuᎮ)irIuᎯ)irIuᎰ)irIuᎱ)irIuᎲ)irIuᎳ)irIuᎴ)irIuᎵ)irIuᎶ)irIuᎷ)irIuᎸ)irIuᎹ)irIuᎺ)irIuᎻ)irIuᎼ)irIuᎽ)irIuᎾ)irIuᎿ)irIuᏀ)irIuᏁ)irIuᏂ)irIuᏃ)irIuᏄ)irIuᏅ)irIuᏆ)irIuᏇ)irIuᏈ)irIuᏉ)irIuᏊ)irIuᏋ)irIuᏌ)irIuᏍ)irIuᏎ)irIuᏏ)irIuᏐ)irIuᏑ)irIuᏒ)irIuᏓ)irIuᏔ)irIuᏕ)irIuᏖ)irIuᏗ)irIuᏘ)irIuᏙ)irIuᏚrrrrr_seg_38{srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIuᏛ)irIuᏜ)irIuᏝ)irIuᏞ)irIuᏟ)irIuᏠ)irIuᏡ)irIuᏢ)irIuᏣ)irIuᏤ)irIuᏥ)irIuᏦ)irIuᏧ)irIuᏨ)irIuᏩ)irIuᏪ)irIuᏫ)irIuᏬ)irIuᏭ)irIuᏮ)irIuᏯ)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)irIu豈)irIu更)irIr8)irIu賈)irIu滑)irIu串)irIu句)irIrA)i rIu契)i rIr;)i rIu喇)i rIu奈)i rI懶)irIu癩)irIu羅)irIu蘿)irIu螺)irIu裸)irIu邏)irI樂)irIu洛)irIu烙)irIu珞)irIu落)irIu酪)irIu駱)irIu亂)irIu卵)irIu欄)irIu爛)irIu蘭)i rIu鸞)i!rIu嵐)i"rIu濫)i#rIu藍)i$rIu襤)i%rIu拉)i&rIu臘)i'rIu蠟)i(rI廊)i)rI朗)i*rIu浪)i+rIu狼)i,rIu郎)i-rIu來)i.rIu冷)i/rIu勞)i0rIu擄)i1rIu櫓)i2rIu爐)i3rIu盧)i4rIr2)i5rIu蘆)i6rI虜)i7rIu路)i8rIu露)i9rIu魯)i:rIu鷺)i;rI碌)i<rIu祿)i=rIu綠)i>rIu菉)i?rIu錄)i@rIr<)iArIu論)iBrIu壟)iCrIu弄)iDrIu籠)iErIu聾rrrrr_seg_39sr cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iFrIu牢)iGrIu磊)iHrIu賂)iIrIu雷)iJrIu壘)iKrIu屢)iLrIu樓)iMrIu淚)iNrIu漏)iOrIu累)iPrIu縷)iQrIu陋)iRrIu勒)iSrIu肋)iTrIu凜)iUrIu凌)iVrIu稜)iWrIu綾)iXrIu菱)iYrIu陵)iZrIu讀)i[rIu拏)i\rIr)i]rI諾)i^rIu丹)i_rI寧)i`rIu怒)iarI率)ibrI異)icrI北)idrIu磻)ierIu便)ifrIu復)igrIu不)ihrIu泌)iirIu數)ijrIu索)ikrIu參)ilrIu塞)imrIu省)inrIu葉)iorI說)iprI殺)iqrIr9)irrIu沈)isrIu拾)itrI若)iurIu掠)ivrIu略)iwrIu亮)ixrIu兩)iyrIu凉)izrIu梁)i{rIu糧)i|rIu良)i}rIu諒)i~rIu量)irIu勵)irIu呂)irIr")irIu廬)irIu旅)irIu濾)irIu礪)irIu閭)irIu驪)irIu麗)irIu黎)irIr)irIu曆)irIu歷)irIu轢)irIu年)irIu憐)irIu戀)irIu撚)irIu漣)irIu煉)irIu璉)irIu秊)irI練)irIu聯)irIu輦)irIu蓮)irIu連)irIu鍊)irIu列)irIu劣)irIu咽)irIu烈)irIu裂)irIr)irIu廉)irIu念)irIu捻)irIu殮)irIu簾)irIu獵)irIu令)irIu囹rrrrr_seg_40KsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIr )irIu嶺)irIu怜)irIu玲)irIu瑩)irIu羚)irIu聆)irIu鈴)irIu零)irIu靈)irIu領)irIu例)irIu禮)irIu醴)irIu隸)irIu惡)irIu了)irIu僚)irIu寮)irIu尿)irI料)irIr)irIu燎)irIu療)irIu蓼)irIu遼)irIr@)irIu暈)irIu阮)irIu劉)irIu杻)irIu柳)irI流)irIu溜)irIu琉)irIu留)irIu硫)irIu紐)irIu類)irIr)irIu戮)irIu陸)irIu倫)irIu崙)irIu淪)irIu輪)irIu律)irIu慄)irIu栗)irIr )irIu隆)irIu利)irIu吏)irIu履)irIu易)irIu李)irIu梨)irIu泥)irIu理)irIu痢)irIu罹)irIu裏)irIu裡)irIr:)irIu離)irIu匿)irIu溺)irIu吝)irIu燐)irIu璘)irIu藺)irIu隣)irIu鱗)irIu麟)irIu林)irIu淋)irIu臨)irIr/)irIu笠)irIu粒)irIu狀)irIu炙)irIu識)irIu什)irIu茶)irIu刺)irI切)irIu度)irIu拓)irIu糖)irIu宅)irIu洞)irIu暴)irIu輻)irIr3)i rIu降)i rIr5)i rIu廓)i rIu兀)i rIu嗀rrrrr_seg_41srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir4)irI塚)ir4)irI晴)ir4)irIu凞)irI猪)irI益)irIu礼)irIu神)irIu祥)irI福)irI靖)irIu精)irIr1)ir4)i rIu蘒)i!r4)i"rI諸)i#r4)i%rI逸)i&rIu都)i'r4)i*rIu飯)i+rIu飼)i,rIu館)i-rIu鶴)i.rIu郞)i/rIu隷)i0rI侮)i1rI僧)i2rI免)i3rI勉)i4rI勤)i5rI卑)i6rI喝)i7rI嘆)i8rIu器)i9rIu塀)i:rIu墨)i;rIu層)i<rIr$)i=rI悔)i>rIu慨)i?rI憎)i@rI懲)iArI敏)iBrIu既)iCrI暑)iDrI梅)iErI海)iFrIu渚)iGrI漢)iHrI煮)iIrIu爫)iJrIu琢)iKrIu碑)iLrIr)iMrIu祉)iNrIu祈)iOrIu祐)iPrI祖)iQrIr)iRrIu禍)iSrIu禎)iTrI穀)iUrIu突)iVrI節)iWrIr)iXrIu縉)iYrIu繁)iZrIu署)i[rI者)i\rIu臭)i]rIu艹)i_rI著)i`rIu褐)iarI視)ibrI謁)icrI謹)idrIu賓)ierI贈)ifrIu辶)igrIr)ihrI難)iirI響)ijrI頻)ikrIu恵)ilrIu𤋮)imrIu舘)inr)iprIu並)iqrI况)irrIu全)isrIu侀)itrIu充)iurIu冀)ivrI勇)iwrI勺)ixrIr&rrrrr_seg_42sr@cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iyrIu啕)izrI喙)i{rIu嗢)i|rIr)i}rIu墳)i~rIu奄)irIu奔)irIu婢)irIu嬨)irIu廒)irIu廙)irIu彩)irIu徭)irIu惘)irI慎)irIu愈)irIr))irIu慠)irIr*)irIu戴)irIu揄)irIu搜)irIu摒)irIu敖)irIr)irIr)irI望)irIu杖)irIr+)irIr)irIr)irIu滛)irI滋)irIr/)irI瀞)irIr0)irIu瞧)irI爵)irIu犯)irIr)irI瑱)irIu甆)irIu画)irIu瘝)irIu瘟)irIr)irIu盛)irI直)irI睊)irIu着)irI磌)irIu窱)irIr3)irIu类)irIu絛)irIr)irIu缾)irIr4)irIu荒)irIu華)irI蝹)irIu襁)irIu覆)irIr6)irIu調)irIr)irIu請)irIr7)irIr )irI諭)irIr8)irI變)irIr9)irI輸)irIu遲)irIu醙)irIu鉶)irIu陼)irIr:)irIr)irIu韛)irIr;)irI頋)irIr<)irI鬒)irIrA)irIu𢡊)irIu𢡄)irIu𣏕)irI㮝)irIu䀘)irI䀹)irIu𥉉)irIu𥳐)irIu𧻓)irIu齃)irIu龎)ir)irIff)irIfirrrrr_seg_43srUcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIfl)irIffi)irIffl)irIst)ir)irIuմն)irIuմե)irIuմի)irIuվն)irIuմխ)ir)irIuיִ)ir4)irIuײַ)i rIuע)i!rIr)i"rIr)i#rIuה)i$rIuכ)i%rIuל)i&rIuם)i'rIuר)i(rIuת)i)rr)i*rIuשׁ)i+rIuשׂ)i,rIuשּׁ)i-rIuשּׂ)i.rIuאַ)i/rIuאָ)i0rIuאּ)i1rIuבּ)i2rIuגּ)i3rIuדּ)i4rIuהּ)i5rIuוּ)i6rIuזּ)i7r)i8rIuטּ)i9rIuיּ)i:rIuךּ)i;rIuכּ)i<rIuלּ)i=r)i>rIuמּ)i?r)i@rIuנּ)iArIuסּ)iBr)iCrIuףּ)iDrIuפּ)iEr)iFrIuצּ)iGrIuקּ)iHrIuרּ)iIrIuשּ)iJrIuתּ)iKrIuוֹ)iLrIuבֿ)iMrIuכֿ)iNrIuפֿ)iOrIuאל)iPrIuٱ)iRrIuٻ)iVrIuپ)iZrIuڀ)i^rIuٺ)ibrIuٿ)ifrIuٹ)ijrIuڤ)inrIuڦ)irrIuڄ)ivrIuڃ)izrIuچ)i~rIuڇ)irIuڍ)irIuڌ)irIuڎ)irIuڈ)irIuژ)irIuڑ)irIuک)irIuگ)irIuڳ)irIuڱ)irIں)irIuڻ)irIuۀ)irIuہ)irIuھ)irIuے)irIuۓ)ir4)ir)irIuڭ)irIuۇ)irIuۆ)irIuۈ)irIr)irIuۋrrrrr_seg_44sr[cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIuۅ)irIuۉ)irIuې)irIى)irIuئا)irIuئە)irIuئو)irIuئۇ)irIuئۆ)irIuئۈ)irIuئې)irIئى)irIuی)irIئج)irIئح)irIئم)irIr])irIئي)irIبج)irIبح)irIبخ)irIبم)i rIبى)i rIبي)i rIتج)i rIتح)i rIتخ)irIتم)irIتى)irIتي)irIuثج)irIثم)irIثى)irIثي)irIجح)irIجم)irIحج)irIحم)irIخج)irIuخح)irIخم)irIسج)irIسح)irIسخ)irIسم)i rIصح)i!rIصم)i"rIضج)i#rIضح)i$rIضخ)i%rIضم)i&rIطح)i'rIطم)i(rIظم)i)rIعج)i*rIعم)i+rIغج)i,rIغم)i-rIفج)i.rIفح)i/rIفخ)i0rIفم)i1rIفى)i2rIفي)i3rIقح)i4rIقم)i5rIقى)i6rIقي)i7rIكا)i8rIكج)i9rIكح)i:rIكخ)i;rIكل)i<rIكم)i=rIكى)i>rIكي)i?rIلج)i@rIلح)iArIلخ)iBrIلم)iCrIلى)iDrIلي)iErIمج)iFrIمح)iGrIمخ)iHrIمم)iIrIuمى)iJrIuمي)iKrIنج)iLrIنح)iMrIنخ)iNrIنم)iOrIنى)iPrIني)iQrIهج)iRrIهم)iSrIuهى)iTrIuهي)iUrIيج)iVrIيحrrrrr_seg_45SsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iWrIيخ)iXrIيم)iYrIيى)iZrIيي)i[rIuذٰ)i\rIuرٰ)i]rIىٰ)i^ru ٌّ)i_ru ٍّ)i`ru َّ)iaru ُّ)ibru ِّ)icru ّٰ)idrIuئر)ierIuئز)ifrIr`)igrIuئن)ihrIr])iirIra)ijrIuبر)ikrIuبز)ilrIre)imrIuبن)inrIrf)iorIrg)iprIuتر)iqrIuتز)irrIrk)isrIuتن)itrIrl)iurIrm)ivrIuثر)iwrIuثز)ixrIrn)iyrIuثن)izrIro)i{rIrp)i|rIr)i}rIr)i~rIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIuما)irIr)irIuنر)irIuنز)irIr)irIuنن)irIr)irIr)irIr)irIuير)irIuيز)irIr)irIuين)irIr)irIr)irIr^)irIr_)irIuئخ)irIr`)irIئه)irIrb)irIrc)irIrd)irIre)irIبه)irIrh)irIri)irIrj)irIrk)irIته)irIrn)irIrq)irIrr)irIrs)irIrt)irIru)irIrv)irIrw)irIrx)irIry)irIrz)irIr{)irIuصخ)irIr|)irIr})irIr~)irIr)irIr)irIr)irIr)irIrrrrrr_seg_46srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIuله)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIنه)irIr)irIr)irIuهٰ)irIr)irIr)irIr)irIr)irIيه)irIr`)irIr)irIre)irIr)irIrk)irIr)irIrn)irIuثه)irIrz)irIسه)irIشم)irIشه)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIuـَّ)irIuـُّ)irIuـِّ)irIطى)irIطي)irIعى)irIعي)irIغى)irIغي)irIسى)irIسي)irIشى)irIشي)irIحى)irIحي)irIجى)irIجي)irIخى)irIخي)irIصى)irIصي)irIضى)irIضي)i rIشج)i rIشح)i rIشخ)i rIr)i rIشر)irIسر)irIصر)irIضر)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIrrrrrr_seg_47#srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIr)i rIr)i!rIr)i"rIr)i#rIr)i$rIr)i%rIr)i&rIr)i'rIr)i(rIr)i)rIr)i*rIr)i+rIr)i,rIr)i-rIr)i.rIr)i/rIr)i0rIr)i1rIr)i2rIr)i3rIr)i4rIrw)i5rIrx)i6rIry)i7rIr)i8rIr)i9rIr)i:rIr)i;rIr)i<rIuاً)i>r4)iPrIuتجم)iQrIuتحج)iSrIuتحم)iTrIuتخم)iUrIuتمج)iVrIuتمح)iWrIuتمخ)iXrIuجمح)iZrIuحمي)i[rIuحمى)i\rIuسحج)i]rIuسجح)i^rIuسجى)i_rIuسمح)iarIuسمج)ibrIuسمم)idrIuصحح)ifrIصمم)igrIuشحم)iirIuشجي)ijrIuشمخ)ilrIuشمم)inrIuضحى)iorIuضخم)iqrIuطمح)isrIuطمم)itrIuطمي)iurIعجم)ivrIuعمم)ixrIuعمى)iyrIuغمم)izrIuغمي)i{rIuغمى)i|rIuفخم)i~rIقمح)irIuقمم)irIلحم)irIuلحي)irIuلحى)irIuلجج)irIuلخم)irIuلمح)irIuمحج)irIuمحم)irIuمحي)irIuمجح)irIuمجم)irIuمخج)irIuمخم)ir)irIuمجخ)irIuهمج)irIuهمم)irIuنحم)irIuنحى)irIuنجم)irIuنجى)irIuنمي)irIuنمى)irIuيمم)irIuبخي)irIuتجي)irIuتجى)irIuتخي)irIuتخى)irIuتمي)irIuتمى)irIuجمي)irIuجحىrrrrr_seg_48srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIuجمى)irIuسخى)irIuصحي)irIuشحي)irIuضحي)irIuلجي)irIuلمي)irIuيحي)irIuيجي)irIuيمي)irIuممي)irIuقمي)irIuنحي)irIr)irIr)irIuعمي)irIuكمي)irIنجح)irIuمخي)irIلجم)irIكمم)irIr)irIr)irIuجحي)irIuحجي)irIuمجي)irIuفمي)irIuبحي)irIr)irIr)irIr)irIuسخي)irIuنجي)ir)ir4)ir)irIuصلے)irIuقلے)irIuالله)irIuاكبر)irIuمحمد)irIuصلعم)irIuرسول)irIuعليه)irIuوسلم)irIuصلى)iru!صلى الله عليه وسلم)iruجل جلاله)irIuریال)ir4)ir)ir,)irI、)ir)ir:)irrp)ir!)ir?)irIu〖)irIu〗)ir)i r4)i0r)i1rI—)i2rIu–)i3r_)i5rr)i6rr)i7r{)i8r})i9rI〔)i:rI〕)i;rIu【)i<rIu】)i=rIu《)i>rIu》)i?rIr)i@rIr)iArI「)iBrI」)iCrIu『)iDrIu』)iEr4)iGr[)iHr])iIrr)iMrr)iPrr)iQrIr)iRr)iTrrp)iUrr)iVrr)iWrr)iXrIr)iYrr)iZrr)i[rr)i\rr)i]rIrrrrrr_seg_49srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i^rIr)i_r#)i`r&)iar*)ibrr)icrI-)idr<)ier>)ifrr)igr)ihr\)iir$)ijr%)ikr@)ilr)ipru ً)iqrIuـً)irru ٌ)isr4)itru ٍ)iur)ivru َ)iwrIuـَ)ixru ُ)iyrIuـُ)izru ِ)i{rIuـِ)i|ru ّ)i}rIuـّ)i~ru ْ)irIuـْ)irIuء)irIuآ)irIuأ)irIuؤ)irIuإ)irIuئ)irIا)irIب)irIuة)irIت)irIث)irIج)irIح)irIخ)irIد)irIذ)irIر)irIز)irIس)irIش)irIص)irIض)irIط)irIظ)irIع)irIغ)irIف)irIق)irIك)irIل)irIم)irIن)irIه)irIو)irIr\)irIي)irIuلآ)irIuلأ)irIuلإ)irIuلا)ir)ir)ir)irr)ir")irr)irr)irr)irr)ir')irr)i rr)i rr)i rr)i rr)i rIr)irIrB)ir/)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irrrrrrr_seg_50[srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irrp)irr)irr)irr)irr)i rr)i!rIrJ)i"rIrL)i#rIrN)i$rIrP)i%rIrR)i&rIrT)i'rIrV)i(rIrX)i)rIrZ)i*rIr\)i+rIr^)i,rIr`)i-rIrb)i.rIrd)i/rIrf)i0rIrh)i1rIrj)i2rIrl)i3rIrn)i4rIrp)i5rIrr)i6rIrt)i7rIrv)i8rIrx)i9rIrz)i:rIr|)i;rr)i<rr)i=rr)i>r^)i?rr)i@rr)iArIrJ)iBrIrL)iCrIrN)iDrIrP)iErIrR)iFrIrT)iGrIrV)iHrIrX)iIrIrZ)iJrIr\)iKrIr^)iLrIr`)iMrIrb)iNrIrd)iOrIrf)iPrIrh)iQrIrj)iRrIrl)iSrIrn)iTrIrp)iUrIrr)iVrIrt)iWrIrv)iXrIrx)iYrIrz)iZrIr|)i[rr)i\r|)i]rr)i^r~)i_rIu⦅)i`rIu⦆)iarIrB)ibrIr)icrIr)idrIr)ierIu・)ifrIr)igrIuァ)ihrIuィ)iirIuゥ)ijrIuェ)ikrIuォ)ilrIuャ)imrIuュ)inrIuョ)iorIuッ)iprIuー)iqrIr)irrIr)isrIr)itrIr)iurIr)ivrIr)iwrIr)ixrIr)iyrIr)izrIr)i{rIr)i|rIr)i}rIr)i~rIrrrrrr_seg_51srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIuン)irIu゙)irIu゚)ir)irIrD)irIrE)irIrF)irIrG)irIrH)irIrI)irIrJ)irIrK)irIrL)irIrM)irIrN)irIrO)irIrP)irIrQ)irIrR)irIrS)irIrT)irIrU)irIrV)irIrW)irIrX)irIrY)irIrZ)irIr[)irIr\)irIr])irIr^)irIr_)irIr`)irIra)ir)irIrb)irIrc)irIrd)irIre)irIrf)irIrg)ir)irIrh)irIri)irIrj)irIrk)irIrl)irIrm)ir)irIrn)irIro)irIrp)irIrq)irIrr)irIrs)ir)irIrt)irIru)irIrv)ir)irI¢)irI£)irI¬)irr)irI¦)irI¥)irIu₩)ir)irIu│)irIu←rrrrr_seg_52+sr$cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIu↑)irIu→)irIu↓)irIu■)irIu○)ir)ir4)i r)i r4)i'r)i(r4)i;r)i<r4)i>r)i?r4)iNr)iPr4)i^r)ir4)ir)ir4)ir)ir4)i4r)i7r4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)i$r)i-r4)iKr)iPr4)i{r)ir4)ir)ir4)ir)ir4)ir)irIu𐐨)irIu𐐩)irIu𐐪)irIu𐐫)irIu𐐬)irIu𐐭)irIu𐐮)irIu𐐯)irIu𐐰)i rIu𐐱)i rIu𐐲)i rIu𐐳)i rIu𐐴)i rIu𐐵)irIu𐐶)irIu𐐷)irIu𐐸)irIu𐐹)irIu𐐺)irIu𐐻)irIu𐐼)irIu𐐽)irIu𐐾)irIu𐐿)irIu𐑀)irIu𐑁)irIu𐑂)irIu𐑃)irIu𐑄)irIu𐑅)irIu𐑆)irIu𐑇)i rIu𐑈)i!rIu𐑉)i"rIu𐑊)i#rIu𐑋)i$rIu𐑌)i%rIu𐑍)i&rIu𐑎)i'rIu𐑏)i(r4)ir)ir4)ir)irIu𐓘)irIu𐓙)irIu𐓚)irIu𐓛)irIu𐓜)irIu𐓝rrrrr_seg_53sr%cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIu𐓞)irIu𐓟)irIu𐓠)irIu𐓡)irIu𐓢)irIu𐓣)irIu𐓤)irIu𐓥)irIu𐓦)irIu𐓧)irIu𐓨)irIu𐓩)irIu𐓪)irIu𐓫)irIu𐓬)irIu𐓭)irIu𐓮)irIu𐓯)irIu𐓰)irIu𐓱)irIu𐓲)irIu𐓳)irIu𐓴)irIu𐓵)irIu𐓶)irIu𐓷)irIu𐓸)irIu𐓹)irIu𐓺)irIu𐓻)ir)ir4)ir)ir4)i(r)i0r4)idr)ior4)iprIu𐖗)iqrIu𐖘)irrIu𐖙)isrIu𐖚)itrIu𐖛)iurIu𐖜)ivrIu𐖝)iwrIu𐖞)ixrIu𐖟)iyrIu𐖠)izrIu𐖡)i{r)i|rIu𐖣)i}rIu𐖤)i~rIu𐖥)irIu𐖦)irIu𐖧)irIu𐖨)irIu𐖩)irIu𐖪)irIu𐖫)irIu𐖬)irIu𐖭)irIu𐖮)irIu𐖯)irIu𐖰)irIu𐖱)ir)irIu𐖳)irIu𐖴)irIu𐖵)irIu𐖶)irIu𐖷)irIu𐖸)irIu𐖹)ir)irIu𐖻)irIu𐖼)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)i7r)i@r4)iVr)i`r4)ihr)ir4)irIuː)irIuˑ)irIr)irIuʙ)irIrT)ir)irIuʣ)irIuꭦrrrrr_seg_54sr&cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIuʥ)irIuʤ)irIrV)irIrW)irIuᶑ)irIuɘ)irIuɞ)irIuʩ)irIuɤ)irIuɢ)irIr[)irIuʛ)irIrO)irIuʜ)irIuɧ)irIuʄ)irIuʪ)irIuʫ)irIr)irIu𝼄)irIuꞎ)irIuɮ)irIu𝼅)irIuʎ)irIu𝼆)irIr)irIuɶ)irIuɷ)irIrj)irIuɺ)irIu𝼈)irIr)irIuɾ)irIrc)irIuʨ)irIuʦ)irIuꭧ)irIuʧ)irIre)irIuⱱ)ir)irIuʏ)irIuʡ)irIuʢ)irIuʘ)irIuǀ)irIuǁ)irIuǂ)irIu𝼊)irIu𝼞)ir)ir4)ir)ir4)i r)i r4)i6r)i7r4)i9r)i<r4)i=r)i?r4)iVr)iWr4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)i r)i r4)i: r)i? r4)i@ r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i r)i r4)i6 r)i8 r4)i; r)i? r4)iI r)iP r4)iY r)i` r4)i r)i r4rrrrr_seg_55csr'cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i r)i r4)i r)i r4)i6 r)i9 r4)iV r)iX r4)is r)ix r4)i r)i r4)i r)i r4)i r)i r4)iI r)i rIu𐳀)i rIu𐳁)i rIu𐳂)i rIu𐳃)i rIu𐳄)i rIu𐳅)i rIu𐳆)i rIu𐳇)i rIu𐳈)i rIu𐳉)i rIu𐳊)i rIu𐳋)i rIu𐳌)i rIu𐳍)i rIu𐳎)i rIu𐳏)i rIu𐳐)i rIu𐳑)i rIu𐳒)i rIu𐳓)i rIu𐳔)i rIu𐳕)i rIu𐳖)i rIu𐳗)i rIu𐳘)i rIu𐳙)i rIu𐳚)i rIu𐳛)i rIu𐳜)i rIu𐳝)i rIu𐳞)i rIu𐳟)i rIu𐳠)i rIu𐳡)i rIu𐳢)i rIu𐳣)i rIu𐳤)i rIu𐳥)i rIu𐳦)i rIu𐳧)i rIu𐳨)i rIu𐳩)i rIu𐳪)i rIu𐳫)i rIu𐳬)i rIu𐳭)i rIu𐳮)i rIu𐳯)i rIu𐳰)i rIu𐳱)i rIu𐳲)i r)i r4)i r)i r4)i( r)i0 r4)i: r)i`r4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)i(r)i0r4)iZr)ipr4)ir)ir4)ir)ir4)ir)ir4)iNr)iRr4)ivr)ir4)ir)ir4rrrrr_seg_56sr(cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir)ir4)ir)ir4)ir)ir4)i5r)i6r4)iHr)iPr4)iwr)ir4)ir)ir4)ir)ir4)ir)ir4)i?r)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)i r)ir4)ir)ir4)i)r)i*r4)i1r)i2r4)i4r)i5r4)i:r)i;r4)iEr)iGr4)iIr)iKr4)iNr)iPr4)iQr)iWr4)iXr)i]r4)idr)ifr4)imr)ipr4)iur)ir4)i\r)i]r4)ibr)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)iEr)iPr4)iZr)i`r4)imr)ir4)ir)ir4)ir)ir4)ir)ir4)i,r)i0r4)iGr)ir4)i<r)irIu𑣀)irIu𑣁)irIu𑣂)irIu𑣃)irIu𑣄)irIu𑣅)irIu𑣆rrrrr_seg_573sr)cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIu𑣇)irIu𑣈)irIu𑣉)irIu𑣊)irIu𑣋)irIu𑣌)irIu𑣍)irIu𑣎)irIu𑣏)irIu𑣐)irIu𑣑)irIu𑣒)irIu𑣓)irIu𑣔)irIu𑣕)irIu𑣖)irIu𑣗)irIu𑣘)irIu𑣙)irIu𑣚)irIu𑣛)irIu𑣜)irIu𑣝)irIu𑣞)irIu𑣟)ir4)ir)ir4)ir)i r4)i r)i r4)ir)ir4)ir)ir4)i6r)i7r4)i9r)i;r4)iGr)iPr4)iZr)ir4)ir)ir4)ir)ir4)ir)ir4)iHr)iPr4)ir)ir4)ir)ir4)i r)i r4)i7r)i8r4)iFr)iPr4)imr)ipr4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)i r)i r4)i7r)i:r4)i;r)i<r4)i>r)i?r4)iHr)iPr4)iZr)i`r4)ifr)igr4)iir)ijr4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4rrrrr_seg_58sr*cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir)ir4)i#r)i$r4)io$r)ip$r4)iu$r)i$r4)iD%r)i/r4)i/r)i0r4)i/4r)iDr4)iGFr)ihr4)i9jr)i@jr4)i_jr)i`jr4)ijjr)injr4)ijr)ijr4)ijr)ijr4)ijr)ijr4)ijr)ikr4)iFkr)iPkr4)iZkr)i[kr4)ibkr)ickr4)ixkr)i}kr4)ikr)i@nrIu𖹠)iAnrIu𖹡)iBnrIu𖹢)iCnrIu𖹣)iDnrIu𖹤)iEnrIu𖹥)iFnrIu𖹦)iGnrIu𖹧)iHnrIu𖹨)iInrIu𖹩)iJnrIu𖹪)iKnrIu𖹫)iLnrIu𖹬)iMnrIu𖹭)iNnrIu𖹮)iOnrIu𖹯)iPnrIu𖹰)iQnrIu𖹱)iRnrIu𖹲)iSnrIu𖹳)iTnrIu𖹴)iUnrIu𖹵)iVnrIu𖹶)iWnrIu𖹷)iXnrIu𖹸)iYnrIu𖹹)iZnrIu𖹺)i[nrIu𖹻)i\nrIu𖹼)i]nrIu𖹽)i^nrIu𖹾)i_nrIu𖹿)i`nr4)inr)ior4)iKor)iOor4)ior)ior4)ior)ior4)ior)ior4)ior)ipr4)ir)ir4)i֌r)ir4)i r)ir4)ir)ir4)ir)ir4)ir)ir4)i#r)iPr4)iSr)idr4rrrrr_seg_59sr+cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ihr)ipr4)ir)ir4)ikr)ipr4)i}r)ir4)ir)ir4)ir)ir4)ir)ir)ir4)i.r)i0r4)iGr)iPr4)ir)ir4)ir)ir4)i'r)i)r4)i^rIu𝅗𝅥)i_rIu𝅘𝅥)i`rIu 𝅘𝅥𝅮)iarIu 𝅘𝅥𝅯)ibrIu 𝅘𝅥𝅰)icrIu 𝅘𝅥𝅱)idrIu 𝅘𝅥𝅲)ier4)isr)i{r4)irIu𝆹𝅥)irIu𝆺𝅥)irIu 𝆹𝅥𝅮)irIu 𝆺𝅥𝅮)irIu 𝆹𝅥𝅯)irIu 𝆺𝅥𝅯)ir4)ir)ir4)iFr)ir4)ir)ir4)iWr)i`r4)iyr)irIrJ)irIrL)irIrN)irIrP)irIrR)irIrT)irIrV)irIrX)irIrZ)i rIr\)i rIr^)i rIr`)i rIrb)i rIrd)irIrf)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)irIrR)irIrT)i rIrV)i!rIrX)i"rIrZ)i#rIr\)i$rIr^)i%rIr`)i&rIrb)i'rIrd)i(rIrf)i)rIrh)i*rIrj)i+rIrl)i,rIrn)i-rIrp)i.rIrr)i/rIrt)i0rIrvrrrrr_seg_60ksr,cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i1rIrx)i2rIrz)i3rIr|)i4rIrJ)i5rIrL)i6rIrN)i7rIrP)i8rIrR)i9rIrT)i:rIrV)i;rIrX)i<rIrZ)i=rIr\)i>rIr^)i?rIr`)i@rIrb)iArIrd)iBrIrf)iCrIrh)iDrIrj)iErIrl)iFrIrn)iGrIrp)iHrIrr)iIrIrt)iJrIrv)iKrIrx)iLrIrz)iMrIr|)iNrIrJ)iOrIrL)iPrIrN)iQrIrP)iRrIrR)iSrIrT)iTrIrV)iUr)iVrIrZ)iWrIr\)iXrIr^)iYrIr`)iZrIrb)i[rIrd)i\rIrf)i]rIrh)i^rIrj)i_rIrl)i`rIrn)iarIrp)ibrIrr)icrIrt)idrIrv)ierIrx)ifrIrz)igrIr|)ihrIrJ)iirIrL)ijrIrN)ikrIrP)ilrIrR)imrIrT)inrIrV)iorIrX)iprIrZ)iqrIr\)irrIr^)isrIr`)itrIrb)iurIrd)ivrIrf)iwrIrh)ixrIrj)iyrIrl)izrIrn)i{rIrp)i|rIrr)i}rIrt)i~rIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)irIrR)irIrT)irIrV)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrb)irIrd)irIrf)irIrh)irIrj)irIrl)irIrnrrrrr_seg_61sr-cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)ir)irIrN)irIrP)ir)irIrV)ir)irIr\)irIr^)ir)irIrd)irIrf)irIrh)irIrj)ir)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)ir)irIrT)ir)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrb)irIrd)ir)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)irIrR)irIrT)irIrV)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrb)irIrd)irIrf)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)irIrR)irIrT)irIrV)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrb)irIrd)irIrf)irIrh)irIrj)irIrlrrrrr_seg_62;sr.cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)ir)irIrP)irIrR)i rIrT)i rIrV)i r)i rIr\)irIr^)irIr`)irIrb)irIrd)irIrf)irIrh)irIrj)ir)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)ir)irIrJ)irIrL)i rIrN)i!rIrP)i"rIrR)i#rIrT)i$rIrV)i%rIrX)i&rIrZ)i'rIr\)i(rIr^)i)rIr`)i*rIrb)i+rIrd)i,rIrf)i-rIrh)i.rIrj)i/rIrl)i0rIrn)i1rIrp)i2rIrr)i3rIrt)i4rIrv)i5rIrx)i6rIrz)i7rIr|)i8rIrJ)i9rIrL)i:r)i;rIrP)i<rIrR)i=rIrT)i>rIrV)i?r)i@rIrZ)iArIr\)iBrIr^)iCrIr`)iDrIrb)iEr)iFrIrf)iGr)iJrIrn)iKrIrp)iLrIrr)iMrIrt)iNrIrv)iOrIrx)iPrIrz)iQr)iRrIrJ)iSrIrL)iTrIrN)iUrIrP)iVrIrR)iWrIrT)iXrIrV)iYrIrX)iZrIrZ)i[rIr\)i\rIr^)i]rIr`)i^rIrb)i_rIrd)i`rIrf)iarIrh)ibrIrjrrrrr_seg_63sr/cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)icrIrl)idrIrn)ierIrp)ifrIrr)igrIrt)ihrIrv)iirIrx)ijrIrz)ikrIr|)ilrIrJ)imrIrL)inrIrN)iorIrP)iprIrR)iqrIrT)irrIrV)isrIrX)itrIrZ)iurIr\)ivrIr^)iwrIr`)ixrIrb)iyrIrd)izrIrf)i{rIrh)i|rIrj)i}rIrl)i~rIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)irIrR)irIrT)irIrV)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrb)irIrd)irIrf)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)irIrR)irIrT)irIrV)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrb)irIrd)irIrf)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)irIrR)irIrT)irIrV)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrbrrrrr_seg_64 sr0cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIrd)irIrf)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)irIrR)irIrT)irIrV)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrb)irIrd)irIrf)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)irIrR)irIrT)irIrV)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrb)irIrd)irIrf)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)i rIrL)i rIrN)i rIrP)i rIrR)i rIrT)irIrV)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrb)irIrd)irIrf)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)i rIrz)i!rIr|)i"rIrJ)i#rIrL)i$rIrN)i%rIrP)i&rIrR)i'rIrT)i(rIrV)i)rIrX)i*rIrZrrrrr_seg_65ssr1cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i+rIr\)i,rIr^)i-rIr`)i.rIrb)i/rIrd)i0rIrf)i1rIrh)i2rIrj)i3rIrl)i4rIrn)i5rIrp)i6rIrr)i7rIrt)i8rIrv)i9rIrx)i:rIrz)i;rIr|)i<rIrJ)i=rIrL)i>rIrN)i?rIrP)i@rIrR)iArIrT)iBrIrV)iCrIrX)iDrIrZ)iErIr\)iFrIr^)iGrIr`)iHrIrb)iIrIrd)iJrIrf)iKrIrh)iLrIrj)iMrIrl)iNrIrn)iOrIrp)iPrIrr)iQrIrt)iRrIrv)iSrIrx)iTrIrz)iUrIr|)iVrIrJ)iWrIrL)iXrIrN)iYrIrP)iZrIrR)i[rIrT)i\rIrV)i]rIrX)i^rIrZ)i_rIr\)i`rIr^)iarIr`)ibrIrb)icrIrd)idrIrf)ierIrh)ifrIrj)igrIrl)ihrIrn)iirIrp)ijrIrr)ikrIrt)ilrIrv)imrIrx)inrIrz)iorIr|)iprIrJ)iqrIrL)irrIrN)isrIrP)itrIrR)iurIrT)ivrIrV)iwrIrX)ixrIrZ)iyrIr\)izrIr^)i{rIr`)i|rIrb)i}rIrd)i~rIrf)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIrJ)irIrL)irIrN)irIrP)irIrRrrrrr_seg_66sr2cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIrT)irIrV)irIrX)irIrZ)irIr\)irIr^)irIr`)irIrb)irIrd)irIrf)irIrh)irIrj)irIrl)irIrn)irIrp)irIrr)irIrt)irIrv)irIrx)irIrz)irIr|)irIuı)irIuȷ)ir)irIrz)irIr{)irIr|)irIr})irIr~)irIr)irIr)irIr)irIrn)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irI∇)irIrz)irIr{)irIr|)irIr})irIr~)irIr)irIr)irIr)irIrn)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irI∂)irIr~)irIr)irIr)irIr)irIr)irIr)irIrz)irIr{)irIr|)irIr})irIr~)irIr)irIr)irIr)irIrn)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIrrrrrr_seg_67Csr5cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIr)irIr)irIr)irIr)irIr)irIr)irIr3)irIrz)irIr{)irIr|)irIr})irIr~)irIr)irIr)irIr)irIrn)irIr)irIr)irIr)irIr)i rIr)i rIr)i rIr)i rIr)i rIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr4)irIr~)irIr)irIr)irIr)irIr)irIr)irIrz)irIr{)irIr|)irIr})i rIr~)i!rIr)i"rIr)i#rIr)i$rIrn)i%rIr)i&rIr)i'rIr)i(rIr)i)rIr)i*rIr)i+rIr)i,rIr)i-rIr)i.rIr)i/rIr)i0rIr)i1rIr)i2rIr)i3rIr)i4rIr)i5rIr3)i6rIrz)i7rIr{)i8rIr|)i9rIr})i:rIr~)i;rIr)i<rIr)i=rIr)i>rIrn)i?rIr)i@rIr)iArIr)iBrIr)iCrIr)iDrIr)iErIr)iFrIr)iGrIr)iIrIr)iJrIr)iKrIr)iLrIr)iMrIr)iNrIr)iOrIr4)iPrIr~)iQrIr)iRrIr)iSrIr)iTrIr)iUrIr)iVrIrz)iWrIr{)iXrIr|)iYrIr})iZrIr~rrrrr_seg_68sr6cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i[rIr)i\rIr)i]rIr)i^rIrn)i_rIr)i`rIr)iarIr)ibrIr)icrIr)idrIr)ierIr)ifrIr)igrIr)ihrIr)iirIr)ijrIr)ikrIr)ilrIr)imrIr)inrIr)iorIr3)iprIrz)iqrIr{)irrIr|)isrIr})itrIr~)iurIr)ivrIr)iwrIr)ixrIrn)iyrIr)izrIr)i{rIr)i|rIr)i}rIr)i~rIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr4)irIr~)irIr)irIr)irIr)irIr)irIr)irIrz)irIr{)irIr|)irIr})irIr~)irIr)irIr)irIr)irIrn)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr3)irIrz)irIr{)irIr|)irIr})irIr~)irIr)irIr)irIr)irIrn)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIrrrrrr_seg_69sr7cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIr)irIr)irIr4)irIr~)irIr)irIr)irIr)irIr)irIr)irIr)ir)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)i"r)i#r4)i%r)i&r4)i+r)ir4)i-r)i0r4)i>r)i@r4)iJr)iNr4)iPr)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4rrrrr_seg_70{sr8cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir)ir4)ir)ir4)ir)irIu𞤢)irIu𞤣)irIu𞤤)irIu𞤥)irIu𞤦)irIu𞤧)irIu𞤨)irIu𞤩)irIu𞤪)i rIu𞤫)i rIu𞤬)i rIu𞤭)i rIu𞤮)i rIu𞤯)irIu𞤰)irIu𞤱)irIu𞤲)irIu𞤳)irIu𞤴)irIu𞤵)irIu𞤶)irIu𞤷)irIu𞤸)irIu𞤹)irIu𞤺)irIu𞤻)irIu𞤼)irIu𞤽)irIu𞤾)irIu𞤿)irIu𞥀)irIu𞥁)i rIu𞥂)i!rIu𞥃)i"r4)iLr)iPr4)iZr)i^r4)i`r)iqr4)ir)ir4)i>r)irIr)irIr)irIr)irIr)ir)irIr)irIr)irIr)irIr )i rIr)i rIr)i rIr)i rIr)i rIr)irIr)irIr )irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr )irIr )irIr )irIٮ)irIrZ)irIڡ)irIٯ)i r)i!rIr)i"rIr)i#r)i$rIr)i%r)i'rIr)i(r)i)rIr)i*rIr)i+rIr)i,rIr)i-rIr)i.rIr)i/rIr )i0rIr)i1rIr)i2rIr)i3rrrrrr_seg_71sr<cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i4rIr)i5rIr)i6rIr)i7rIr)i8r)i9rIr )i:r)i;rIr )i<r)iBrIr)iCr)iGrIr)iHr)iIrIr)iJr)iKrIr)iLr)iMrIr)iNrIr)iOrIr )iPr)iQrIr)iRrIr)iSr)iTrIr)iUr)iWrIr)iXr)iYrIr )iZr)i[rIr )i\r)i]rIrZ)i^r)i_rIr;)i`r)iarIr)ibrIr)icr)idrIr)ier)igrIr)ihrIr )iirIr)ijrIr)ikr)ilrIr)imrIr)inrIr)iorIr )iprIr)iqrIr)irrIr)isr)itrIr)iurIr)ivrIr)iwrIr)ixr)iyrIr )izrIr )i{rIr )i|rIr9)i}r)i~rIr:)ir)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr )irIr)ir)irIr)irIr)irIr)irIr)irIr )irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr )irIr )irIr )ir)irIr)irIr)irIr)ir)irIrrrrrr_seg_72Ksr=cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIr)irIr)irIr )irIr)ir)irIr)irIr)irIr)irIr)irIr )irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr )irIr )irIr )ir)ir4)ir)ir4)i,r)i0r4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)irz0,)irz1,)irz2,)irz3,)irz4,)irz5,)irz6,)irz7,)i rz8,)i rz9,)i r4)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)i rr )i!rr )i"rr )i#rr )i$rr )i%rr)i&rr)i'rr)i(rr)i)rr)i*rIu〔s〕)i+rIrN)i,rIrl)i-rIr)i.rIZwz)i/r4)i0rIrJ)i1rIrL)i2rIrN)i3rIrP)i4rIrR)i5rIrT)i6rIrV)i7rIrX)i8rIrZ)i9rIr\)i:rIr^)i;rIr`)i<rIrb)i=rIrd)i>rIrf)i?rIrh)i@rIrj)iArIrl)iBrIrn)iCrIrprrrrr_seg_73sr>cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iDrIrr)iErIrt)iFrIrv)iGrIrx)iHrIrz)iIrIr|)iJrIZhv)iKrIr)iLrIsd)iMrIr-)iNrIZppv)iOrIwc)iPr4)ijrIZmc)ikrImd)ilrImr)imr4)irIZdj)ir4)ir)ir4)irIuほか)irIuココ)irIr)ir)irIr&)irIu字)irIu双)irIuデ)irIr)irI多)irIu解)irIr})irIu交)irIu映)irIu無)irIr)irIu前)irIu後)irI再)irIu新)i rIu初)i!rIu終)i"rIr.)i#rIu販)i$rIu声)i%rIu吹)i&rIu演)i'rIu投)i(rIu捕)i)rIr)i*rIrx)i+rIu遊)i,rIr)i-rIr{)i.rIr)i/rIu指)i0rIr7)i1rIu打)i2rIu禁)i3rIu空)i4rIu合)i5rIu満)i6rIr)i7rIr))i8rIu申)i9rI割)i:rIu営)i;rIu配)i<r)i@rIu 〔本〕)iArIu 〔三〕)iBrIu 〔二〕)iCrIu 〔安〕)iDrIu 〔点〕)iErIu 〔打〕)iFrIu 〔盗〕)iGrIu 〔勝〕)iHrIu 〔敗〕)iIr)iPrIu得)iQrIu可)iRr)i`r4)ifr)ir4)ir)ir4)ir)ir4)ir)ir4)itr)ir4)ir)ir4)ir)ir4)ir)ir4rrrrr_seg_74srFcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i r)ir4)iHr)iPr4)iZr)i`r4)ir)ir4)ir)ir4)ir)ir4)iTr)i`r4)inr)ipr4)iur)ixr4)i}r)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)ir4)ir)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)irIr)ir)ir4)ir)ir4)i9r)i@r4)ir)i r4)ir)ir4)ir)irIu丽)irIu丸)irIu乁)irIu𠄢)irIu你)irIr )irIu侻)irIu倂)irIu偺)i rIu備)i rIr!)i rIu像)i rIu㒞)i rIu𠘺)irIr")irIu兔)irIu兤)irIu具)irIu𠔜)irIu㒹)irIu內)irIrD)irIu𠕋)irIu冗)irIu冤)irIu仌)irIu冬)irIr=)irIu𩇟)irIr)irIu刃)irIu㓟)i rIu刻)i!rIu剆)i"rIrE)i#rIu剷)i$rIu㔕)i%rIr>)i&rIr#)i'rIr$)i(rIr?)i)rIu包rrrrr_seg_75srGcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i*rIu匆)i+rIr)i,rIu卉)i-rIr%)i.rIu博)i/rIu即)i0rIu卽)i1rIu卿)i4rIu𠨬)i5rIu灰)i6rIu及)i7rIu叟)i8rIu𠭣)i9rIu叫)i:rIu叱)i;rIu吆)i<rIu咞)i=rIu吸)i>rIu呈)i?rIu周)i@rIu咢)iArIu哶)iBrIu唐)iCrIu啓)iDrIu啣)iErIu善)iGrIrA)iHrIu喫)iIrIu喳)iJrIu嗂)iKrIu圖)iLrIr')iMrIu圗)iNrIu噑)iOrIu噴)iPrIr)iQrIu壮)iRrIu城)iSrIu埴)iTrIu堍)iUrIu型)iVrIu堲)iWrIu報)iXrIu墬)iYrIu𡓤)iZrIu売)i[rIu壷)i\rIu夆)i]rIrC)i^rIu夢)i_rIu奢)i`rIu𡚨)iarIu𡛪)ibrIu姬)icrIu娛)idrIu娧)ierIu姘)ifrIu婦)igrIu㛮)ihr)iirIu嬈)ijrIu嬾)ilrIu𡧈)imrIu寃)inrIu寘)iorIr )iprIu寳)iqrIu𡬘)irrIu寿)isrIu将)itr)iurIr#)ivrIu㞁)iwrIu屠)ixrIr$)iyrIu峀)izrIu岍)i{rIu𡷤)i|rIu嵃)i}rIu𡷦)i~rIu嵮)irIu嵫)irIu嵼)irIu巡)irIu巢)irIu㠯)irIu巽)irIu帨)irIu帽)irIu幩)irIu㡢)irIu𢆃)irIu㡼)irIu庰)irIu庳)irIu庶)irIr)irIu𪎒)irIr%)irIu𢌱rrrrr_seg_76srHcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irI舁)irIu弢)irIu㣇)irIu𣊸)irIu𦇚)irIu形)irIu彫)irIu㣣)irIu徚)irIu忍)irIu志)irIu忹)irIu悁)irIu㤺)irIu㤜)irIr()irIu𢛔)irIu惇)irIu慈)irI慌)irIrB)irIrJ)irIu慺)irIr))irIu憲)irIu憤)irIu憯)irIu懞)irIr*)irIr)irIu成)irIu戛)irIu扝)irIu抱)irIu拔)irIu捐)irIu𢬌)irIu挽)irIu拼)irIu捨)irIu掃)irIu揤)irIu𢯱)irIu搢)irIu揅)irIu掩)irIu㨮)irIu摩)irIu摾)irIu撝)irIu摷)irIu㩬)irIr+)irIu敬)irIu𣀊)irIu旣)irIu書)irIu晉)irIu㬙)irIr,)irIu㬈)irIu㫤)irIu冒)irIu冕)irIu最)irIu暜)irIu肭)irIu䏙)irIr)irIrC)irIu朡)irIu杞)irIu杓)irIu𣏃)irIu㭉)irIu柺)irIu枅)irIu桒)irIr-)irIu𣑭)irIu梎)irIu栟)irIu椔)irIrQ)irIu楂)irIu榣)irIu槪)irIu檨)irIu𣚣)irIu櫛)irIu㰘)irIu次)irIu𣢧)irIu歔)irIu㱎)irIu歲)irIu殟)irIr)irIu殻)irIu𣪍rrrrr_seg_77SsrKcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irIu𡴋)irIu𣫺)irIu汎)irIu𣲼)irIu沿)irIu泍)irIu汧)irIu洖)irIu派)irIr.)irIr)irIu浩)irIu浸)irIu涅)irIu𣴞)irIu洴)irIu港)i rIu湮)i rIu㴳)i rIrD)i rIu滇)i rIu𣻑)irIu淹)irIu潮)irIu𣽞)irIu𣾎)irIu濆)irIu瀹)irIrE)irIu瀛)irIu㶖)irIu灊)irIu災)irIu灷)irIu炭)irIu𠔥)irIu煅)irIu𤉣)irIu熜)ir)i rIu爨)i!rIrF)i"rIu牐)i#rIu𤘈)i$rIu犀)i%rIu犕)i&rIu𤜵)i'rIu𤠔)i(rIu獺)i)rIu王)i*rIu㺬)i+rIu玥)i,rIu㺸)i.rIu瑇)i/rIu瑜)i0rIrG)i1rIu璅)i2rIu瓊)i3rIu㼛)i4rIu甤)i5rIu𤰶)i6rIu甾)i7rIu𤲒)i8rIr )i9rIu𢆟)i:rIu瘐)i;rIu𤾡)i<rIu𤾸)i=rIu𥁄)i>rIu㿼)i?rIu䀈)i@rIrH)iArIu𥃳)iBrIu𥃲)iCrIu𥄙)iDrIu𥄳)iErIu眞)iFrIu真)iHrIrI)iIrIrR)iJrIu瞋)iKrIu䁆)iLrIu䂖)iMrIu𥐝)iNrIu硎)iOrIr)iPrIrJ)iQrIu䃣)iRrIu𥘦)iSrIr1)iTrIu𥚚)iUrIu𥛅)iVrIr)iWrIu秫)iXrIu䄯)iYrIr2)iZrIu穊)i[rIu穏)i\rIu𥥼)i]rIu𥪧rrrrr_seg_78srLcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i_r)i`rIu䈂)iarIu𥮫)ibrIu篆)icrIu築)idrIu䈧)ierIu𥲀)ifrIu糒)igrIu䊠)ihrIu糨)iirIu糣)ijrIu紀)ikrIu𥾆)ilrIu絣)imrIu䌁)inrIu緇)iorIu縂)iprIu繅)iqrIu䌴)irrIu𦈨)isrIu𦉇)itrIu䍙)iurIu𦋙)ivrIu罺)iwrIu𦌾)ixrIu羕)iyrIu翺)izrIr4)i{rIu𦓚)i|rIu𦔣)i}rIu聠)i~rIu𦖨)irIu聰)irIu𣍟)irIu䏕)irIu育)irIu脃)irIu䐋)irIu脾)irIu媵)irIu𦞧)irIu𦞵)irIu𣎓)irIu𣎜)irIrI)irIu舄)irIu辞)irIu䑫)irIu芑)irIu芋)irIu芝)irIu劳)irIu花)irIu芳)irIu芽)irIu苦)irIu𦬼)irIr)irIu茝)irIu荣)irIu莭)irIu茣)irIu莽)irIu菧)irIr5)irIu荓)irIu菊)irIu菌)irIu菜)irIu𦰶)irIu𦵫)irIu𦳕)irIu䔫)irIu蓱)irIu蓳)irIu蔖)irIu𧏊)irIu蕤)irIu𦼬)irIu䕝)irIu䕡)irIu𦾱)irIu𧃒)irIu䕫)irIu虐)irIr)irIu虧)irIu虩)irIu蚩)irIu蚈)irIu蜎)irIu蛢)irIrK)irIu蜨)irIu蝫)irIu螆)ir)irIu蟡)irIu蠁)irIu䗹rrrrr_seg_79# srMc_Csddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_g_S)`N)irIu衠)irIr4)irIu𧙧)irIu裗)irIu裞)irIu䘵)irIu裺)irIu㒻)irIu𧢮)irIu𧥦)irIu䚾)irIu䛇)irIu誠)irIrL)irIrM)irIr6)irIu𧲨)irIu貫)irIu賁)irIu贛)irIu起)irIu𧼯)irIu𠠄)irIu跋)irIu趼)irIu跰)irIu𠣞)irIu軔)irIrN)irIu𨗒)irIu𨗭)irIu邔)irIu郱)irIu鄑)irIu𨜮)irIu鄛)irIu鈸)irIu鋗)irIu鋘)irIu鉼)irIu鏹)irIu鐕)irIu𨯺)irIu開)irIu䦕)irIu閷)irIu𨵷)irIu䧦)irIu雃)irIu嶲)irIu霣)irIu𩅅)irIu𩈚)irIu䩮)irIu䩶)irIu韠)irIu𩐊)irIu䪲)irIu𩒖)irIrO)irIu頩)irIu𩖶)irIu飢)irIu䬳)irIu餩)irIu馧)irIu駂)irIu駾)irIu䯎)i rIu𩬰)i rIrP)i rIu鱀)i rIu鳽)i rIu䳎)irIu䳭)irIu鵧)irIu𪃎)irIu䳸)irIu𪄅)irIu𪈎)irIu𪊑)irIr=)irIu䵖)irIr>)irIu黾)irIu鼅)irIu鼏)irIu鼖)irIr?)irIu𪘀)ir)ir4)iKr)ir)irrrrrr_seg_80 srNN)Ztypingrrr __version__intstrrrrPr\rirorrrrrrrrrrrrrrrrrrrrrr0rCrwr~rrrrrrrrr rrr@rUr[rrrrrrrr$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r5r6r7r8r<r=r>rFrGrHrKrLrMrNtuple uts46datarrrrs,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,c      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPPKd]QbDD/idna/__pycache__/uts46data.cpython-38.opt-1.pycnu[U .e@sbdZdZddZddZddZdd Zd d Zd d ZddZddZ ddZ ddZ ddZ ddZ ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z d@dAZ!dBdCZ"dDdEZ#dFdGZ$dHdIZ%dJdKZ&dLdMZ'dNdOZ(dPdQZ)dRdSZ*dTdUZ+dVdWZ,dXdYZ-dZd[Z.d\d]Z/d^d_Z0d`daZ1dbdcZ2dddeZ3dfdgZ4dhdiZ5djdkZ6dldmZ7dndoZ8dpdqZ9drdsZ:dtduZ;dvdwZd|d}Z?d~dZ@ddZAddZBddZCddZDddZEddZFddZGddZHddZIddZJddZKddZLddZMddZNddZOddZPeQeeeeeeee e e e e eeeeeeeeeeeeeeeeeee e!e"e#e$e%e&e'e(e)e*e+e,e-e.e/e0e1e2e3e4e5e6e7e8e9e:e;e<e=e>e?e@eAeBeCeDeEeFeGeHeIeJeKeLeMeNeOePZRdS)zIDNA Mapping Table from UTS46.z11.0.0cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)3)r)r)r)r)r)r)r)r) r) r) r) r) r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r) r)!r)"r)#r)$r)%r)&r)'r)(r))r)*r)+r),r)-V).r0)/r)0r0)1r0)2r0)3r0)4r0)5r0)6r0)7r0)8r0)9r0):r);r)<r)=r)>r)?r)@r)AMa)BrEb)CrEc)DrEd)ErEe)FrEf)GrEg)HrEh)IrEi)JrEj)KrEk)LrEl)MrEm)NrEn)OrEo)PrEp)QrEq)RrEr)SrEs)TrEt)UrEu)VrEv)WrEw)XrEx)YrEy)ZrEz)[r)\r)]r)^r)_r)`r)ar0)br0)cr0rrr>/usr/lib/python3.8/site-packages/pip/_vendor/idna/uts46data.py_seg_0srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)dr0)er0)fr0)gr0)hr0)ir0)jr0)kr0)lr0)mr0)nr0)or0)pr0)qr0)rr0)sr0)tr0)ur0)vr0)wr0)xr0)yr0)zr0){r)|r)}r)~r)r)X)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r)r )r0)r0)r0)r0)r0)r0)r0)ru ̈)r0)rErF)r0)r0)I)r0)r ̄)r0)r0)rE2)rEr)r ́)rEμ)r0)r0)ru ̧)rE1)rErb)r0)rEu1⁄4)rEu1⁄2)rEu3⁄4)r0)rEà)rEá)rEâ)rEã)rEä)rEå)rEæ)rEçrrrrr_seg_1psrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)rEè)rEé)rEê)rEë)rEì)rEí)rEî)rEï)rEð)rEñ)rEò)rEó)rEô)rEõ)rEö)r0)rEø)rEù)rEú)rEû)rEü)rEý)rEþ)Dss)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)r0)rEuā)ir0)irEuă)ir0)irEuą)ir0)irEuć)ir0)irEuĉ)i r0)i rEuċ)i r0)i rEuč)i r0)irEuď)ir0)irEuđ)ir0)irEuē)ir0)irEuĕ)ir0)irEuė)ir0)irEuę)ir0)irEuě)ir0)irEuĝ)ir0)irEuğ)ir0)i rEuġ)i!r0)i"rEuģ)i#r0)i$rEuĥ)i%r0)i&rEħ)i'r0)i(rEuĩ)i)r0)i*rEuī)i+r0rrrrr_seg_2srLcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i,rEuĭ)i-r0)i.rEuį)i/r0)i0rEui̇)i1r0)i2rEZij)i4rEuĵ)i5r0)i6rEuķ)i7r0)i9rEuĺ)i:r0)i;rEuļ)i<r0)i=rEuľ)i>r0)i?rEul·)iArEuł)iBr0)iCrEuń)iDr0)iErEuņ)iFr0)iGrEuň)iHr0)iIrEuʼn)iJrEŋ)iKr0)iLrEuō)iMr0)iNrEuŏ)iOr0)iPrEuő)iQr0)iRrEœ)iSr0)iTrEuŕ)iUr0)iVrEuŗ)iWr0)iXrEuř)iYr0)iZrEuś)i[r0)i\rEuŝ)i]r0)i^rEuş)i_r0)i`rEuš)iar0)ibrEuţ)icr0)idrEuť)ier0)ifrEuŧ)igr0)ihrEuũ)iir0)ijrEuū)ikr0)ilrEuŭ)imr0)inrEuů)ior0)iprEuű)iqr0)irrEuų)isr0)itrEuŵ)iur0)ivrEuŷ)iwr0)ixrEÿ)iyrEuź)izr0)i{rEuż)i|r0)i}rEuž)i~r0)irErj)ir0)irEuɓ)irEuƃ)ir0)irEuƅ)ir0)irEɔ)irEuƈ)ir0)irEuɖ)irEuɗ)irEuƌ)ir0)irEǝ)irEə)irEɛ)irEuƒ)ir0)irEuɠrrrrr_seg_3@srTcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEɣ)ir0)irEɩ)irEɨ)irEuƙ)ir0)irEɯ)irEɲ)ir0)irEɵ)irEuơ)ir0)irEuƣ)ir0)irEuƥ)ir0)irEuʀ)irEuƨ)ir0)irEʃ)ir0)irEuƭ)ir0)irEuʈ)irEuư)ir0)irEʊ)irEʋ)irEuƴ)ir0)irEuƶ)ir0)irEʒ)irEuƹ)ir0)irEuƽ)ir0)irEudž)irEZlj)irEZnj)irEuǎ)ir0)irEuǐ)ir0)irEuǒ)ir0)irEuǔ)ir0)irEuǖ)ir0)irEuǘ)ir0)irEuǚ)ir0)irEuǜ)ir0)irEuǟ)ir0)irEuǡ)ir0)irEuǣ)ir0)irEuǥ)ir0)irEuǧ)ir0)irEuǩ)ir0)irEuǫ)ir0)irEuǭ)ir0)irEuǯ)ir0)irEZdz)irEuǵ)ir0)irEuƕ)irEuƿ)irEuǹ)ir0)irEuǻ)ir0)irEuǽ)ir0)irEuǿ)ir0)irEuȁ)ir0)irEuȃ)ir0)irEuȅ)ir0)irEuȇ)ir0)irEuȉ)i r0)i rEuȋ)i r0)i rEuȍrrrrr_seg_4sr_cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i r0)irEuȏ)ir0)irEuȑ)ir0)irEuȓ)ir0)irEuȕ)ir0)irEuȗ)ir0)irEuș)ir0)irEuț)ir0)irEuȝ)ir0)irEuȟ)ir0)i rEuƞ)i!r0)i"rEȣ)i#r0)i$rEuȥ)i%r0)i&rEuȧ)i'r0)i(rEuȩ)i)r0)i*rEuȫ)i+r0)i,rEuȭ)i-r0)i.rEuȯ)i/r0)i0rEuȱ)i1r0)i2rEuȳ)i3r0)i:rEuⱥ)i;rEuȼ)i<r0)i=rEuƚ)i>rEuⱦ)i?r0)iArEuɂ)iBr0)iCrEuƀ)iDrEʉ)iErEʌ)iFrEuɇ)iGr0)iHrEuɉ)iIr0)iJrEuɋ)iKr0)iLrEuɍ)iMr0)iNrEuɏ)iOr0)irErT)irEɦ)irErX)irErh)irEuɹ)irEuɻ)irEuʁ)irErr)irErv)ir0)iru ̆)iru ̇)iru ̊)iru ̨)iru ̃)iru ̋)ir0)irErU)irEr\)irErj)irErt)irEuʕ)ir0)i@rEù)iArEú)iBr0)iCrEu̓)iDrEǘ)iErEι)iFr0)iOr)iPr0)iprEuͱ)iqr0)irrEuͳ)isr0)itrEuʹ)iur0)ivrEuͷ)iwr0rrrrr_seg_5srecdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ixr)izru ι)i{r0)i~r;)irEuϳ)ir)irr)ir ̈́)irEά)irE·)irEέ)irEή)irEί)ir)irEό)ir)irEύ)irEώ)ir0)irEα)irEβ)irEγ)irEδ)irEε)irEζ)irEη)irEθ)irErd)irEκ)irEλ)irEr)irEν)irEξ)irEο)irEπ)irEρ)ir)irEσ)irEτ)irEυ)irEφ)irEχ)irEψ)irEω)irEuϊ)irEϋ)ir0)ir(r)ir0)irEuϗ)irErq)irErw)irEr)irErn)irEr)irEr)irEr})ir0)irEuϙ)ir0)irEuϛ)ir0)irEϝ)ir0)irEuϟ)ir0)irEuϡ)ir0)irEuϣ)ir0)irEuϥ)ir0)irEuϧ)ir0)irEuϩ)ir0)irEuϫ)ir0)irEuϭ)ir0)irEuϯ)ir0)irErx)irEr~)irEr)ir0)irErw)irErt)ir0)irEuϸ)ir0)irEr)irEuϻ)ir0)irEuͻ)irEuͼ)irEuͽ)irEuѐ)irEuё)irEuђrrrrr_seg_6xsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEuѓ)irEuє)irEuѕ)irEuі)irEuї)irEuј)i rEuљ)i rEuњ)i rEuћ)i rEuќ)i rEuѝ)irEuў)irEuџ)irEuа)irEuб)irEв)irEuг)irEд)irEuе)irEuж)irEuз)irEuи)irEuй)irEuк)irEuл)irEuм)irEн)irEо)irEuп)i rEuр)i!rEс)i"rEт)i#rEuу)i$rEuф)i%rEuх)i&rEuц)i'rEuч)i(rEuш)i)rEuщ)i*rEъ)i+rEuы)i,rEь)i-rEuэ)i.rEuю)i/rEuя)i0r0)i`rEuѡ)iar0)ibrEѣ)icr0)idrEuѥ)ier0)ifrEuѧ)igr0)ihrEuѩ)iir0)ijrEuѫ)ikr0)ilrEuѭ)imr0)inrEuѯ)ior0)iprEuѱ)iqr0)irrEuѳ)isr0)itrEuѵ)iur0)ivrEuѷ)iwr0)ixrEuѹ)iyr0)izrEuѻ)i{r0)i|rEuѽ)i}r0)i~rEuѿ)ir0)irEuҁ)ir0)irEuҋ)ir0)irEuҍ)ir0)irEuҏ)ir0)irEuґ)ir0)irEuғ)ir0)irEuҕ)ir0)irEuҗ)ir0)irEuҙ)ir0)irEuқ)ir0)irEuҝ)ir0rrrrr_seg_7srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEuҟ)ir0)irEuҡ)ir0)irEuң)ir0)irEuҥ)ir0)irEuҧ)ir0)irEuҩ)ir0)irEuҫ)ir0)irEuҭ)ir0)irEuү)ir0)irEuұ)ir0)irEuҳ)ir0)irEuҵ)ir0)irEuҷ)ir0)irEuҹ)ir0)irEuһ)ir0)irEuҽ)ir0)irEuҿ)ir0)ir)irEuӂ)ir0)irEuӄ)ir0)irEuӆ)ir0)irEuӈ)ir0)irEuӊ)ir0)irEuӌ)ir0)irEuӎ)ir0)irEuӑ)ir0)irEuӓ)ir0)irEuӕ)ir0)irEuӗ)ir0)irEuә)ir0)irEuӛ)ir0)irEuӝ)ir0)irEuӟ)ir0)irEuӡ)ir0)irEuӣ)ir0)irEuӥ)ir0)irEuӧ)ir0)irEuө)ir0)irEuӫ)ir0)irEuӭ)ir0)irEuӯ)ir0)irEuӱ)ir0)irEuӳ)ir0)irEuӵ)ir0)irEuӷ)ir0)irEuӹ)ir0)irEuӻ)ir0)irEuӽ)ir0)irEuӿ)ir0)irEuԁ)ir0)irEuԃrrrrr_seg_8HsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir0)irEuԅ)ir0)irEuԇ)ir0)irEuԉ)i r0)i rEuԋ)i r0)i rEuԍ)i r0)irEuԏ)ir0)irEuԑ)ir0)irEuԓ)ir0)irEuԕ)ir0)irEuԗ)ir0)irEuԙ)ir0)irEuԛ)ir0)irEuԝ)ir0)irEuԟ)ir0)i rEuԡ)i!r0)i"rEuԣ)i#r0)i$rEuԥ)i%r0)i&rEuԧ)i'r0)i(rEuԩ)i)r0)i*rEuԫ)i+r0)i,rEuԭ)i-r0)i.rEuԯ)i/r0)i0r)i1rEuա)i2rEuբ)i3rEuգ)i4rEuդ)i5rEuե)i6rEuզ)i7rEuէ)i8rEuը)i9rEuթ)i:rEuժ)i;rEuի)i<rEuլ)i=rEuխ)i>rEuծ)i?rEuկ)i@rEuհ)iArEuձ)iBrEuղ)iCrEuճ)iDrEuմ)iErEuյ)iFrEuն)iGrEuշ)iHrEuո)iIrEuչ)iJrEuպ)iKrEuջ)iLrEuռ)iMrEuս)iNrEuվ)iOrEuտ)iPrEuր)iQrEuց)iRrEuւ)iSrEuփ)iTrEuք)iUrEuօ)iVrEuֆ)iWr)iYr0)irEuեւ)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0rrrrr_seg_9srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iurEuاٴ)ivrEuوٴ)iwrEۇٴ)ixrEuيٴ)iyr0)ir)ir0)ir)ir0)iKr)iMr0)ir)ir0)ir)ir0)i.r)i0r0)i?r)i@r0)i\r)i^r0)i_r)i`r0)ikr)ir0)ir)ir0)ir)ir0)ir)ir0)iX rEuक़)iY rEuख़)iZ rEuग़)i[ rEuज़)i\ rEuड़)i] rEuढ़)i^ rEuफ़)i_ rEuय़)i` r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i rEuড়)i rEuঢ়)i r)i rEuয়)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i) r)i* r0)i1 r)i2 r0)i3 rEuਲ਼)i4 r)i5 r0)i6 rEuਸ਼)i7 r)i8 r0)i: r)i< r0)i= r)i> r0)iC r)iG r0)iI r)iK r0)iN r)iQ r0)iR r)iY rEuਖ਼)iZ rEuਗ਼)i[ rEuਜ਼rrrrr_seg_10srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i\ r0)i] r)i^ rEuਫ਼)i_ r)if r0)iw r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i) r)i* r0)i1 r)i2 r0)i4 r)i5 r0)i: r)i< r0)iE r)iG r0)iI r)iK r0)iN r)iV r0)iX r)i\ rEuଡ଼)i] rEuଢ଼)i^ r)i_ r0)id r)if r0)ix r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0rrrrr_seg_11srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i) r)i* r0)i: r)i= r0)iE r)iF r0)iI r)iJ r0)iN r)iU r0)iW r)iX r0)i[ r)i` r0)id r)if r0)ip r)ix r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)iE r)iF r0)iI r)iJ r0)iP r)iT r0)id r)if r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)ir0)i3rEuํา)i4r0)i;r)i?r0)i\r)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0rrrrr_seg_12srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)irEuໍາ)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)irEuຫນ)irEuຫມ)ir0)ir)ir0)i rEu་)i r0)iCrEuགྷ)iDr0)iHr)iIr0)iMrEuཌྷ)iNr0)iRrEuདྷ)iSr0)iWrEuབྷ)iXr0)i\rEuཛྷ)i]r0)iirEuཀྵ)ijr0)imr)iqr0)isrEuཱི)itr0)iurEuཱུ)ivrEuྲྀ)iwrEu ྲཱྀ)ixrEuླྀ)iyrEu ླཱྀ)izr0)irEuཱྀ)ir0)irEuྒྷ)ir0)ir)ir0)irEuྜྷ)ir0)irEuྡྷ)ir0)irEuྦྷ)ir0)irEuྫྷ)ir0)irEuྐྵ)ir0)ir)ir0)ir)ir0)ir)ir0)ir)irEuⴧ)ir)irEuⴭ)ir)ir0)irEuნ)ir0)i_r)iar0)iIr)iJr0)iNr)iPr0)iWr)iXr0)iYr)iZr0)i^r)i`r0)ir)ir0rrrrr_seg_13PsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i[r)i]r0)i}r)ir0)ir)ir0)ir)irEuᏰ)irEuᏱ)irEuᏲ)irEuᏳ)irEuᏴ)irEuᏵ)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i r)ir0)ir)i r0)i7r)i@r0)iTr)i`r0)imr)inr0)iqr)irr0)itr)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i r)ir)ir0)ir)i r0)iyr)ir0)ir)ir0)ir)ir0)ir)i r0)i,r)i0r0)i<r)i@r0)iAr)iDr0)inr)ipr0)iur)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i_r)i`r0)i}r)ir0)ir)ir0rrrrr_seg_14srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir)ir0)ir)ir0)ir)ir0)iLr)iPr0)i}r)ir0)ir)ir0)i8r)i;r0)iJr)iMr0)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEꙋ)ir)ir0)ir)ir0)ir)ir0)i,rErF)i-rEr)i.rErH)i/r0)i0rErL)i1rErN)i2rErQ)i3rErR)i4rErT)i5rErV)i6rErX)i7rErZ)i8rEr\)i9rEr^)i:rEr`)i;r0)i<rErb)i=rEr`)i>rErd)i?rErh)i@rErl)iArErn)iBrErr)iCrErF)iDrEɐ)iErEɑ)iFrEuᴂ)iGrErH)iHrErL)iIrErN)iJrErR)iKrErS)iLrEɜ)iMrErR)iNr0)iOrErZ)iPrEr^)iQrErM)iRrErb)iSrErP)iTrEuᴖ)iUrEuᴗ)iVrErd)iWrErl)iXrErn)iYrEuᴝ)iZrErX)i[rErp)i\rEuᴥ)i]rErq)i^rErr)i_rErs)i`rEr)iarEr)ibrErV)icrErh)idrErn)ierErp)ifrErq)igrErr)ihrEr~)iirEr)ijrEr)ikr0)ixrEr)iyr0)irEɒ)irErJ)irEuɕ)irEr rrrrr_seg_15 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEr)irErP)irEuɟ)irEɡ)irEɥ)irErW)irErV)irEɪ)irEuᵻ)irEʝ)irEuɭ)irEuᶅ)irEuʟ)irEɱ)irEuɰ)irErY)irEuɳ)irEuɴ)irErZ)irEuɸ)irEuʂ)irEr[)irEuƫ)irEra)irEr\)irEuᴜ)irEr])irErb)irErx)irEuʐ)irEuʑ)irEr^)irErw)ir0)ir)ir0)irEuḁ)ir0)irEuḃ)ir0)irEuḅ)ir0)irEuḇ)ir0)irEuḉ)i r0)i rEuḋ)i r0)i rEuḍ)i r0)irEuḏ)ir0)irEuḑ)ir0)irEuḓ)ir0)irEuḕ)ir0)irEuḗ)ir0)irEuḙ)ir0)irEuḛ)ir0)irEuḝ)ir0)irEuḟ)ir0)i rEuḡ)i!r0)i"rEuḣ)i#r0)i$rEuḥ)i%r0)i&rEuḧ)i'r0)i(rEuḩ)i)r0)i*rEuḫ)i+r0)i,rEuḭ)i-r0)i.rEuḯ)i/r0)i0rEuḱ)i1r0)i2rEuḳ)i3r0)i4rEuḵ)i5r0)i6rEuḷ)i7r0)i8rEuḹ)i9r0)i:rEuḻ)i;r0)i<rEuḽ)i=r0)i>rEuḿ)i?r0rrrrr_seg_16srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i@rEuṁ)iAr0)iBrEuṃ)iCr0)iDrEuṅ)iEr0)iFrEuṇ)iGr0)iHrEuṉ)iIr0)iJrEuṋ)iKr0)iLrEuṍ)iMr0)iNrEuṏ)iOr0)iPrEuṑ)iQr0)iRrEuṓ)iSr0)iTrEuṕ)iUr0)iVrEuṗ)iWr0)iXrEuṙ)iYr0)iZrEuṛ)i[r0)i\rEuṝ)i]r0)i^rEuṟ)i_r0)i`rEṡ)iar0)ibrEuṣ)icr0)idrEuṥ)ier0)ifrEuṧ)igr0)ihrEuṩ)iir0)ijrEuṫ)ikr0)ilrEuṭ)imr0)inrEuṯ)ior0)iprEuṱ)iqr0)irrEuṳ)isr0)itrEuṵ)iur0)ivrEuṷ)iwr0)ixrEuṹ)iyr0)izrEuṻ)i{r0)i|rEuṽ)i}r0)i~rEuṿ)ir0)irEuẁ)ir0)irEuẃ)ir0)irEuẅ)ir0)irEuẇ)ir0)irEuẉ)ir0)irEuẋ)ir0)irEuẍ)ir0)irEuẏ)ir0)irEuẑ)ir0)irEuẓ)ir0)irEuẕ)ir0)irEuaʾ)irEr)ir0)irEr))ir0)irEuạ)ir0)irEuả)ir0)irEuấ)ir0)irEuầ)ir0)irEuẩrrrrr_seg_17srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir0)irEuẫ)ir0)irEuậ)ir0)irEuắ)ir0)irEuằ)ir0)irEuẳ)ir0)irEuẵ)ir0)irEuặ)ir0)irEuẹ)ir0)irEuẻ)ir0)irEuẽ)ir0)irEuế)ir0)irEuề)ir0)irEuể)ir0)irEuễ)ir0)irEuệ)ir0)irEuỉ)ir0)irEuị)ir0)irEuọ)ir0)irEuỏ)ir0)irEuố)ir0)irEuồ)ir0)irEuổ)ir0)irEuỗ)ir0)irEuộ)ir0)irEuớ)ir0)irEuờ)ir0)irEuở)ir0)irEuỡ)ir0)irEuợ)ir0)irEuụ)ir0)irEuủ)ir0)irEuứ)ir0)irEuừ)ir0)irEuử)ir0)irEuữ)ir0)irEuự)ir0)irEuỳ)ir0)irEuỵ)ir0)irEuỷ)ir0)irEuỹ)ir0)irEuỻ)ir0)irEuỽ)ir0)irEuỿ)ir0)irEuἀ)i rEuἁ)i rEuἂ)i rEuἃ)i rEuἄ)i rEuἅ)irEuἆ)irEuἇ)ir0)ir)irEuἐ)irEuἑ)irEuἒrrrrr_seg_18XsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEuἓ)irEuἔ)irEuἕ)ir)i r0)i(rEuἠ)i)rEuἡ)i*rEuἢ)i+rEuἣ)i,rEuἤ)i-rEuἥ)i.rEuἦ)i/rEuἧ)i0r0)i8rEuἰ)i9rEuἱ)i:rEuἲ)i;rEuἳ)i<rEuἴ)i=rEuἵ)i>rEuἶ)i?rEuἷ)i@r0)iFr)iHrEuὀ)iIrEuὁ)iJrEuὂ)iKrEuὃ)iLrEuὄ)iMrEuὅ)iNr)iPr0)iXr)iYrEuὑ)iZr)i[rEuὓ)i\r)i]rEuὕ)i^r)i_rEuὗ)i`r0)ihrEuὠ)iirEuὡ)ijrEuὢ)ikrEuὣ)ilrEuὤ)imrEuὥ)inrEuὦ)iorEuὧ)ipr0)iqrErh)irr0)isrErj)itr0)iurErk)ivr0)iwrErl)ixr0)iyrErm)izr0)i{rErn)i|r0)i}rEro)i~r)irEἀι)irEἁι)irEἂι)irEἃι)irEἄι)irEἅι)irEἆι)irEἇι)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEἠι)irEἡι)irEἢι)irEἣι)irEἤι)irEἥι)irEἦι)irEἧι)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEὠι)irEὡι)irEὢι)irEὣιrrrrr_seg_19srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEὤι)irEὥι)irEὦι)irEὧι)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)ir0)irEuὰι)irEαι)irEuάι)ir)ir0)irEuᾶι)irEuᾰ)irEuᾱ)irEuὰ)irErh)irEr)ir ̓)irErd)irr)iru ͂)iru ̈͂)irEuὴι)irEηι)irEuήι)ir)ir0)irEuῆι)irEuὲ)irErj)irEuὴ)irErk)irEr)iru ̓̀)iru ̓́)iru ̓͂)ir0)irEuΐ)ir)ir0)irEuῐ)irEuῑ)irEuὶ)irErl)ir)iru ̔̀)iru ̔́)iru ̔͂)ir0)irEuΰ)ir0)irEuῠ)irEuῡ)irEuὺ)irErn)irEuῥ)iru ̈̀)irrg)ir`)ir)irEuὼι)irEωι)irEuώι)ir)ir0)irEuῶι)irEuὸ)irErm)irEuὼ)irEro)irEr)irr)iru ̔)ir)i rr)i r)i r()i r)i r0)i rEu‐)i r0)i ru ̳)i r0)i$ r)i' r0)i( r)i/ rr)i0 r0)i3 rEu′′)i4 rEu ′′′)i5 r0)i6 rEu‵‵)i7 rEu ‵‵‵rrrrr_seg_20(srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i8 r0)i< rz!!)i= r0)i> r ̅)i? r0)iG rz??)iH rz?!)iI rz!?)iJ r0)iW rEu ′′′′)iX r0)i_ rr)i` r)ia r)id r)ie r)ip rE0)iq rErV)ir r)it rE4)iu rE5)iv rE6)iw rE7)ix rE8)iy rE9)iz r+)i{ rE−)i| r=)i} r()i~ r))i rEr`)i rEr)i rEr)i rEr)i rEr)i rEr)i rEr)i rEr)i rEr)i rEr)i rEr)i rr)i rEr)i rr)i rr)i rr)i r)i rErF)i rErN)i rErb)i rErt)i rErR)i rErT)i rErZ)i rEr\)i rEr^)i rEr`)i rErd)i rErj)i rErl)i r)i r0)i rEZrs)i r0)i r)i r0)i r)i!rza/c)i!rza/s)i!rErJ)i!rEu°c)i!r0)i!rzc/o)i!rzc/u)i!rErS)i!r0)i !rEu°f)i !rErR)i !rErT)i!rErK)i!rErV)i!rEr\)i!r0)i!rEr`)i!rEZno)i!r0)i!rErd)i!rErf)i!rErh)i!r0)i !rEZsm)i!!rEZtel)i"!rEZtm)i#!r0)i$!rErx)i%!r0)i&!rEr)i'!r0)i(!rErx)i)!r0rrrrr_seg_21srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i*!rErZ)i+!rEr)i,!rErH)i-!rErJ)i.!r0)i/!rErN)i1!rErP)i2!r)i3!rEr^)i4!rErb)i5!rEא)i6!rEuב)i7!rEuג)i8!rEד)i9!rErV)i:!r0)i;!rEZfax)id?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ib$rEr)ic$rEr)id$rEr)ie$rEr)if$rEr)ig$rEr)ih$rEr)ii$rEZ10)ij$rEZ11)ik$rEZ12)il$rEZ13)im$rEZ14)in$rEZ15)io$rEZ16)ip$rEZ17)iq$rEZ18)ir$rEZ19)is$rEZ20)it$rz(1))iu$rz(2))iv$rz(3))iw$rz(4))ix$rz(5))iy$rz(6))iz$rz(7))i{$rz(8))i|$rz(9))i}$rz(10))i~$rz(11))i$rz(12))i$rz(13))i$rz(14))i$rz(15))i$rz(16))i$rz(17))i$rz(18))i$rz(19))i$rz(20))i$r)i$r(a))i$r(b))i$r(c))i$r(d))i$r(e))i$r(f))i$r(g))i$r(h))i$r(i))i$r(j))i$r(k))i$r(l))i$r(m))i$r(n))i$r(o))i$r(p))i$r(q))i$r(r))i$r(s))i$r(t))i$r(u))i$r(v))i$r(w))i$r(x))i$r(y))i$r(z))i$rErF)i$rErH)i$rErJ)i$rErL)i$rErN)i$rErP)i$rErR)i$rErT)i$rErV)i$rErX)i$rErZ)i$rEr\)i$rEr^)i$rEr`)i$rErb)i$rErd)i$rErf)i$rErh)i$rErj)i$rErl)i$rErn)i$rErp)i$rErr)i$rErt)i$rErv)i$rErx)i$rErF)i$rErH)i$rErJ)i$rErL)i$rErN)i$rErP)i$rErR)i$rErT)i$rErVrrrrr_seg_23` srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i$rErX)i$rErZ)i$rEr\)i$rEr^)i$rEr`)i$rErb)i$rErd)i$rErf)i$rErh)i$rErj)i$rErl)i$rErn)i$rErp)i$rErr)i$rErt)i$rErv)i$rErx)i$rEr)i$r0)i *rEu ∫∫∫∫)i *r0)it*rz::=)iu*rz==)iv*rz===)iw*r0)i*rEu⫝̸)i*r0)it+r)iv+r0)i+r)i+r0)i+r)i+r0)i+r)i,rEuⰰ)i,rEuⰱ)i,rEuⰲ)i,rEuⰳ)i,rEuⰴ)i,rEuⰵ)i,rEuⰶ)i,rEuⰷ)i,rEuⰸ)i ,rEuⰹ)i ,rEuⰺ)i ,rEuⰻ)i ,rEuⰼ)i ,rEuⰽ)i,rEuⰾ)i,rEuⰿ)i,rEuⱀ)i,rEuⱁ)i,rEuⱂ)i,rEuⱃ)i,rEuⱄ)i,rEuⱅ)i,rEuⱆ)i,rEuⱇ)i,rEuⱈ)i,rEuⱉ)i,rEuⱊ)i,rEuⱋ)i,rEuⱌ)i,rEuⱍ)i,rEuⱎ)i,rEuⱏ)i ,rEuⱐ)i!,rEuⱑ)i",rEuⱒ)i#,rEuⱓ)i$,rEuⱔ)i%,rEuⱕ)i&,rEuⱖ)i',rEuⱗ)i(,rEuⱘ)i),rEuⱙ)i*,rEuⱚ)i+,rEuⱛ)i,,rEuⱜ)i-,rEuⱝ)i.,rEuⱞ)i/,r)i0,r0)i_,r)i`,rEuⱡ)ia,r0)ib,rEɫ)ic,rEuᵽ)id,rEuɽ)ie,r0)ig,rEuⱨ)ih,r0)ii,rEuⱪ)ij,r0)ik,rEuⱬ)il,r0)im,rEr)in,rEr)io,rEr)ip,rErrrrrr_seg_24 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iq,r0)ir,rEuⱳ)is,r0)iu,rEuⱶ)iv,r0)i|,rErX)i},rErp)i~,rEuȿ)i,rEuɀ)i,rEuⲁ)i,r0)i,rEuⲃ)i,r0)i,rEuⲅ)i,r0)i,rEuⲇ)i,r0)i,rEuⲉ)i,r0)i,rEuⲋ)i,r0)i,rEuⲍ)i,r0)i,rEuⲏ)i,r0)i,rEuⲑ)i,r0)i,rEuⲓ)i,r0)i,rEuⲕ)i,r0)i,rEuⲗ)i,r0)i,rEuⲙ)i,r0)i,rEuⲛ)i,r0)i,rEuⲝ)i,r0)i,rEuⲟ)i,r0)i,rEuⲡ)i,r0)i,rEuⲣ)i,r0)i,rEuⲥ)i,r0)i,rEuⲧ)i,r0)i,rEuⲩ)i,r0)i,rEuⲫ)i,r0)i,rEuⲭ)i,r0)i,rEuⲯ)i,r0)i,rEuⲱ)i,r0)i,rEuⲳ)i,r0)i,rEuⲵ)i,r0)i,rEuⲷ)i,r0)i,rEuⲹ)i,r0)i,rEuⲻ)i,r0)i,rEuⲽ)i,r0)i,rEuⲿ)i,r0)i,rEuⳁ)i,r0)i,rEuⳃ)i,r0)i,rEuⳅ)i,r0)i,rEuⳇ)i,r0)i,rEuⳉ)i,r0)i,rEuⳋ)i,r0)i,rEuⳍ)i,r0)i,rEuⳏ)i,r0)i,rEuⳑ)i,r0)i,rEuⳓ)i,r0)i,rEuⳕ)i,r0)i,rEuⳗ)i,r0)i,rEuⳙ)i,r0)i,rEuⳛrrrrr_seg_250 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i,r0)i,rEuⳝ)i,r0)i,rEuⳟ)i,r0)i,rEuⳡ)i,r0)i,rEuⳣ)i,r0)i,rEuⳬ)i,r0)i,rEuⳮ)i,r0)i,rEuⳳ)i,r0)i,r)i,r0)i&-r)i'-r0)i(-r)i--r0)i.-r)i0-r0)ih-r)io-rEuⵡ)ip-r0)iq-r)i-r0)i-r)i-r0)i-r)i-r0)i-r)i-r0)i-r)i-r0)i-r)i-r0)i-r)i-r0)i-r)i-r0)i-r)i-r0)i-r)i-r0)iO.r)i.r0)i.r)i.r0)i.rEu母)i.r0)i.rEu龟)i.r)i/rE一)i/rEu丨)i/rEu丶)i/rEu丿)i/rE乙)i/rEu亅)i/rE二)i/rEu亠)i/rE人)i /rEu儿)i /rEu入)i /rE八)i /rEu冂)i /rEu冖)i/rEu冫)i/rEu几)i/rE凵)i/rEu刀)i/rE力)i/rEu勹)i/rEu匕)i/rEu匚)i/rEu匸)i/rE十)i/rEu卜)i/rEu卩)i/rEu厂)i/rEu厶)i/rEu又)i/rEu口)i/rEu囗)i/rE土)i /rEu士)i!/rEu夂)i"/rEu夊)i#/rEu夕)i$/rEu大)i%/rE女)i&/rEu子)i'/rEu宀)i(/rEu寸)i)/rEu小)i*/rE尢)i+/rEu尸)i,/rE屮)i-/rEu山rrrrr_seg_26 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i./rEu巛)i//rEu工)i0/rEu己)i1/rEu巾)i2/rEu干)i3/rEu幺)i4/rEu广)i5/rEu廴)i6/rE廾)i7/rEu弋)i8/rEu弓)i9/rEu彐)i:/rEu彡)i;/rEu彳)i/rEu戶)i?/rE手)i@/rEu支)iA/rEu攴)iB/rE文)iC/rEu斗)iD/rEu斤)iE/rEu方)iF/rEu无)iG/rE日)iH/rEu曰)iI/rE月)iJ/rE木)iK/rEu欠)iL/rEu止)iM/rE歹)iN/rEu殳)iO/rEu毋)iP/rEu比)iQ/rEu毛)iR/rEu氏)iS/rEu气)iT/rE水)iU/rE火)iV/rEu爪)iW/rEu父)iX/rEu爻)iY/rEu爿)iZ/rEu片)i[/rEu牙)i\/rEu牛)i]/rEu犬)i^/rEu玄)i_/rEu玉)i`/rEu瓜)ia/rEu瓦)ib/rEu甘)ic/rE生)id/rEu用)ie/rEu田)if/rEu疋)ig/rEu疒)ih/rEu癶)ii/rEu白)ij/rEu皮)ik/rEu皿)il/rEu目)im/rEu矛)in/rEu矢)io/rEu石)ip/rEu示)iq/rEu禸)ir/rEu禾)is/rEu穴)it/rE立)iu/rEu竹)iv/rEu米)iw/rEu糸)ix/rEu缶)iy/rEu网)iz/rEu羊)i{/rE羽)i|/rE老)i}/rEu而)i~/rEu耒)i/rEu耳)i/rEu聿)i/rEu肉)i/rEu臣)i/rEu自)i/rEu至)i/rEu臼)i/rEu舌)i/rEu舛)i/rEu舟)i/rEu艮)i/rEu色)i/rEu艸)i/rEu虍)i/rEu虫)i/rEu血)i/rE行)i/rE衣)i/rEu襾rrrrr_seg_27 sr cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i/rE見)i/rEu角)i/rEu言)i/rEu谷)i/rEu豆)i/rE豕)i/rEu豸)i/rEu貝)i/rEu赤)i/rE走)i/rEu足)i/rEu身)i/rE車)i/rEu辛)i/rE辰)i/rEu辵)i/rEu邑)i/rEu酉)i/rEu釆)i/rE里)i/rE金)i/rEu長)i/rEu門)i/rEu阜)i/rEu隶)i/rEu隹)i/rEu雨)i/rEu靑)i/rEu非)i/rEu面)i/rEu革)i/rEu韋)i/rEu韭)i/rEu音)i/rEu頁)i/rEu風)i/rEu飛)i/rEu食)i/rEu首)i/rEu香)i/rEu馬)i/rEu骨)i/rEu高)i/rEu髟)i/rEu鬥)i/rEu鬯)i/rEu鬲)i/rEu鬼)i/rEu魚)i/rEu鳥)i/rEu鹵)i/rE鹿)i/rEu麥)i/rE麻)i/rEu黃)i/rEu黍)i/rEu黑)i/rE黹)i/rEu黽)i/rEu鼎)i/rEu鼓)i/rEu鼠)i/rE鼻)i/rEu齊)i/rEu齒)i/rE龍)i/rE龜)i/rEu龠)i/r)i0rr)i0r0)i0rE.)i0r0)i60rEu〒)i70r0)i80rEr )i90rEu卄)i:0rEu卅)i;0r0)i@0r)iA0r0)i0r)i0r0)i0ru ゙)i0ru ゚)i0r0)i0rEuより)i0r0)i0rEuコト)i1r)i1r0)i01r)i11rEᄀ)i21rEᄁ)i31rEᆪ)i41rEᄂ)i51rEᆬ)i61rEᆭ)i71rEᄃ)i81rEᄄrrrrr_seg_28h sr7cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i91rEᄅ)i:1rEᆰ)i;1rEᆱ)i<1rEᆲ)i=1rEᆳ)i>1rEᆴ)i?1rEᆵ)i@1rEᄚ)iA1rEᄆ)iB1rEᄇ)iC1rEᄈ)iD1rEᄡ)iE1rEᄉ)iF1rEᄊ)iG1rEᄋ)iH1rEᄌ)iI1rEᄍ)iJ1rEᄎ)iK1rEᄏ)iL1rEᄐ)iM1rEᄑ)iN1rEᄒ)iO1rEᅡ)iP1rEᅢ)iQ1rEᅣ)iR1rEᅤ)iS1rEᅥ)iT1rEᅦ)iU1rEᅧ)iV1rEᅨ)iW1rEᅩ)iX1rEᅪ)iY1rEᅫ)iZ1rEᅬ)i[1rEᅭ)i\1rEᅮ)i]1rEᅯ)i^1rEᅰ)i_1rEᅱ)i`1rEᅲ)ia1rEᅳ)ib1rEᅴ)ic1rEᅵ)id1r)ie1rEuᄔ)if1rEuᄕ)ig1rEuᇇ)ih1rEuᇈ)ii1rEuᇌ)ij1rEuᇎ)ik1rEuᇓ)il1rEuᇗ)im1rEuᇙ)in1rEuᄜ)io1rEuᇝ)ip1rEuᇟ)iq1rEuᄝ)ir1rEuᄞ)is1rEuᄠ)it1rEuᄢ)iu1rEuᄣ)iv1rEuᄧ)iw1rEuᄩ)ix1rEuᄫ)iy1rEuᄬ)iz1rEuᄭ)i{1rEuᄮ)i|1rEuᄯ)i}1rEuᄲ)i~1rEuᄶ)i1rEuᅀ)i1rEuᅇ)i1rEuᅌ)i1rEuᇱ)i1rEuᇲ)i1rEuᅗ)i1rEuᅘ)i1rEuᅙ)i1rEuᆄ)i1rEuᆅ)i1rEuᆈ)i1rEuᆑ)i1rEuᆒ)i1rEuᆔ)i1rEuᆞ)i1rEuᆡ)i1r)i1r0)i1rEr)i1rEr)i1rE三)i1rE四)i1rE上)i1rE中)i1rE下)i1rEu甲)i1rEr)i1rEu丙)i1rEu丁)i1rE天rrrrr_seg_29 sricdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i1rEu地)i1rEr)i1r0)i1r)i1r0)i1r)i1r0)i2ru(ᄀ))i2ru(ᄂ))i2ru(ᄃ))i2ru(ᄅ))i2ru(ᄆ))i2ru(ᄇ))i2ru(ᄉ))i2ru(ᄋ))i2ru(ᄌ))i 2ru(ᄎ))i 2ru(ᄏ))i 2ru(ᄐ))i 2ru(ᄑ))i 2ru(ᄒ))i2ru(가))i2ru(나))i2ru(다))i2ru(라))i2ru(마))i2ru(바))i2ru(사))i2ru(아))i2ru(자))i2ru(차))i2ru(카))i2ru(타))i2ru(파))i2ru(하))i2ru(주))i2ru(오전))i2ru(오후))i2r)i 2ru(一))i!2ru(二))i"2ru(三))i#2ru(四))i$2ru(五))i%2ru(六))i&2ru(七))i'2ru(八))i(2ru(九))i)2ru(十))i*2ru(月))i+2ru(火))i,2ru(水))i-2ru(木))i.2ru(金))i/2ru(土))i02ru(日))i12ru(株))i22ru(有))i32ru(社))i42ru(名))i52ru(特))i62ru(財))i72ru(祝))i82ru(労))i92ru(代))i:2ru(呼))i;2ru(学))i<2ru(監))i=2ru(企))i>2ru(資))i?2ru(協))i@2ru(祭))iA2ru(休))iB2ru(自))iC2ru(至))iD2rEu問)iE2rEu幼)iF2rEr)iG2rEu箏)iH2r0)iP2rEZpte)iQ2rEZ21)iR2rEZ22)iS2rEZ23)iT2rEZ24)iU2rEZ25)iV2rEZ26)iW2rEZ27)iX2rEZ28)iY2rEZ29)iZ2rEZ30)i[2rEZ31)i\2rEZ32)i]2rEZ33)i^2rEZ34)i_2rEZ35)i`2rEr/)ia2rEr2)ib2rEr5)ic2rEr8rrrrr_seg_308 srjcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)id2rEr@)ie2rErA)if2rErD)ig2rErF)ih2rErG)ii2rErI)ij2rErJ)ik2rErK)il2rErL)im2rErM)in2rEu가)io2rEu나)ip2rEu다)iq2rEu라)ir2rEu마)is2rEu바)it2rEu사)iu2rEu아)iv2rEu자)iw2rEu차)ix2rEu카)iy2rEu타)iz2rEu파)i{2rEu하)i|2rEu참고)i}2rEu주의)i~2rEu우)i2r0)i2rEr)i2rEr)i2rErc)i2rErd)i2rEu五)i2rE六)i2rEu七)i2rEr)i2rEu九)i2rEr )i2rEr)i2rEr)i2rEr)i2rEr)i2rEr')i2rEr )i2rEr)i2rEu株)i2rE有)i2rE社)i2rEu名)i2rEu特)i2rEu財)i2rE祝)i2rEu労)i2rEu秘)i2rEu男)i2rEr )i2rEu適)i2rEu優)i2rEu印)i2rEu注)i2rEu項)i2rEu休)i2rEu写)i2rEu正)i2rEre)i2rErf)i2rErg)i2rE左)i2rE右)i2rEu医)i2rEu宗)i2rEu学)i2rEu監)i2rEu企)i2rEu資)i2rEu協)i2rEu夜)i2rEZ36)i2rEZ37)i2rEZ38)i2rEZ39)i2rEZ40)i2rEZ41)i2rEZ42)i2rEZ43)i2rEZ44)i2rEZ45)i2rEZ46)i2rEZ47)i2rEZ48)i2rEZ49)i2rEZ50)i2rEu1月)i2rEu2月)i2rEu3月)i2rEu4月)i2rEu5月)i2rEu6月)i2rEu7月)i2rEu8月rrrrr_seg_31 srqcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i2rEu9月)i2rEu10月)i2rEu11月)i2rEu12月)i2rEZhg)i2rEZerg)i2rEZev)i2rEZltd)i2rEア)i2rEイ)i2rEウ)i2rEエ)i2rEオ)i2rEカ)i2rEキ)i2rEク)i2rEケ)i2rEコ)i2rEサ)i2rEシ)i2rEス)i2rEセ)i2rEソ)i2rEタ)i2rEチ)i2rEツ)i2rEテ)i2rEト)i2rEナ)i2rEニ)i2rEヌ)i2rEネ)i2rEノ)i2rEハ)i2rEヒ)i2rEフ)i2rEヘ)i2rEホ)i2rEマ)i2rEミ)i2rEム)i2rEメ)i2rEモ)i2rEヤ)i2rEユ)i2rEヨ)i2rEラ)i2rEリ)i2rEル)i2rEレ)i2rEロ)i2rEワ)i2rEuヰ)i2rEuヱ)i2rEヲ)i2r)i3rEu アパート)i3rEu アルファ)i3rEu アンペア)i3rEu アール)i3rEu イニング)i3rEu インチ)i3rEu ウォン)i3rEuエスクード)i3rEu エーカー)i 3rEu オンス)i 3rEu オーム)i 3rEu カイリ)i 3rEu カラット)i 3rEu カロリー)i3rEu ガロン)i3rEu ガンマ)i3rEuギガ)i3rEu ギニー)i3rEu キュリー)i3rEu ギルダー)i3rEuキロ)i3rEuキログラム)i3rEuキロメートル)i3rEuキロワット)i3rEu グラム)i3rEuグラムトン)i3rEuクルゼイロ)i3rEu クローネ)i3rEu ケース)i3rEu コルナ)i3rEu コーポ)i3rEu サイクル)i 3rEuサンチーム)i!3rEu シリング)i"3rEu センチ)i#3rEu セント)i$3rEu ダース)i%3rEuデシ)i&3rEuドル)i'3rEuトン)i(3rEuナノ)i)3rEu ノット)i*3rEu ハイツ)i+3rEuパーセントrrrrr_seg_32 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i,3rEu パーツ)i-3rEu バーレル)i.3rEuピアストル)i/3rEu ピクル)i03rEuピコ)i13rEuビル)i23rEuファラッド)i33rEu フィート)i43rEuブッシェル)i53rEu フラン)i63rEuヘクタール)i73rEuペソ)i83rEu ペニヒ)i93rEu ヘルツ)i:3rEu ペンス)i;3rEu ページ)i<3rEu ベータ)i=3rEu ポイント)i>3rEu ボルト)i?3rEuホン)i@3rEu ポンド)iA3rEu ホール)iB3rEu ホーン)iC3rEu マイクロ)iD3rEu マイル)iE3rEu マッハ)iF3rEu マルク)iG3rEuマンション)iH3rEu ミクロン)iI3rEuミリ)iJ3rEuミリバール)iK3rEuメガ)iL3rEu メガトン)iM3rEu メートル)iN3rEu ヤード)iO3rEu ヤール)iP3rEu ユアン)iQ3rEu リットル)iR3rEuリラ)iS3rEu ルピー)iT3rEu ルーブル)iU3rEuレム)iV3rEuレントゲン)iW3rEu ワット)iX3rEu0点)iY3rEu1点)iZ3rEu2点)i[3rEu3点)i\3rEu4点)i]3rEu5点)i^3rEu6点)i_3rEu7点)i`3rEu8点)ia3rEu9点)ib3rEu10点)ic3rEu11点)id3rEu12点)ie3rEu13点)if3rEu14点)ig3rEu15点)ih3rEu16点)ii3rEu17点)ij3rEu18点)ik3rEu19点)il3rEu20点)im3rEu21点)in3rEu22点)io3rEu23点)ip3rEu24点)iq3rEZhpa)ir3rEZda)is3rEZau)it3rEZbar)iu3rEZov)iv3rEZpc)iw3rEZdm)ix3rEZdm2)iy3rEZdm3)iz3rEZiu)i{3rEu平成)i|3rEu昭和)i}3rEu大正)i~3rEu明治)i3rEu 株式会社)i3rEpa)i3rEZna)i3rEuμa)i3rEZma)i3rEZka)i3rEZkb)i3rEmb)i3rEZgb)i3rEZcal)i3rEZkcal)i3rEZpf)i3rEZnf)i3rEuμf)i3rEuμg)i3rEZmg)i3rEZkgrrrrr_seg_33p srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i3rEhz)i3rEZkhz)i3rEZmhz)i3rEZghz)i3rEZthz)i3rEuμl)i3rEZml)i3rEZdl)i3rEZkl)i3rEZfm)i3rEZnm)i3rEuμm)i3rEZmm)i3rEcm)i3rEkm)i3rEZmm2)i3rEZcm2)i3rEZm2)i3rEZkm2)i3rEZmm3)i3rEZcm3)i3rEZm3)i3rEZkm3)i3rEum∕s)i3rEum∕s2)i3rEr)i3rEZkpa)i3rEZmpa)i3rEZgpa)i3rEZrad)i3rEurad∕s)i3rEurad∕s2)i3rEZps)i3rEns)i3rEuμs)i3rEZms)i3rEZpv)i3rEZnv)i3rEuμv)i3rEmv)i3rEZkv)i3rEr)i3rEZpw)i3rEZnw)i3rEuμw)i3rEmw)i3rEkw)i3rEr)i3rEukω)i3rEumω)i3r)i3rEZbq)i3rEZcc)i3rEcd)i3rEuc∕kg)i3r)i3rEZdb)i3rEZgy)i3rEZha)i3rEZhp)i3rEin)i3rEZkk)i3rEr)i3rEZkt)i3rEZlm)i3rEZln)i3rElog)i3rEZlx)i3rEr)i3rEZmil)i3rEZmol)i3rEZph)i3r)i3rEZppm)i3rEZpr)i3rEsr)i3rEZsv)i3rEwb)i3rEuv∕m)i3rEua∕m)i3rEu1日)i3rEu2日)i3rEu3日)i3rEu4日)i3rEu5日)i3rEu6日)i3rEu7日)i3rEu8日)i3rEu9日)i3rEu10日)i3rEu11日)i3rEu12日)i3rEu13日)i3rEu14日)i3rEu15日)i3rEu16日)i3rEu17日)i3rEu18日)i3rEu19日)i3rEu20日rrrrr_seg_34 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i3rEu21日)i3rEu22日)i3rEu23日)i3rEu24日)i3rEu25日)i3rEu26日)i3rEu27日)i3rEu28日)i3rEu29日)i3rEu30日)i3rEu31日)i3rEZgal)i4r0)iMr)iMr0)ir)ir0)ir)ir0)iǤr)iФr0)i,r)i@rEuꙁ)iAr0)iBrEuꙃ)iCr0)iDrEuꙅ)iEr0)iFrEuꙇ)iGr0)iHrEuꙉ)iIr0)iJrEr)iKr0)iLrEuꙍ)iMr0)iNrEuꙏ)iOr0)iPrEuꙑ)iQr0)iRrEuꙓ)iSr0)iTrEuꙕ)iUr0)iVrEuꙗ)iWr0)iXrEuꙙ)iYr0)iZrEuꙛ)i[r0)i\rEuꙝ)i]r0)i^rEuꙟ)i_r0)i`rEuꙡ)iar0)ibrEuꙣ)icr0)idrEuꙥ)ier0)ifrEuꙧ)igr0)ihrEuꙩ)iir0)ijrEuꙫ)ikr0)ilrEuꙭ)imr0)irEuꚁ)ir0)irEuꚃ)ir0)irEuꚅ)ir0)irEuꚇ)ir0)irEuꚉ)ir0)irEuꚋ)ir0)irEuꚍ)ir0)irEuꚏ)ir0)irEuꚑ)ir0)irEuꚓ)ir0)irEuꚕ)ir0)irEuꚗ)ir0)irEuꚙ)ir0)irEuꚛ)ir0)irEr)irEr)ir0)irrrrrr_seg_35@srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir0)i"rEuꜣ)i#r0)i$rEuꜥ)i%r0)i&rEꜧ)i'r0)i(rEuꜩ)i)r0)i*rEuꜫ)i+r0)i,rEuꜭ)i-r0)i.rEuꜯ)i/r0)i2rEuꜳ)i3r0)i4rEuꜵ)i5r0)i6rEuꜷ)i7r0)i8rEuꜹ)i9r0)i:rEuꜻ)i;r0)i<rEuꜽ)i=r0)i>rEuꜿ)i?r0)i@rEuꝁ)iAr0)iBrEuꝃ)iCr0)iDrEuꝅ)iEr0)iFrEuꝇ)iGr0)iHrEuꝉ)iIr0)iJrEuꝋ)iKr0)iLrEuꝍ)iMr0)iNrEuꝏ)iOr0)iPrEuꝑ)iQr0)iRrEuꝓ)iSr0)iTrEuꝕ)iUr0)iVrEuꝗ)iWr0)iXrEuꝙ)iYr0)iZrEuꝛ)i[r0)i\rEuꝝ)i]r0)i^rEuꝟ)i_r0)i`rEuꝡ)iar0)ibrEuꝣ)icr0)idrEuꝥ)ier0)ifrEuꝧ)igr0)ihrEuꝩ)iir0)ijrEuꝫ)ikr0)ilrEuꝭ)imr0)inrEꝯ)ior0)iprEr)iqr0)iyrEuꝺ)izr0)i{rEuꝼ)i|r0)i}rEuᵹ)i~rEuꝿ)ir0)irEuꞁ)ir0)irEuꞃ)ir0)irEuꞅ)ir0)irEuꞇ)ir0)irEuꞌ)ir0)irEr)ir0)irEuꞑ)ir0rrrrr_seg_36srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEuꞓ)ir0)irEuꞗ)ir0)irEuꞙ)ir0)irEuꞛ)ir0)irEuꞝ)ir0)irEuꞟ)ir0)irEuꞡ)ir0)irEuꞣ)ir0)irEuꞥ)ir0)irEuꞧ)ir0)irEuꞩ)ir0)irErc)irEr)irEr)irEuɬ)irEr)ir0)irEuʞ)irEuʇ)irEr)irEuꭓ)irEuꞵ)ir0)irEuꞷ)ir0)ir)ir0)ir)ir0)irErK)irErN)ir0)i,r)i0r0)i:r)i@r0)ixr)ir0)iƨr)iΨr0)iڨr)ir0)iTr)i_r0)i}r)ir0)iΩr)iϩr0)iکr)iީr0)ir)ir0)i7r)i@r0)iNr)iPr0)iZr)i\r0)iêr)i۪r0)ir)ir0)ir)i r0)ir)ir0)ir)i r0)i'r)i(r0)i/r)i0r0)i\rEr)i]rEuꬷ)i^rEr)i_rEuꭒ)i`r0)ifr)iprEuᎠ)iqrEuᎡ)irrEuᎢ)isrEuᎣ)itrEuᎤ)iurEuᎥ)ivrEuᎦ)iwrEuᎧ)ixrEuᎨ)iyrEuᎩ)izrEuᎪrrrrr_seg_37srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i{rEuᎫ)i|rEuᎬ)i}rEuᎭ)i~rEuᎮ)irEuᎯ)irEuᎰ)irEuᎱ)irEuᎲ)irEuᎳ)irEuᎴ)irEuᎵ)irEuᎶ)irEuᎷ)irEuᎸ)irEuᎹ)irEuᎺ)irEuᎻ)irEuᎼ)irEuᎽ)irEuᎾ)irEuᎿ)irEuᏀ)irEuᏁ)irEuᏂ)irEuᏃ)irEuᏄ)irEuᏅ)irEuᏆ)irEuᏇ)irEuᏈ)irEuᏉ)irEuᏊ)irEuᏋ)irEuᏌ)irEuᏍ)irEuᏎ)irEuᏏ)irEuᏐ)irEuᏑ)irEuᏒ)irEuᏓ)irEuᏔ)irEuᏕ)irEuᏖ)irEuᏗ)irEuᏘ)irEuᏙ)irEuᏚ)irEuᏛ)irEuᏜ)irEuᏝ)irEuᏞ)irEuᏟ)irEuᏠ)irEuᏡ)irEuᏢ)irEuᏣ)irEuᏤ)irEuᏥ)irEuᏦ)irEuᏧ)irEuᏨ)irEuᏩ)irEuᏪ)irEuᏫ)irEuᏬ)irEuᏭ)irEuᏮ)irEuᏯ)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)irEu豈)irEu更)irEr$)irEu賈)irEu滑)irEu串)irEu句)irEr-)i rEu契)i rEr')i rEu喇)i rEu奈)i rE懶)irEu癩)irEu羅)irEu蘿)irEu螺)irEu裸)irEu邏)irE樂)irEu洛rrrrr_seg_38xsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEu烙)irEu珞)irEu落)irEu酪)irEu駱)irEu亂)irEu卵)irEu欄)irEu爛)irEu蘭)i rEu鸞)i!rEu嵐)i"rEu濫)i#rEu藍)i$rEu襤)i%rEu拉)i&rEu臘)i'rEu蠟)i(rE廊)i)rE朗)i*rEu浪)i+rEu狼)i,rEu郎)i-rEu來)i.rEu冷)i/rEu勞)i0rEu擄)i1rEu櫓)i2rEu爐)i3rEu盧)i4rEr)i5rEu蘆)i6rE虜)i7rEu路)i8rEu露)i9rEu魯)i:rEu鷺)i;rE碌)i<rEu祿)i=rEu綠)i>rEu菉)i?rEu錄)i@rEr()iArEu論)iBrEu壟)iCrEu弄)iDrEu籠)iErEu聾)iFrEu牢)iGrEu磊)iHrEu賂)iIrEu雷)iJrEu壘)iKrEu屢)iLrEu樓)iMrEu淚)iNrEu漏)iOrEu累)iPrEu縷)iQrEu陋)iRrEu勒)iSrEu肋)iTrEu凜)iUrEu凌)iVrEu稜)iWrEu綾)iXrEu菱)iYrEu陵)iZrEu讀)i[rEu拏)i\rEr)i]rE諾)i^rEu丹)i_rE寧)i`rEu怒)iarE率)ibrE異)icrE北)idrEu磻)ierEu便)ifrEu復)igrEu不)ihrEu泌)iirEu數)ijrEu索)ikrEu參)ilrEu塞)imrEu省)inrEu葉)iorE說)iprE殺)iqrEr%)irrEu沈)isrEu拾)itrE若)iurEu掠)ivrEu略)iwrEu亮)ixrEu兩)iyrEu凉rrrrr_seg_39srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)izrEu梁)i{rEu糧)i|rEu良)i}rEu諒)i~rEu量)irEu勵)irEu呂)irEr )irEu廬)irEu旅)irEu濾)irEu礪)irEu閭)irEu驪)irEu麗)irEu黎)irEr )irEu曆)irEu歷)irEu轢)irEu年)irEu憐)irEu戀)irEu撚)irEu漣)irEu煉)irEu璉)irEu秊)irE練)irEu聯)irEu輦)irEu蓮)irEu連)irEu鍊)irEu列)irEu劣)irEu咽)irEu烈)irEu裂)irEr)irEu廉)irEu念)irEu捻)irEu殮)irEu簾)irEu獵)irEu令)irEu囹)irEr)irEu嶺)irEu怜)irEu玲)irEu瑩)irEu羚)irEu聆)irEu鈴)irEu零)irEu靈)irEu領)irEu例)irEu禮)irEu醴)irEu隸)irEu惡)irEu了)irEu僚)irEu寮)irEu尿)irE料)irEr)irEu燎)irEu療)irEu蓼)irEu遼)irEr,)irEu暈)irEu阮)irEu劉)irEu杻)irEu柳)irE流)irEu溜)irEu琉)irEu留)irEu硫)irEu紐)irEu類)irErk)irEu戮)irEu陸)irEu倫)irEu崙)irEu淪)irEu輪)irEu律)irEu慄)irEu栗)irEr)irEu隆)irEu利rrrrr_seg_40HsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEu吏)irEu履)irEu易)irEu李)irEu梨)irEu泥)irEu理)irEu痢)irEu罹)irEu裏)irEu裡)irEr&)irEu離)irEu匿)irEu溺)irEu吝)irEu燐)irEu璘)irEu藺)irEu隣)irEu鱗)irEu麟)irEu林)irEu淋)irEu臨)irEr)irEu笠)irEu粒)irEu狀)irEu炙)irEu識)irEu什)irEu茶)irEu刺)irE切)irEu度)irEu拓)irEu糖)irEu宅)irEu洞)irEu暴)irEu輻)irEr)i rEu降)i rEr!)i rEu廓)i rEu兀)i rEu嗀)ir0)irE塚)ir0)irE晴)ir0)irEu凞)irE猪)irE益)irEu礼)irEu神)irEu祥)irE福)irE靖)irEu精)irEr)ir0)i rEu蘒)i!r0)i"rE諸)i#r0)i%rE逸)i&rEu都)i'r0)i*rEu飯)i+rEu飼)i,rEu館)i-rEu鶴)i.rEu郞)i/rEu隷)i0rE侮)i1rE僧)i2rE免)i3rE勉)i4rE勤)i5rE卑)i6rE喝)i7rE嘆)i8rEu器)i9rEu塀)i:rEu墨)i;rEu層)i<rEr)i=rE悔)i>rEu慨)i?rE憎)i@rE懲)iArE敏)iBrEu既)iCrE暑)iDrE梅)iErE海)iFrEu渚rrrrr_seg_41srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iGrE漢)iHrE煮)iIrEu爫)iJrEu琢)iKrEu碑)iLrErm)iMrEu祉)iNrEu祈)iOrEu祐)iPrE祖)iQrErn)iRrEu禍)iSrEu禎)iTrE穀)iUrEu突)iVrE節)iWrEr)iXrEu縉)iYrEu繁)iZrEu署)i[rE者)i\rEu臭)i]rEu艹)i_rE著)i`rEu褐)iarE視)ibrE謁)icrE謹)idrEu賓)ierE贈)ifrEu辶)igrEr)ihrE難)iirE響)ijrE頻)ikrEu恵)ilrEu𤋮)imrEu舘)inr)iprEu並)iqrE况)irrEu全)isrEu侀)itrEu充)iurEu冀)ivrE勇)iwrE勺)ixrEr)iyrEu啕)izrE喙)i{rEu嗢)i|rEr)i}rEu墳)i~rEu奄)irEu奔)irEu婢)irEu嬨)irEu廒)irEu廙)irEu彩)irEu徭)irEu惘)irE慎)irEu愈)irEr)irEu慠)irEr)irEu戴)irEu揄)irEu搜)irEu摒)irEu敖)irEr)irEr)irE望)irEu杖)irEr)irEr)irEr)irEu滛)irE滋)irEr)irE瀞)irEr)irEu瞧)irE爵)irEu犯)irEr)irE瑱)irEu甆)irEu画)irEu瘝)irEu瘟)irEr)irEu盛)irE直)irE睊)irEu着)irE磌)irEu窱rrrrr_seg_42srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEr)irEu类)irEu絛)irEr)irEu缾)irEr)irEu荒)irEu華)irE蝹)irEu襁)irEu覆)irEr)irEu調)irEr)irEu請)irEr)irEr)irE諭)irEr)irE變)irEr)irE輸)irEu遲)irEu醙)irEu鉶)irEu陼)irEr)irEr)irEu韛)irEr)irE頋)irEr)irE鬒)irEr-)irEu𢡊)irEu𢡄)irEu𣏕)irE㮝)irEu䀘)irE䀹)irEu𥉉)irEu𥳐)irEu𧻓)irEu齃)irEu龎)ir)irEZff)irEZfi)irEZfl)irEZffi)irEZffl)irEst)ir)irEuմն)irEuմե)irEuմի)irEuվն)irEuմխ)ir)irEuיִ)ir0)irEuײַ)i rEuע)i!rEr)i"rEr)i#rEuה)i$rEuכ)i%rEuל)i&rEuם)i'rEuר)i(rEuת)i)rr)i*rEuשׁ)i+rEuשׂ)i,rEuשּׁ)i-rEuשּׂ)i.rEuאַ)i/rEuאָ)i0rEuאּ)i1rEuבּ)i2rEuגּ)i3rEuדּ)i4rEuהּ)i5rEuוּ)i6rEuזּ)i7r)i8rEuטּ)i9rEuיּ)i:rEuךּ)i;rEuכּ)i<rEuלּ)i=r)i>rEuמּ)i?r)i@rEuנּ)iArEuסּ)iBr)iCrEuףּ)iDrEuפּ)iErrrrrr_seg_43srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iFrEuצּ)iGrEuקּ)iHrEuרּ)iIrEuשּ)iJrEuתּ)iKrEuוֹ)iLrEuבֿ)iMrEuכֿ)iNrEuפֿ)iOrEuאל)iPrEuٱ)iRrEuٻ)iVrEuپ)iZrEuڀ)i^rEuٺ)ibrEuٿ)ifrEuٹ)ijrEuڤ)inrEuڦ)irrEuڄ)ivrEuڃ)izrEuچ)i~rEuڇ)irEuڍ)irEuڌ)irEuڎ)irEuڈ)irEuژ)irEuڑ)irEuک)irEuگ)irEuڳ)irEuڱ)irEں)irEuڻ)irEuۀ)irEuہ)irEuھ)irEuے)irEuۓ)ir0)ir)irEuڭ)irEuۇ)irEuۆ)irEuۈ)irEr)irEuۋ)irEuۅ)irEuۉ)irEuې)irEى)irEuئا)irEuئە)irEuئو)irEuئۇ)irEuئۆ)irEuئۈ)irEuئې)irEئى)irEuی)irEئج)irEئح)irEئم)irEr )irEئي)irEبج)irEبح)irEبخ)irEبم)i rEبى)i rEبي)i rEتج)i rEتح)i rEتخ)irEتم)irEتى)irEتي)irEuثج)irEثم)irEثى)irEثي)irEجح)irEجم)irEحج)irEحم)irEخج)irEuخح)irEخم)irEسج)irEسح)irEسخ)irEسم)i rEصح)i!rEصم)i"rEضج)i#rEضح)i$rEضخ)i%rEضم)i&rEطحrrrrr_seg_44sr/cdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i'rEطم)i(rEظم)i)rEعج)i*rEعم)i+rEغج)i,rEغم)i-rEفج)i.rEفح)i/rEفخ)i0rEفم)i1rEفى)i2rEفي)i3rEقح)i4rEقم)i5rEقى)i6rEقي)i7rEكا)i8rEكج)i9rEكح)i:rEكخ)i;rEكل)i<rEكم)i=rEكى)i>rEكي)i?rEلج)i@rEلح)iArEلخ)iBrEلم)iCrEلى)iDrEلي)iErEمج)iFrEمح)iGrEمخ)iHrEمم)iIrEuمى)iJrEuمي)iKrEنج)iLrEنح)iMrEنخ)iNrEنم)iOrEنى)iPrEني)iQrEهج)iRrEهم)iSrEuهى)iTrEuهي)iUrEيج)iVrEيح)iWrEيخ)iXrEيم)iYrEيى)iZrEيي)i[rEuذٰ)i\rEuرٰ)i]rEىٰ)i^ru ٌّ)i_ru ٍّ)i`ru َّ)iaru ُّ)ibru ِّ)icru ّٰ)idrEuئر)ierEuئز)ifrEr )igrEuئن)ihrEr )iirEr)ijrEuبر)ikrEuبز)ilrEr)imrEuبن)inrEr)iorEr)iprEuتر)iqrEuتز)irrEr)isrEuتن)itrEr)iurEr)ivrEuثر)iwrEuثز)ixrEr)iyrEuثن)izrEr)i{rEr)i|rEr:)i}rEr;)i~rEr>)irEr?)irEr@)irErD)irErE)irErF)irErG)irErK)irErL)irErM)irEuما)irErQ)irEuنرrrrrr_seg_45PsracdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEuنز)irErU)irEuنن)irErV)irErW)irEr`)irEuير)irEuيز)irEr])irEuين)irEr^)irEr_)irEr )irEr )irEuئخ)irEr )irEئه)irEr)irEr)irEr)irEr)irEبه)irEr)irEr)irEr)irEr)irEته)irEr)irEr)irEr)irEr )irEr!)irEr")irEr#)irEr$)irEr%)irEr&)irEr')irEr()irEuصخ)irEr))irEr*)irEr+)irEr,)irEr-)irEr.)irEr1)irEr2)irEr3)irEr4)irEr5)irEr6)irEr7)irEr8)irEr9)irEr<)irEr=)irErA)irErB)irErC)irErD)irErE)irErH)irErI)irErJ)irErK)irEuله)irErN)irErO)irErP)irErQ)irErR)irErS)irErT)irErU)irEنه)irErX)irErY)irEuهٰ)irErZ)irEr[)irEr\)irEr])irEيه)irEr )irErb)irEr)irErc)irEr)irErd)irEr)irEuثه)irEr')irEسه)irEشم)irEشه)irErD)irErE)irErK)irErUrrrrr_seg_46srjcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEre)irEr])irErf)irEuـَّ)irEuـُّ)irEuـِّ)irEطى)irEطي)irEعى)irEعي)irEغى)irEغي)irEسى)irEسي)irEشى)irEشي)irEحى)irEحي)irEجى)irEجي)irEخى)irEخي)irEصى)irEصي)irEضى)irEضي)i rEشج)i rEشح)i rEشخ)i rErh)i rEشر)irEسر)irEصر)irEضر)irErk)irErl)irErm)irErn)irEro)irErp)irErq)irErr)irErs)irErt)irEru)irErv)irErw)irErx)irEry)i rErz)i!rEr{)i"rEr|)i#rEr})i$rEr~)i%rEr)i&rEr)i'rEr)i(rErh)i)rEr)i*rEr)i+rEr)i,rEr)i-rEr)i.rEr)i/rEr)i0rErh)i1rErg)i2rEri)i3rEr0)i4rEr$)i5rEr%)i6rEr&)i7rEr)i8rEr)i9rEr)i:rEr0)i;rEr1)i<rEuاً)i>r0)i@r)iPrEuتجم)iQrEuتحج)iSrEuتحم)iTrEuتخم)iUrEuتمج)iVrEuتمح)iWrEuتمخ)iXrEuجمح)iZrEuحمي)i[rEuحمى)i\rEuسحج)i]rEuسجح)i^rEuسجى)i_rEuسمح)iarEuسمج)ibrEuسمم)idrEuصحح)ifrEصمم)igrEuشحم)iirEuشجيrrrrr_seg_47 srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ijrEuشمخ)ilrEuشمم)inrEuضحى)iorEuضخم)iqrEuطمح)isrEuطمم)itrEuطمي)iurEعجم)ivrEuعمم)ixrEuعمى)iyrEuغمم)izrEuغمي)i{rEuغمى)i|rEuفخم)i~rEقمح)irEuقمم)irEلحم)irEuلحي)irEuلحى)irEuلجج)irEuلخم)irEuلمح)irEuمحج)irEuمحم)irEuمحي)irEuمجح)irEuمجم)irEuمخج)irEuمخم)ir)irEuمجخ)irEuهمج)irEuهمم)irEuنحم)irEuنحى)irEuنجم)irEuنجى)irEuنمي)irEuنمى)irEuيمم)irEuبخي)irEuتجي)irEuتجى)irEuتخي)irEuتخى)irEuتمي)irEuتمى)irEuجمي)irEuجحى)irEuجمى)irEuسخى)irEuصحي)irEuشحي)irEuضحي)irEuلجي)irEuلمي)irEuيحي)irEuيجي)irEuيمي)irEuممي)irEuقمي)irEuنحي)irEr)irEr)irEuعمي)irEuكمي)irEنجح)irEuمخي)irEلجم)irEكمم)irEr)irEr)irEuجحي)irEuحجي)irEuمجي)irEuفمي)irEuبحي)irEr)irEr)irEr)irEuسخي)irEuنجي)ir)irEuصلے)irEuقلے)irEuالله)irEuاكبر)irEuمحمد)irEuصلعم)irEuرسول)irEuعليه)irEuوسلم)irEuصلى)iru!صلى الله عليه وسلم)iruجل جلاله)irEuریال)ir0)ir)ir)ir,rrrrr_seg_48srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irE、)ir)ir:)irrf)ir!)ir?)irEu〖)irEu〗)ir)i r0)i0r)i1rE—)i2rEu–)i3r_)i5rr)i6rr)i7r{)i8r})i9rE〔)i:rE〕)i;rEu【)i<rEu】)i=rEu《)i>rEu》)i?rEr)i@rEr)iArE「)iBrE」)iCrEu『)iDrEu』)iEr0)iGr[)iHr])iIrr)iMrr)iPrr)iQrEr)iRr)iTrrf)iUrr)iVrr)iWrr)iXrEr)iYrr)iZrr)i[rr)i\rr)i]rEr)i^rEr)i_r#)i`r&)iar*)ibrr)icrE-)idr<)ier>)ifrr)igr)ihr\)iir$)ijr%)ikr@)ilr)ipru ً)iqrEuـً)irru ٌ)isr0)itru ٍ)iur)ivru َ)iwrEuـَ)ixru ُ)iyrEuـُ)izru ِ)i{rEuـِ)i|ru ّ)i}rEuـّ)i~ru ْ)irEuـْ)irEuء)irEuآ)irEuأ)irEuؤ)irEuإ)irEuئ)irEا)irEب)irEuة)irEت)irEث)irEج)irEح)irEخ)irEد)irEذ)irEر)irEز)irEس)irEش)irEصrrrrr_seg_49srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEض)irEط)irEظ)irEع)irEغ)irEف)irEق)irEك)irEل)irEم)irEن)irEه)irEو)irEr )irEي)irEuلآ)irEuلأ)irEuلإ)irEuلا)ir)ir)ir)irr)ir")irr)irr)irr)irr)ir')irr)i rr)i rr)i rr)i rr)i rEr)irEr.)ir/)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irr)irrf)irr)irr)irr)irr)i rr)i!rErF)i"rErH)i#rErJ)i$rErL)i%rErN)i&rErP)i'rErR)i(rErT)i)rErV)i*rErX)i+rErZ)i,rEr\)i-rEr^)i.rEr`)i/rErb)i0rErd)i1rErf)i2rErh)i3rErj)i4rErl)i5rErn)i6rErp)i7rErr)i8rErt)i9rErv)i:rErx)i;rr)i<rr)i=rr)i>r^)i?rr)i@rr)iArErF)iBrErH)iCrErJ)iDrErL)iErErN)iFrErP)iGrErR)iHrErT)iIrErV)iJrErX)iKrErZ)iLrEr\)iMrEr^)iNrEr`rrrrr_seg_50XsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iOrErb)iPrErd)iQrErf)iRrErh)iSrErj)iTrErl)iUrErn)iVrErp)iWrErr)iXrErt)iYrErv)iZrErx)i[rr)i\r|)i]rr)i^r~)i_rEu⦅)i`rEu⦆)iarEr.)ibrEr)icrEr)idrEr)ierEu・)ifrEr)igrEuァ)ihrEuィ)iirEuゥ)ijrEuェ)ikrEuォ)ilrEuャ)imrEuュ)inrEuョ)iorEuッ)iprEuー)iqrErr)irrErs)isrErt)itrEru)iurErv)ivrErw)iwrErx)ixrEry)iyrErz)izrEr{)i{rEr|)i|rEr})i}rEr~)i~rEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEuン)irEu゙)irEu゚)ir)irEr/)irEr0)irEr1)irEr2)irEr3)irEr4)irEr5)irEr6)irEr8)irEr9)irEr:)irEr;)irEr<)irEr=)irEr>)irEr?)irEr@)irErArrrrr_seg_51srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irErB)irErC)irErD)irErE)irErF)irErG)irErH)irErI)irErJ)irErK)irErL)irErM)ir)irErN)irErO)irErP)irErQ)irErR)irErS)ir)irErT)irErU)irErV)irErW)irErX)irErY)ir)irErZ)irEr[)irEr\)irEr])irEr^)irEr_)ir)irEr`)irEra)irErb)ir)irE¢)irE£)irE¬)irr)irE¦)irE¥)irEu₩)ir)irEu│)irEu←)irEu↑)irEu→)irEu↓)irEu■)irEu○)ir)ir0)i r)i r0)i'r)i(r0)i;r)i<r0)i>r)i?r0)iNr)iPr0)i^r)ir0)ir)ir0)ir)ir0)i4r)i7r0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i$r)i-r0)iKr)iPr0)i{r)ir0)ir)ir0)ir)ir0)ir)irEu𐐨)irEu𐐩rrrrr_seg_52(srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEu𐐪)irEu𐐫)irEu𐐬)irEu𐐭)irEu𐐮)irEu𐐯)irEu𐐰)i rEu𐐱)i rEu𐐲)i rEu𐐳)i rEu𐐴)i rEu𐐵)irEu𐐶)irEu𐐷)irEu𐐸)irEu𐐹)irEu𐐺)irEu𐐻)irEu𐐼)irEu𐐽)irEu𐐾)irEu𐐿)irEu𐑀)irEu𐑁)irEu𐑂)irEu𐑃)irEu𐑄)irEu𐑅)irEu𐑆)irEu𐑇)i rEu𐑈)i!rEu𐑉)i"rEu𐑊)i#rEu𐑋)i$rEu𐑌)i%rEu𐑍)i&rEu𐑎)i'rEu𐑏)i(r0)ir)ir0)ir)irEu𐓘)irEu𐓙)irEu𐓚)irEu𐓛)irEu𐓜)irEu𐓝)irEu𐓞)irEu𐓟)irEu𐓠)irEu𐓡)irEu𐓢)irEu𐓣)irEu𐓤)irEu𐓥)irEu𐓦)irEu𐓧)irEu𐓨)irEu𐓩)irEu𐓪)irEu𐓫)irEu𐓬)irEu𐓭)irEu𐓮)irEu𐓯)irEu𐓰)irEu𐓱)irEu𐓲)irEu𐓳)irEu𐓴)irEu𐓵)irEu𐓶)irEu𐓷)irEu𐓸)irEu𐓹)irEu𐓺)irEu𐓻)ir)ir0)ir)ir0)i(r)i0r0)idr)ior0)ipr)ir0)i7r)i@r0)iVr)i`r0)ihr)ir0)ir)ir0)i r)i r0)i6r)i7r0rrrrr_seg_53srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i9r)i<r0)i=r)i?r0)iVr)iWr0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i r)i r0)i: r)i? r0)i@ r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i r)i r0)i6 r)i8 r0)i; r)i? r0)iI r)iP r0)iY r)i` r0)i r)i r0)i r)i r0)i r)i r0)i6 r)i9 r0)iV r)iX r0)is r)ix r0)i r)i r0)i r)i r0)i r)i r0)iI r)i rEu𐳀)i rEu𐳁)i rEu𐳂)i rEu𐳃)i rEu𐳄)i rEu𐳅)i rEu𐳆)i rEu𐳇)i rEu𐳈)i rEu𐳉)i rEu𐳊)i rEu𐳋)i rEu𐳌)i rEu𐳍)i rEu𐳎)i rEu𐳏)i rEu𐳐)i rEu𐳑)i rEu𐳒)i rEu𐳓)i rEu𐳔)i rEu𐳕)i rEu𐳖)i rEu𐳗)i rEu𐳘)i rEu𐳙)i rEu𐳚)i rEu𐳛)i rEu𐳜)i rEu𐳝)i rEu𐳞)i rEu𐳟)i rEu𐳠)i rEu𐳡)i rEu𐳢)i rEu𐳣)i rEu𐳤)i rEu𐳥)i rEu𐳦)i rEu𐳧)i rEu𐳨rrrrr_seg_54srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i rEu𐳩)i rEu𐳪)i rEu𐳫)i rEu𐳬)i rEu𐳭)i rEu𐳮)i rEu𐳯)i rEu𐳰)i rEu𐳱)i rEu𐳲)i r)i r0)i r)i r0)i( r)i0 r0)i: r)i`r0)ir)ir0)i(r)i0r0)iZr)ir0)iNr)iRr0)ipr)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i5r)i6r0)iGr)iPr0)iwr)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i?r)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i r)ir0)ir)ir0)i)r)i*r0)i1r)i2r0)i4r)i5r0)i:r)i;r0)iEr)iGr0)iIr)iKr0)iNr)iPr0)iQr)iWr0)iXr)i]r0)idr)ifr0)imr)ipr0)iur)ir0)iZr)i[r0)i\r)i]r0rrrrr_seg_55`srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i_r)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)iEr)iPr0)iZr)i`r0)imr)ir0)ir)ir0)ir)ir0)ir)ir0)i,r)i0r0)i@r)ir0)i<r)irEu𑣀)irEu𑣁)irEu𑣂)irEu𑣃)irEu𑣄)irEu𑣅)irEu𑣆)irEu𑣇)irEu𑣈)irEu𑣉)irEu𑣊)irEu𑣋)irEu𑣌)irEu𑣍)irEu𑣎)irEu𑣏)irEu𑣐)irEu𑣑)irEu𑣒)irEu𑣓)irEu𑣔)irEu𑣕)irEu𑣖)irEu𑣗)irEu𑣘)irEu𑣙)irEu𑣚)irEu𑣛)irEu𑣜)irEu𑣝)irEu𑣞)irEu𑣟)ir0)ir)ir0)ir)ir0)iHr)iPr0)ir)ir0)ir)ir0)ir)ir0)i r)i r0)i7r)i8r0)iFr)iPr0)imr)ipr0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i r)i r0)i7r)i:r0)i;r)i<r0)i>r)i?r0)iHr)iPr0)iZr)i`r0rrrrr_seg_56srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ifr)igr0)iir)ijr0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)i r0)i#r)i$r0)io$r)ip$r0)iu$r)i$r0)iD%r)i0r0)i/4r)iDr0)iGFr)ihr0)i9jr)i@jr0)i_jr)i`jr0)ijjr)injr0)ipjr)ijr0)ijr)ijr0)ijr)ikr0)iFkr)iPkr0)iZkr)i[kr0)ibkr)ickr0)ixkr)i}kr0)ikr)i`nr0)inr)ior0)iEor)iPor0)ior)ior0)ior)ior0)ior)ipr0)ir)ir0)ir)ir0)ir)ipr0)ir)ir0)ikr)ipr0)i}r)ir0)ir)ir0)ir)ir0)ir)ir)ir0)ir)ir0)i'r)i)r0)i^rEu𝅗𝅥)i_rEu𝅘𝅥)i`rEu 𝅘𝅥𝅮)iarEu 𝅘𝅥𝅯)ibrEu 𝅘𝅥𝅰)icrEu 𝅘𝅥𝅱)idrEu 𝅘𝅥𝅲)ier0)isr)i{r0)irEu𝆹𝅥)irEu𝆺𝅥)irEu 𝆹𝅥𝅮)irEu 𝆺𝅥𝅮)irEu 𝆹𝅥𝅯)irEu 𝆺𝅥𝅯)ir0)ir)ir0rrrrr_seg_570srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iFr)ir0)ir)ir0)iWr)i`r0)iyr)irErF)irErH)irErJ)irErL)irErN)irErP)irErR)irErT)irErV)i rErX)i rErZ)i rEr\)i rEr^)i rEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)irErN)irErP)i rErR)i!rErT)i"rErV)i#rErX)i$rErZ)i%rEr\)i&rEr^)i'rEr`)i(rErb)i)rErd)i*rErf)i+rErh)i,rErj)i-rErl)i.rErn)i/rErp)i0rErr)i1rErt)i2rErv)i3rErx)i4rErF)i5rErH)i6rErJ)i7rErL)i8rErN)i9rErP)i:rErR)i;rErT)i<rErV)i=rErX)i>rErZ)i?rEr\)i@rEr^)iArEr`)iBrErb)iCrErd)iDrErf)iErErh)iFrErj)iGrErl)iHrErn)iIrErp)iJrErr)iKrErt)iLrErv)iMrErx)iNrErF)iOrErH)iPrErJ)iQrErL)iRrErN)iSrErP)iTrErR)iUr)iVrErV)iWrErX)iXrErZ)iYrEr\)iZrEr^)i[rEr`)i\rErbrrrrr_seg_58srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i]rErd)i^rErf)i_rErh)i`rErj)iarErl)ibrErn)icrErp)idrErr)ierErt)ifrErv)igrErx)ihrErF)iirErH)ijrErJ)ikrErL)ilrErN)imrErP)inrErR)iorErT)iprErV)iqrErX)irrErZ)isrEr\)itrEr^)iurEr`)ivrErb)iwrErd)ixrErf)iyrErh)izrErj)i{rErl)i|rErn)i}rErp)i~rErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)irErN)irErP)irErR)irErT)irErV)irErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)ir)irErJ)irErL)ir)irErR)ir)irErX)irErZ)ir)irEr`)irErb)irErd)irErf)ir)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)ir)irErP)ir)irErT)irErV)irErX)irErZ)irEr\)irEr^)irEr`rrrrr_seg_59srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)ir)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)irErN)irErP)irErR)irErT)irErV)irErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)irErN)irErP)irErR)irErT)irErV)irErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)ir)irErL)irErN)i rErP)i rErR)i r)i rErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)ir)irErj)irErl)irErn)irErp)irErr)irErt)irErv)ir)irErF)irErH)i rErJ)i!rErL)i"rErN)i#rErP)i$rErR)i%rErT)i&rErV)i'rErX)i(rErZrrrrr_seg_60hsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i)rEr\)i*rEr^)i+rEr`)i,rErb)i-rErd)i.rErf)i/rErh)i0rErj)i1rErl)i2rErn)i3rErp)i4rErr)i5rErt)i6rErv)i7rErx)i8rErF)i9rErH)i:r)i;rErL)i<rErN)i=rErP)i>rErR)i?r)i@rErV)iArErX)iBrErZ)iCrEr\)iDrEr^)iEr)iFrErb)iGr)iJrErj)iKrErl)iLrErn)iMrErp)iNrErr)iOrErt)iPrErv)iQr)iRrErF)iSrErH)iTrErJ)iUrErL)iVrErN)iWrErP)iXrErR)iYrErT)iZrErV)i[rErX)i\rErZ)i]rEr\)i^rEr^)i_rEr`)i`rErb)iarErd)ibrErf)icrErh)idrErj)ierErl)ifrErn)igrErp)ihrErr)iirErt)ijrErv)ikrErx)ilrErF)imrErH)inrErJ)iorErL)iprErN)iqrErP)irrErR)isrErT)itrErV)iurErX)ivrErZ)iwrEr\)ixrEr^)iyrEr`)izrErb)i{rErd)i|rErf)i}rErh)i~rErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)irErN)irErP)irErR)irErT)irErVrrrrr_seg_61srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)irErN)irErP)irErR)irErT)irErV)irErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)irErN)irErP)irErR)irErT)irErV)irErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)irErN)irErP)irErR)irErT)irErV)irErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)irErNrrrrr_seg_628srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irErP)irErR)irErT)irErV)irErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)i rErH)i rErJ)i rErL)i rErN)i rErP)irErR)irErT)irErV)irErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)i rErv)i!rErx)i"rErF)i#rErH)i$rErJ)i%rErL)i&rErN)i'rErP)i(rErR)i)rErT)i*rErV)i+rErX)i,rErZ)i-rEr\)i.rEr^)i/rEr`)i0rErb)i1rErd)i2rErf)i3rErh)i4rErj)i5rErl)i6rErn)i7rErp)i8rErr)i9rErt)i:rErv)i;rErx)i<rErF)i=rErH)i>rErJ)i?rErL)i@rErN)iArErP)iBrErR)iCrErT)iDrErV)iErErX)iFrErZ)iGrEr\)iHrEr^)iIrEr`)iJrErb)iKrErd)iLrErf)iMrErh)iNrErj)iOrErl)iPrErn)iQrErp)iRrErr)iSrErt)iTrErv)iUrErx)iVrErFrrrrr_seg_63srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iWrErH)iXrErJ)iYrErL)iZrErN)i[rErP)i\rErR)i]rErT)i^rErV)i_rErX)i`rErZ)iarEr\)ibrEr^)icrEr`)idrErb)ierErd)ifrErf)igrErh)ihrErj)iirErl)ijrErn)ikrErp)ilrErr)imrErt)inrErv)iorErx)iprErF)iqrErH)irrErJ)isrErL)itrErN)iurErP)ivrErR)iwrErT)ixrErV)iyrErX)izrErZ)i{rEr\)i|rEr^)i}rEr`)i~rErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irErF)irErH)irErJ)irErL)irErN)irErP)irErR)irErT)irErV)irErX)irErZ)irEr\)irEr^)irEr`)irErb)irErd)irErf)irErh)irErj)irErl)irErn)irErp)irErr)irErt)irErv)irErx)irEuı)irEuȷ)ir)irErp)irErq)irErr)irErs)irErt)irEru)irErv)irErw)irErd)irErx)irEry)irEr)irErz)irEr{)irEr|)irEr})irEr~)irErw)irEr)irErrrrrr_seg_64srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEr)irEr)irEr)irEr)irEr)irE∇)irErp)irErq)irErr)irErs)irErt)irEru)irErv)irErw)irErd)irErx)irEry)irEr)irErz)irEr{)irEr|)irEr})irEr~)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irE∂)irErt)irErw)irErx)irEr)irEr~)irEr})irErp)irErq)irErr)irErs)irErt)irEru)irErv)irErw)irErd)irErx)irEry)irEr)irErz)irEr{)irEr|)irEr})irEr~)irErw)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irErp)irErq)irErr)irErs)irErt)irEru)irErv)irErw)irErd)irErx)irEry)irEr)irErz)i rEr{)i rEr|)i rEr})i rEr~)i rEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irErt)irErw)irErx)irEr)irEr~)irEr})irErp)irErq)irErr)irErs)i rErt)i!rErurrrrr_seg_65psrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i"rErv)i#rErw)i$rErd)i%rErx)i&rEry)i'rEr)i(rErz)i)rEr{)i*rEr|)i+rEr})i,rEr~)i-rErw)i.rEr)i/rEr)i0rEr)i1rEr)i2rEr)i3rEr)i4rEr)i5rEr)i6rErp)i7rErq)i8rErr)i9rErs)i:rErt)i;rEru)i<rErv)i=rErw)i>rErd)i?rErx)i@rEry)iArEr)iBrErz)iCrEr{)iDrEr|)iErEr})iFrEr~)iGrEr)iIrEr)iJrEr)iKrEr)iLrEr)iMrEr)iNrEr)iOrEr)iPrErt)iQrErw)iRrErx)iSrEr)iTrEr~)iUrEr})iVrErp)iWrErq)iXrErr)iYrErs)iZrErt)i[rEru)i\rErv)i]rErw)i^rErd)i_rErx)i`rEry)iarEr)ibrErz)icrEr{)idrEr|)ierEr})ifrEr~)igrErw)ihrEr)iirEr)ijrEr)ikrEr)ilrEr)imrEr)inrEr)iorEr)iprErp)iqrErq)irrErr)isrErs)itrErt)iurEru)ivrErv)iwrErw)ixrErd)iyrErx)izrEry)i{rEr)i|rErz)i}rEr{)i~rEr|)irEr})irEr~)irEr)irEr)irEr)irEr)irEr)irErrrrrr_seg_66srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEr)irEr)irErt)irErw)irErx)irEr)irEr~)irEr})irErp)irErq)irErr)irErs)irErt)irEru)irErv)irErw)irErd)irErx)irEry)irEr)irErz)irEr{)irEr|)irEr})irEr~)irErw)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irErp)irErq)irErr)irErs)irErt)irEru)irErv)irErw)irErd)irErx)irEry)irEr)irErz)irEr{)irEr|)irEr})irEr~)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irErt)irErw)irErx)irEr)irEr~)irEr})irEr)ir)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irErrrrrr_seg_67@srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)i"r)i#r0)i%r)i&r0)i+r)ir0)ir)ir0)ir)irEu𞤢)irEu𞤣)irEu𞤤)irEu𞤥)irEu𞤦)irEu𞤧)irEu𞤨)irEu𞤩)irEu𞤪)i rEu𞤫)i rEu𞤬)i rEu𞤭)i rEu𞤮)i rEu𞤯)irEu𞤰)irEu𞤱)irEu𞤲)irEu𞤳)irEu𞤴)irEu𞤵)irEu𞤶)irEu𞤷)irEu𞤸)irEu𞤹)irEu𞤺)irEu𞤻)irEu𞤼)irEu𞤽)irEu𞤾)irEu𞤿)irEu𞥀)irEu𞥁)i rEu𞥂)i!rEu𞥃)i"r0)iKr)iPr0)iZr)i^r0)i`r)iqr0)ir)irEr)irEr)irEr)irEr)ir)irEr)irEr)irEr)irEr)i rEr)i rEr)i rEr)i rEr)i rEr)irEr)irEr)irEr)irEr)irEr)irEr)irErrrrrr_seg_68srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEٮ)irEr)irEڡ)irEٯ)i r)i!rEr)i"rEr)i#r)i$rEr)i%r)i'rEr)i(r)i)rEr)i*rEr)i+rEr)i,rEr)i-rEr)i.rEr)i/rEr)i0rEr)i1rEr)i2rEr)i3r)i4rEr)i5rEr)i6rEr)i7rEr)i8r)i9rEr)i:r)i;rEr)i<r)iBrEr)iCr)iGrEr)iHr)iIrEr)iJr)iKrEr)iLr)iMrEr)iNrEr)iOrEr)iPr)iQrEr)iRrEr)iSr)iTrEr)iUr)iWrEr)iXr)iYrEr)iZr)i[rEr)i\r)i]rEr)i^r)i_rEr)i`r)iarEr)ibrEr)icr)idrEr)ier)igrEr)ihrEr)iirEr)ijrEr)ikr)ilrEr)imrEr)inrEr)iorEr)iprEr)iqrEr)irrEr)isr)itrEr)iurEr)ivrEr)iwrEr)ixr)iyrEr)izrEr)i{rEr)i|rEr)i}r)i~rEr)ir)irEr)irEr)irEr)irErrrrrr_seg_69srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEr)irEr)irEr)irEr)irEr)irEr)ir)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)ir)irEr)irEr)irEr)ir)irEr)irEr)irEr)irEr)irEr)ir)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)irEr)ir)ir0)ir)ir0)i,r)i0r0)ir)ir0)ir)ir0)ir)ir0)ir)ir0)ir)irz0,)irz1,)irz2,)irz3,)irz4,)irz5,)irz6,)irz7,)i rz8,)i rz9,)i r0)i r)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)irr)i rr)i!rr)i"rr)i#rr)i$rrrrrrr_seg_70xsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i%rr)i&rr)i'rr)i(rr)i)rr)i*rEu〔s〕)i+rErJ)i,rErh)i-rEr)i.rEZwz)i/r0)i0rErF)i1rErH)i2rErJ)i3rErL)i4rErN)i5rErP)i6rErR)i7rErT)i8rErV)i9rErX)i:rErZ)i;rEr\)i<rEr^)i=rEr`)i>rErb)i?rErd)i@rErf)iArErh)iBrErj)iCrErl)iDrErn)iErErp)iFrErr)iGrErt)iHrErv)iIrErx)iJrEZhv)iKrEr)iLrEZsd)iMrEr))iNrEZppv)iOrEZwc)iPr0)ijrEZmc)ikrEZmd)ilr)ipr0)irEZdj)ir0)ir)ir0)irEuほか)irEuココ)irEr|)ir)irEr)irEu字)irEu双)irEuデ)irEr)irE多)irEu解)irErh)irEu交)irEu映)irEu無)irEr)irEu前)irEu後)irE再)irEu新)i rEu初)i!rEu終)i"rEr)i#rEu販)i$rEu声)i%rEu吹)i&rEu演)i'rEu投)i(rEu捕)i)rEr)i*rErc)i+rEu遊)i,rEro)i-rErf)i.rErp)i/rEu指)i0rEr#)i1rEu打)i2rEu禁)i3rEu空)i4rEu合)i5rEu満)i6rErl)i7rEr)i8rEu申)i9rE割)i:rEu営)i;rEu配rrrrr_seg_71srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i<r)i@rEu 〔本〕)iArEu 〔三〕)iBrEu 〔二〕)iCrEu 〔安〕)iDrEu 〔点〕)iErEu 〔打〕)iFrEu 〔盗〕)iGrEu 〔勝〕)iHrEu 〔敗〕)iIr)iPrEu得)iQrEu可)iRr)i`r0)ifr)ir0)ir)ir0)ir)ir0)ir)ir0)itr)ir0)ir)ir0)i r)ir0)iHr)iPr0)iZr)i`r0)ir)ir0)ir)ir0)i r)ir0)i?r)i@r0)iqr)isr0)iwr)izr0)i{r)i|r0)ir)ir0)ir)ir0)ir)ir0)ir)i`r0)inr)ir0)iצr)ir0)i5r)i@r0)ir)i r0)ir)ir0)ir)irEu丽)irEu丸)irEu乁)irEu𠄢)irEu你)irEr)irEu侻)irEu倂)irEu偺)i rEu備)i rEr)i rEu像)i rEu㒞)i rEu𠘺)irEr)irEu兔)irEu兤)irEu具)irEu𠔜)irEu㒹)irEu內)irEr)irEu𠕋)irEu冗)irEu冤)irEu仌)irEu冬)irEr)irEu𩇟)irEr )irEu刃)irEu㓟)i rEu刻)i!rEu剆rrrrr_seg_72HsrcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)i"rEr)i#rEu剷)i$rEu㔕)i%rEr)i&rEr)i'rEr)i(rEr)i)rEu包)i*rEu匆)i+rEr)i,rEu卉)i-rEr)i.rEu博)i/rEu即)i0rEu卽)i1rEu卿)i4rEu𠨬)i5rEu灰)i6rEu及)i7rEu叟)i8rEu𠭣)i9rEu叫)i:rEu叱)i;rEu吆)i<rEu咞)i=rEu吸)i>rEu呈)i?rEu周)i@rEu咢)iArEu哶)iBrEu唐)iCrEu啓)iDrEu啣)iErEu善)iGrEr)iHrEu喫)iIrEu喳)iJrEu嗂)iKrEu圖)iLrEr)iMrEu圗)iNrEu噑)iOrEu噴)iPrEr)iQrEu壮)iRrEu城)iSrEu埴)iTrEu堍)iUrEu型)iVrEu堲)iWrEu報)iXrEu墬)iYrEu𡓤)iZrEu売)i[rEu壷)i\rEu夆)i]rEr)i^rEu夢)i_rEu奢)i`rEu𡚨)iarEu𡛪)ibrEu姬)icrEu娛)idrEu娧)ierEu姘)ifrEu婦)igrEu㛮)ihr)iirEu嬈)ijrEu嬾)ilrEu𡧈)imrEu寃)inrEu寘)iorEr)iprEu寳)iqrEu𡬘)irrEu寿)isrEu将)itr)iurEr)ivrEu㞁)iwrEu屠)ixrEr)iyrEu峀)izrEu岍)i{rEu𡷤)i|rEu嵃)i}rEu𡷦)i~rEu嵮)irEu嵫)irEu嵼)irEu巡)irEu巢)irEu㠯)irEu巽)irEu帨)irEu帽)irEu幩)irEu㡢)irEu𢆃rrrrr_seg_73srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEu㡼)irEu庰)irEu庳)irEu庶)irEr)irEu𪎒)irEr)irEu𢌱)irE舁)irEu弢)irEu㣇)irEu𣊸)irEu𦇚)irEu形)irEu彫)irEu㣣)irEu徚)irEu忍)irEu志)irEu忹)irEu悁)irEu㤺)irEu㤜)irEr)irEu𢛔)irEu惇)irEu慈)irE慌)irEr)irEr)irEu慺)irEr)irEu憲)irEu憤)irEu憯)irEu懞)irEr)irEr)irEu成)irEu戛)irEu扝)irEu抱)irEu拔)irEu捐)irEu𢬌)irEu挽)irEu拼)irEu捨)irEu掃)irEu揤)irEu𢯱)irEu搢)irEu揅)irEu掩)irEu㨮)irEu摩)irEu摾)irEu撝)irEu摷)irEu㩬)irEr)irEu敬)irEu𣀊)irEu旣)irEu書)irEu晉)irEu㬙)irEr)irEu㬈)irEu㫤)irEu冒)irEu冕)irEu最)irEu暜)irEu肭)irEu䏙)irEr)irEr)irEu朡)irEu杞)irEu杓)irEu𣏃)irEu㭉)irEu柺)irEu枅)irEu桒)irEr)irEu𣑭)irEu梎)irEu栟)irEu椔)irEr)irEu楂)irEu榣)irEu槪)irEu檨)irEu𣚣)irEu櫛)irEu㰘)irEu次rrrrr_seg_74srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEu𣢧)irEu歔)irEu㱎)irEu歲)irEu殟)irEr)irEu殻)irEu𣪍)irEu𡴋)irEu𣫺)irEu汎)irEu𣲼)irEu沿)irEu泍)irEu汧)irEu洖)irEu派)irEr)irEr)irEu浩)irEu浸)irEu涅)irEu𣴞)irEu洴)irEu港)i rEu湮)i rEu㴳)i rEr)i rEu滇)i rEu𣻑)irEu淹)irEu潮)irEu𣽞)irEu𣾎)irEu濆)irEu瀹)irEr)irEu瀛)irEu㶖)irEu灊)irEu災)irEu灷)irEu炭)irEu𠔥)irEu煅)irEu𤉣)irEu熜)ir)i rEu爨)i!rEr)i"rEu牐)i#rEu𤘈)i$rEu犀)i%rEu犕)i&rEu𤜵)i'rEu𤠔)i(rEu獺)i)rEu王)i*rEu㺬)i+rEu玥)i,rEu㺸)i.rEu瑇)i/rEu瑜)i0rEr)i1rEu璅)i2rEu瓊)i3rEu㼛)i4rEu甤)i5rEu𤰶)i6rEu甾)i7rEu𤲒)i8rEr)i9rEu𢆟)i:rEu瘐)i;rEu𤾡)i<rEu𤾸)i=rEu𥁄)i>rEu㿼)i?rEu䀈)i@rEr)iArEu𥃳)iBrEu𥃲)iCrEu𥄙)iDrEu𥄳)iErEu眞)iFrEu真)iHrEr)iIrEr)iJrEu瞋)iKrEu䁆)iLrEu䂖)iMrEu𥐝)iNrEu硎)iOrEr)iPrEr)iQrEu䃣)iRrEu𥘦)iSrEr)iTrEu𥚚)iUrEu𥛅rrrrr_seg_75srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)iVrEr)iWrEu秫)iXrEu䄯)iYrEr)iZrEu穊)i[rEu穏)i\rEu𥥼)i]rEu𥪧)i_r)i`rEu䈂)iarEu𥮫)ibrEu篆)icrEu築)idrEu䈧)ierEu𥲀)ifrEu糒)igrEu䊠)ihrEu糨)iirEu糣)ijrEu紀)ikrEu𥾆)ilrEu絣)imrEu䌁)inrEu緇)iorEu縂)iprEu繅)iqrEu䌴)irrEu𦈨)isrEu𦉇)itrEu䍙)iurEu𦋙)ivrEu罺)iwrEu𦌾)ixrEu羕)iyrEu翺)izrEr)i{rEu𦓚)i|rEu𦔣)i}rEu聠)i~rEu𦖨)irEu聰)irEu𣍟)irEu䏕)irEu育)irEu脃)irEu䐋)irEu脾)irEu媵)irEu𦞧)irEu𦞵)irEu𣎓)irEu𣎜)irEr)irEu舄)irEu辞)irEu䑫)irEu芑)irEu芋)irEu芝)irEu劳)irEu花)irEu芳)irEu芽)irEu苦)irEu𦬼)irEr)irEu茝)irEu荣)irEu莭)irEu茣)irEu莽)irEu菧)irEr)irEu荓)irEu菊)irEu菌)irEu菜)irEu𦰶)irEu𦵫)irEu𦳕)irEu䔫)irEu蓱)irEu蓳)irEu蔖)irEu𧏊)irEu蕤)irEu𦼬)irEu䕝)irEu䕡)irEu𦾱)irEu𧃒)irEu䕫)irEu虐)irEr)irEu虧)irEu虩)irEu蚩)irEu蚈)irEu蜎)irEu蛢rrrrr_seg_76srcdCsddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddgdS)eN)irEr)irEu蜨)irEu蝫)irEu螆)ir)irEu蟡)irEu蠁)irEu䗹)irEu衠)irEr)irEu𧙧)irEu裗)irEu裞)irEu䘵)irEu裺)irEu㒻)irEu𧢮)irEu𧥦)irEu䚾)irEu䛇)irEu誠)irEr)irEr)irEr")irEu𧲨)irEu貫)irEu賁)irEu贛)irEu起)irEu𧼯)irEu𠠄)irEu跋)irEu趼)irEu跰)irEu𠣞)irEu軔)irEr)irEu𨗒)irEu𨗭)irEu邔)irEu郱)irEu鄑)irEu𨜮)irEu鄛)irEu鈸)irEu鋗)irEu鋘)irEu鉼)irEu鏹)irEu鐕)irEu𨯺)irEu開)irEu䦕)irEu閷)irEu𨵷)irEu䧦)irEu雃)irEu嶲)irEu霣)irEu𩅅)irEu𩈚)irEu䩮)irEu䩶)irEu韠)irEu𩐊)irEu䪲)irEu𩒖)irEr)irEu頩)irEu𩖶)irEu飢)irEu䬳)irEu餩)irEu馧)irEu駂)irEu駾)irEu䯎)i rEu𩬰)i rEr)i rEu鱀)i rEu鳽)i rEu䳎)irEu䳭)irEu鵧)irEu𪃎)irEu䳸)irEu𪄅)irEu𪈎)irEu𪊑)irEr))irEu䵖)irEr*)irEu黾)irEu鼅)irEu鼏)irEu鼖)irEr+)irEu𪘀)ir)irrrrrr_seg_77PsrcCsdgS)N)irrrrrr_seg_78srN)S__doc__ __version__rrrLrTr_rerrrrrrrrrrrrrrrrrrrrrr r7rirjrqrrrrrrrrrrrrr/rarjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrtupleZ uts46datarrrrshhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNPKd]](idna/__pycache__/__init__.cpython-38.pycnu[U ʗReQ@sddlmZddlmZmZmZmZmZmZm Z m Z m Z m Z m Z mZmZmZmZmZmZmZddlmZdddddd d d d d dddddddddgZdS)) __version__) IDNABidiError IDNAErrorInvalidCodepointInvalidCodepointContextalabel check_bidicheck_hyphen_okcheck_initial_combiner check_label check_nfcdecodeencodeulabel uts46_remapvalid_contextjvalid_contextovalid_label_lengthvalid_string_length)intranges_containrrrrrrr r r r r rrrrrrrrN) package_datarcorerrrrrrr r r r r rrrrrrr intrangesr__all__rr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/idna/__init__.pys, P PKd]3 3 %idna/__pycache__/codec.cpython-38.pycnu[U ʗRe. @sddlmZmZmZmZmZddlZddlZddlm Z m Z e dZ Gdddej Z Gdd d ejZGd d d ejZGd d d e ejZGddde ejZejdddZdS))encodedecodealabelulabel IDNAErrorN)TupleOptionalu [.。.。]c@sDeZdZdeeeeefdddZd eeeeefdddZdS) Codecstrict)dataerrorsreturncCs.|dkrtd||sdSt|t|fS)Nr Unsupported error handling "{}")r)rformatrlenselfr r r/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/idna/codec.pyr s z Codec.encodecCs.|dkrtd||sdSt|t|fS)Nr rr)rrrrrrrrrs z Codec.decodeN)r )r ) __name__ __module__ __qualname__strrbytesintrrrrrrr s r c@s(eZdZeeeeeefdddZdS)IncrementalEncoderr r finalrc Cs|dkrtd||sdSt|}d}|rV|dsDd}|d=n|sV|d=|rVd}g}d}|D]*}|t||r|d7}|t|7}qbd||} |t|7}| |fS Nr rrr.rr)rr_unicode_dots_resplitappendrrjoin rr r r!labels trailing_dotresultsizelabelZ result_strrrr_buffer_encodes0  z!IncrementalEncoder._buffer_encodeN)rrrrboolrrr/rrrrrsrc@s(eZdZeeeeeefdddZdS)IncrementalDecoderr c Cs|dkrtd||sdSt|}d}|rV|dsDd}|d=n|sV|d=|rVd}g}d}|D]*}|t||r|d7}|t|7}qbd||} |t|7}| |fSr")rrr%r&r'rrr(r)rrr_buffer_decode>s0  z!IncrementalDecoder._buffer_decodeN)rrrrr0rrr2rrrrr1=sr1c@s eZdZdS) StreamWriterNrrrrrrrr3^sr3c@s eZdZdS) StreamReaderNr4rrrrr5bsr5)rc Cs tjdtjtjttttdS)Nidna)namerrincrementalencoderincrementaldecoder streamwriter streamreader) codecs CodecInfor rrrr1r3r5rrrr getregentryfsr>)corerrrrrr<retypingrr compiler%r BufferedIncrementalEncoderrBufferedIncrementalDecoderr1r3r5r=r>rrrrs !!PKd]`Z2idna/__pycache__/package_data.cpython-38.opt-1.pycnu[U .e@sdZdS)z2.8N) __version__rrA/usr/lib/python3.8/site-packages/pip/_vendor/idna/package_data.pyPKd]Z3QQ,idna/__pycache__/compat.cpython-38.opt-1.pycnu[U .e@s,ddlTddlTddZddZddZdS) )*cCst|SN)encodeZlabelr;/usr/lib/python3.8/site-packages/pip/_vendor/idna/compat.pyToASCIIsrcCst|Sr)decoderrrr ToUnicodesr cCs tddS)Nz,IDNA 2008 does not utilise nameprep protocol)NotImplementedError)srrrnameprep sr N)Zcorecodecrr r rrrrsPKd]1j%%&idna/__pycache__/compat.cpython-38.pycnu[U ʗReA@s\ddlTddlTddlmZmZeedddZeeefedddZ ed d d d Z d S) )*)AnyUnion)labelreturncCst|SN)encoderr /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/idna/compat.pyToASCIIsr cCst|Sr)decoder r r r ToUnicodesrN)srcCs tddS)Nz,IDNA 2008 does not utilise nameprep protocol)NotImplementedError)rr r r nameprep sr) corecodectypingrrstrbytesr bytearrayrrr r r r s PKd]m*aSaS.idna/__pycache__/idnadata.cpython-38.opt-1.pycnu[U .eß@sdZddddddZddddddddddd d d d dd dd dddddd d d d dddddddddddddd dddddddd ddddd d d dd d d ddddddddddddddddd d d d d d d d d d d d d d d d d d ddddddddddddddddddddddddddddddddddddddd ddd d d d d d d d d dd dd ddd d d dd d ddddd d dddd d d d d ddddd dddddddddd dd dd ddd d dddddddddddd d d dddddddddddddddd d ddddd dd d dddd d dddddddddddddddddddddddddddddddddddddddd d dddddd d dd ddddddddddd dddddddddddd dd d ddddddddddd d d dd ddd d dddddd dddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d ddddddddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddd ddddddd dd dd d ddd d d d d d ddddd dddddd dddd ddd ddddd dd dd d d dddd ddd dd d dd d d d d dddd dddddddddddddddddddddddddddddddddd ddddd dddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd ZddddZdS)z11.0.0)$lt lx l~ l lll l0l8lll+tlbtulkulvl|l`|lF|lN }X@}lZd}l\l}l^t}l~|}l~l~llXltlll'!lf+-lllFRH)l.:l.l:l/<l0@l0@l*0@l<0@MP8lnzdlzi&578]N`k:lz`) lD@ll7{tll={ll?{llB{mlE{ mlP{m)0Al0tBl1@ lrH)0Bl1C2Gl2@KlX3Llp}l}l0@ )ZGreekZHanZHebrewZHiraganaZKatakanaUDRCTL(iiiiiiii i i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJinioiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/iMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXi`iaibicidieifigihiiijiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisitiuiviwixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i/ if ig ih ii i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisi i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i! i" i# i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiQiRiSiTiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiC(ql.l:l{l|lll lll $l ,l4l<lDlLlTl\ldllltl |l"l$l&l(l*l,l.l0l2l6l9l;l=l?lClElGlI lL,lN4lP<lRDlTLlVTlX\lZdl\ll^tl`|lbldlflhljlllnlplrltlvlxl{l}lll ll l0lHlTldlxllllllllllll8l@lHlPlXl`lhlpl|lllllllllllllll lll $l ,l4l<lDlLlTl\ldllltl |l"l$l&l(l*l,l.l0l2l:l=lAlC lH lJ$ lL, lN4 l< l l l l l@ lC lO lp@ lr lt lx l~ l@ll\ldllltl|llllllllllll`lbldlflhljlllnlplrltlvlxlzl|l~lll l,l4l<lDlLlTl\ldllltl|llllllllllllllllllll l(l0l8lDlLlTl\ldllltl|llllllllllllllllll lll $l ,l4l<lDlLlTl\ldllltl |l"l$l&l(l*l,l.l0lZdll lDllllr ll@l@l`lullTl|lllK@l4lll. l\!lk!l"l"lL#lX #ld %lp %l %l &l <&l L&l &l &l &l &l 'l ,'l \'l 'l 'l 'l 'l (l (l <(l) L(l1 (l3 (l6 (l: (l= (lC (lI )lN ,)lR D)l] p)lv )l *l *l <*l L*l *l *l *l *l +l ,+l @+l +l +l +l ,l ,l <,l) L,l1 ,l4 ,l: ,lE ,lI -lN ,-lX X-ld |-lp -lr -l .l .l 8.l H.l d.l p.l x.l .l .l .l .l /l (/l @/l \/l /l 0l 80l) H0l: 0lE 0lI 1lN (1lW T1l[ `1ld 1lp 1l 2l 2l 82l H2l 2l 2l 2l 3l (3l T3l x3l 3l 3l 3l 4l 4l 84lE H4lI 5lO (5lX P5ld |5lp 5l 5l 6l 6l h6l 6l 6l 7l (7l <7l X7l `7l 7l 7l38l;8lO9lZ@9l:l:l:l(:l4:lP:ld:l:l:l:l:l:l:l:l;l;l ;l@;lx;ll>lP>ld>lx>l>l>l>l>l?lJ@l@Al@ClClIHlN(IlW@IlY`Il^hIlIl(Jl@JlJlJlKlKl Kl`KlHLl[`Ll`tMlNlNlmPlYlZlZl[l \l8\l5\lT]lm]lq]lt]l^l^l\_lp_l_l@`ly`lblbldl,dl<dlneluelflfl@glhl_hl}ilil@jljljlLllZ@mltmlnl8plJql~4ql@slPsl,tl0tl<tlO8ulxululwlwlxl xlxlxl $xl ,xl4xlxl@xlBylD ylFylHylJ$ylL,ylN4ylP'l@'lB'lD' lF'lH'lJ'$lL',lN'4lP'<lR'DlT'LlV'TlX'\lZ'dl\'ll^'tl`'|lb'ld'lf'lh'lj'll'ln'lp'ly'l{'l}'l'l'l' l'l'l'0l'8l'Dl'Ll'\l'dl'll'tl'|l'l'l'l'l'l'l'l'l'l'l((lt(!l("l(@#l(#l(#l.)#lT)$l)&l)<'l)'l7*(lN*)lZ*@)lw*)l*)l*l+l*+l*+l+,l+$,l+D,l'+,l/+,l[+,lf+-l+/l+/l+/lW0lz8hlzDhlzLhl z|hl"zhl%zhl*zhl{xll0~xlt~yl l'4l;l>lNl^@lll l l l  lA lJ l{@ lll lll`l(ldl7lVlhl l  l6( l9 l= lV lw!l"l#l#l $l: $l &l &l (l (l 0(l T(l6 d(l; (l@ (l} )l *l +l $+l6 ,lV -ls -l .lI 0l 3l( 4l: 4l<l(<lQ<lG@lpAlAl@ClCl5Dl@DlGElt@ElwElFl$Gl@GlpGlHl8LHl?HlJl Jl(JltlHtlZ@ulfuliulul@vlLvlvl{l# lD% l/4@ lGF l9j l_j) ljj) lj@+ lj+ l7k, lDk- lZk@- lxk- lk- ln9 lEo< lo@= lo<> lo? l@ l  l1@ l2E lk<p l}<q l<r l<@r l<tr l7ZhlmZhlvZilZjlZljlZjl`l` l"`ll%`l+`lh lh@#lKi$lZi@%rrrrr)l 0)llv lljll0C)ZPVALIDZCONTEXTJZCONTEXTON) __version__ZscriptsZ joining_typesZcodepoint_classesrr=/usr/lib/python3.8/site-packages/pip/_vendor/idna/idnadata.pys & Wh{PKd]o;U*Z*Z(idna/__pycache__/idnadata.cpython-38.pycnu[U ʗRe=@sdZddddddZddddddddddd d d d dd dd dddddd d d d dddddddddddddd dddddddd ddddd d d dd d d ddddddddddddddddd d d d d d d d d d d d d d d d d d ddddddddddddddddddddddddddddddddddddddd ddd d d d d d d d d dd dd ddd d d dd d ddddd d dddd d d d d ddddd dddddddddd dd dd ddd d dddddddddddd d d dddddddddddddddd d ddddd dd d dddd d dddddddddddddddddddddddddddddddddddddddd d dddddd d dd ddddddddddd dd d d dddddddd dd d d d d d d d d d d d d d d d d d d d d d d d ddddddddd ddddddddddddd d d dd ddd d ddddddd ddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d ddddddddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddd ddddddd dd dd d ddd d d d d d ddddd dddddd dddd ddd ddddd dd dd d d dddd ddd dd d dd d d d d dddd dddddddddddddddddddddddddddddddddd ddddd dddddddddddddddddddddd ddddd d ddddddddddddddddd d d ddd d ddd ddddd d dddddd dd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d i?i@iAiBiCiDiEiFiGiHiIiJinioiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/iMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXi`iaibicidieifigihiiijipiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisitiuiviwixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i/ if ig ih ii i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisi i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i! i" i# i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiQiRiSiTipiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiK(l.l:l{l|lll lll $l ,l4l<lDlLlTl\ldllltl |l"l$l&l(l*l,l.l0l2l6l9l;l=l?lClElGlI lL,lN4lP<lRDlTLlVTlX\lZdl\ll^tl`|lbldlflhljlllnlplrltlvlxl{l}lll ll l0lHlTldlxllllllllllll8l@lHlPlXl`lhlpl|lllllllllllllll lll $l ,l4l<lDlLlTl\ldllltl |l"l$l&l(l*l,l.l0l2l:l=lAlC lH lJ$ lL, lN4 l< l l l l l@ lC lO lp@ lr lt lx l~ l@ll\ldllltl|llllllllllll`lbldlflhljlllnlplrltlvlxlzl|l~lll l,l4l<lDlLlTl\ldllltl|llllllllllllllllllll l(l0l8lDlLlTl\ldllltl|llllllllllllllllll lll $l ,l4l<lDlLlTl\ldllltl |l"l$l&l(l*l,l.l0lZdll lDllllr ll@l@l`lullTl|lllK@l4lll. l\!lk!l!l$"l`"lX #ld %lp %l %l &l <&l L&l &l &l &l &l 'l ,'l \'l 'l 'l 'l 'l (l (l <(l) L(l1 (l3 (l6 (l: (l= (lC (lI )lN ,)lR D)l] p)lv )l *l *l <*l L*l *l *l *l *l +l ,+l @+l +l +l +l ,l ,l <,l) L,l1 ,l4 ,l: ,lE ,lI -lN ,-lX T-ld |-lp -lr -l .l .l 8.l H.l d.l p.l x.l .l .l .l .l /l (/l @/l \/l /l 0l 80l) H0l: 0lE 0lI 1lN (1lW T1l[ `1l^ t1ld 1lp 1l 2l 2l 82l H2l 2l 2l 2l 3l (3l T3l t3l 3l 3l 3l 4l 84lE H4lI 5lO (5lX P5ld |5lp 5l 5l 6l 6l h6l 6l 6l 7l (7l <7l X7l `7l 7l 7l38l;8lO9lZ@9l:l:l:l0:l:l:l:l;l;l ;l@;lx;ll>lP>ld>lx>l>l>l>l>l?lJ@l@Al@ClClIHlN(IlW@IlY`Il^hIlIl(Jl@JlJlJlKlKl Kl`KlHLl[`Ll`tMlNlNlmPlYlZlZl[l\l5|\lT]lm]lq]lt]l^l^l\_lp_l_l@`ly`lblbldl,dl<dlneluelflfl@glhl_hl}ilil@jljljljlMllZ@mltmlnl8plJql~4ql@slPsl,tl0tl<tlO8ulxululwlxl xlxlxl $xl ,xl4xlxl@xlBylD ylFylHylJ$ylL,ylN4ylP'l@'lB'lD' lF'lH'lJ'$lL',lN'4lP'<lR'DlT'LlV'TlX'\lZ'dl\'ll^'tl`'|lb'ld'lf'lh'lj'll'ln'lp'ly'l{'l}'l'l'l' l'l'l'0l'8l'Dl'Ll'\l'dl'll'tl'|l'l'l'l'l'l'l'l'l'l'l'l'l'l' l' l'(l'Dl'Ll'Tl'\l'dl'l'l((l-( lt(!l("l(@#l(#l(#l.)#lT)$l)&l)<'l)'l7*(lN*)lZ*@)lw*)l*)l*l+l*+l*+l+,l+$,l+D,l'+,l/+,l[+,lj+-l+/l+/l+/lW0lz8hlzDhlzLhl z|hl"zhl%zhl*zhl{xll0~xlt~yl l'4l;l>lNl^@lll l l l  lA lJ l{@ lll lll`l(ldl\llll7lVlhllll l  l6( l9 l= lV lw!l"l#l#l $l: $l &l &l (l (l 0(l T(l6 d(l; (l@ (l} )l *l +l $+l6 ,lV -ls -l .lI 0l 3l( 4l: 4l:l:l:l<l(<lQ<l=l>l?lG@lvAlAlCl@ClCl5Dl@DlHElt@ElwElFl$Gl8GlpGlHl8LHl?HlJl Jl(JltlHtlZ@ulfuliulul@vlLvlvl{l~l# lD% l/@> l/4@ lGF l9j l_j) ljj) lj) lj+ lj@+ lj+ l7k, lDk- lZk@- lxk- lk- ln9 lKo< lo<= lo<> lo? lo? rl@ l  l 4 rrrl#1@ r rl2E lk<p l}<q l<r l<@r l<tr l.O<lGO<l7ZhlmZhlvZilZjlZljlZjl_|l`l` l"`ll%`l+`l-al>alJalOa8lb@ lb lglglglglh lh@#lLi$lZi@%l{orrrrrr )l 0)llv lljll0C)PVALIDCONTEXTJCONTEXTON) __version__scripts joining_typescodepoint_classesr%r%/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/idna/idnadata.pys& `E5PKd]0.idna/__pycache__/__init__.cpython-38.opt-1.pycnu[U .e:@sddlmZddlTdS)) __version__)*N)Z package_datarZcorerr=/usr/lib/python3.8/site-packages/pip/_vendor/idna/__init__.pys PKd]Xx/idna/__pycache__/intranges.cpython-38.opt-1.pycnu[U .e@s0dZddlZddZddZddZd d ZdS) a  Given a list of integers, made up of (hopefully) a small number of long runs of consecutive integers, compute a representation of the form ((start1, end1), (start2, end2) ...). Then answer the question "was x present in the original list?" in time O(log(# runs)). NcCst|}g}d}tt|D]b}|dt|krJ||||ddkrJq||d|d}|t|d|dd|}qt|S)aRepresent a list of integers as a sequence of ranges: ((start_0, end_0), (start_1, end_1), ...), such that the original integers are exactly those x such that start_i <= x < end_i for some i. Ranges are encoded as single integers (start << 32 | end), not as tuples. r)sortedrangelenappend _encode_rangetuple)Zlist_Z sorted_listrangesZ last_writeiZ current_ranger >/usr/lib/python3.8/site-packages/pip/_vendor/idna/intranges.pyintranges_from_list srcCs |d>|BS)N r )startendr r r rsrcCs|d?|d@fS)Nrlr )rr r r _decode_range"srcCszt|d}t||}|dkrNt||d\}}||krF|krNnndS|t|krvt||\}}||krvdSdS)z=Determine if `int_` falls into one of the ranges in `ranges`.rrTF)rbisectZ bisect_leftrr)Zint_r Ztuple_posleftright_r r r intranges_contain&s   r)__doc__rrrrrr r r r s PKd]>3IVddidna/uts46data.pynu[# This file is automatically generated by tools/idna-data # vim: set fileencoding=utf-8 : """IDNA Mapping Table from UTS46.""" __version__ = "13.0.0" def _seg_0(): return [ (0x0, '3'), (0x1, '3'), (0x2, '3'), (0x3, '3'), (0x4, '3'), (0x5, '3'), (0x6, '3'), (0x7, '3'), (0x8, '3'), (0x9, '3'), (0xA, '3'), (0xB, '3'), (0xC, '3'), (0xD, '3'), (0xE, '3'), (0xF, '3'), (0x10, '3'), (0x11, '3'), (0x12, '3'), (0x13, '3'), (0x14, '3'), (0x15, '3'), (0x16, '3'), (0x17, '3'), (0x18, '3'), (0x19, '3'), (0x1A, '3'), (0x1B, '3'), (0x1C, '3'), (0x1D, '3'), (0x1E, '3'), (0x1F, '3'), (0x20, '3'), (0x21, '3'), (0x22, '3'), (0x23, '3'), (0x24, '3'), (0x25, '3'), (0x26, '3'), (0x27, '3'), (0x28, '3'), (0x29, '3'), (0x2A, '3'), (0x2B, '3'), (0x2C, '3'), (0x2D, 'V'), (0x2E, 'V'), (0x2F, '3'), (0x30, 'V'), (0x31, 'V'), (0x32, 'V'), (0x33, 'V'), (0x34, 'V'), (0x35, 'V'), (0x36, 'V'), (0x37, 'V'), (0x38, 'V'), (0x39, 'V'), (0x3A, '3'), (0x3B, '3'), (0x3C, '3'), (0x3D, '3'), (0x3E, '3'), (0x3F, '3'), (0x40, '3'), (0x41, 'M', u'a'), (0x42, 'M', u'b'), (0x43, 'M', u'c'), (0x44, 'M', u'd'), (0x45, 'M', u'e'), (0x46, 'M', u'f'), (0x47, 'M', u'g'), (0x48, 'M', u'h'), (0x49, 'M', u'i'), (0x4A, 'M', u'j'), (0x4B, 'M', u'k'), (0x4C, 'M', u'l'), (0x4D, 'M', u'm'), (0x4E, 'M', u'n'), (0x4F, 'M', u'o'), (0x50, 'M', u'p'), (0x51, 'M', u'q'), (0x52, 'M', u'r'), (0x53, 'M', u's'), (0x54, 'M', u't'), (0x55, 'M', u'u'), (0x56, 'M', u'v'), (0x57, 'M', u'w'), (0x58, 'M', u'x'), (0x59, 'M', u'y'), (0x5A, 'M', u'z'), (0x5B, '3'), (0x5C, '3'), (0x5D, '3'), (0x5E, '3'), (0x5F, '3'), (0x60, '3'), (0x61, 'V'), (0x62, 'V'), (0x63, 'V'), ] def _seg_1(): return [ (0x64, 'V'), (0x65, 'V'), (0x66, 'V'), (0x67, 'V'), (0x68, 'V'), (0x69, 'V'), (0x6A, 'V'), (0x6B, 'V'), (0x6C, 'V'), (0x6D, 'V'), (0x6E, 'V'), (0x6F, 'V'), (0x70, 'V'), (0x71, 'V'), (0x72, 'V'), (0x73, 'V'), (0x74, 'V'), (0x75, 'V'), (0x76, 'V'), (0x77, 'V'), (0x78, 'V'), (0x79, 'V'), (0x7A, 'V'), (0x7B, '3'), (0x7C, '3'), (0x7D, '3'), (0x7E, '3'), (0x7F, '3'), (0x80, 'X'), (0x81, 'X'), (0x82, 'X'), (0x83, 'X'), (0x84, 'X'), (0x85, 'X'), (0x86, 'X'), (0x87, 'X'), (0x88, 'X'), (0x89, 'X'), (0x8A, 'X'), (0x8B, 'X'), (0x8C, 'X'), (0x8D, 'X'), (0x8E, 'X'), (0x8F, 'X'), (0x90, 'X'), (0x91, 'X'), (0x92, 'X'), (0x93, 'X'), (0x94, 'X'), (0x95, 'X'), (0x96, 'X'), (0x97, 'X'), (0x98, 'X'), (0x99, 'X'), (0x9A, 'X'), (0x9B, 'X'), (0x9C, 'X'), (0x9D, 'X'), (0x9E, 'X'), (0x9F, 'X'), (0xA0, '3', u' '), (0xA1, 'V'), (0xA2, 'V'), (0xA3, 'V'), (0xA4, 'V'), (0xA5, 'V'), (0xA6, 'V'), (0xA7, 'V'), (0xA8, '3', u' ̈'), (0xA9, 'V'), (0xAA, 'M', u'a'), (0xAB, 'V'), (0xAC, 'V'), (0xAD, 'I'), (0xAE, 'V'), (0xAF, '3', u' ̄'), (0xB0, 'V'), (0xB1, 'V'), (0xB2, 'M', u'2'), (0xB3, 'M', u'3'), (0xB4, '3', u' ́'), (0xB5, 'M', u'μ'), (0xB6, 'V'), (0xB7, 'V'), (0xB8, '3', u' ̧'), (0xB9, 'M', u'1'), (0xBA, 'M', u'o'), (0xBB, 'V'), (0xBC, 'M', u'1⁄4'), (0xBD, 'M', u'1⁄2'), (0xBE, 'M', u'3⁄4'), (0xBF, 'V'), (0xC0, 'M', u'à'), (0xC1, 'M', u'á'), (0xC2, 'M', u'â'), (0xC3, 'M', u'ã'), (0xC4, 'M', u'ä'), (0xC5, 'M', u'å'), (0xC6, 'M', u'æ'), (0xC7, 'M', u'ç'), ] def _seg_2(): return [ (0xC8, 'M', u'è'), (0xC9, 'M', u'é'), (0xCA, 'M', u'ê'), (0xCB, 'M', u'ë'), (0xCC, 'M', u'ì'), (0xCD, 'M', u'í'), (0xCE, 'M', u'î'), (0xCF, 'M', u'ï'), (0xD0, 'M', u'ð'), (0xD1, 'M', u'ñ'), (0xD2, 'M', u'ò'), (0xD3, 'M', u'ó'), (0xD4, 'M', u'ô'), (0xD5, 'M', u'õ'), (0xD6, 'M', u'ö'), (0xD7, 'V'), (0xD8, 'M', u'ø'), (0xD9, 'M', u'ù'), (0xDA, 'M', u'ú'), (0xDB, 'M', u'û'), (0xDC, 'M', u'ü'), (0xDD, 'M', u'ý'), (0xDE, 'M', u'þ'), (0xDF, 'D', u'ss'), (0xE0, 'V'), (0xE1, 'V'), (0xE2, 'V'), (0xE3, 'V'), (0xE4, 'V'), (0xE5, 'V'), (0xE6, 'V'), (0xE7, 'V'), (0xE8, 'V'), (0xE9, 'V'), (0xEA, 'V'), (0xEB, 'V'), (0xEC, 'V'), (0xED, 'V'), (0xEE, 'V'), (0xEF, 'V'), (0xF0, 'V'), (0xF1, 'V'), (0xF2, 'V'), (0xF3, 'V'), (0xF4, 'V'), (0xF5, 'V'), (0xF6, 'V'), (0xF7, 'V'), (0xF8, 'V'), (0xF9, 'V'), (0xFA, 'V'), (0xFB, 'V'), (0xFC, 'V'), (0xFD, 'V'), (0xFE, 'V'), (0xFF, 'V'), (0x100, 'M', u'ā'), (0x101, 'V'), (0x102, 'M', u'ă'), (0x103, 'V'), (0x104, 'M', u'ą'), (0x105, 'V'), (0x106, 'M', u'ć'), (0x107, 'V'), (0x108, 'M', u'ĉ'), (0x109, 'V'), (0x10A, 'M', u'ċ'), (0x10B, 'V'), (0x10C, 'M', u'č'), (0x10D, 'V'), (0x10E, 'M', u'ď'), (0x10F, 'V'), (0x110, 'M', u'đ'), (0x111, 'V'), (0x112, 'M', u'ē'), (0x113, 'V'), (0x114, 'M', u'ĕ'), (0x115, 'V'), (0x116, 'M', u'ė'), (0x117, 'V'), (0x118, 'M', u'ę'), (0x119, 'V'), (0x11A, 'M', u'ě'), (0x11B, 'V'), (0x11C, 'M', u'ĝ'), (0x11D, 'V'), (0x11E, 'M', u'ğ'), (0x11F, 'V'), (0x120, 'M', u'ġ'), (0x121, 'V'), (0x122, 'M', u'ģ'), (0x123, 'V'), (0x124, 'M', u'ĥ'), (0x125, 'V'), (0x126, 'M', u'ħ'), (0x127, 'V'), (0x128, 'M', u'ĩ'), (0x129, 'V'), (0x12A, 'M', u'ī'), (0x12B, 'V'), ] def _seg_3(): return [ (0x12C, 'M', u'ĭ'), (0x12D, 'V'), (0x12E, 'M', u'į'), (0x12F, 'V'), (0x130, 'M', u'i̇'), (0x131, 'V'), (0x132, 'M', u'ij'), (0x134, 'M', u'ĵ'), (0x135, 'V'), (0x136, 'M', u'ķ'), (0x137, 'V'), (0x139, 'M', u'ĺ'), (0x13A, 'V'), (0x13B, 'M', u'ļ'), (0x13C, 'V'), (0x13D, 'M', u'ľ'), (0x13E, 'V'), (0x13F, 'M', u'l·'), (0x141, 'M', u'ł'), (0x142, 'V'), (0x143, 'M', u'ń'), (0x144, 'V'), (0x145, 'M', u'ņ'), (0x146, 'V'), (0x147, 'M', u'ň'), (0x148, 'V'), (0x149, 'M', u'ʼn'), (0x14A, 'M', u'ŋ'), (0x14B, 'V'), (0x14C, 'M', u'ō'), (0x14D, 'V'), (0x14E, 'M', u'ŏ'), (0x14F, 'V'), (0x150, 'M', u'ő'), (0x151, 'V'), (0x152, 'M', u'œ'), (0x153, 'V'), (0x154, 'M', u'ŕ'), (0x155, 'V'), (0x156, 'M', u'ŗ'), (0x157, 'V'), (0x158, 'M', u'ř'), (0x159, 'V'), (0x15A, 'M', u'ś'), (0x15B, 'V'), (0x15C, 'M', u'ŝ'), (0x15D, 'V'), (0x15E, 'M', u'ş'), (0x15F, 'V'), (0x160, 'M', u'š'), (0x161, 'V'), (0x162, 'M', u'ţ'), (0x163, 'V'), (0x164, 'M', u'ť'), (0x165, 'V'), (0x166, 'M', u'ŧ'), (0x167, 'V'), (0x168, 'M', u'ũ'), (0x169, 'V'), (0x16A, 'M', u'ū'), (0x16B, 'V'), (0x16C, 'M', u'ŭ'), (0x16D, 'V'), (0x16E, 'M', u'ů'), (0x16F, 'V'), (0x170, 'M', u'ű'), (0x171, 'V'), (0x172, 'M', u'ų'), (0x173, 'V'), (0x174, 'M', u'ŵ'), (0x175, 'V'), (0x176, 'M', u'ŷ'), (0x177, 'V'), (0x178, 'M', u'ÿ'), (0x179, 'M', u'ź'), (0x17A, 'V'), (0x17B, 'M', u'ż'), (0x17C, 'V'), (0x17D, 'M', u'ž'), (0x17E, 'V'), (0x17F, 'M', u's'), (0x180, 'V'), (0x181, 'M', u'ɓ'), (0x182, 'M', u'ƃ'), (0x183, 'V'), (0x184, 'M', u'ƅ'), (0x185, 'V'), (0x186, 'M', u'ɔ'), (0x187, 'M', u'ƈ'), (0x188, 'V'), (0x189, 'M', u'ɖ'), (0x18A, 'M', u'ɗ'), (0x18B, 'M', u'ƌ'), (0x18C, 'V'), (0x18E, 'M', u'ǝ'), (0x18F, 'M', u'ə'), (0x190, 'M', u'ɛ'), (0x191, 'M', u'ƒ'), (0x192, 'V'), (0x193, 'M', u'ɠ'), ] def _seg_4(): return [ (0x194, 'M', u'ɣ'), (0x195, 'V'), (0x196, 'M', u'ɩ'), (0x197, 'M', u'ɨ'), (0x198, 'M', u'ƙ'), (0x199, 'V'), (0x19C, 'M', u'ɯ'), (0x19D, 'M', u'ɲ'), (0x19E, 'V'), (0x19F, 'M', u'ɵ'), (0x1A0, 'M', u'ơ'), (0x1A1, 'V'), (0x1A2, 'M', u'ƣ'), (0x1A3, 'V'), (0x1A4, 'M', u'ƥ'), (0x1A5, 'V'), (0x1A6, 'M', u'ʀ'), (0x1A7, 'M', u'ƨ'), (0x1A8, 'V'), (0x1A9, 'M', u'ʃ'), (0x1AA, 'V'), (0x1AC, 'M', u'ƭ'), (0x1AD, 'V'), (0x1AE, 'M', u'ʈ'), (0x1AF, 'M', u'ư'), (0x1B0, 'V'), (0x1B1, 'M', u'ʊ'), (0x1B2, 'M', u'ʋ'), (0x1B3, 'M', u'ƴ'), (0x1B4, 'V'), (0x1B5, 'M', u'ƶ'), (0x1B6, 'V'), (0x1B7, 'M', u'ʒ'), (0x1B8, 'M', u'ƹ'), (0x1B9, 'V'), (0x1BC, 'M', u'ƽ'), (0x1BD, 'V'), (0x1C4, 'M', u'dž'), (0x1C7, 'M', u'lj'), (0x1CA, 'M', u'nj'), (0x1CD, 'M', u'ǎ'), (0x1CE, 'V'), (0x1CF, 'M', u'ǐ'), (0x1D0, 'V'), (0x1D1, 'M', u'ǒ'), (0x1D2, 'V'), (0x1D3, 'M', u'ǔ'), (0x1D4, 'V'), (0x1D5, 'M', u'ǖ'), (0x1D6, 'V'), (0x1D7, 'M', u'ǘ'), (0x1D8, 'V'), (0x1D9, 'M', u'ǚ'), (0x1DA, 'V'), (0x1DB, 'M', u'ǜ'), (0x1DC, 'V'), (0x1DE, 'M', u'ǟ'), (0x1DF, 'V'), (0x1E0, 'M', u'ǡ'), (0x1E1, 'V'), (0x1E2, 'M', u'ǣ'), (0x1E3, 'V'), (0x1E4, 'M', u'ǥ'), (0x1E5, 'V'), (0x1E6, 'M', u'ǧ'), (0x1E7, 'V'), (0x1E8, 'M', u'ǩ'), (0x1E9, 'V'), (0x1EA, 'M', u'ǫ'), (0x1EB, 'V'), (0x1EC, 'M', u'ǭ'), (0x1ED, 'V'), (0x1EE, 'M', u'ǯ'), (0x1EF, 'V'), (0x1F1, 'M', u'dz'), (0x1F4, 'M', u'ǵ'), (0x1F5, 'V'), (0x1F6, 'M', u'ƕ'), (0x1F7, 'M', u'ƿ'), (0x1F8, 'M', u'ǹ'), (0x1F9, 'V'), (0x1FA, 'M', u'ǻ'), (0x1FB, 'V'), (0x1FC, 'M', u'ǽ'), (0x1FD, 'V'), (0x1FE, 'M', u'ǿ'), (0x1FF, 'V'), (0x200, 'M', u'ȁ'), (0x201, 'V'), (0x202, 'M', u'ȃ'), (0x203, 'V'), (0x204, 'M', u'ȅ'), (0x205, 'V'), (0x206, 'M', u'ȇ'), (0x207, 'V'), (0x208, 'M', u'ȉ'), (0x209, 'V'), (0x20A, 'M', u'ȋ'), (0x20B, 'V'), (0x20C, 'M', u'ȍ'), ] def _seg_5(): return [ (0x20D, 'V'), (0x20E, 'M', u'ȏ'), (0x20F, 'V'), (0x210, 'M', u'ȑ'), (0x211, 'V'), (0x212, 'M', u'ȓ'), (0x213, 'V'), (0x214, 'M', u'ȕ'), (0x215, 'V'), (0x216, 'M', u'ȗ'), (0x217, 'V'), (0x218, 'M', u'ș'), (0x219, 'V'), (0x21A, 'M', u'ț'), (0x21B, 'V'), (0x21C, 'M', u'ȝ'), (0x21D, 'V'), (0x21E, 'M', u'ȟ'), (0x21F, 'V'), (0x220, 'M', u'ƞ'), (0x221, 'V'), (0x222, 'M', u'ȣ'), (0x223, 'V'), (0x224, 'M', u'ȥ'), (0x225, 'V'), (0x226, 'M', u'ȧ'), (0x227, 'V'), (0x228, 'M', u'ȩ'), (0x229, 'V'), (0x22A, 'M', u'ȫ'), (0x22B, 'V'), (0x22C, 'M', u'ȭ'), (0x22D, 'V'), (0x22E, 'M', u'ȯ'), (0x22F, 'V'), (0x230, 'M', u'ȱ'), (0x231, 'V'), (0x232, 'M', u'ȳ'), (0x233, 'V'), (0x23A, 'M', u'ⱥ'), (0x23B, 'M', u'ȼ'), (0x23C, 'V'), (0x23D, 'M', u'ƚ'), (0x23E, 'M', u'ⱦ'), (0x23F, 'V'), (0x241, 'M', u'ɂ'), (0x242, 'V'), (0x243, 'M', u'ƀ'), (0x244, 'M', u'ʉ'), (0x245, 'M', u'ʌ'), (0x246, 'M', u'ɇ'), (0x247, 'V'), (0x248, 'M', u'ɉ'), (0x249, 'V'), (0x24A, 'M', u'ɋ'), (0x24B, 'V'), (0x24C, 'M', u'ɍ'), (0x24D, 'V'), (0x24E, 'M', u'ɏ'), (0x24F, 'V'), (0x2B0, 'M', u'h'), (0x2B1, 'M', u'ɦ'), (0x2B2, 'M', u'j'), (0x2B3, 'M', u'r'), (0x2B4, 'M', u'ɹ'), (0x2B5, 'M', u'ɻ'), (0x2B6, 'M', u'ʁ'), (0x2B7, 'M', u'w'), (0x2B8, 'M', u'y'), (0x2B9, 'V'), (0x2D8, '3', u' ̆'), (0x2D9, '3', u' ̇'), (0x2DA, '3', u' ̊'), (0x2DB, '3', u' ̨'), (0x2DC, '3', u' ̃'), (0x2DD, '3', u' ̋'), (0x2DE, 'V'), (0x2E0, 'M', u'ɣ'), (0x2E1, 'M', u'l'), (0x2E2, 'M', u's'), (0x2E3, 'M', u'x'), (0x2E4, 'M', u'ʕ'), (0x2E5, 'V'), (0x340, 'M', u'̀'), (0x341, 'M', u'́'), (0x342, 'V'), (0x343, 'M', u'̓'), (0x344, 'M', u'̈́'), (0x345, 'M', u'ι'), (0x346, 'V'), (0x34F, 'I'), (0x350, 'V'), (0x370, 'M', u'ͱ'), (0x371, 'V'), (0x372, 'M', u'ͳ'), (0x373, 'V'), (0x374, 'M', u'ʹ'), (0x375, 'V'), (0x376, 'M', u'ͷ'), (0x377, 'V'), ] def _seg_6(): return [ (0x378, 'X'), (0x37A, '3', u' ι'), (0x37B, 'V'), (0x37E, '3', u';'), (0x37F, 'M', u'ϳ'), (0x380, 'X'), (0x384, '3', u' ́'), (0x385, '3', u' ̈́'), (0x386, 'M', u'ά'), (0x387, 'M', u'·'), (0x388, 'M', u'έ'), (0x389, 'M', u'ή'), (0x38A, 'M', u'ί'), (0x38B, 'X'), (0x38C, 'M', u'ό'), (0x38D, 'X'), (0x38E, 'M', u'ύ'), (0x38F, 'M', u'ώ'), (0x390, 'V'), (0x391, 'M', u'α'), (0x392, 'M', u'β'), (0x393, 'M', u'γ'), (0x394, 'M', u'δ'), (0x395, 'M', u'ε'), (0x396, 'M', u'ζ'), (0x397, 'M', u'η'), (0x398, 'M', u'θ'), (0x399, 'M', u'ι'), (0x39A, 'M', u'κ'), (0x39B, 'M', u'λ'), (0x39C, 'M', u'μ'), (0x39D, 'M', u'ν'), (0x39E, 'M', u'ξ'), (0x39F, 'M', u'ο'), (0x3A0, 'M', u'π'), (0x3A1, 'M', u'ρ'), (0x3A2, 'X'), (0x3A3, 'M', u'σ'), (0x3A4, 'M', u'τ'), (0x3A5, 'M', u'υ'), (0x3A6, 'M', u'φ'), (0x3A7, 'M', u'χ'), (0x3A8, 'M', u'ψ'), (0x3A9, 'M', u'ω'), (0x3AA, 'M', u'ϊ'), (0x3AB, 'M', u'ϋ'), (0x3AC, 'V'), (0x3C2, 'D', u'σ'), (0x3C3, 'V'), (0x3CF, 'M', u'ϗ'), (0x3D0, 'M', u'β'), (0x3D1, 'M', u'θ'), (0x3D2, 'M', u'υ'), (0x3D3, 'M', u'ύ'), (0x3D4, 'M', u'ϋ'), (0x3D5, 'M', u'φ'), (0x3D6, 'M', u'π'), (0x3D7, 'V'), (0x3D8, 'M', u'ϙ'), (0x3D9, 'V'), (0x3DA, 'M', u'ϛ'), (0x3DB, 'V'), (0x3DC, 'M', u'ϝ'), (0x3DD, 'V'), (0x3DE, 'M', u'ϟ'), (0x3DF, 'V'), (0x3E0, 'M', u'ϡ'), (0x3E1, 'V'), (0x3E2, 'M', u'ϣ'), (0x3E3, 'V'), (0x3E4, 'M', u'ϥ'), (0x3E5, 'V'), (0x3E6, 'M', u'ϧ'), (0x3E7, 'V'), (0x3E8, 'M', u'ϩ'), (0x3E9, 'V'), (0x3EA, 'M', u'ϫ'), (0x3EB, 'V'), (0x3EC, 'M', u'ϭ'), (0x3ED, 'V'), (0x3EE, 'M', u'ϯ'), (0x3EF, 'V'), (0x3F0, 'M', u'κ'), (0x3F1, 'M', u'ρ'), (0x3F2, 'M', u'σ'), (0x3F3, 'V'), (0x3F4, 'M', u'θ'), (0x3F5, 'M', u'ε'), (0x3F6, 'V'), (0x3F7, 'M', u'ϸ'), (0x3F8, 'V'), (0x3F9, 'M', u'σ'), (0x3FA, 'M', u'ϻ'), (0x3FB, 'V'), (0x3FD, 'M', u'ͻ'), (0x3FE, 'M', u'ͼ'), (0x3FF, 'M', u'ͽ'), (0x400, 'M', u'ѐ'), (0x401, 'M', u'ё'), (0x402, 'M', u'ђ'), ] def _seg_7(): return [ (0x403, 'M', u'ѓ'), (0x404, 'M', u'є'), (0x405, 'M', u'ѕ'), (0x406, 'M', u'і'), (0x407, 'M', u'ї'), (0x408, 'M', u'ј'), (0x409, 'M', u'љ'), (0x40A, 'M', u'њ'), (0x40B, 'M', u'ћ'), (0x40C, 'M', u'ќ'), (0x40D, 'M', u'ѝ'), (0x40E, 'M', u'ў'), (0x40F, 'M', u'џ'), (0x410, 'M', u'а'), (0x411, 'M', u'б'), (0x412, 'M', u'в'), (0x413, 'M', u'г'), (0x414, 'M', u'д'), (0x415, 'M', u'е'), (0x416, 'M', u'ж'), (0x417, 'M', u'з'), (0x418, 'M', u'и'), (0x419, 'M', u'й'), (0x41A, 'M', u'к'), (0x41B, 'M', u'л'), (0x41C, 'M', u'м'), (0x41D, 'M', u'н'), (0x41E, 'M', u'о'), (0x41F, 'M', u'п'), (0x420, 'M', u'р'), (0x421, 'M', u'с'), (0x422, 'M', u'т'), (0x423, 'M', u'у'), (0x424, 'M', u'ф'), (0x425, 'M', u'х'), (0x426, 'M', u'ц'), (0x427, 'M', u'ч'), (0x428, 'M', u'ш'), (0x429, 'M', u'щ'), (0x42A, 'M', u'ъ'), (0x42B, 'M', u'ы'), (0x42C, 'M', u'ь'), (0x42D, 'M', u'э'), (0x42E, 'M', u'ю'), (0x42F, 'M', u'я'), (0x430, 'V'), (0x460, 'M', u'ѡ'), (0x461, 'V'), (0x462, 'M', u'ѣ'), (0x463, 'V'), (0x464, 'M', u'ѥ'), (0x465, 'V'), (0x466, 'M', u'ѧ'), (0x467, 'V'), (0x468, 'M', u'ѩ'), (0x469, 'V'), (0x46A, 'M', u'ѫ'), (0x46B, 'V'), (0x46C, 'M', u'ѭ'), (0x46D, 'V'), (0x46E, 'M', u'ѯ'), (0x46F, 'V'), (0x470, 'M', u'ѱ'), (0x471, 'V'), (0x472, 'M', u'ѳ'), (0x473, 'V'), (0x474, 'M', u'ѵ'), (0x475, 'V'), (0x476, 'M', u'ѷ'), (0x477, 'V'), (0x478, 'M', u'ѹ'), (0x479, 'V'), (0x47A, 'M', u'ѻ'), (0x47B, 'V'), (0x47C, 'M', u'ѽ'), (0x47D, 'V'), (0x47E, 'M', u'ѿ'), (0x47F, 'V'), (0x480, 'M', u'ҁ'), (0x481, 'V'), (0x48A, 'M', u'ҋ'), (0x48B, 'V'), (0x48C, 'M', u'ҍ'), (0x48D, 'V'), (0x48E, 'M', u'ҏ'), (0x48F, 'V'), (0x490, 'M', u'ґ'), (0x491, 'V'), (0x492, 'M', u'ғ'), (0x493, 'V'), (0x494, 'M', u'ҕ'), (0x495, 'V'), (0x496, 'M', u'җ'), (0x497, 'V'), (0x498, 'M', u'ҙ'), (0x499, 'V'), (0x49A, 'M', u'қ'), (0x49B, 'V'), (0x49C, 'M', u'ҝ'), (0x49D, 'V'), ] def _seg_8(): return [ (0x49E, 'M', u'ҟ'), (0x49F, 'V'), (0x4A0, 'M', u'ҡ'), (0x4A1, 'V'), (0x4A2, 'M', u'ң'), (0x4A3, 'V'), (0x4A4, 'M', u'ҥ'), (0x4A5, 'V'), (0x4A6, 'M', u'ҧ'), (0x4A7, 'V'), (0x4A8, 'M', u'ҩ'), (0x4A9, 'V'), (0x4AA, 'M', u'ҫ'), (0x4AB, 'V'), (0x4AC, 'M', u'ҭ'), (0x4AD, 'V'), (0x4AE, 'M', u'ү'), (0x4AF, 'V'), (0x4B0, 'M', u'ұ'), (0x4B1, 'V'), (0x4B2, 'M', u'ҳ'), (0x4B3, 'V'), (0x4B4, 'M', u'ҵ'), (0x4B5, 'V'), (0x4B6, 'M', u'ҷ'), (0x4B7, 'V'), (0x4B8, 'M', u'ҹ'), (0x4B9, 'V'), (0x4BA, 'M', u'һ'), (0x4BB, 'V'), (0x4BC, 'M', u'ҽ'), (0x4BD, 'V'), (0x4BE, 'M', u'ҿ'), (0x4BF, 'V'), (0x4C0, 'X'), (0x4C1, 'M', u'ӂ'), (0x4C2, 'V'), (0x4C3, 'M', u'ӄ'), (0x4C4, 'V'), (0x4C5, 'M', u'ӆ'), (0x4C6, 'V'), (0x4C7, 'M', u'ӈ'), (0x4C8, 'V'), (0x4C9, 'M', u'ӊ'), (0x4CA, 'V'), (0x4CB, 'M', u'ӌ'), (0x4CC, 'V'), (0x4CD, 'M', u'ӎ'), (0x4CE, 'V'), (0x4D0, 'M', u'ӑ'), (0x4D1, 'V'), (0x4D2, 'M', u'ӓ'), (0x4D3, 'V'), (0x4D4, 'M', u'ӕ'), (0x4D5, 'V'), (0x4D6, 'M', u'ӗ'), (0x4D7, 'V'), (0x4D8, 'M', u'ә'), (0x4D9, 'V'), (0x4DA, 'M', u'ӛ'), (0x4DB, 'V'), (0x4DC, 'M', u'ӝ'), (0x4DD, 'V'), (0x4DE, 'M', u'ӟ'), (0x4DF, 'V'), (0x4E0, 'M', u'ӡ'), (0x4E1, 'V'), (0x4E2, 'M', u'ӣ'), (0x4E3, 'V'), (0x4E4, 'M', u'ӥ'), (0x4E5, 'V'), (0x4E6, 'M', u'ӧ'), (0x4E7, 'V'), (0x4E8, 'M', u'ө'), (0x4E9, 'V'), (0x4EA, 'M', u'ӫ'), (0x4EB, 'V'), (0x4EC, 'M', u'ӭ'), (0x4ED, 'V'), (0x4EE, 'M', u'ӯ'), (0x4EF, 'V'), (0x4F0, 'M', u'ӱ'), (0x4F1, 'V'), (0x4F2, 'M', u'ӳ'), (0x4F3, 'V'), (0x4F4, 'M', u'ӵ'), (0x4F5, 'V'), (0x4F6, 'M', u'ӷ'), (0x4F7, 'V'), (0x4F8, 'M', u'ӹ'), (0x4F9, 'V'), (0x4FA, 'M', u'ӻ'), (0x4FB, 'V'), (0x4FC, 'M', u'ӽ'), (0x4FD, 'V'), (0x4FE, 'M', u'ӿ'), (0x4FF, 'V'), (0x500, 'M', u'ԁ'), (0x501, 'V'), (0x502, 'M', u'ԃ'), ] def _seg_9(): return [ (0x503, 'V'), (0x504, 'M', u'ԅ'), (0x505, 'V'), (0x506, 'M', u'ԇ'), (0x507, 'V'), (0x508, 'M', u'ԉ'), (0x509, 'V'), (0x50A, 'M', u'ԋ'), (0x50B, 'V'), (0x50C, 'M', u'ԍ'), (0x50D, 'V'), (0x50E, 'M', u'ԏ'), (0x50F, 'V'), (0x510, 'M', u'ԑ'), (0x511, 'V'), (0x512, 'M', u'ԓ'), (0x513, 'V'), (0x514, 'M', u'ԕ'), (0x515, 'V'), (0x516, 'M', u'ԗ'), (0x517, 'V'), (0x518, 'M', u'ԙ'), (0x519, 'V'), (0x51A, 'M', u'ԛ'), (0x51B, 'V'), (0x51C, 'M', u'ԝ'), (0x51D, 'V'), (0x51E, 'M', u'ԟ'), (0x51F, 'V'), (0x520, 'M', u'ԡ'), (0x521, 'V'), (0x522, 'M', u'ԣ'), (0x523, 'V'), (0x524, 'M', u'ԥ'), (0x525, 'V'), (0x526, 'M', u'ԧ'), (0x527, 'V'), (0x528, 'M', u'ԩ'), (0x529, 'V'), (0x52A, 'M', u'ԫ'), (0x52B, 'V'), (0x52C, 'M', u'ԭ'), (0x52D, 'V'), (0x52E, 'M', u'ԯ'), (0x52F, 'V'), (0x530, 'X'), (0x531, 'M', u'ա'), (0x532, 'M', u'բ'), (0x533, 'M', u'գ'), (0x534, 'M', u'դ'), (0x535, 'M', u'ե'), (0x536, 'M', u'զ'), (0x537, 'M', u'է'), (0x538, 'M', u'ը'), (0x539, 'M', u'թ'), (0x53A, 'M', u'ժ'), (0x53B, 'M', u'ի'), (0x53C, 'M', u'լ'), (0x53D, 'M', u'խ'), (0x53E, 'M', u'ծ'), (0x53F, 'M', u'կ'), (0x540, 'M', u'հ'), (0x541, 'M', u'ձ'), (0x542, 'M', u'ղ'), (0x543, 'M', u'ճ'), (0x544, 'M', u'մ'), (0x545, 'M', u'յ'), (0x546, 'M', u'ն'), (0x547, 'M', u'շ'), (0x548, 'M', u'ո'), (0x549, 'M', u'չ'), (0x54A, 'M', u'պ'), (0x54B, 'M', u'ջ'), (0x54C, 'M', u'ռ'), (0x54D, 'M', u'ս'), (0x54E, 'M', u'վ'), (0x54F, 'M', u'տ'), (0x550, 'M', u'ր'), (0x551, 'M', u'ց'), (0x552, 'M', u'ւ'), (0x553, 'M', u'փ'), (0x554, 'M', u'ք'), (0x555, 'M', u'օ'), (0x556, 'M', u'ֆ'), (0x557, 'X'), (0x559, 'V'), (0x587, 'M', u'եւ'), (0x588, 'V'), (0x58B, 'X'), (0x58D, 'V'), (0x590, 'X'), (0x591, 'V'), (0x5C8, 'X'), (0x5D0, 'V'), (0x5EB, 'X'), (0x5EF, 'V'), (0x5F5, 'X'), (0x606, 'V'), (0x61C, 'X'), (0x61E, 'V'), ] def _seg_10(): return [ (0x675, 'M', u'اٴ'), (0x676, 'M', u'وٴ'), (0x677, 'M', u'ۇٴ'), (0x678, 'M', u'يٴ'), (0x679, 'V'), (0x6DD, 'X'), (0x6DE, 'V'), (0x70E, 'X'), (0x710, 'V'), (0x74B, 'X'), (0x74D, 'V'), (0x7B2, 'X'), (0x7C0, 'V'), (0x7FB, 'X'), (0x7FD, 'V'), (0x82E, 'X'), (0x830, 'V'), (0x83F, 'X'), (0x840, 'V'), (0x85C, 'X'), (0x85E, 'V'), (0x85F, 'X'), (0x860, 'V'), (0x86B, 'X'), (0x8A0, 'V'), (0x8B5, 'X'), (0x8B6, 'V'), (0x8C8, 'X'), (0x8D3, 'V'), (0x8E2, 'X'), (0x8E3, 'V'), (0x958, 'M', u'क़'), (0x959, 'M', u'ख़'), (0x95A, 'M', u'ग़'), (0x95B, 'M', u'ज़'), (0x95C, 'M', u'ड़'), (0x95D, 'M', u'ढ़'), (0x95E, 'M', u'फ़'), (0x95F, 'M', u'य़'), (0x960, 'V'), (0x984, 'X'), (0x985, 'V'), (0x98D, 'X'), (0x98F, 'V'), (0x991, 'X'), (0x993, 'V'), (0x9A9, 'X'), (0x9AA, 'V'), (0x9B1, 'X'), (0x9B2, 'V'), (0x9B3, 'X'), (0x9B6, 'V'), (0x9BA, 'X'), (0x9BC, 'V'), (0x9C5, 'X'), (0x9C7, 'V'), (0x9C9, 'X'), (0x9CB, 'V'), (0x9CF, 'X'), (0x9D7, 'V'), (0x9D8, 'X'), (0x9DC, 'M', u'ড়'), (0x9DD, 'M', u'ঢ়'), (0x9DE, 'X'), (0x9DF, 'M', u'য়'), (0x9E0, 'V'), (0x9E4, 'X'), (0x9E6, 'V'), (0x9FF, 'X'), (0xA01, 'V'), (0xA04, 'X'), (0xA05, 'V'), (0xA0B, 'X'), (0xA0F, 'V'), (0xA11, 'X'), (0xA13, 'V'), (0xA29, 'X'), (0xA2A, 'V'), (0xA31, 'X'), (0xA32, 'V'), (0xA33, 'M', u'ਲ਼'), (0xA34, 'X'), (0xA35, 'V'), (0xA36, 'M', u'ਸ਼'), (0xA37, 'X'), (0xA38, 'V'), (0xA3A, 'X'), (0xA3C, 'V'), (0xA3D, 'X'), (0xA3E, 'V'), (0xA43, 'X'), (0xA47, 'V'), (0xA49, 'X'), (0xA4B, 'V'), (0xA4E, 'X'), (0xA51, 'V'), (0xA52, 'X'), (0xA59, 'M', u'ਖ਼'), (0xA5A, 'M', u'ਗ਼'), (0xA5B, 'M', u'ਜ਼'), ] def _seg_11(): return [ (0xA5C, 'V'), (0xA5D, 'X'), (0xA5E, 'M', u'ਫ਼'), (0xA5F, 'X'), (0xA66, 'V'), (0xA77, 'X'), (0xA81, 'V'), (0xA84, 'X'), (0xA85, 'V'), (0xA8E, 'X'), (0xA8F, 'V'), (0xA92, 'X'), (0xA93, 'V'), (0xAA9, 'X'), (0xAAA, 'V'), (0xAB1, 'X'), (0xAB2, 'V'), (0xAB4, 'X'), (0xAB5, 'V'), (0xABA, 'X'), (0xABC, 'V'), (0xAC6, 'X'), (0xAC7, 'V'), (0xACA, 'X'), (0xACB, 'V'), (0xACE, 'X'), (0xAD0, 'V'), (0xAD1, 'X'), (0xAE0, 'V'), (0xAE4, 'X'), (0xAE6, 'V'), (0xAF2, 'X'), (0xAF9, 'V'), (0xB00, 'X'), (0xB01, 'V'), (0xB04, 'X'), (0xB05, 'V'), (0xB0D, 'X'), (0xB0F, 'V'), (0xB11, 'X'), (0xB13, 'V'), (0xB29, 'X'), (0xB2A, 'V'), (0xB31, 'X'), (0xB32, 'V'), (0xB34, 'X'), (0xB35, 'V'), (0xB3A, 'X'), (0xB3C, 'V'), (0xB45, 'X'), (0xB47, 'V'), (0xB49, 'X'), (0xB4B, 'V'), (0xB4E, 'X'), (0xB55, 'V'), (0xB58, 'X'), (0xB5C, 'M', u'ଡ଼'), (0xB5D, 'M', u'ଢ଼'), (0xB5E, 'X'), (0xB5F, 'V'), (0xB64, 'X'), (0xB66, 'V'), (0xB78, 'X'), (0xB82, 'V'), (0xB84, 'X'), (0xB85, 'V'), (0xB8B, 'X'), (0xB8E, 'V'), (0xB91, 'X'), (0xB92, 'V'), (0xB96, 'X'), (0xB99, 'V'), (0xB9B, 'X'), (0xB9C, 'V'), (0xB9D, 'X'), (0xB9E, 'V'), (0xBA0, 'X'), (0xBA3, 'V'), (0xBA5, 'X'), (0xBA8, 'V'), (0xBAB, 'X'), (0xBAE, 'V'), (0xBBA, 'X'), (0xBBE, 'V'), (0xBC3, 'X'), (0xBC6, 'V'), (0xBC9, 'X'), (0xBCA, 'V'), (0xBCE, 'X'), (0xBD0, 'V'), (0xBD1, 'X'), (0xBD7, 'V'), (0xBD8, 'X'), (0xBE6, 'V'), (0xBFB, 'X'), (0xC00, 'V'), (0xC0D, 'X'), (0xC0E, 'V'), (0xC11, 'X'), (0xC12, 'V'), ] def _seg_12(): return [ (0xC29, 'X'), (0xC2A, 'V'), (0xC3A, 'X'), (0xC3D, 'V'), (0xC45, 'X'), (0xC46, 'V'), (0xC49, 'X'), (0xC4A, 'V'), (0xC4E, 'X'), (0xC55, 'V'), (0xC57, 'X'), (0xC58, 'V'), (0xC5B, 'X'), (0xC60, 'V'), (0xC64, 'X'), (0xC66, 'V'), (0xC70, 'X'), (0xC77, 'V'), (0xC8D, 'X'), (0xC8E, 'V'), (0xC91, 'X'), (0xC92, 'V'), (0xCA9, 'X'), (0xCAA, 'V'), (0xCB4, 'X'), (0xCB5, 'V'), (0xCBA, 'X'), (0xCBC, 'V'), (0xCC5, 'X'), (0xCC6, 'V'), (0xCC9, 'X'), (0xCCA, 'V'), (0xCCE, 'X'), (0xCD5, 'V'), (0xCD7, 'X'), (0xCDE, 'V'), (0xCDF, 'X'), (0xCE0, 'V'), (0xCE4, 'X'), (0xCE6, 'V'), (0xCF0, 'X'), (0xCF1, 'V'), (0xCF3, 'X'), (0xD00, 'V'), (0xD0D, 'X'), (0xD0E, 'V'), (0xD11, 'X'), (0xD12, 'V'), (0xD45, 'X'), (0xD46, 'V'), (0xD49, 'X'), (0xD4A, 'V'), (0xD50, 'X'), (0xD54, 'V'), (0xD64, 'X'), (0xD66, 'V'), (0xD80, 'X'), (0xD81, 'V'), (0xD84, 'X'), (0xD85, 'V'), (0xD97, 'X'), (0xD9A, 'V'), (0xDB2, 'X'), (0xDB3, 'V'), (0xDBC, 'X'), (0xDBD, 'V'), (0xDBE, 'X'), (0xDC0, 'V'), (0xDC7, 'X'), (0xDCA, 'V'), (0xDCB, 'X'), (0xDCF, 'V'), (0xDD5, 'X'), (0xDD6, 'V'), (0xDD7, 'X'), (0xDD8, 'V'), (0xDE0, 'X'), (0xDE6, 'V'), (0xDF0, 'X'), (0xDF2, 'V'), (0xDF5, 'X'), (0xE01, 'V'), (0xE33, 'M', u'ํา'), (0xE34, 'V'), (0xE3B, 'X'), (0xE3F, 'V'), (0xE5C, 'X'), (0xE81, 'V'), (0xE83, 'X'), (0xE84, 'V'), (0xE85, 'X'), (0xE86, 'V'), (0xE8B, 'X'), (0xE8C, 'V'), (0xEA4, 'X'), (0xEA5, 'V'), (0xEA6, 'X'), (0xEA7, 'V'), (0xEB3, 'M', u'ໍາ'), (0xEB4, 'V'), ] def _seg_13(): return [ (0xEBE, 'X'), (0xEC0, 'V'), (0xEC5, 'X'), (0xEC6, 'V'), (0xEC7, 'X'), (0xEC8, 'V'), (0xECE, 'X'), (0xED0, 'V'), (0xEDA, 'X'), (0xEDC, 'M', u'ຫນ'), (0xEDD, 'M', u'ຫມ'), (0xEDE, 'V'), (0xEE0, 'X'), (0xF00, 'V'), (0xF0C, 'M', u'་'), (0xF0D, 'V'), (0xF43, 'M', u'གྷ'), (0xF44, 'V'), (0xF48, 'X'), (0xF49, 'V'), (0xF4D, 'M', u'ཌྷ'), (0xF4E, 'V'), (0xF52, 'M', u'དྷ'), (0xF53, 'V'), (0xF57, 'M', u'བྷ'), (0xF58, 'V'), (0xF5C, 'M', u'ཛྷ'), (0xF5D, 'V'), (0xF69, 'M', u'ཀྵ'), (0xF6A, 'V'), (0xF6D, 'X'), (0xF71, 'V'), (0xF73, 'M', u'ཱི'), (0xF74, 'V'), (0xF75, 'M', u'ཱུ'), (0xF76, 'M', u'ྲྀ'), (0xF77, 'M', u'ྲཱྀ'), (0xF78, 'M', u'ླྀ'), (0xF79, 'M', u'ླཱྀ'), (0xF7A, 'V'), (0xF81, 'M', u'ཱྀ'), (0xF82, 'V'), (0xF93, 'M', u'ྒྷ'), (0xF94, 'V'), (0xF98, 'X'), (0xF99, 'V'), (0xF9D, 'M', u'ྜྷ'), (0xF9E, 'V'), (0xFA2, 'M', u'ྡྷ'), (0xFA3, 'V'), (0xFA7, 'M', u'ྦྷ'), (0xFA8, 'V'), (0xFAC, 'M', u'ྫྷ'), (0xFAD, 'V'), (0xFB9, 'M', u'ྐྵ'), (0xFBA, 'V'), (0xFBD, 'X'), (0xFBE, 'V'), (0xFCD, 'X'), (0xFCE, 'V'), (0xFDB, 'X'), (0x1000, 'V'), (0x10A0, 'X'), (0x10C7, 'M', u'ⴧ'), (0x10C8, 'X'), (0x10CD, 'M', u'ⴭ'), (0x10CE, 'X'), (0x10D0, 'V'), (0x10FC, 'M', u'ნ'), (0x10FD, 'V'), (0x115F, 'X'), (0x1161, 'V'), (0x1249, 'X'), (0x124A, 'V'), (0x124E, 'X'), (0x1250, 'V'), (0x1257, 'X'), (0x1258, 'V'), (0x1259, 'X'), (0x125A, 'V'), (0x125E, 'X'), (0x1260, 'V'), (0x1289, 'X'), (0x128A, 'V'), (0x128E, 'X'), (0x1290, 'V'), (0x12B1, 'X'), (0x12B2, 'V'), (0x12B6, 'X'), (0x12B8, 'V'), (0x12BF, 'X'), (0x12C0, 'V'), (0x12C1, 'X'), (0x12C2, 'V'), (0x12C6, 'X'), (0x12C8, 'V'), (0x12D7, 'X'), (0x12D8, 'V'), (0x1311, 'X'), (0x1312, 'V'), ] def _seg_14(): return [ (0x1316, 'X'), (0x1318, 'V'), (0x135B, 'X'), (0x135D, 'V'), (0x137D, 'X'), (0x1380, 'V'), (0x139A, 'X'), (0x13A0, 'V'), (0x13F6, 'X'), (0x13F8, 'M', u'Ᏸ'), (0x13F9, 'M', u'Ᏹ'), (0x13FA, 'M', u'Ᏺ'), (0x13FB, 'M', u'Ᏻ'), (0x13FC, 'M', u'Ᏼ'), (0x13FD, 'M', u'Ᏽ'), (0x13FE, 'X'), (0x1400, 'V'), (0x1680, 'X'), (0x1681, 'V'), (0x169D, 'X'), (0x16A0, 'V'), (0x16F9, 'X'), (0x1700, 'V'), (0x170D, 'X'), (0x170E, 'V'), (0x1715, 'X'), (0x1720, 'V'), (0x1737, 'X'), (0x1740, 'V'), (0x1754, 'X'), (0x1760, 'V'), (0x176D, 'X'), (0x176E, 'V'), (0x1771, 'X'), (0x1772, 'V'), (0x1774, 'X'), (0x1780, 'V'), (0x17B4, 'X'), (0x17B6, 'V'), (0x17DE, 'X'), (0x17E0, 'V'), (0x17EA, 'X'), (0x17F0, 'V'), (0x17FA, 'X'), (0x1800, 'V'), (0x1806, 'X'), (0x1807, 'V'), (0x180B, 'I'), (0x180E, 'X'), (0x1810, 'V'), (0x181A, 'X'), (0x1820, 'V'), (0x1879, 'X'), (0x1880, 'V'), (0x18AB, 'X'), (0x18B0, 'V'), (0x18F6, 'X'), (0x1900, 'V'), (0x191F, 'X'), (0x1920, 'V'), (0x192C, 'X'), (0x1930, 'V'), (0x193C, 'X'), (0x1940, 'V'), (0x1941, 'X'), (0x1944, 'V'), (0x196E, 'X'), (0x1970, 'V'), (0x1975, 'X'), (0x1980, 'V'), (0x19AC, 'X'), (0x19B0, 'V'), (0x19CA, 'X'), (0x19D0, 'V'), (0x19DB, 'X'), (0x19DE, 'V'), (0x1A1C, 'X'), (0x1A1E, 'V'), (0x1A5F, 'X'), (0x1A60, 'V'), (0x1A7D, 'X'), (0x1A7F, 'V'), (0x1A8A, 'X'), (0x1A90, 'V'), (0x1A9A, 'X'), (0x1AA0, 'V'), (0x1AAE, 'X'), (0x1AB0, 'V'), (0x1AC1, 'X'), (0x1B00, 'V'), (0x1B4C, 'X'), (0x1B50, 'V'), (0x1B7D, 'X'), (0x1B80, 'V'), (0x1BF4, 'X'), (0x1BFC, 'V'), (0x1C38, 'X'), (0x1C3B, 'V'), (0x1C4A, 'X'), (0x1C4D, 'V'), ] def _seg_15(): return [ (0x1C80, 'M', u'в'), (0x1C81, 'M', u'д'), (0x1C82, 'M', u'о'), (0x1C83, 'M', u'с'), (0x1C84, 'M', u'т'), (0x1C86, 'M', u'ъ'), (0x1C87, 'M', u'ѣ'), (0x1C88, 'M', u'ꙋ'), (0x1C89, 'X'), (0x1C90, 'M', u'ა'), (0x1C91, 'M', u'ბ'), (0x1C92, 'M', u'გ'), (0x1C93, 'M', u'დ'), (0x1C94, 'M', u'ე'), (0x1C95, 'M', u'ვ'), (0x1C96, 'M', u'ზ'), (0x1C97, 'M', u'თ'), (0x1C98, 'M', u'ი'), (0x1C99, 'M', u'კ'), (0x1C9A, 'M', u'ლ'), (0x1C9B, 'M', u'მ'), (0x1C9C, 'M', u'ნ'), (0x1C9D, 'M', u'ო'), (0x1C9E, 'M', u'პ'), (0x1C9F, 'M', u'ჟ'), (0x1CA0, 'M', u'რ'), (0x1CA1, 'M', u'ს'), (0x1CA2, 'M', u'ტ'), (0x1CA3, 'M', u'უ'), (0x1CA4, 'M', u'ფ'), (0x1CA5, 'M', u'ქ'), (0x1CA6, 'M', u'ღ'), (0x1CA7, 'M', u'ყ'), (0x1CA8, 'M', u'შ'), (0x1CA9, 'M', u'ჩ'), (0x1CAA, 'M', u'ც'), (0x1CAB, 'M', u'ძ'), (0x1CAC, 'M', u'წ'), (0x1CAD, 'M', u'ჭ'), (0x1CAE, 'M', u'ხ'), (0x1CAF, 'M', u'ჯ'), (0x1CB0, 'M', u'ჰ'), (0x1CB1, 'M', u'ჱ'), (0x1CB2, 'M', u'ჲ'), (0x1CB3, 'M', u'ჳ'), (0x1CB4, 'M', u'ჴ'), (0x1CB5, 'M', u'ჵ'), (0x1CB6, 'M', u'ჶ'), (0x1CB7, 'M', u'ჷ'), (0x1CB8, 'M', u'ჸ'), (0x1CB9, 'M', u'ჹ'), (0x1CBA, 'M', u'ჺ'), (0x1CBB, 'X'), (0x1CBD, 'M', u'ჽ'), (0x1CBE, 'M', u'ჾ'), (0x1CBF, 'M', u'ჿ'), (0x1CC0, 'V'), (0x1CC8, 'X'), (0x1CD0, 'V'), (0x1CFB, 'X'), (0x1D00, 'V'), (0x1D2C, 'M', u'a'), (0x1D2D, 'M', u'æ'), (0x1D2E, 'M', u'b'), (0x1D2F, 'V'), (0x1D30, 'M', u'd'), (0x1D31, 'M', u'e'), (0x1D32, 'M', u'ǝ'), (0x1D33, 'M', u'g'), (0x1D34, 'M', u'h'), (0x1D35, 'M', u'i'), (0x1D36, 'M', u'j'), (0x1D37, 'M', u'k'), (0x1D38, 'M', u'l'), (0x1D39, 'M', u'm'), (0x1D3A, 'M', u'n'), (0x1D3B, 'V'), (0x1D3C, 'M', u'o'), (0x1D3D, 'M', u'ȣ'), (0x1D3E, 'M', u'p'), (0x1D3F, 'M', u'r'), (0x1D40, 'M', u't'), (0x1D41, 'M', u'u'), (0x1D42, 'M', u'w'), (0x1D43, 'M', u'a'), (0x1D44, 'M', u'ɐ'), (0x1D45, 'M', u'ɑ'), (0x1D46, 'M', u'ᴂ'), (0x1D47, 'M', u'b'), (0x1D48, 'M', u'd'), (0x1D49, 'M', u'e'), (0x1D4A, 'M', u'ə'), (0x1D4B, 'M', u'ɛ'), (0x1D4C, 'M', u'ɜ'), (0x1D4D, 'M', u'g'), (0x1D4E, 'V'), (0x1D4F, 'M', u'k'), (0x1D50, 'M', u'm'), (0x1D51, 'M', u'ŋ'), (0x1D52, 'M', u'o'), ] def _seg_16(): return [ (0x1D53, 'M', u'ɔ'), (0x1D54, 'M', u'ᴖ'), (0x1D55, 'M', u'ᴗ'), (0x1D56, 'M', u'p'), (0x1D57, 'M', u't'), (0x1D58, 'M', u'u'), (0x1D59, 'M', u'ᴝ'), (0x1D5A, 'M', u'ɯ'), (0x1D5B, 'M', u'v'), (0x1D5C, 'M', u'ᴥ'), (0x1D5D, 'M', u'β'), (0x1D5E, 'M', u'γ'), (0x1D5F, 'M', u'δ'), (0x1D60, 'M', u'φ'), (0x1D61, 'M', u'χ'), (0x1D62, 'M', u'i'), (0x1D63, 'M', u'r'), (0x1D64, 'M', u'u'), (0x1D65, 'M', u'v'), (0x1D66, 'M', u'β'), (0x1D67, 'M', u'γ'), (0x1D68, 'M', u'ρ'), (0x1D69, 'M', u'φ'), (0x1D6A, 'M', u'χ'), (0x1D6B, 'V'), (0x1D78, 'M', u'н'), (0x1D79, 'V'), (0x1D9B, 'M', u'ɒ'), (0x1D9C, 'M', u'c'), (0x1D9D, 'M', u'ɕ'), (0x1D9E, 'M', u'ð'), (0x1D9F, 'M', u'ɜ'), (0x1DA0, 'M', u'f'), (0x1DA1, 'M', u'ɟ'), (0x1DA2, 'M', u'ɡ'), (0x1DA3, 'M', u'ɥ'), (0x1DA4, 'M', u'ɨ'), (0x1DA5, 'M', u'ɩ'), (0x1DA6, 'M', u'ɪ'), (0x1DA7, 'M', u'ᵻ'), (0x1DA8, 'M', u'ʝ'), (0x1DA9, 'M', u'ɭ'), (0x1DAA, 'M', u'ᶅ'), (0x1DAB, 'M', u'ʟ'), (0x1DAC, 'M', u'ɱ'), (0x1DAD, 'M', u'ɰ'), (0x1DAE, 'M', u'ɲ'), (0x1DAF, 'M', u'ɳ'), (0x1DB0, 'M', u'ɴ'), (0x1DB1, 'M', u'ɵ'), (0x1DB2, 'M', u'ɸ'), (0x1DB3, 'M', u'ʂ'), (0x1DB4, 'M', u'ʃ'), (0x1DB5, 'M', u'ƫ'), (0x1DB6, 'M', u'ʉ'), (0x1DB7, 'M', u'ʊ'), (0x1DB8, 'M', u'ᴜ'), (0x1DB9, 'M', u'ʋ'), (0x1DBA, 'M', u'ʌ'), (0x1DBB, 'M', u'z'), (0x1DBC, 'M', u'ʐ'), (0x1DBD, 'M', u'ʑ'), (0x1DBE, 'M', u'ʒ'), (0x1DBF, 'M', u'θ'), (0x1DC0, 'V'), (0x1DFA, 'X'), (0x1DFB, 'V'), (0x1E00, 'M', u'ḁ'), (0x1E01, 'V'), (0x1E02, 'M', u'ḃ'), (0x1E03, 'V'), (0x1E04, 'M', u'ḅ'), (0x1E05, 'V'), (0x1E06, 'M', u'ḇ'), (0x1E07, 'V'), (0x1E08, 'M', u'ḉ'), (0x1E09, 'V'), (0x1E0A, 'M', u'ḋ'), (0x1E0B, 'V'), (0x1E0C, 'M', u'ḍ'), (0x1E0D, 'V'), (0x1E0E, 'M', u'ḏ'), (0x1E0F, 'V'), (0x1E10, 'M', u'ḑ'), (0x1E11, 'V'), (0x1E12, 'M', u'ḓ'), (0x1E13, 'V'), (0x1E14, 'M', u'ḕ'), (0x1E15, 'V'), (0x1E16, 'M', u'ḗ'), (0x1E17, 'V'), (0x1E18, 'M', u'ḙ'), (0x1E19, 'V'), (0x1E1A, 'M', u'ḛ'), (0x1E1B, 'V'), (0x1E1C, 'M', u'ḝ'), (0x1E1D, 'V'), (0x1E1E, 'M', u'ḟ'), (0x1E1F, 'V'), (0x1E20, 'M', u'ḡ'), ] def _seg_17(): return [ (0x1E21, 'V'), (0x1E22, 'M', u'ḣ'), (0x1E23, 'V'), (0x1E24, 'M', u'ḥ'), (0x1E25, 'V'), (0x1E26, 'M', u'ḧ'), (0x1E27, 'V'), (0x1E28, 'M', u'ḩ'), (0x1E29, 'V'), (0x1E2A, 'M', u'ḫ'), (0x1E2B, 'V'), (0x1E2C, 'M', u'ḭ'), (0x1E2D, 'V'), (0x1E2E, 'M', u'ḯ'), (0x1E2F, 'V'), (0x1E30, 'M', u'ḱ'), (0x1E31, 'V'), (0x1E32, 'M', u'ḳ'), (0x1E33, 'V'), (0x1E34, 'M', u'ḵ'), (0x1E35, 'V'), (0x1E36, 'M', u'ḷ'), (0x1E37, 'V'), (0x1E38, 'M', u'ḹ'), (0x1E39, 'V'), (0x1E3A, 'M', u'ḻ'), (0x1E3B, 'V'), (0x1E3C, 'M', u'ḽ'), (0x1E3D, 'V'), (0x1E3E, 'M', u'ḿ'), (0x1E3F, 'V'), (0x1E40, 'M', u'ṁ'), (0x1E41, 'V'), (0x1E42, 'M', u'ṃ'), (0x1E43, 'V'), (0x1E44, 'M', u'ṅ'), (0x1E45, 'V'), (0x1E46, 'M', u'ṇ'), (0x1E47, 'V'), (0x1E48, 'M', u'ṉ'), (0x1E49, 'V'), (0x1E4A, 'M', u'ṋ'), (0x1E4B, 'V'), (0x1E4C, 'M', u'ṍ'), (0x1E4D, 'V'), (0x1E4E, 'M', u'ṏ'), (0x1E4F, 'V'), (0x1E50, 'M', u'ṑ'), (0x1E51, 'V'), (0x1E52, 'M', u'ṓ'), (0x1E53, 'V'), (0x1E54, 'M', u'ṕ'), (0x1E55, 'V'), (0x1E56, 'M', u'ṗ'), (0x1E57, 'V'), (0x1E58, 'M', u'ṙ'), (0x1E59, 'V'), (0x1E5A, 'M', u'ṛ'), (0x1E5B, 'V'), (0x1E5C, 'M', u'ṝ'), (0x1E5D, 'V'), (0x1E5E, 'M', u'ṟ'), (0x1E5F, 'V'), (0x1E60, 'M', u'ṡ'), (0x1E61, 'V'), (0x1E62, 'M', u'ṣ'), (0x1E63, 'V'), (0x1E64, 'M', u'ṥ'), (0x1E65, 'V'), (0x1E66, 'M', u'ṧ'), (0x1E67, 'V'), (0x1E68, 'M', u'ṩ'), (0x1E69, 'V'), (0x1E6A, 'M', u'ṫ'), (0x1E6B, 'V'), (0x1E6C, 'M', u'ṭ'), (0x1E6D, 'V'), (0x1E6E, 'M', u'ṯ'), (0x1E6F, 'V'), (0x1E70, 'M', u'ṱ'), (0x1E71, 'V'), (0x1E72, 'M', u'ṳ'), (0x1E73, 'V'), (0x1E74, 'M', u'ṵ'), (0x1E75, 'V'), (0x1E76, 'M', u'ṷ'), (0x1E77, 'V'), (0x1E78, 'M', u'ṹ'), (0x1E79, 'V'), (0x1E7A, 'M', u'ṻ'), (0x1E7B, 'V'), (0x1E7C, 'M', u'ṽ'), (0x1E7D, 'V'), (0x1E7E, 'M', u'ṿ'), (0x1E7F, 'V'), (0x1E80, 'M', u'ẁ'), (0x1E81, 'V'), (0x1E82, 'M', u'ẃ'), (0x1E83, 'V'), (0x1E84, 'M', u'ẅ'), ] def _seg_18(): return [ (0x1E85, 'V'), (0x1E86, 'M', u'ẇ'), (0x1E87, 'V'), (0x1E88, 'M', u'ẉ'), (0x1E89, 'V'), (0x1E8A, 'M', u'ẋ'), (0x1E8B, 'V'), (0x1E8C, 'M', u'ẍ'), (0x1E8D, 'V'), (0x1E8E, 'M', u'ẏ'), (0x1E8F, 'V'), (0x1E90, 'M', u'ẑ'), (0x1E91, 'V'), (0x1E92, 'M', u'ẓ'), (0x1E93, 'V'), (0x1E94, 'M', u'ẕ'), (0x1E95, 'V'), (0x1E9A, 'M', u'aʾ'), (0x1E9B, 'M', u'ṡ'), (0x1E9C, 'V'), (0x1E9E, 'M', u'ss'), (0x1E9F, 'V'), (0x1EA0, 'M', u'ạ'), (0x1EA1, 'V'), (0x1EA2, 'M', u'ả'), (0x1EA3, 'V'), (0x1EA4, 'M', u'ấ'), (0x1EA5, 'V'), (0x1EA6, 'M', u'ầ'), (0x1EA7, 'V'), (0x1EA8, 'M', u'ẩ'), (0x1EA9, 'V'), (0x1EAA, 'M', u'ẫ'), (0x1EAB, 'V'), (0x1EAC, 'M', u'ậ'), (0x1EAD, 'V'), (0x1EAE, 'M', u'ắ'), (0x1EAF, 'V'), (0x1EB0, 'M', u'ằ'), (0x1EB1, 'V'), (0x1EB2, 'M', u'ẳ'), (0x1EB3, 'V'), (0x1EB4, 'M', u'ẵ'), (0x1EB5, 'V'), (0x1EB6, 'M', u'ặ'), (0x1EB7, 'V'), (0x1EB8, 'M', u'ẹ'), (0x1EB9, 'V'), (0x1EBA, 'M', u'ẻ'), (0x1EBB, 'V'), (0x1EBC, 'M', u'ẽ'), (0x1EBD, 'V'), (0x1EBE, 'M', u'ế'), (0x1EBF, 'V'), (0x1EC0, 'M', u'ề'), (0x1EC1, 'V'), (0x1EC2, 'M', u'ể'), (0x1EC3, 'V'), (0x1EC4, 'M', u'ễ'), (0x1EC5, 'V'), (0x1EC6, 'M', u'ệ'), (0x1EC7, 'V'), (0x1EC8, 'M', u'ỉ'), (0x1EC9, 'V'), (0x1ECA, 'M', u'ị'), (0x1ECB, 'V'), (0x1ECC, 'M', u'ọ'), (0x1ECD, 'V'), (0x1ECE, 'M', u'ỏ'), (0x1ECF, 'V'), (0x1ED0, 'M', u'ố'), (0x1ED1, 'V'), (0x1ED2, 'M', u'ồ'), (0x1ED3, 'V'), (0x1ED4, 'M', u'ổ'), (0x1ED5, 'V'), (0x1ED6, 'M', u'ỗ'), (0x1ED7, 'V'), (0x1ED8, 'M', u'ộ'), (0x1ED9, 'V'), (0x1EDA, 'M', u'ớ'), (0x1EDB, 'V'), (0x1EDC, 'M', u'ờ'), (0x1EDD, 'V'), (0x1EDE, 'M', u'ở'), (0x1EDF, 'V'), (0x1EE0, 'M', u'ỡ'), (0x1EE1, 'V'), (0x1EE2, 'M', u'ợ'), (0x1EE3, 'V'), (0x1EE4, 'M', u'ụ'), (0x1EE5, 'V'), (0x1EE6, 'M', u'ủ'), (0x1EE7, 'V'), (0x1EE8, 'M', u'ứ'), (0x1EE9, 'V'), (0x1EEA, 'M', u'ừ'), (0x1EEB, 'V'), (0x1EEC, 'M', u'ử'), (0x1EED, 'V'), ] def _seg_19(): return [ (0x1EEE, 'M', u'ữ'), (0x1EEF, 'V'), (0x1EF0, 'M', u'ự'), (0x1EF1, 'V'), (0x1EF2, 'M', u'ỳ'), (0x1EF3, 'V'), (0x1EF4, 'M', u'ỵ'), (0x1EF5, 'V'), (0x1EF6, 'M', u'ỷ'), (0x1EF7, 'V'), (0x1EF8, 'M', u'ỹ'), (0x1EF9, 'V'), (0x1EFA, 'M', u'ỻ'), (0x1EFB, 'V'), (0x1EFC, 'M', u'ỽ'), (0x1EFD, 'V'), (0x1EFE, 'M', u'ỿ'), (0x1EFF, 'V'), (0x1F08, 'M', u'ἀ'), (0x1F09, 'M', u'ἁ'), (0x1F0A, 'M', u'ἂ'), (0x1F0B, 'M', u'ἃ'), (0x1F0C, 'M', u'ἄ'), (0x1F0D, 'M', u'ἅ'), (0x1F0E, 'M', u'ἆ'), (0x1F0F, 'M', u'ἇ'), (0x1F10, 'V'), (0x1F16, 'X'), (0x1F18, 'M', u'ἐ'), (0x1F19, 'M', u'ἑ'), (0x1F1A, 'M', u'ἒ'), (0x1F1B, 'M', u'ἓ'), (0x1F1C, 'M', u'ἔ'), (0x1F1D, 'M', u'ἕ'), (0x1F1E, 'X'), (0x1F20, 'V'), (0x1F28, 'M', u'ἠ'), (0x1F29, 'M', u'ἡ'), (0x1F2A, 'M', u'ἢ'), (0x1F2B, 'M', u'ἣ'), (0x1F2C, 'M', u'ἤ'), (0x1F2D, 'M', u'ἥ'), (0x1F2E, 'M', u'ἦ'), (0x1F2F, 'M', u'ἧ'), (0x1F30, 'V'), (0x1F38, 'M', u'ἰ'), (0x1F39, 'M', u'ἱ'), (0x1F3A, 'M', u'ἲ'), (0x1F3B, 'M', u'ἳ'), (0x1F3C, 'M', u'ἴ'), (0x1F3D, 'M', u'ἵ'), (0x1F3E, 'M', u'ἶ'), (0x1F3F, 'M', u'ἷ'), (0x1F40, 'V'), (0x1F46, 'X'), (0x1F48, 'M', u'ὀ'), (0x1F49, 'M', u'ὁ'), (0x1F4A, 'M', u'ὂ'), (0x1F4B, 'M', u'ὃ'), (0x1F4C, 'M', u'ὄ'), (0x1F4D, 'M', u'ὅ'), (0x1F4E, 'X'), (0x1F50, 'V'), (0x1F58, 'X'), (0x1F59, 'M', u'ὑ'), (0x1F5A, 'X'), (0x1F5B, 'M', u'ὓ'), (0x1F5C, 'X'), (0x1F5D, 'M', u'ὕ'), (0x1F5E, 'X'), (0x1F5F, 'M', u'ὗ'), (0x1F60, 'V'), (0x1F68, 'M', u'ὠ'), (0x1F69, 'M', u'ὡ'), (0x1F6A, 'M', u'ὢ'), (0x1F6B, 'M', u'ὣ'), (0x1F6C, 'M', u'ὤ'), (0x1F6D, 'M', u'ὥ'), (0x1F6E, 'M', u'ὦ'), (0x1F6F, 'M', u'ὧ'), (0x1F70, 'V'), (0x1F71, 'M', u'ά'), (0x1F72, 'V'), (0x1F73, 'M', u'έ'), (0x1F74, 'V'), (0x1F75, 'M', u'ή'), (0x1F76, 'V'), (0x1F77, 'M', u'ί'), (0x1F78, 'V'), (0x1F79, 'M', u'ό'), (0x1F7A, 'V'), (0x1F7B, 'M', u'ύ'), (0x1F7C, 'V'), (0x1F7D, 'M', u'ώ'), (0x1F7E, 'X'), (0x1F80, 'M', u'ἀι'), (0x1F81, 'M', u'ἁι'), (0x1F82, 'M', u'ἂι'), (0x1F83, 'M', u'ἃι'), (0x1F84, 'M', u'ἄι'), ] def _seg_20(): return [ (0x1F85, 'M', u'ἅι'), (0x1F86, 'M', u'ἆι'), (0x1F87, 'M', u'ἇι'), (0x1F88, 'M', u'ἀι'), (0x1F89, 'M', u'ἁι'), (0x1F8A, 'M', u'ἂι'), (0x1F8B, 'M', u'ἃι'), (0x1F8C, 'M', u'ἄι'), (0x1F8D, 'M', u'ἅι'), (0x1F8E, 'M', u'ἆι'), (0x1F8F, 'M', u'ἇι'), (0x1F90, 'M', u'ἠι'), (0x1F91, 'M', u'ἡι'), (0x1F92, 'M', u'ἢι'), (0x1F93, 'M', u'ἣι'), (0x1F94, 'M', u'ἤι'), (0x1F95, 'M', u'ἥι'), (0x1F96, 'M', u'ἦι'), (0x1F97, 'M', u'ἧι'), (0x1F98, 'M', u'ἠι'), (0x1F99, 'M', u'ἡι'), (0x1F9A, 'M', u'ἢι'), (0x1F9B, 'M', u'ἣι'), (0x1F9C, 'M', u'ἤι'), (0x1F9D, 'M', u'ἥι'), (0x1F9E, 'M', u'ἦι'), (0x1F9F, 'M', u'ἧι'), (0x1FA0, 'M', u'ὠι'), (0x1FA1, 'M', u'ὡι'), (0x1FA2, 'M', u'ὢι'), (0x1FA3, 'M', u'ὣι'), (0x1FA4, 'M', u'ὤι'), (0x1FA5, 'M', u'ὥι'), (0x1FA6, 'M', u'ὦι'), (0x1FA7, 'M', u'ὧι'), (0x1FA8, 'M', u'ὠι'), (0x1FA9, 'M', u'ὡι'), (0x1FAA, 'M', u'ὢι'), (0x1FAB, 'M', u'ὣι'), (0x1FAC, 'M', u'ὤι'), (0x1FAD, 'M', u'ὥι'), (0x1FAE, 'M', u'ὦι'), (0x1FAF, 'M', u'ὧι'), (0x1FB0, 'V'), (0x1FB2, 'M', u'ὰι'), (0x1FB3, 'M', u'αι'), (0x1FB4, 'M', u'άι'), (0x1FB5, 'X'), (0x1FB6, 'V'), (0x1FB7, 'M', u'ᾶι'), (0x1FB8, 'M', u'ᾰ'), (0x1FB9, 'M', u'ᾱ'), (0x1FBA, 'M', u'ὰ'), (0x1FBB, 'M', u'ά'), (0x1FBC, 'M', u'αι'), (0x1FBD, '3', u' ̓'), (0x1FBE, 'M', u'ι'), (0x1FBF, '3', u' ̓'), (0x1FC0, '3', u' ͂'), (0x1FC1, '3', u' ̈͂'), (0x1FC2, 'M', u'ὴι'), (0x1FC3, 'M', u'ηι'), (0x1FC4, 'M', u'ήι'), (0x1FC5, 'X'), (0x1FC6, 'V'), (0x1FC7, 'M', u'ῆι'), (0x1FC8, 'M', u'ὲ'), (0x1FC9, 'M', u'έ'), (0x1FCA, 'M', u'ὴ'), (0x1FCB, 'M', u'ή'), (0x1FCC, 'M', u'ηι'), (0x1FCD, '3', u' ̓̀'), (0x1FCE, '3', u' ̓́'), (0x1FCF, '3', u' ̓͂'), (0x1FD0, 'V'), (0x1FD3, 'M', u'ΐ'), (0x1FD4, 'X'), (0x1FD6, 'V'), (0x1FD8, 'M', u'ῐ'), (0x1FD9, 'M', u'ῑ'), (0x1FDA, 'M', u'ὶ'), (0x1FDB, 'M', u'ί'), (0x1FDC, 'X'), (0x1FDD, '3', u' ̔̀'), (0x1FDE, '3', u' ̔́'), (0x1FDF, '3', u' ̔͂'), (0x1FE0, 'V'), (0x1FE3, 'M', u'ΰ'), (0x1FE4, 'V'), (0x1FE8, 'M', u'ῠ'), (0x1FE9, 'M', u'ῡ'), (0x1FEA, 'M', u'ὺ'), (0x1FEB, 'M', u'ύ'), (0x1FEC, 'M', u'ῥ'), (0x1FED, '3', u' ̈̀'), (0x1FEE, '3', u' ̈́'), (0x1FEF, '3', u'`'), (0x1FF0, 'X'), (0x1FF2, 'M', u'ὼι'), (0x1FF3, 'M', u'ωι'), ] def _seg_21(): return [ (0x1FF4, 'M', u'ώι'), (0x1FF5, 'X'), (0x1FF6, 'V'), (0x1FF7, 'M', u'ῶι'), (0x1FF8, 'M', u'ὸ'), (0x1FF9, 'M', u'ό'), (0x1FFA, 'M', u'ὼ'), (0x1FFB, 'M', u'ώ'), (0x1FFC, 'M', u'ωι'), (0x1FFD, '3', u' ́'), (0x1FFE, '3', u' ̔'), (0x1FFF, 'X'), (0x2000, '3', u' '), (0x200B, 'I'), (0x200C, 'D', u''), (0x200E, 'X'), (0x2010, 'V'), (0x2011, 'M', u'‐'), (0x2012, 'V'), (0x2017, '3', u' ̳'), (0x2018, 'V'), (0x2024, 'X'), (0x2027, 'V'), (0x2028, 'X'), (0x202F, '3', u' '), (0x2030, 'V'), (0x2033, 'M', u'′′'), (0x2034, 'M', u'′′′'), (0x2035, 'V'), (0x2036, 'M', u'‵‵'), (0x2037, 'M', u'‵‵‵'), (0x2038, 'V'), (0x203C, '3', u'!!'), (0x203D, 'V'), (0x203E, '3', u' ̅'), (0x203F, 'V'), (0x2047, '3', u'??'), (0x2048, '3', u'?!'), (0x2049, '3', u'!?'), (0x204A, 'V'), (0x2057, 'M', u'′′′′'), (0x2058, 'V'), (0x205F, '3', u' '), (0x2060, 'I'), (0x2061, 'X'), (0x2064, 'I'), (0x2065, 'X'), (0x2070, 'M', u'0'), (0x2071, 'M', u'i'), (0x2072, 'X'), (0x2074, 'M', u'4'), (0x2075, 'M', u'5'), (0x2076, 'M', u'6'), (0x2077, 'M', u'7'), (0x2078, 'M', u'8'), (0x2079, 'M', u'9'), (0x207A, '3', u'+'), (0x207B, 'M', u'−'), (0x207C, '3', u'='), (0x207D, '3', u'('), (0x207E, '3', u')'), (0x207F, 'M', u'n'), (0x2080, 'M', u'0'), (0x2081, 'M', u'1'), (0x2082, 'M', u'2'), (0x2083, 'M', u'3'), (0x2084, 'M', u'4'), (0x2085, 'M', u'5'), (0x2086, 'M', u'6'), (0x2087, 'M', u'7'), (0x2088, 'M', u'8'), (0x2089, 'M', u'9'), (0x208A, '3', u'+'), (0x208B, 'M', u'−'), (0x208C, '3', u'='), (0x208D, '3', u'('), (0x208E, '3', u')'), (0x208F, 'X'), (0x2090, 'M', u'a'), (0x2091, 'M', u'e'), (0x2092, 'M', u'o'), (0x2093, 'M', u'x'), (0x2094, 'M', u'ə'), (0x2095, 'M', u'h'), (0x2096, 'M', u'k'), (0x2097, 'M', u'l'), (0x2098, 'M', u'm'), (0x2099, 'M', u'n'), (0x209A, 'M', u'p'), (0x209B, 'M', u's'), (0x209C, 'M', u't'), (0x209D, 'X'), (0x20A0, 'V'), (0x20A8, 'M', u'rs'), (0x20A9, 'V'), (0x20C0, 'X'), (0x20D0, 'V'), (0x20F1, 'X'), (0x2100, '3', u'a/c'), (0x2101, '3', u'a/s'), ] def _seg_22(): return [ (0x2102, 'M', u'c'), (0x2103, 'M', u'°c'), (0x2104, 'V'), (0x2105, '3', u'c/o'), (0x2106, '3', u'c/u'), (0x2107, 'M', u'ɛ'), (0x2108, 'V'), (0x2109, 'M', u'°f'), (0x210A, 'M', u'g'), (0x210B, 'M', u'h'), (0x210F, 'M', u'ħ'), (0x2110, 'M', u'i'), (0x2112, 'M', u'l'), (0x2114, 'V'), (0x2115, 'M', u'n'), (0x2116, 'M', u'no'), (0x2117, 'V'), (0x2119, 'M', u'p'), (0x211A, 'M', u'q'), (0x211B, 'M', u'r'), (0x211E, 'V'), (0x2120, 'M', u'sm'), (0x2121, 'M', u'tel'), (0x2122, 'M', u'tm'), (0x2123, 'V'), (0x2124, 'M', u'z'), (0x2125, 'V'), (0x2126, 'M', u'ω'), (0x2127, 'V'), (0x2128, 'M', u'z'), (0x2129, 'V'), (0x212A, 'M', u'k'), (0x212B, 'M', u'å'), (0x212C, 'M', u'b'), (0x212D, 'M', u'c'), (0x212E, 'V'), (0x212F, 'M', u'e'), (0x2131, 'M', u'f'), (0x2132, 'X'), (0x2133, 'M', u'm'), (0x2134, 'M', u'o'), (0x2135, 'M', u'א'), (0x2136, 'M', u'ב'), (0x2137, 'M', u'ג'), (0x2138, 'M', u'ד'), (0x2139, 'M', u'i'), (0x213A, 'V'), (0x213B, 'M', u'fax'), (0x213C, 'M', u'π'), (0x213D, 'M', u'γ'), (0x213F, 'M', u'π'), (0x2140, 'M', u'∑'), (0x2141, 'V'), (0x2145, 'M', u'd'), (0x2147, 'M', u'e'), (0x2148, 'M', u'i'), (0x2149, 'M', u'j'), (0x214A, 'V'), (0x2150, 'M', u'1⁄7'), (0x2151, 'M', u'1⁄9'), (0x2152, 'M', u'1⁄10'), (0x2153, 'M', u'1⁄3'), (0x2154, 'M', u'2⁄3'), (0x2155, 'M', u'1⁄5'), (0x2156, 'M', u'2⁄5'), (0x2157, 'M', u'3⁄5'), (0x2158, 'M', u'4⁄5'), (0x2159, 'M', u'1⁄6'), (0x215A, 'M', u'5⁄6'), (0x215B, 'M', u'1⁄8'), (0x215C, 'M', u'3⁄8'), (0x215D, 'M', u'5⁄8'), (0x215E, 'M', u'7⁄8'), (0x215F, 'M', u'1⁄'), (0x2160, 'M', u'i'), (0x2161, 'M', u'ii'), (0x2162, 'M', u'iii'), (0x2163, 'M', u'iv'), (0x2164, 'M', u'v'), (0x2165, 'M', u'vi'), (0x2166, 'M', u'vii'), (0x2167, 'M', u'viii'), (0x2168, 'M', u'ix'), (0x2169, 'M', u'x'), (0x216A, 'M', u'xi'), (0x216B, 'M', u'xii'), (0x216C, 'M', u'l'), (0x216D, 'M', u'c'), (0x216E, 'M', u'd'), (0x216F, 'M', u'm'), (0x2170, 'M', u'i'), (0x2171, 'M', u'ii'), (0x2172, 'M', u'iii'), (0x2173, 'M', u'iv'), (0x2174, 'M', u'v'), (0x2175, 'M', u'vi'), (0x2176, 'M', u'vii'), (0x2177, 'M', u'viii'), (0x2178, 'M', u'ix'), (0x2179, 'M', u'x'), ] def _seg_23(): return [ (0x217A, 'M', u'xi'), (0x217B, 'M', u'xii'), (0x217C, 'M', u'l'), (0x217D, 'M', u'c'), (0x217E, 'M', u'd'), (0x217F, 'M', u'm'), (0x2180, 'V'), (0x2183, 'X'), (0x2184, 'V'), (0x2189, 'M', u'0⁄3'), (0x218A, 'V'), (0x218C, 'X'), (0x2190, 'V'), (0x222C, 'M', u'∫∫'), (0x222D, 'M', u'∫∫∫'), (0x222E, 'V'), (0x222F, 'M', u'∮∮'), (0x2230, 'M', u'∮∮∮'), (0x2231, 'V'), (0x2260, '3'), (0x2261, 'V'), (0x226E, '3'), (0x2270, 'V'), (0x2329, 'M', u'〈'), (0x232A, 'M', u'〉'), (0x232B, 'V'), (0x2427, 'X'), (0x2440, 'V'), (0x244B, 'X'), (0x2460, 'M', u'1'), (0x2461, 'M', u'2'), (0x2462, 'M', u'3'), (0x2463, 'M', u'4'), (0x2464, 'M', u'5'), (0x2465, 'M', u'6'), (0x2466, 'M', u'7'), (0x2467, 'M', u'8'), (0x2468, 'M', u'9'), (0x2469, 'M', u'10'), (0x246A, 'M', u'11'), (0x246B, 'M', u'12'), (0x246C, 'M', u'13'), (0x246D, 'M', u'14'), (0x246E, 'M', u'15'), (0x246F, 'M', u'16'), (0x2470, 'M', u'17'), (0x2471, 'M', u'18'), (0x2472, 'M', u'19'), (0x2473, 'M', u'20'), (0x2474, '3', u'(1)'), (0x2475, '3', u'(2)'), (0x2476, '3', u'(3)'), (0x2477, '3', u'(4)'), (0x2478, '3', u'(5)'), (0x2479, '3', u'(6)'), (0x247A, '3', u'(7)'), (0x247B, '3', u'(8)'), (0x247C, '3', u'(9)'), (0x247D, '3', u'(10)'), (0x247E, '3', u'(11)'), (0x247F, '3', u'(12)'), (0x2480, '3', u'(13)'), (0x2481, '3', u'(14)'), (0x2482, '3', u'(15)'), (0x2483, '3', u'(16)'), (0x2484, '3', u'(17)'), (0x2485, '3', u'(18)'), (0x2486, '3', u'(19)'), (0x2487, '3', u'(20)'), (0x2488, 'X'), (0x249C, '3', u'(a)'), (0x249D, '3', u'(b)'), (0x249E, '3', u'(c)'), (0x249F, '3', u'(d)'), (0x24A0, '3', u'(e)'), (0x24A1, '3', u'(f)'), (0x24A2, '3', u'(g)'), (0x24A3, '3', u'(h)'), (0x24A4, '3', u'(i)'), (0x24A5, '3', u'(j)'), (0x24A6, '3', u'(k)'), (0x24A7, '3', u'(l)'), (0x24A8, '3', u'(m)'), (0x24A9, '3', u'(n)'), (0x24AA, '3', u'(o)'), (0x24AB, '3', u'(p)'), (0x24AC, '3', u'(q)'), (0x24AD, '3', u'(r)'), (0x24AE, '3', u'(s)'), (0x24AF, '3', u'(t)'), (0x24B0, '3', u'(u)'), (0x24B1, '3', u'(v)'), (0x24B2, '3', u'(w)'), (0x24B3, '3', u'(x)'), (0x24B4, '3', u'(y)'), (0x24B5, '3', u'(z)'), (0x24B6, 'M', u'a'), (0x24B7, 'M', u'b'), (0x24B8, 'M', u'c'), (0x24B9, 'M', u'd'), ] def _seg_24(): return [ (0x24BA, 'M', u'e'), (0x24BB, 'M', u'f'), (0x24BC, 'M', u'g'), (0x24BD, 'M', u'h'), (0x24BE, 'M', u'i'), (0x24BF, 'M', u'j'), (0x24C0, 'M', u'k'), (0x24C1, 'M', u'l'), (0x24C2, 'M', u'm'), (0x24C3, 'M', u'n'), (0x24C4, 'M', u'o'), (0x24C5, 'M', u'p'), (0x24C6, 'M', u'q'), (0x24C7, 'M', u'r'), (0x24C8, 'M', u's'), (0x24C9, 'M', u't'), (0x24CA, 'M', u'u'), (0x24CB, 'M', u'v'), (0x24CC, 'M', u'w'), (0x24CD, 'M', u'x'), (0x24CE, 'M', u'y'), (0x24CF, 'M', u'z'), (0x24D0, 'M', u'a'), (0x24D1, 'M', u'b'), (0x24D2, 'M', u'c'), (0x24D3, 'M', u'd'), (0x24D4, 'M', u'e'), (0x24D5, 'M', u'f'), (0x24D6, 'M', u'g'), (0x24D7, 'M', u'h'), (0x24D8, 'M', u'i'), (0x24D9, 'M', u'j'), (0x24DA, 'M', u'k'), (0x24DB, 'M', u'l'), (0x24DC, 'M', u'm'), (0x24DD, 'M', u'n'), (0x24DE, 'M', u'o'), (0x24DF, 'M', u'p'), (0x24E0, 'M', u'q'), (0x24E1, 'M', u'r'), (0x24E2, 'M', u's'), (0x24E3, 'M', u't'), (0x24E4, 'M', u'u'), (0x24E5, 'M', u'v'), (0x24E6, 'M', u'w'), (0x24E7, 'M', u'x'), (0x24E8, 'M', u'y'), (0x24E9, 'M', u'z'), (0x24EA, 'M', u'0'), (0x24EB, 'V'), (0x2A0C, 'M', u'∫∫∫∫'), (0x2A0D, 'V'), (0x2A74, '3', u'::='), (0x2A75, '3', u'=='), (0x2A76, '3', u'==='), (0x2A77, 'V'), (0x2ADC, 'M', u'⫝̸'), (0x2ADD, 'V'), (0x2B74, 'X'), (0x2B76, 'V'), (0x2B96, 'X'), (0x2B97, 'V'), (0x2C00, 'M', u'ⰰ'), (0x2C01, 'M', u'ⰱ'), (0x2C02, 'M', u'ⰲ'), (0x2C03, 'M', u'ⰳ'), (0x2C04, 'M', u'ⰴ'), (0x2C05, 'M', u'ⰵ'), (0x2C06, 'M', u'ⰶ'), (0x2C07, 'M', u'ⰷ'), (0x2C08, 'M', u'ⰸ'), (0x2C09, 'M', u'ⰹ'), (0x2C0A, 'M', u'ⰺ'), (0x2C0B, 'M', u'ⰻ'), (0x2C0C, 'M', u'ⰼ'), (0x2C0D, 'M', u'ⰽ'), (0x2C0E, 'M', u'ⰾ'), (0x2C0F, 'M', u'ⰿ'), (0x2C10, 'M', u'ⱀ'), (0x2C11, 'M', u'ⱁ'), (0x2C12, 'M', u'ⱂ'), (0x2C13, 'M', u'ⱃ'), (0x2C14, 'M', u'ⱄ'), (0x2C15, 'M', u'ⱅ'), (0x2C16, 'M', u'ⱆ'), (0x2C17, 'M', u'ⱇ'), (0x2C18, 'M', u'ⱈ'), (0x2C19, 'M', u'ⱉ'), (0x2C1A, 'M', u'ⱊ'), (0x2C1B, 'M', u'ⱋ'), (0x2C1C, 'M', u'ⱌ'), (0x2C1D, 'M', u'ⱍ'), (0x2C1E, 'M', u'ⱎ'), (0x2C1F, 'M', u'ⱏ'), (0x2C20, 'M', u'ⱐ'), (0x2C21, 'M', u'ⱑ'), (0x2C22, 'M', u'ⱒ'), (0x2C23, 'M', u'ⱓ'), (0x2C24, 'M', u'ⱔ'), (0x2C25, 'M', u'ⱕ'), ] def _seg_25(): return [ (0x2C26, 'M', u'ⱖ'), (0x2C27, 'M', u'ⱗ'), (0x2C28, 'M', u'ⱘ'), (0x2C29, 'M', u'ⱙ'), (0x2C2A, 'M', u'ⱚ'), (0x2C2B, 'M', u'ⱛ'), (0x2C2C, 'M', u'ⱜ'), (0x2C2D, 'M', u'ⱝ'), (0x2C2E, 'M', u'ⱞ'), (0x2C2F, 'X'), (0x2C30, 'V'), (0x2C5F, 'X'), (0x2C60, 'M', u'ⱡ'), (0x2C61, 'V'), (0x2C62, 'M', u'ɫ'), (0x2C63, 'M', u'ᵽ'), (0x2C64, 'M', u'ɽ'), (0x2C65, 'V'), (0x2C67, 'M', u'ⱨ'), (0x2C68, 'V'), (0x2C69, 'M', u'ⱪ'), (0x2C6A, 'V'), (0x2C6B, 'M', u'ⱬ'), (0x2C6C, 'V'), (0x2C6D, 'M', u'ɑ'), (0x2C6E, 'M', u'ɱ'), (0x2C6F, 'M', u'ɐ'), (0x2C70, 'M', u'ɒ'), (0x2C71, 'V'), (0x2C72, 'M', u'ⱳ'), (0x2C73, 'V'), (0x2C75, 'M', u'ⱶ'), (0x2C76, 'V'), (0x2C7C, 'M', u'j'), (0x2C7D, 'M', u'v'), (0x2C7E, 'M', u'ȿ'), (0x2C7F, 'M', u'ɀ'), (0x2C80, 'M', u'ⲁ'), (0x2C81, 'V'), (0x2C82, 'M', u'ⲃ'), (0x2C83, 'V'), (0x2C84, 'M', u'ⲅ'), (0x2C85, 'V'), (0x2C86, 'M', u'ⲇ'), (0x2C87, 'V'), (0x2C88, 'M', u'ⲉ'), (0x2C89, 'V'), (0x2C8A, 'M', u'ⲋ'), (0x2C8B, 'V'), (0x2C8C, 'M', u'ⲍ'), (0x2C8D, 'V'), (0x2C8E, 'M', u'ⲏ'), (0x2C8F, 'V'), (0x2C90, 'M', u'ⲑ'), (0x2C91, 'V'), (0x2C92, 'M', u'ⲓ'), (0x2C93, 'V'), (0x2C94, 'M', u'ⲕ'), (0x2C95, 'V'), (0x2C96, 'M', u'ⲗ'), (0x2C97, 'V'), (0x2C98, 'M', u'ⲙ'), (0x2C99, 'V'), (0x2C9A, 'M', u'ⲛ'), (0x2C9B, 'V'), (0x2C9C, 'M', u'ⲝ'), (0x2C9D, 'V'), (0x2C9E, 'M', u'ⲟ'), (0x2C9F, 'V'), (0x2CA0, 'M', u'ⲡ'), (0x2CA1, 'V'), (0x2CA2, 'M', u'ⲣ'), (0x2CA3, 'V'), (0x2CA4, 'M', u'ⲥ'), (0x2CA5, 'V'), (0x2CA6, 'M', u'ⲧ'), (0x2CA7, 'V'), (0x2CA8, 'M', u'ⲩ'), (0x2CA9, 'V'), (0x2CAA, 'M', u'ⲫ'), (0x2CAB, 'V'), (0x2CAC, 'M', u'ⲭ'), (0x2CAD, 'V'), (0x2CAE, 'M', u'ⲯ'), (0x2CAF, 'V'), (0x2CB0, 'M', u'ⲱ'), (0x2CB1, 'V'), (0x2CB2, 'M', u'ⲳ'), (0x2CB3, 'V'), (0x2CB4, 'M', u'ⲵ'), (0x2CB5, 'V'), (0x2CB6, 'M', u'ⲷ'), (0x2CB7, 'V'), (0x2CB8, 'M', u'ⲹ'), (0x2CB9, 'V'), (0x2CBA, 'M', u'ⲻ'), (0x2CBB, 'V'), (0x2CBC, 'M', u'ⲽ'), (0x2CBD, 'V'), (0x2CBE, 'M', u'ⲿ'), ] def _seg_26(): return [ (0x2CBF, 'V'), (0x2CC0, 'M', u'ⳁ'), (0x2CC1, 'V'), (0x2CC2, 'M', u'ⳃ'), (0x2CC3, 'V'), (0x2CC4, 'M', u'ⳅ'), (0x2CC5, 'V'), (0x2CC6, 'M', u'ⳇ'), (0x2CC7, 'V'), (0x2CC8, 'M', u'ⳉ'), (0x2CC9, 'V'), (0x2CCA, 'M', u'ⳋ'), (0x2CCB, 'V'), (0x2CCC, 'M', u'ⳍ'), (0x2CCD, 'V'), (0x2CCE, 'M', u'ⳏ'), (0x2CCF, 'V'), (0x2CD0, 'M', u'ⳑ'), (0x2CD1, 'V'), (0x2CD2, 'M', u'ⳓ'), (0x2CD3, 'V'), (0x2CD4, 'M', u'ⳕ'), (0x2CD5, 'V'), (0x2CD6, 'M', u'ⳗ'), (0x2CD7, 'V'), (0x2CD8, 'M', u'ⳙ'), (0x2CD9, 'V'), (0x2CDA, 'M', u'ⳛ'), (0x2CDB, 'V'), (0x2CDC, 'M', u'ⳝ'), (0x2CDD, 'V'), (0x2CDE, 'M', u'ⳟ'), (0x2CDF, 'V'), (0x2CE0, 'M', u'ⳡ'), (0x2CE1, 'V'), (0x2CE2, 'M', u'ⳣ'), (0x2CE3, 'V'), (0x2CEB, 'M', u'ⳬ'), (0x2CEC, 'V'), (0x2CED, 'M', u'ⳮ'), (0x2CEE, 'V'), (0x2CF2, 'M', u'ⳳ'), (0x2CF3, 'V'), (0x2CF4, 'X'), (0x2CF9, 'V'), (0x2D26, 'X'), (0x2D27, 'V'), (0x2D28, 'X'), (0x2D2D, 'V'), (0x2D2E, 'X'), (0x2D30, 'V'), (0x2D68, 'X'), (0x2D6F, 'M', u'ⵡ'), (0x2D70, 'V'), (0x2D71, 'X'), (0x2D7F, 'V'), (0x2D97, 'X'), (0x2DA0, 'V'), (0x2DA7, 'X'), (0x2DA8, 'V'), (0x2DAF, 'X'), (0x2DB0, 'V'), (0x2DB7, 'X'), (0x2DB8, 'V'), (0x2DBF, 'X'), (0x2DC0, 'V'), (0x2DC7, 'X'), (0x2DC8, 'V'), (0x2DCF, 'X'), (0x2DD0, 'V'), (0x2DD7, 'X'), (0x2DD8, 'V'), (0x2DDF, 'X'), (0x2DE0, 'V'), (0x2E53, 'X'), (0x2E80, 'V'), (0x2E9A, 'X'), (0x2E9B, 'V'), (0x2E9F, 'M', u'母'), (0x2EA0, 'V'), (0x2EF3, 'M', u'龟'), (0x2EF4, 'X'), (0x2F00, 'M', u'一'), (0x2F01, 'M', u'丨'), (0x2F02, 'M', u'丶'), (0x2F03, 'M', u'丿'), (0x2F04, 'M', u'乙'), (0x2F05, 'M', u'亅'), (0x2F06, 'M', u'二'), (0x2F07, 'M', u'亠'), (0x2F08, 'M', u'人'), (0x2F09, 'M', u'儿'), (0x2F0A, 'M', u'入'), (0x2F0B, 'M', u'八'), (0x2F0C, 'M', u'冂'), (0x2F0D, 'M', u'冖'), (0x2F0E, 'M', u'冫'), (0x2F0F, 'M', u'几'), (0x2F10, 'M', u'凵'), (0x2F11, 'M', u'刀'), ] def _seg_27(): return [ (0x2F12, 'M', u'力'), (0x2F13, 'M', u'勹'), (0x2F14, 'M', u'匕'), (0x2F15, 'M', u'匚'), (0x2F16, 'M', u'匸'), (0x2F17, 'M', u'十'), (0x2F18, 'M', u'卜'), (0x2F19, 'M', u'卩'), (0x2F1A, 'M', u'厂'), (0x2F1B, 'M', u'厶'), (0x2F1C, 'M', u'又'), (0x2F1D, 'M', u'口'), (0x2F1E, 'M', u'囗'), (0x2F1F, 'M', u'土'), (0x2F20, 'M', u'士'), (0x2F21, 'M', u'夂'), (0x2F22, 'M', u'夊'), (0x2F23, 'M', u'夕'), (0x2F24, 'M', u'大'), (0x2F25, 'M', u'女'), (0x2F26, 'M', u'子'), (0x2F27, 'M', u'宀'), (0x2F28, 'M', u'寸'), (0x2F29, 'M', u'小'), (0x2F2A, 'M', u'尢'), (0x2F2B, 'M', u'尸'), (0x2F2C, 'M', u'屮'), (0x2F2D, 'M', u'山'), (0x2F2E, 'M', u'巛'), (0x2F2F, 'M', u'工'), (0x2F30, 'M', u'己'), (0x2F31, 'M', u'巾'), (0x2F32, 'M', u'干'), (0x2F33, 'M', u'幺'), (0x2F34, 'M', u'广'), (0x2F35, 'M', u'廴'), (0x2F36, 'M', u'廾'), (0x2F37, 'M', u'弋'), (0x2F38, 'M', u'弓'), (0x2F39, 'M', u'彐'), (0x2F3A, 'M', u'彡'), (0x2F3B, 'M', u'彳'), (0x2F3C, 'M', u'心'), (0x2F3D, 'M', u'戈'), (0x2F3E, 'M', u'戶'), (0x2F3F, 'M', u'手'), (0x2F40, 'M', u'支'), (0x2F41, 'M', u'攴'), (0x2F42, 'M', u'文'), (0x2F43, 'M', u'斗'), (0x2F44, 'M', u'斤'), (0x2F45, 'M', u'方'), (0x2F46, 'M', u'无'), (0x2F47, 'M', u'日'), (0x2F48, 'M', u'曰'), (0x2F49, 'M', u'月'), (0x2F4A, 'M', u'木'), (0x2F4B, 'M', u'欠'), (0x2F4C, 'M', u'止'), (0x2F4D, 'M', u'歹'), (0x2F4E, 'M', u'殳'), (0x2F4F, 'M', u'毋'), (0x2F50, 'M', u'比'), (0x2F51, 'M', u'毛'), (0x2F52, 'M', u'氏'), (0x2F53, 'M', u'气'), (0x2F54, 'M', u'水'), (0x2F55, 'M', u'火'), (0x2F56, 'M', u'爪'), (0x2F57, 'M', u'父'), (0x2F58, 'M', u'爻'), (0x2F59, 'M', u'爿'), (0x2F5A, 'M', u'片'), (0x2F5B, 'M', u'牙'), (0x2F5C, 'M', u'牛'), (0x2F5D, 'M', u'犬'), (0x2F5E, 'M', u'玄'), (0x2F5F, 'M', u'玉'), (0x2F60, 'M', u'瓜'), (0x2F61, 'M', u'瓦'), (0x2F62, 'M', u'甘'), (0x2F63, 'M', u'生'), (0x2F64, 'M', u'用'), (0x2F65, 'M', u'田'), (0x2F66, 'M', u'疋'), (0x2F67, 'M', u'疒'), (0x2F68, 'M', u'癶'), (0x2F69, 'M', u'白'), (0x2F6A, 'M', u'皮'), (0x2F6B, 'M', u'皿'), (0x2F6C, 'M', u'目'), (0x2F6D, 'M', u'矛'), (0x2F6E, 'M', u'矢'), (0x2F6F, 'M', u'石'), (0x2F70, 'M', u'示'), (0x2F71, 'M', u'禸'), (0x2F72, 'M', u'禾'), (0x2F73, 'M', u'穴'), (0x2F74, 'M', u'立'), (0x2F75, 'M', u'竹'), ] def _seg_28(): return [ (0x2F76, 'M', u'米'), (0x2F77, 'M', u'糸'), (0x2F78, 'M', u'缶'), (0x2F79, 'M', u'网'), (0x2F7A, 'M', u'羊'), (0x2F7B, 'M', u'羽'), (0x2F7C, 'M', u'老'), (0x2F7D, 'M', u'而'), (0x2F7E, 'M', u'耒'), (0x2F7F, 'M', u'耳'), (0x2F80, 'M', u'聿'), (0x2F81, 'M', u'肉'), (0x2F82, 'M', u'臣'), (0x2F83, 'M', u'自'), (0x2F84, 'M', u'至'), (0x2F85, 'M', u'臼'), (0x2F86, 'M', u'舌'), (0x2F87, 'M', u'舛'), (0x2F88, 'M', u'舟'), (0x2F89, 'M', u'艮'), (0x2F8A, 'M', u'色'), (0x2F8B, 'M', u'艸'), (0x2F8C, 'M', u'虍'), (0x2F8D, 'M', u'虫'), (0x2F8E, 'M', u'血'), (0x2F8F, 'M', u'行'), (0x2F90, 'M', u'衣'), (0x2F91, 'M', u'襾'), (0x2F92, 'M', u'見'), (0x2F93, 'M', u'角'), (0x2F94, 'M', u'言'), (0x2F95, 'M', u'谷'), (0x2F96, 'M', u'豆'), (0x2F97, 'M', u'豕'), (0x2F98, 'M', u'豸'), (0x2F99, 'M', u'貝'), (0x2F9A, 'M', u'赤'), (0x2F9B, 'M', u'走'), (0x2F9C, 'M', u'足'), (0x2F9D, 'M', u'身'), (0x2F9E, 'M', u'車'), (0x2F9F, 'M', u'辛'), (0x2FA0, 'M', u'辰'), (0x2FA1, 'M', u'辵'), (0x2FA2, 'M', u'邑'), (0x2FA3, 'M', u'酉'), (0x2FA4, 'M', u'釆'), (0x2FA5, 'M', u'里'), (0x2FA6, 'M', u'金'), (0x2FA7, 'M', u'長'), (0x2FA8, 'M', u'門'), (0x2FA9, 'M', u'阜'), (0x2FAA, 'M', u'隶'), (0x2FAB, 'M', u'隹'), (0x2FAC, 'M', u'雨'), (0x2FAD, 'M', u'靑'), (0x2FAE, 'M', u'非'), (0x2FAF, 'M', u'面'), (0x2FB0, 'M', u'革'), (0x2FB1, 'M', u'韋'), (0x2FB2, 'M', u'韭'), (0x2FB3, 'M', u'音'), (0x2FB4, 'M', u'頁'), (0x2FB5, 'M', u'風'), (0x2FB6, 'M', u'飛'), (0x2FB7, 'M', u'食'), (0x2FB8, 'M', u'首'), (0x2FB9, 'M', u'香'), (0x2FBA, 'M', u'馬'), (0x2FBB, 'M', u'骨'), (0x2FBC, 'M', u'高'), (0x2FBD, 'M', u'髟'), (0x2FBE, 'M', u'鬥'), (0x2FBF, 'M', u'鬯'), (0x2FC0, 'M', u'鬲'), (0x2FC1, 'M', u'鬼'), (0x2FC2, 'M', u'魚'), (0x2FC3, 'M', u'鳥'), (0x2FC4, 'M', u'鹵'), (0x2FC5, 'M', u'鹿'), (0x2FC6, 'M', u'麥'), (0x2FC7, 'M', u'麻'), (0x2FC8, 'M', u'黃'), (0x2FC9, 'M', u'黍'), (0x2FCA, 'M', u'黑'), (0x2FCB, 'M', u'黹'), (0x2FCC, 'M', u'黽'), (0x2FCD, 'M', u'鼎'), (0x2FCE, 'M', u'鼓'), (0x2FCF, 'M', u'鼠'), (0x2FD0, 'M', u'鼻'), (0x2FD1, 'M', u'齊'), (0x2FD2, 'M', u'齒'), (0x2FD3, 'M', u'龍'), (0x2FD4, 'M', u'龜'), (0x2FD5, 'M', u'龠'), (0x2FD6, 'X'), (0x3000, '3', u' '), (0x3001, 'V'), (0x3002, 'M', u'.'), ] def _seg_29(): return [ (0x3003, 'V'), (0x3036, 'M', u'〒'), (0x3037, 'V'), (0x3038, 'M', u'十'), (0x3039, 'M', u'卄'), (0x303A, 'M', u'卅'), (0x303B, 'V'), (0x3040, 'X'), (0x3041, 'V'), (0x3097, 'X'), (0x3099, 'V'), (0x309B, '3', u' ゙'), (0x309C, '3', u' ゚'), (0x309D, 'V'), (0x309F, 'M', u'より'), (0x30A0, 'V'), (0x30FF, 'M', u'コト'), (0x3100, 'X'), (0x3105, 'V'), (0x3130, 'X'), (0x3131, 'M', u'ᄀ'), (0x3132, 'M', u'ᄁ'), (0x3133, 'M', u'ᆪ'), (0x3134, 'M', u'ᄂ'), (0x3135, 'M', u'ᆬ'), (0x3136, 'M', u'ᆭ'), (0x3137, 'M', u'ᄃ'), (0x3138, 'M', u'ᄄ'), (0x3139, 'M', u'ᄅ'), (0x313A, 'M', u'ᆰ'), (0x313B, 'M', u'ᆱ'), (0x313C, 'M', u'ᆲ'), (0x313D, 'M', u'ᆳ'), (0x313E, 'M', u'ᆴ'), (0x313F, 'M', u'ᆵ'), (0x3140, 'M', u'ᄚ'), (0x3141, 'M', u'ᄆ'), (0x3142, 'M', u'ᄇ'), (0x3143, 'M', u'ᄈ'), (0x3144, 'M', u'ᄡ'), (0x3145, 'M', u'ᄉ'), (0x3146, 'M', u'ᄊ'), (0x3147, 'M', u'ᄋ'), (0x3148, 'M', u'ᄌ'), (0x3149, 'M', u'ᄍ'), (0x314A, 'M', u'ᄎ'), (0x314B, 'M', u'ᄏ'), (0x314C, 'M', u'ᄐ'), (0x314D, 'M', u'ᄑ'), (0x314E, 'M', u'ᄒ'), (0x314F, 'M', u'ᅡ'), (0x3150, 'M', u'ᅢ'), (0x3151, 'M', u'ᅣ'), (0x3152, 'M', u'ᅤ'), (0x3153, 'M', u'ᅥ'), (0x3154, 'M', u'ᅦ'), (0x3155, 'M', u'ᅧ'), (0x3156, 'M', u'ᅨ'), (0x3157, 'M', u'ᅩ'), (0x3158, 'M', u'ᅪ'), (0x3159, 'M', u'ᅫ'), (0x315A, 'M', u'ᅬ'), (0x315B, 'M', u'ᅭ'), (0x315C, 'M', u'ᅮ'), (0x315D, 'M', u'ᅯ'), (0x315E, 'M', u'ᅰ'), (0x315F, 'M', u'ᅱ'), (0x3160, 'M', u'ᅲ'), (0x3161, 'M', u'ᅳ'), (0x3162, 'M', u'ᅴ'), (0x3163, 'M', u'ᅵ'), (0x3164, 'X'), (0x3165, 'M', u'ᄔ'), (0x3166, 'M', u'ᄕ'), (0x3167, 'M', u'ᇇ'), (0x3168, 'M', u'ᇈ'), (0x3169, 'M', u'ᇌ'), (0x316A, 'M', u'ᇎ'), (0x316B, 'M', u'ᇓ'), (0x316C, 'M', u'ᇗ'), (0x316D, 'M', u'ᇙ'), (0x316E, 'M', u'ᄜ'), (0x316F, 'M', u'ᇝ'), (0x3170, 'M', u'ᇟ'), (0x3171, 'M', u'ᄝ'), (0x3172, 'M', u'ᄞ'), (0x3173, 'M', u'ᄠ'), (0x3174, 'M', u'ᄢ'), (0x3175, 'M', u'ᄣ'), (0x3176, 'M', u'ᄧ'), (0x3177, 'M', u'ᄩ'), (0x3178, 'M', u'ᄫ'), (0x3179, 'M', u'ᄬ'), (0x317A, 'M', u'ᄭ'), (0x317B, 'M', u'ᄮ'), (0x317C, 'M', u'ᄯ'), (0x317D, 'M', u'ᄲ'), (0x317E, 'M', u'ᄶ'), (0x317F, 'M', u'ᅀ'), (0x3180, 'M', u'ᅇ'), ] def _seg_30(): return [ (0x3181, 'M', u'ᅌ'), (0x3182, 'M', u'ᇱ'), (0x3183, 'M', u'ᇲ'), (0x3184, 'M', u'ᅗ'), (0x3185, 'M', u'ᅘ'), (0x3186, 'M', u'ᅙ'), (0x3187, 'M', u'ᆄ'), (0x3188, 'M', u'ᆅ'), (0x3189, 'M', u'ᆈ'), (0x318A, 'M', u'ᆑ'), (0x318B, 'M', u'ᆒ'), (0x318C, 'M', u'ᆔ'), (0x318D, 'M', u'ᆞ'), (0x318E, 'M', u'ᆡ'), (0x318F, 'X'), (0x3190, 'V'), (0x3192, 'M', u'一'), (0x3193, 'M', u'二'), (0x3194, 'M', u'三'), (0x3195, 'M', u'四'), (0x3196, 'M', u'上'), (0x3197, 'M', u'中'), (0x3198, 'M', u'下'), (0x3199, 'M', u'甲'), (0x319A, 'M', u'乙'), (0x319B, 'M', u'丙'), (0x319C, 'M', u'丁'), (0x319D, 'M', u'天'), (0x319E, 'M', u'地'), (0x319F, 'M', u'人'), (0x31A0, 'V'), (0x31E4, 'X'), (0x31F0, 'V'), (0x3200, '3', u'(ᄀ)'), (0x3201, '3', u'(ᄂ)'), (0x3202, '3', u'(ᄃ)'), (0x3203, '3', u'(ᄅ)'), (0x3204, '3', u'(ᄆ)'), (0x3205, '3', u'(ᄇ)'), (0x3206, '3', u'(ᄉ)'), (0x3207, '3', u'(ᄋ)'), (0x3208, '3', u'(ᄌ)'), (0x3209, '3', u'(ᄎ)'), (0x320A, '3', u'(ᄏ)'), (0x320B, '3', u'(ᄐ)'), (0x320C, '3', u'(ᄑ)'), (0x320D, '3', u'(ᄒ)'), (0x320E, '3', u'(가)'), (0x320F, '3', u'(나)'), (0x3210, '3', u'(다)'), (0x3211, '3', u'(라)'), (0x3212, '3', u'(마)'), (0x3213, '3', u'(바)'), (0x3214, '3', u'(사)'), (0x3215, '3', u'(아)'), (0x3216, '3', u'(자)'), (0x3217, '3', u'(차)'), (0x3218, '3', u'(카)'), (0x3219, '3', u'(타)'), (0x321A, '3', u'(파)'), (0x321B, '3', u'(하)'), (0x321C, '3', u'(주)'), (0x321D, '3', u'(오전)'), (0x321E, '3', u'(오후)'), (0x321F, 'X'), (0x3220, '3', u'(一)'), (0x3221, '3', u'(二)'), (0x3222, '3', u'(三)'), (0x3223, '3', u'(四)'), (0x3224, '3', u'(五)'), (0x3225, '3', u'(六)'), (0x3226, '3', u'(七)'), (0x3227, '3', u'(八)'), (0x3228, '3', u'(九)'), (0x3229, '3', u'(十)'), (0x322A, '3', u'(月)'), (0x322B, '3', u'(火)'), (0x322C, '3', u'(水)'), (0x322D, '3', u'(木)'), (0x322E, '3', u'(金)'), (0x322F, '3', u'(土)'), (0x3230, '3', u'(日)'), (0x3231, '3', u'(株)'), (0x3232, '3', u'(有)'), (0x3233, '3', u'(社)'), (0x3234, '3', u'(名)'), (0x3235, '3', u'(特)'), (0x3236, '3', u'(財)'), (0x3237, '3', u'(祝)'), (0x3238, '3', u'(労)'), (0x3239, '3', u'(代)'), (0x323A, '3', u'(呼)'), (0x323B, '3', u'(学)'), (0x323C, '3', u'(監)'), (0x323D, '3', u'(企)'), (0x323E, '3', u'(資)'), (0x323F, '3', u'(協)'), (0x3240, '3', u'(祭)'), (0x3241, '3', u'(休)'), (0x3242, '3', u'(自)'), ] def _seg_31(): return [ (0x3243, '3', u'(至)'), (0x3244, 'M', u'問'), (0x3245, 'M', u'幼'), (0x3246, 'M', u'文'), (0x3247, 'M', u'箏'), (0x3248, 'V'), (0x3250, 'M', u'pte'), (0x3251, 'M', u'21'), (0x3252, 'M', u'22'), (0x3253, 'M', u'23'), (0x3254, 'M', u'24'), (0x3255, 'M', u'25'), (0x3256, 'M', u'26'), (0x3257, 'M', u'27'), (0x3258, 'M', u'28'), (0x3259, 'M', u'29'), (0x325A, 'M', u'30'), (0x325B, 'M', u'31'), (0x325C, 'M', u'32'), (0x325D, 'M', u'33'), (0x325E, 'M', u'34'), (0x325F, 'M', u'35'), (0x3260, 'M', u'ᄀ'), (0x3261, 'M', u'ᄂ'), (0x3262, 'M', u'ᄃ'), (0x3263, 'M', u'ᄅ'), (0x3264, 'M', u'ᄆ'), (0x3265, 'M', u'ᄇ'), (0x3266, 'M', u'ᄉ'), (0x3267, 'M', u'ᄋ'), (0x3268, 'M', u'ᄌ'), (0x3269, 'M', u'ᄎ'), (0x326A, 'M', u'ᄏ'), (0x326B, 'M', u'ᄐ'), (0x326C, 'M', u'ᄑ'), (0x326D, 'M', u'ᄒ'), (0x326E, 'M', u'가'), (0x326F, 'M', u'나'), (0x3270, 'M', u'다'), (0x3271, 'M', u'라'), (0x3272, 'M', u'마'), (0x3273, 'M', u'바'), (0x3274, 'M', u'사'), (0x3275, 'M', u'아'), (0x3276, 'M', u'자'), (0x3277, 'M', u'차'), (0x3278, 'M', u'카'), (0x3279, 'M', u'타'), (0x327A, 'M', u'파'), (0x327B, 'M', u'하'), (0x327C, 'M', u'참고'), (0x327D, 'M', u'주의'), (0x327E, 'M', u'우'), (0x327F, 'V'), (0x3280, 'M', u'一'), (0x3281, 'M', u'二'), (0x3282, 'M', u'三'), (0x3283, 'M', u'四'), (0x3284, 'M', u'五'), (0x3285, 'M', u'六'), (0x3286, 'M', u'七'), (0x3287, 'M', u'八'), (0x3288, 'M', u'九'), (0x3289, 'M', u'十'), (0x328A, 'M', u'月'), (0x328B, 'M', u'火'), (0x328C, 'M', u'水'), (0x328D, 'M', u'木'), (0x328E, 'M', u'金'), (0x328F, 'M', u'土'), (0x3290, 'M', u'日'), (0x3291, 'M', u'株'), (0x3292, 'M', u'有'), (0x3293, 'M', u'社'), (0x3294, 'M', u'名'), (0x3295, 'M', u'特'), (0x3296, 'M', u'財'), (0x3297, 'M', u'祝'), (0x3298, 'M', u'労'), (0x3299, 'M', u'秘'), (0x329A, 'M', u'男'), (0x329B, 'M', u'女'), (0x329C, 'M', u'適'), (0x329D, 'M', u'優'), (0x329E, 'M', u'印'), (0x329F, 'M', u'注'), (0x32A0, 'M', u'項'), (0x32A1, 'M', u'休'), (0x32A2, 'M', u'写'), (0x32A3, 'M', u'正'), (0x32A4, 'M', u'上'), (0x32A5, 'M', u'中'), (0x32A6, 'M', u'下'), (0x32A7, 'M', u'左'), (0x32A8, 'M', u'右'), (0x32A9, 'M', u'医'), (0x32AA, 'M', u'宗'), (0x32AB, 'M', u'学'), (0x32AC, 'M', u'監'), (0x32AD, 'M', u'企'), ] def _seg_32(): return [ (0x32AE, 'M', u'資'), (0x32AF, 'M', u'協'), (0x32B0, 'M', u'夜'), (0x32B1, 'M', u'36'), (0x32B2, 'M', u'37'), (0x32B3, 'M', u'38'), (0x32B4, 'M', u'39'), (0x32B5, 'M', u'40'), (0x32B6, 'M', u'41'), (0x32B7, 'M', u'42'), (0x32B8, 'M', u'43'), (0x32B9, 'M', u'44'), (0x32BA, 'M', u'45'), (0x32BB, 'M', u'46'), (0x32BC, 'M', u'47'), (0x32BD, 'M', u'48'), (0x32BE, 'M', u'49'), (0x32BF, 'M', u'50'), (0x32C0, 'M', u'1月'), (0x32C1, 'M', u'2月'), (0x32C2, 'M', u'3月'), (0x32C3, 'M', u'4月'), (0x32C4, 'M', u'5月'), (0x32C5, 'M', u'6月'), (0x32C6, 'M', u'7月'), (0x32C7, 'M', u'8月'), (0x32C8, 'M', u'9月'), (0x32C9, 'M', u'10月'), (0x32CA, 'M', u'11月'), (0x32CB, 'M', u'12月'), (0x32CC, 'M', u'hg'), (0x32CD, 'M', u'erg'), (0x32CE, 'M', u'ev'), (0x32CF, 'M', u'ltd'), (0x32D0, 'M', u'ア'), (0x32D1, 'M', u'イ'), (0x32D2, 'M', u'ウ'), (0x32D3, 'M', u'エ'), (0x32D4, 'M', u'オ'), (0x32D5, 'M', u'カ'), (0x32D6, 'M', u'キ'), (0x32D7, 'M', u'ク'), (0x32D8, 'M', u'ケ'), (0x32D9, 'M', u'コ'), (0x32DA, 'M', u'サ'), (0x32DB, 'M', u'シ'), (0x32DC, 'M', u'ス'), (0x32DD, 'M', u'セ'), (0x32DE, 'M', u'ソ'), (0x32DF, 'M', u'タ'), (0x32E0, 'M', u'チ'), (0x32E1, 'M', u'ツ'), (0x32E2, 'M', u'テ'), (0x32E3, 'M', u'ト'), (0x32E4, 'M', u'ナ'), (0x32E5, 'M', u'ニ'), (0x32E6, 'M', u'ヌ'), (0x32E7, 'M', u'ネ'), (0x32E8, 'M', u'ノ'), (0x32E9, 'M', u'ハ'), (0x32EA, 'M', u'ヒ'), (0x32EB, 'M', u'フ'), (0x32EC, 'M', u'ヘ'), (0x32ED, 'M', u'ホ'), (0x32EE, 'M', u'マ'), (0x32EF, 'M', u'ミ'), (0x32F0, 'M', u'ム'), (0x32F1, 'M', u'メ'), (0x32F2, 'M', u'モ'), (0x32F3, 'M', u'ヤ'), (0x32F4, 'M', u'ユ'), (0x32F5, 'M', u'ヨ'), (0x32F6, 'M', u'ラ'), (0x32F7, 'M', u'リ'), (0x32F8, 'M', u'ル'), (0x32F9, 'M', u'レ'), (0x32FA, 'M', u'ロ'), (0x32FB, 'M', u'ワ'), (0x32FC, 'M', u'ヰ'), (0x32FD, 'M', u'ヱ'), (0x32FE, 'M', u'ヲ'), (0x32FF, 'M', u'令和'), (0x3300, 'M', u'アパート'), (0x3301, 'M', u'アルファ'), (0x3302, 'M', u'アンペア'), (0x3303, 'M', u'アール'), (0x3304, 'M', u'イニング'), (0x3305, 'M', u'インチ'), (0x3306, 'M', u'ウォン'), (0x3307, 'M', u'エスクード'), (0x3308, 'M', u'エーカー'), (0x3309, 'M', u'オンス'), (0x330A, 'M', u'オーム'), (0x330B, 'M', u'カイリ'), (0x330C, 'M', u'カラット'), (0x330D, 'M', u'カロリー'), (0x330E, 'M', u'ガロン'), (0x330F, 'M', u'ガンマ'), (0x3310, 'M', u'ギガ'), (0x3311, 'M', u'ギニー'), ] def _seg_33(): return [ (0x3312, 'M', u'キュリー'), (0x3313, 'M', u'ギルダー'), (0x3314, 'M', u'キロ'), (0x3315, 'M', u'キログラム'), (0x3316, 'M', u'キロメートル'), (0x3317, 'M', u'キロワット'), (0x3318, 'M', u'グラム'), (0x3319, 'M', u'グラムトン'), (0x331A, 'M', u'クルゼイロ'), (0x331B, 'M', u'クローネ'), (0x331C, 'M', u'ケース'), (0x331D, 'M', u'コルナ'), (0x331E, 'M', u'コーポ'), (0x331F, 'M', u'サイクル'), (0x3320, 'M', u'サンチーム'), (0x3321, 'M', u'シリング'), (0x3322, 'M', u'センチ'), (0x3323, 'M', u'セント'), (0x3324, 'M', u'ダース'), (0x3325, 'M', u'デシ'), (0x3326, 'M', u'ドル'), (0x3327, 'M', u'トン'), (0x3328, 'M', u'ナノ'), (0x3329, 'M', u'ノット'), (0x332A, 'M', u'ハイツ'), (0x332B, 'M', u'パーセント'), (0x332C, 'M', u'パーツ'), (0x332D, 'M', u'バーレル'), (0x332E, 'M', u'ピアストル'), (0x332F, 'M', u'ピクル'), (0x3330, 'M', u'ピコ'), (0x3331, 'M', u'ビル'), (0x3332, 'M', u'ファラッド'), (0x3333, 'M', u'フィート'), (0x3334, 'M', u'ブッシェル'), (0x3335, 'M', u'フラン'), (0x3336, 'M', u'ヘクタール'), (0x3337, 'M', u'ペソ'), (0x3338, 'M', u'ペニヒ'), (0x3339, 'M', u'ヘルツ'), (0x333A, 'M', u'ペンス'), (0x333B, 'M', u'ページ'), (0x333C, 'M', u'ベータ'), (0x333D, 'M', u'ポイント'), (0x333E, 'M', u'ボルト'), (0x333F, 'M', u'ホン'), (0x3340, 'M', u'ポンド'), (0x3341, 'M', u'ホール'), (0x3342, 'M', u'ホーン'), (0x3343, 'M', u'マイクロ'), (0x3344, 'M', u'マイル'), (0x3345, 'M', u'マッハ'), (0x3346, 'M', u'マルク'), (0x3347, 'M', u'マンション'), (0x3348, 'M', u'ミクロン'), (0x3349, 'M', u'ミリ'), (0x334A, 'M', u'ミリバール'), (0x334B, 'M', u'メガ'), (0x334C, 'M', u'メガトン'), (0x334D, 'M', u'メートル'), (0x334E, 'M', u'ヤード'), (0x334F, 'M', u'ヤール'), (0x3350, 'M', u'ユアン'), (0x3351, 'M', u'リットル'), (0x3352, 'M', u'リラ'), (0x3353, 'M', u'ルピー'), (0x3354, 'M', u'ルーブル'), (0x3355, 'M', u'レム'), (0x3356, 'M', u'レントゲン'), (0x3357, 'M', u'ワット'), (0x3358, 'M', u'0点'), (0x3359, 'M', u'1点'), (0x335A, 'M', u'2点'), (0x335B, 'M', u'3点'), (0x335C, 'M', u'4点'), (0x335D, 'M', u'5点'), (0x335E, 'M', u'6点'), (0x335F, 'M', u'7点'), (0x3360, 'M', u'8点'), (0x3361, 'M', u'9点'), (0x3362, 'M', u'10点'), (0x3363, 'M', u'11点'), (0x3364, 'M', u'12点'), (0x3365, 'M', u'13点'), (0x3366, 'M', u'14点'), (0x3367, 'M', u'15点'), (0x3368, 'M', u'16点'), (0x3369, 'M', u'17点'), (0x336A, 'M', u'18点'), (0x336B, 'M', u'19点'), (0x336C, 'M', u'20点'), (0x336D, 'M', u'21点'), (0x336E, 'M', u'22点'), (0x336F, 'M', u'23点'), (0x3370, 'M', u'24点'), (0x3371, 'M', u'hpa'), (0x3372, 'M', u'da'), (0x3373, 'M', u'au'), (0x3374, 'M', u'bar'), (0x3375, 'M', u'ov'), ] def _seg_34(): return [ (0x3376, 'M', u'pc'), (0x3377, 'M', u'dm'), (0x3378, 'M', u'dm2'), (0x3379, 'M', u'dm3'), (0x337A, 'M', u'iu'), (0x337B, 'M', u'平成'), (0x337C, 'M', u'昭和'), (0x337D, 'M', u'大正'), (0x337E, 'M', u'明治'), (0x337F, 'M', u'株式会社'), (0x3380, 'M', u'pa'), (0x3381, 'M', u'na'), (0x3382, 'M', u'μa'), (0x3383, 'M', u'ma'), (0x3384, 'M', u'ka'), (0x3385, 'M', u'kb'), (0x3386, 'M', u'mb'), (0x3387, 'M', u'gb'), (0x3388, 'M', u'cal'), (0x3389, 'M', u'kcal'), (0x338A, 'M', u'pf'), (0x338B, 'M', u'nf'), (0x338C, 'M', u'μf'), (0x338D, 'M', u'μg'), (0x338E, 'M', u'mg'), (0x338F, 'M', u'kg'), (0x3390, 'M', u'hz'), (0x3391, 'M', u'khz'), (0x3392, 'M', u'mhz'), (0x3393, 'M', u'ghz'), (0x3394, 'M', u'thz'), (0x3395, 'M', u'μl'), (0x3396, 'M', u'ml'), (0x3397, 'M', u'dl'), (0x3398, 'M', u'kl'), (0x3399, 'M', u'fm'), (0x339A, 'M', u'nm'), (0x339B, 'M', u'μm'), (0x339C, 'M', u'mm'), (0x339D, 'M', u'cm'), (0x339E, 'M', u'km'), (0x339F, 'M', u'mm2'), (0x33A0, 'M', u'cm2'), (0x33A1, 'M', u'm2'), (0x33A2, 'M', u'km2'), (0x33A3, 'M', u'mm3'), (0x33A4, 'M', u'cm3'), (0x33A5, 'M', u'm3'), (0x33A6, 'M', u'km3'), (0x33A7, 'M', u'm∕s'), (0x33A8, 'M', u'm∕s2'), (0x33A9, 'M', u'pa'), (0x33AA, 'M', u'kpa'), (0x33AB, 'M', u'mpa'), (0x33AC, 'M', u'gpa'), (0x33AD, 'M', u'rad'), (0x33AE, 'M', u'rad∕s'), (0x33AF, 'M', u'rad∕s2'), (0x33B0, 'M', u'ps'), (0x33B1, 'M', u'ns'), (0x33B2, 'M', u'μs'), (0x33B3, 'M', u'ms'), (0x33B4, 'M', u'pv'), (0x33B5, 'M', u'nv'), (0x33B6, 'M', u'μv'), (0x33B7, 'M', u'mv'), (0x33B8, 'M', u'kv'), (0x33B9, 'M', u'mv'), (0x33BA, 'M', u'pw'), (0x33BB, 'M', u'nw'), (0x33BC, 'M', u'μw'), (0x33BD, 'M', u'mw'), (0x33BE, 'M', u'kw'), (0x33BF, 'M', u'mw'), (0x33C0, 'M', u'kω'), (0x33C1, 'M', u'mω'), (0x33C2, 'X'), (0x33C3, 'M', u'bq'), (0x33C4, 'M', u'cc'), (0x33C5, 'M', u'cd'), (0x33C6, 'M', u'c∕kg'), (0x33C7, 'X'), (0x33C8, 'M', u'db'), (0x33C9, 'M', u'gy'), (0x33CA, 'M', u'ha'), (0x33CB, 'M', u'hp'), (0x33CC, 'M', u'in'), (0x33CD, 'M', u'kk'), (0x33CE, 'M', u'km'), (0x33CF, 'M', u'kt'), (0x33D0, 'M', u'lm'), (0x33D1, 'M', u'ln'), (0x33D2, 'M', u'log'), (0x33D3, 'M', u'lx'), (0x33D4, 'M', u'mb'), (0x33D5, 'M', u'mil'), (0x33D6, 'M', u'mol'), (0x33D7, 'M', u'ph'), (0x33D8, 'X'), (0x33D9, 'M', u'ppm'), ] def _seg_35(): return [ (0x33DA, 'M', u'pr'), (0x33DB, 'M', u'sr'), (0x33DC, 'M', u'sv'), (0x33DD, 'M', u'wb'), (0x33DE, 'M', u'v∕m'), (0x33DF, 'M', u'a∕m'), (0x33E0, 'M', u'1日'), (0x33E1, 'M', u'2日'), (0x33E2, 'M', u'3日'), (0x33E3, 'M', u'4日'), (0x33E4, 'M', u'5日'), (0x33E5, 'M', u'6日'), (0x33E6, 'M', u'7日'), (0x33E7, 'M', u'8日'), (0x33E8, 'M', u'9日'), (0x33E9, 'M', u'10日'), (0x33EA, 'M', u'11日'), (0x33EB, 'M', u'12日'), (0x33EC, 'M', u'13日'), (0x33ED, 'M', u'14日'), (0x33EE, 'M', u'15日'), (0x33EF, 'M', u'16日'), (0x33F0, 'M', u'17日'), (0x33F1, 'M', u'18日'), (0x33F2, 'M', u'19日'), (0x33F3, 'M', u'20日'), (0x33F4, 'M', u'21日'), (0x33F5, 'M', u'22日'), (0x33F6, 'M', u'23日'), (0x33F7, 'M', u'24日'), (0x33F8, 'M', u'25日'), (0x33F9, 'M', u'26日'), (0x33FA, 'M', u'27日'), (0x33FB, 'M', u'28日'), (0x33FC, 'M', u'29日'), (0x33FD, 'M', u'30日'), (0x33FE, 'M', u'31日'), (0x33FF, 'M', u'gal'), (0x3400, 'V'), (0x9FFD, 'X'), (0xA000, 'V'), (0xA48D, 'X'), (0xA490, 'V'), (0xA4C7, 'X'), (0xA4D0, 'V'), (0xA62C, 'X'), (0xA640, 'M', u'ꙁ'), (0xA641, 'V'), (0xA642, 'M', u'ꙃ'), (0xA643, 'V'), (0xA644, 'M', u'ꙅ'), (0xA645, 'V'), (0xA646, 'M', u'ꙇ'), (0xA647, 'V'), (0xA648, 'M', u'ꙉ'), (0xA649, 'V'), (0xA64A, 'M', u'ꙋ'), (0xA64B, 'V'), (0xA64C, 'M', u'ꙍ'), (0xA64D, 'V'), (0xA64E, 'M', u'ꙏ'), (0xA64F, 'V'), (0xA650, 'M', u'ꙑ'), (0xA651, 'V'), (0xA652, 'M', u'ꙓ'), (0xA653, 'V'), (0xA654, 'M', u'ꙕ'), (0xA655, 'V'), (0xA656, 'M', u'ꙗ'), (0xA657, 'V'), (0xA658, 'M', u'ꙙ'), (0xA659, 'V'), (0xA65A, 'M', u'ꙛ'), (0xA65B, 'V'), (0xA65C, 'M', u'ꙝ'), (0xA65D, 'V'), (0xA65E, 'M', u'ꙟ'), (0xA65F, 'V'), (0xA660, 'M', u'ꙡ'), (0xA661, 'V'), (0xA662, 'M', u'ꙣ'), (0xA663, 'V'), (0xA664, 'M', u'ꙥ'), (0xA665, 'V'), (0xA666, 'M', u'ꙧ'), (0xA667, 'V'), (0xA668, 'M', u'ꙩ'), (0xA669, 'V'), (0xA66A, 'M', u'ꙫ'), (0xA66B, 'V'), (0xA66C, 'M', u'ꙭ'), (0xA66D, 'V'), (0xA680, 'M', u'ꚁ'), (0xA681, 'V'), (0xA682, 'M', u'ꚃ'), (0xA683, 'V'), (0xA684, 'M', u'ꚅ'), (0xA685, 'V'), (0xA686, 'M', u'ꚇ'), (0xA687, 'V'), ] def _seg_36(): return [ (0xA688, 'M', u'ꚉ'), (0xA689, 'V'), (0xA68A, 'M', u'ꚋ'), (0xA68B, 'V'), (0xA68C, 'M', u'ꚍ'), (0xA68D, 'V'), (0xA68E, 'M', u'ꚏ'), (0xA68F, 'V'), (0xA690, 'M', u'ꚑ'), (0xA691, 'V'), (0xA692, 'M', u'ꚓ'), (0xA693, 'V'), (0xA694, 'M', u'ꚕ'), (0xA695, 'V'), (0xA696, 'M', u'ꚗ'), (0xA697, 'V'), (0xA698, 'M', u'ꚙ'), (0xA699, 'V'), (0xA69A, 'M', u'ꚛ'), (0xA69B, 'V'), (0xA69C, 'M', u'ъ'), (0xA69D, 'M', u'ь'), (0xA69E, 'V'), (0xA6F8, 'X'), (0xA700, 'V'), (0xA722, 'M', u'ꜣ'), (0xA723, 'V'), (0xA724, 'M', u'ꜥ'), (0xA725, 'V'), (0xA726, 'M', u'ꜧ'), (0xA727, 'V'), (0xA728, 'M', u'ꜩ'), (0xA729, 'V'), (0xA72A, 'M', u'ꜫ'), (0xA72B, 'V'), (0xA72C, 'M', u'ꜭ'), (0xA72D, 'V'), (0xA72E, 'M', u'ꜯ'), (0xA72F, 'V'), (0xA732, 'M', u'ꜳ'), (0xA733, 'V'), (0xA734, 'M', u'ꜵ'), (0xA735, 'V'), (0xA736, 'M', u'ꜷ'), (0xA737, 'V'), (0xA738, 'M', u'ꜹ'), (0xA739, 'V'), (0xA73A, 'M', u'ꜻ'), (0xA73B, 'V'), (0xA73C, 'M', u'ꜽ'), (0xA73D, 'V'), (0xA73E, 'M', u'ꜿ'), (0xA73F, 'V'), (0xA740, 'M', u'ꝁ'), (0xA741, 'V'), (0xA742, 'M', u'ꝃ'), (0xA743, 'V'), (0xA744, 'M', u'ꝅ'), (0xA745, 'V'), (0xA746, 'M', u'ꝇ'), (0xA747, 'V'), (0xA748, 'M', u'ꝉ'), (0xA749, 'V'), (0xA74A, 'M', u'ꝋ'), (0xA74B, 'V'), (0xA74C, 'M', u'ꝍ'), (0xA74D, 'V'), (0xA74E, 'M', u'ꝏ'), (0xA74F, 'V'), (0xA750, 'M', u'ꝑ'), (0xA751, 'V'), (0xA752, 'M', u'ꝓ'), (0xA753, 'V'), (0xA754, 'M', u'ꝕ'), (0xA755, 'V'), (0xA756, 'M', u'ꝗ'), (0xA757, 'V'), (0xA758, 'M', u'ꝙ'), (0xA759, 'V'), (0xA75A, 'M', u'ꝛ'), (0xA75B, 'V'), (0xA75C, 'M', u'ꝝ'), (0xA75D, 'V'), (0xA75E, 'M', u'ꝟ'), (0xA75F, 'V'), (0xA760, 'M', u'ꝡ'), (0xA761, 'V'), (0xA762, 'M', u'ꝣ'), (0xA763, 'V'), (0xA764, 'M', u'ꝥ'), (0xA765, 'V'), (0xA766, 'M', u'ꝧ'), (0xA767, 'V'), (0xA768, 'M', u'ꝩ'), (0xA769, 'V'), (0xA76A, 'M', u'ꝫ'), (0xA76B, 'V'), (0xA76C, 'M', u'ꝭ'), (0xA76D, 'V'), (0xA76E, 'M', u'ꝯ'), ] def _seg_37(): return [ (0xA76F, 'V'), (0xA770, 'M', u'ꝯ'), (0xA771, 'V'), (0xA779, 'M', u'ꝺ'), (0xA77A, 'V'), (0xA77B, 'M', u'ꝼ'), (0xA77C, 'V'), (0xA77D, 'M', u'ᵹ'), (0xA77E, 'M', u'ꝿ'), (0xA77F, 'V'), (0xA780, 'M', u'ꞁ'), (0xA781, 'V'), (0xA782, 'M', u'ꞃ'), (0xA783, 'V'), (0xA784, 'M', u'ꞅ'), (0xA785, 'V'), (0xA786, 'M', u'ꞇ'), (0xA787, 'V'), (0xA78B, 'M', u'ꞌ'), (0xA78C, 'V'), (0xA78D, 'M', u'ɥ'), (0xA78E, 'V'), (0xA790, 'M', u'ꞑ'), (0xA791, 'V'), (0xA792, 'M', u'ꞓ'), (0xA793, 'V'), (0xA796, 'M', u'ꞗ'), (0xA797, 'V'), (0xA798, 'M', u'ꞙ'), (0xA799, 'V'), (0xA79A, 'M', u'ꞛ'), (0xA79B, 'V'), (0xA79C, 'M', u'ꞝ'), (0xA79D, 'V'), (0xA79E, 'M', u'ꞟ'), (0xA79F, 'V'), (0xA7A0, 'M', u'ꞡ'), (0xA7A1, 'V'), (0xA7A2, 'M', u'ꞣ'), (0xA7A3, 'V'), (0xA7A4, 'M', u'ꞥ'), (0xA7A5, 'V'), (0xA7A6, 'M', u'ꞧ'), (0xA7A7, 'V'), (0xA7A8, 'M', u'ꞩ'), (0xA7A9, 'V'), (0xA7AA, 'M', u'ɦ'), (0xA7AB, 'M', u'ɜ'), (0xA7AC, 'M', u'ɡ'), (0xA7AD, 'M', u'ɬ'), (0xA7AE, 'M', u'ɪ'), (0xA7AF, 'V'), (0xA7B0, 'M', u'ʞ'), (0xA7B1, 'M', u'ʇ'), (0xA7B2, 'M', u'ʝ'), (0xA7B3, 'M', u'ꭓ'), (0xA7B4, 'M', u'ꞵ'), (0xA7B5, 'V'), (0xA7B6, 'M', u'ꞷ'), (0xA7B7, 'V'), (0xA7B8, 'M', u'ꞹ'), (0xA7B9, 'V'), (0xA7BA, 'M', u'ꞻ'), (0xA7BB, 'V'), (0xA7BC, 'M', u'ꞽ'), (0xA7BD, 'V'), (0xA7BE, 'M', u'ꞿ'), (0xA7BF, 'V'), (0xA7C0, 'X'), (0xA7C2, 'M', u'ꟃ'), (0xA7C3, 'V'), (0xA7C4, 'M', u'ꞔ'), (0xA7C5, 'M', u'ʂ'), (0xA7C6, 'M', u'ᶎ'), (0xA7C7, 'M', u'ꟈ'), (0xA7C8, 'V'), (0xA7C9, 'M', u'ꟊ'), (0xA7CA, 'V'), (0xA7CB, 'X'), (0xA7F5, 'M', u'ꟶ'), (0xA7F6, 'V'), (0xA7F8, 'M', u'ħ'), (0xA7F9, 'M', u'œ'), (0xA7FA, 'V'), (0xA82D, 'X'), (0xA830, 'V'), (0xA83A, 'X'), (0xA840, 'V'), (0xA878, 'X'), (0xA880, 'V'), (0xA8C6, 'X'), (0xA8CE, 'V'), (0xA8DA, 'X'), (0xA8E0, 'V'), (0xA954, 'X'), (0xA95F, 'V'), (0xA97D, 'X'), (0xA980, 'V'), (0xA9CE, 'X'), (0xA9CF, 'V'), ] def _seg_38(): return [ (0xA9DA, 'X'), (0xA9DE, 'V'), (0xA9FF, 'X'), (0xAA00, 'V'), (0xAA37, 'X'), (0xAA40, 'V'), (0xAA4E, 'X'), (0xAA50, 'V'), (0xAA5A, 'X'), (0xAA5C, 'V'), (0xAAC3, 'X'), (0xAADB, 'V'), (0xAAF7, 'X'), (0xAB01, 'V'), (0xAB07, 'X'), (0xAB09, 'V'), (0xAB0F, 'X'), (0xAB11, 'V'), (0xAB17, 'X'), (0xAB20, 'V'), (0xAB27, 'X'), (0xAB28, 'V'), (0xAB2F, 'X'), (0xAB30, 'V'), (0xAB5C, 'M', u'ꜧ'), (0xAB5D, 'M', u'ꬷ'), (0xAB5E, 'M', u'ɫ'), (0xAB5F, 'M', u'ꭒ'), (0xAB60, 'V'), (0xAB69, 'M', u'ʍ'), (0xAB6A, 'V'), (0xAB6C, 'X'), (0xAB70, 'M', u'Ꭰ'), (0xAB71, 'M', u'Ꭱ'), (0xAB72, 'M', u'Ꭲ'), (0xAB73, 'M', u'Ꭳ'), (0xAB74, 'M', u'Ꭴ'), (0xAB75, 'M', u'Ꭵ'), (0xAB76, 'M', u'Ꭶ'), (0xAB77, 'M', u'Ꭷ'), (0xAB78, 'M', u'Ꭸ'), (0xAB79, 'M', u'Ꭹ'), (0xAB7A, 'M', u'Ꭺ'), (0xAB7B, 'M', u'Ꭻ'), (0xAB7C, 'M', u'Ꭼ'), (0xAB7D, 'M', u'Ꭽ'), (0xAB7E, 'M', u'Ꭾ'), (0xAB7F, 'M', u'Ꭿ'), (0xAB80, 'M', u'Ꮀ'), (0xAB81, 'M', u'Ꮁ'), (0xAB82, 'M', u'Ꮂ'), (0xAB83, 'M', u'Ꮃ'), (0xAB84, 'M', u'Ꮄ'), (0xAB85, 'M', u'Ꮅ'), (0xAB86, 'M', u'Ꮆ'), (0xAB87, 'M', u'Ꮇ'), (0xAB88, 'M', u'Ꮈ'), (0xAB89, 'M', u'Ꮉ'), (0xAB8A, 'M', u'Ꮊ'), (0xAB8B, 'M', u'Ꮋ'), (0xAB8C, 'M', u'Ꮌ'), (0xAB8D, 'M', u'Ꮍ'), (0xAB8E, 'M', u'Ꮎ'), (0xAB8F, 'M', u'Ꮏ'), (0xAB90, 'M', u'Ꮐ'), (0xAB91, 'M', u'Ꮑ'), (0xAB92, 'M', u'Ꮒ'), (0xAB93, 'M', u'Ꮓ'), (0xAB94, 'M', u'Ꮔ'), (0xAB95, 'M', u'Ꮕ'), (0xAB96, 'M', u'Ꮖ'), (0xAB97, 'M', u'Ꮗ'), (0xAB98, 'M', u'Ꮘ'), (0xAB99, 'M', u'Ꮙ'), (0xAB9A, 'M', u'Ꮚ'), (0xAB9B, 'M', u'Ꮛ'), (0xAB9C, 'M', u'Ꮜ'), (0xAB9D, 'M', u'Ꮝ'), (0xAB9E, 'M', u'Ꮞ'), (0xAB9F, 'M', u'Ꮟ'), (0xABA0, 'M', u'Ꮠ'), (0xABA1, 'M', u'Ꮡ'), (0xABA2, 'M', u'Ꮢ'), (0xABA3, 'M', u'Ꮣ'), (0xABA4, 'M', u'Ꮤ'), (0xABA5, 'M', u'Ꮥ'), (0xABA6, 'M', u'Ꮦ'), (0xABA7, 'M', u'Ꮧ'), (0xABA8, 'M', u'Ꮨ'), (0xABA9, 'M', u'Ꮩ'), (0xABAA, 'M', u'Ꮪ'), (0xABAB, 'M', u'Ꮫ'), (0xABAC, 'M', u'Ꮬ'), (0xABAD, 'M', u'Ꮭ'), (0xABAE, 'M', u'Ꮮ'), (0xABAF, 'M', u'Ꮯ'), (0xABB0, 'M', u'Ꮰ'), (0xABB1, 'M', u'Ꮱ'), (0xABB2, 'M', u'Ꮲ'), (0xABB3, 'M', u'Ꮳ'), ] def _seg_39(): return [ (0xABB4, 'M', u'Ꮴ'), (0xABB5, 'M', u'Ꮵ'), (0xABB6, 'M', u'Ꮶ'), (0xABB7, 'M', u'Ꮷ'), (0xABB8, 'M', u'Ꮸ'), (0xABB9, 'M', u'Ꮹ'), (0xABBA, 'M', u'Ꮺ'), (0xABBB, 'M', u'Ꮻ'), (0xABBC, 'M', u'Ꮼ'), (0xABBD, 'M', u'Ꮽ'), (0xABBE, 'M', u'Ꮾ'), (0xABBF, 'M', u'Ꮿ'), (0xABC0, 'V'), (0xABEE, 'X'), (0xABF0, 'V'), (0xABFA, 'X'), (0xAC00, 'V'), (0xD7A4, 'X'), (0xD7B0, 'V'), (0xD7C7, 'X'), (0xD7CB, 'V'), (0xD7FC, 'X'), (0xF900, 'M', u'豈'), (0xF901, 'M', u'更'), (0xF902, 'M', u'車'), (0xF903, 'M', u'賈'), (0xF904, 'M', u'滑'), (0xF905, 'M', u'串'), (0xF906, 'M', u'句'), (0xF907, 'M', u'龜'), (0xF909, 'M', u'契'), (0xF90A, 'M', u'金'), (0xF90B, 'M', u'喇'), (0xF90C, 'M', u'奈'), (0xF90D, 'M', u'懶'), (0xF90E, 'M', u'癩'), (0xF90F, 'M', u'羅'), (0xF910, 'M', u'蘿'), (0xF911, 'M', u'螺'), (0xF912, 'M', u'裸'), (0xF913, 'M', u'邏'), (0xF914, 'M', u'樂'), (0xF915, 'M', u'洛'), (0xF916, 'M', u'烙'), (0xF917, 'M', u'珞'), (0xF918, 'M', u'落'), (0xF919, 'M', u'酪'), (0xF91A, 'M', u'駱'), (0xF91B, 'M', u'亂'), (0xF91C, 'M', u'卵'), (0xF91D, 'M', u'欄'), (0xF91E, 'M', u'爛'), (0xF91F, 'M', u'蘭'), (0xF920, 'M', u'鸞'), (0xF921, 'M', u'嵐'), (0xF922, 'M', u'濫'), (0xF923, 'M', u'藍'), (0xF924, 'M', u'襤'), (0xF925, 'M', u'拉'), (0xF926, 'M', u'臘'), (0xF927, 'M', u'蠟'), (0xF928, 'M', u'廊'), (0xF929, 'M', u'朗'), (0xF92A, 'M', u'浪'), (0xF92B, 'M', u'狼'), (0xF92C, 'M', u'郎'), (0xF92D, 'M', u'來'), (0xF92E, 'M', u'冷'), (0xF92F, 'M', u'勞'), (0xF930, 'M', u'擄'), (0xF931, 'M', u'櫓'), (0xF932, 'M', u'爐'), (0xF933, 'M', u'盧'), (0xF934, 'M', u'老'), (0xF935, 'M', u'蘆'), (0xF936, 'M', u'虜'), (0xF937, 'M', u'路'), (0xF938, 'M', u'露'), (0xF939, 'M', u'魯'), (0xF93A, 'M', u'鷺'), (0xF93B, 'M', u'碌'), (0xF93C, 'M', u'祿'), (0xF93D, 'M', u'綠'), (0xF93E, 'M', u'菉'), (0xF93F, 'M', u'錄'), (0xF940, 'M', u'鹿'), (0xF941, 'M', u'論'), (0xF942, 'M', u'壟'), (0xF943, 'M', u'弄'), (0xF944, 'M', u'籠'), (0xF945, 'M', u'聾'), (0xF946, 'M', u'牢'), (0xF947, 'M', u'磊'), (0xF948, 'M', u'賂'), (0xF949, 'M', u'雷'), (0xF94A, 'M', u'壘'), (0xF94B, 'M', u'屢'), (0xF94C, 'M', u'樓'), (0xF94D, 'M', u'淚'), (0xF94E, 'M', u'漏'), ] def _seg_40(): return [ (0xF94F, 'M', u'累'), (0xF950, 'M', u'縷'), (0xF951, 'M', u'陋'), (0xF952, 'M', u'勒'), (0xF953, 'M', u'肋'), (0xF954, 'M', u'凜'), (0xF955, 'M', u'凌'), (0xF956, 'M', u'稜'), (0xF957, 'M', u'綾'), (0xF958, 'M', u'菱'), (0xF959, 'M', u'陵'), (0xF95A, 'M', u'讀'), (0xF95B, 'M', u'拏'), (0xF95C, 'M', u'樂'), (0xF95D, 'M', u'諾'), (0xF95E, 'M', u'丹'), (0xF95F, 'M', u'寧'), (0xF960, 'M', u'怒'), (0xF961, 'M', u'率'), (0xF962, 'M', u'異'), (0xF963, 'M', u'北'), (0xF964, 'M', u'磻'), (0xF965, 'M', u'便'), (0xF966, 'M', u'復'), (0xF967, 'M', u'不'), (0xF968, 'M', u'泌'), (0xF969, 'M', u'數'), (0xF96A, 'M', u'索'), (0xF96B, 'M', u'參'), (0xF96C, 'M', u'塞'), (0xF96D, 'M', u'省'), (0xF96E, 'M', u'葉'), (0xF96F, 'M', u'說'), (0xF970, 'M', u'殺'), (0xF971, 'M', u'辰'), (0xF972, 'M', u'沈'), (0xF973, 'M', u'拾'), (0xF974, 'M', u'若'), (0xF975, 'M', u'掠'), (0xF976, 'M', u'略'), (0xF977, 'M', u'亮'), (0xF978, 'M', u'兩'), (0xF979, 'M', u'凉'), (0xF97A, 'M', u'梁'), (0xF97B, 'M', u'糧'), (0xF97C, 'M', u'良'), (0xF97D, 'M', u'諒'), (0xF97E, 'M', u'量'), (0xF97F, 'M', u'勵'), (0xF980, 'M', u'呂'), (0xF981, 'M', u'女'), (0xF982, 'M', u'廬'), (0xF983, 'M', u'旅'), (0xF984, 'M', u'濾'), (0xF985, 'M', u'礪'), (0xF986, 'M', u'閭'), (0xF987, 'M', u'驪'), (0xF988, 'M', u'麗'), (0xF989, 'M', u'黎'), (0xF98A, 'M', u'力'), (0xF98B, 'M', u'曆'), (0xF98C, 'M', u'歷'), (0xF98D, 'M', u'轢'), (0xF98E, 'M', u'年'), (0xF98F, 'M', u'憐'), (0xF990, 'M', u'戀'), (0xF991, 'M', u'撚'), (0xF992, 'M', u'漣'), (0xF993, 'M', u'煉'), (0xF994, 'M', u'璉'), (0xF995, 'M', u'秊'), (0xF996, 'M', u'練'), (0xF997, 'M', u'聯'), (0xF998, 'M', u'輦'), (0xF999, 'M', u'蓮'), (0xF99A, 'M', u'連'), (0xF99B, 'M', u'鍊'), (0xF99C, 'M', u'列'), (0xF99D, 'M', u'劣'), (0xF99E, 'M', u'咽'), (0xF99F, 'M', u'烈'), (0xF9A0, 'M', u'裂'), (0xF9A1, 'M', u'說'), (0xF9A2, 'M', u'廉'), (0xF9A3, 'M', u'念'), (0xF9A4, 'M', u'捻'), (0xF9A5, 'M', u'殮'), (0xF9A6, 'M', u'簾'), (0xF9A7, 'M', u'獵'), (0xF9A8, 'M', u'令'), (0xF9A9, 'M', u'囹'), (0xF9AA, 'M', u'寧'), (0xF9AB, 'M', u'嶺'), (0xF9AC, 'M', u'怜'), (0xF9AD, 'M', u'玲'), (0xF9AE, 'M', u'瑩'), (0xF9AF, 'M', u'羚'), (0xF9B0, 'M', u'聆'), (0xF9B1, 'M', u'鈴'), (0xF9B2, 'M', u'零'), ] def _seg_41(): return [ (0xF9B3, 'M', u'靈'), (0xF9B4, 'M', u'領'), (0xF9B5, 'M', u'例'), (0xF9B6, 'M', u'禮'), (0xF9B7, 'M', u'醴'), (0xF9B8, 'M', u'隸'), (0xF9B9, 'M', u'惡'), (0xF9BA, 'M', u'了'), (0xF9BB, 'M', u'僚'), (0xF9BC, 'M', u'寮'), (0xF9BD, 'M', u'尿'), (0xF9BE, 'M', u'料'), (0xF9BF, 'M', u'樂'), (0xF9C0, 'M', u'燎'), (0xF9C1, 'M', u'療'), (0xF9C2, 'M', u'蓼'), (0xF9C3, 'M', u'遼'), (0xF9C4, 'M', u'龍'), (0xF9C5, 'M', u'暈'), (0xF9C6, 'M', u'阮'), (0xF9C7, 'M', u'劉'), (0xF9C8, 'M', u'杻'), (0xF9C9, 'M', u'柳'), (0xF9CA, 'M', u'流'), (0xF9CB, 'M', u'溜'), (0xF9CC, 'M', u'琉'), (0xF9CD, 'M', u'留'), (0xF9CE, 'M', u'硫'), (0xF9CF, 'M', u'紐'), (0xF9D0, 'M', u'類'), (0xF9D1, 'M', u'六'), (0xF9D2, 'M', u'戮'), (0xF9D3, 'M', u'陸'), (0xF9D4, 'M', u'倫'), (0xF9D5, 'M', u'崙'), (0xF9D6, 'M', u'淪'), (0xF9D7, 'M', u'輪'), (0xF9D8, 'M', u'律'), (0xF9D9, 'M', u'慄'), (0xF9DA, 'M', u'栗'), (0xF9DB, 'M', u'率'), (0xF9DC, 'M', u'隆'), (0xF9DD, 'M', u'利'), (0xF9DE, 'M', u'吏'), (0xF9DF, 'M', u'履'), (0xF9E0, 'M', u'易'), (0xF9E1, 'M', u'李'), (0xF9E2, 'M', u'梨'), (0xF9E3, 'M', u'泥'), (0xF9E4, 'M', u'理'), (0xF9E5, 'M', u'痢'), (0xF9E6, 'M', u'罹'), (0xF9E7, 'M', u'裏'), (0xF9E8, 'M', u'裡'), (0xF9E9, 'M', u'里'), (0xF9EA, 'M', u'離'), (0xF9EB, 'M', u'匿'), (0xF9EC, 'M', u'溺'), (0xF9ED, 'M', u'吝'), (0xF9EE, 'M', u'燐'), (0xF9EF, 'M', u'璘'), (0xF9F0, 'M', u'藺'), (0xF9F1, 'M', u'隣'), (0xF9F2, 'M', u'鱗'), (0xF9F3, 'M', u'麟'), (0xF9F4, 'M', u'林'), (0xF9F5, 'M', u'淋'), (0xF9F6, 'M', u'臨'), (0xF9F7, 'M', u'立'), (0xF9F8, 'M', u'笠'), (0xF9F9, 'M', u'粒'), (0xF9FA, 'M', u'狀'), (0xF9FB, 'M', u'炙'), (0xF9FC, 'M', u'識'), (0xF9FD, 'M', u'什'), (0xF9FE, 'M', u'茶'), (0xF9FF, 'M', u'刺'), (0xFA00, 'M', u'切'), (0xFA01, 'M', u'度'), (0xFA02, 'M', u'拓'), (0xFA03, 'M', u'糖'), (0xFA04, 'M', u'宅'), (0xFA05, 'M', u'洞'), (0xFA06, 'M', u'暴'), (0xFA07, 'M', u'輻'), (0xFA08, 'M', u'行'), (0xFA09, 'M', u'降'), (0xFA0A, 'M', u'見'), (0xFA0B, 'M', u'廓'), (0xFA0C, 'M', u'兀'), (0xFA0D, 'M', u'嗀'), (0xFA0E, 'V'), (0xFA10, 'M', u'塚'), (0xFA11, 'V'), (0xFA12, 'M', u'晴'), (0xFA13, 'V'), (0xFA15, 'M', u'凞'), (0xFA16, 'M', u'猪'), (0xFA17, 'M', u'益'), (0xFA18, 'M', u'礼'), ] def _seg_42(): return [ (0xFA19, 'M', u'神'), (0xFA1A, 'M', u'祥'), (0xFA1B, 'M', u'福'), (0xFA1C, 'M', u'靖'), (0xFA1D, 'M', u'精'), (0xFA1E, 'M', u'羽'), (0xFA1F, 'V'), (0xFA20, 'M', u'蘒'), (0xFA21, 'V'), (0xFA22, 'M', u'諸'), (0xFA23, 'V'), (0xFA25, 'M', u'逸'), (0xFA26, 'M', u'都'), (0xFA27, 'V'), (0xFA2A, 'M', u'飯'), (0xFA2B, 'M', u'飼'), (0xFA2C, 'M', u'館'), (0xFA2D, 'M', u'鶴'), (0xFA2E, 'M', u'郞'), (0xFA2F, 'M', u'隷'), (0xFA30, 'M', u'侮'), (0xFA31, 'M', u'僧'), (0xFA32, 'M', u'免'), (0xFA33, 'M', u'勉'), (0xFA34, 'M', u'勤'), (0xFA35, 'M', u'卑'), (0xFA36, 'M', u'喝'), (0xFA37, 'M', u'嘆'), (0xFA38, 'M', u'器'), (0xFA39, 'M', u'塀'), (0xFA3A, 'M', u'墨'), (0xFA3B, 'M', u'層'), (0xFA3C, 'M', u'屮'), (0xFA3D, 'M', u'悔'), (0xFA3E, 'M', u'慨'), (0xFA3F, 'M', u'憎'), (0xFA40, 'M', u'懲'), (0xFA41, 'M', u'敏'), (0xFA42, 'M', u'既'), (0xFA43, 'M', u'暑'), (0xFA44, 'M', u'梅'), (0xFA45, 'M', u'海'), (0xFA46, 'M', u'渚'), (0xFA47, 'M', u'漢'), (0xFA48, 'M', u'煮'), (0xFA49, 'M', u'爫'), (0xFA4A, 'M', u'琢'), (0xFA4B, 'M', u'碑'), (0xFA4C, 'M', u'社'), (0xFA4D, 'M', u'祉'), (0xFA4E, 'M', u'祈'), (0xFA4F, 'M', u'祐'), (0xFA50, 'M', u'祖'), (0xFA51, 'M', u'祝'), (0xFA52, 'M', u'禍'), (0xFA53, 'M', u'禎'), (0xFA54, 'M', u'穀'), (0xFA55, 'M', u'突'), (0xFA56, 'M', u'節'), (0xFA57, 'M', u'練'), (0xFA58, 'M', u'縉'), (0xFA59, 'M', u'繁'), (0xFA5A, 'M', u'署'), (0xFA5B, 'M', u'者'), (0xFA5C, 'M', u'臭'), (0xFA5D, 'M', u'艹'), (0xFA5F, 'M', u'著'), (0xFA60, 'M', u'褐'), (0xFA61, 'M', u'視'), (0xFA62, 'M', u'謁'), (0xFA63, 'M', u'謹'), (0xFA64, 'M', u'賓'), (0xFA65, 'M', u'贈'), (0xFA66, 'M', u'辶'), (0xFA67, 'M', u'逸'), (0xFA68, 'M', u'難'), (0xFA69, 'M', u'響'), (0xFA6A, 'M', u'頻'), (0xFA6B, 'M', u'恵'), (0xFA6C, 'M', u'𤋮'), (0xFA6D, 'M', u'舘'), (0xFA6E, 'X'), (0xFA70, 'M', u'並'), (0xFA71, 'M', u'况'), (0xFA72, 'M', u'全'), (0xFA73, 'M', u'侀'), (0xFA74, 'M', u'充'), (0xFA75, 'M', u'冀'), (0xFA76, 'M', u'勇'), (0xFA77, 'M', u'勺'), (0xFA78, 'M', u'喝'), (0xFA79, 'M', u'啕'), (0xFA7A, 'M', u'喙'), (0xFA7B, 'M', u'嗢'), (0xFA7C, 'M', u'塚'), (0xFA7D, 'M', u'墳'), (0xFA7E, 'M', u'奄'), (0xFA7F, 'M', u'奔'), (0xFA80, 'M', u'婢'), (0xFA81, 'M', u'嬨'), ] def _seg_43(): return [ (0xFA82, 'M', u'廒'), (0xFA83, 'M', u'廙'), (0xFA84, 'M', u'彩'), (0xFA85, 'M', u'徭'), (0xFA86, 'M', u'惘'), (0xFA87, 'M', u'慎'), (0xFA88, 'M', u'愈'), (0xFA89, 'M', u'憎'), (0xFA8A, 'M', u'慠'), (0xFA8B, 'M', u'懲'), (0xFA8C, 'M', u'戴'), (0xFA8D, 'M', u'揄'), (0xFA8E, 'M', u'搜'), (0xFA8F, 'M', u'摒'), (0xFA90, 'M', u'敖'), (0xFA91, 'M', u'晴'), (0xFA92, 'M', u'朗'), (0xFA93, 'M', u'望'), (0xFA94, 'M', u'杖'), (0xFA95, 'M', u'歹'), (0xFA96, 'M', u'殺'), (0xFA97, 'M', u'流'), (0xFA98, 'M', u'滛'), (0xFA99, 'M', u'滋'), (0xFA9A, 'M', u'漢'), (0xFA9B, 'M', u'瀞'), (0xFA9C, 'M', u'煮'), (0xFA9D, 'M', u'瞧'), (0xFA9E, 'M', u'爵'), (0xFA9F, 'M', u'犯'), (0xFAA0, 'M', u'猪'), (0xFAA1, 'M', u'瑱'), (0xFAA2, 'M', u'甆'), (0xFAA3, 'M', u'画'), (0xFAA4, 'M', u'瘝'), (0xFAA5, 'M', u'瘟'), (0xFAA6, 'M', u'益'), (0xFAA7, 'M', u'盛'), (0xFAA8, 'M', u'直'), (0xFAA9, 'M', u'睊'), (0xFAAA, 'M', u'着'), (0xFAAB, 'M', u'磌'), (0xFAAC, 'M', u'窱'), (0xFAAD, 'M', u'節'), (0xFAAE, 'M', u'类'), (0xFAAF, 'M', u'絛'), (0xFAB0, 'M', u'練'), (0xFAB1, 'M', u'缾'), (0xFAB2, 'M', u'者'), (0xFAB3, 'M', u'荒'), (0xFAB4, 'M', u'華'), (0xFAB5, 'M', u'蝹'), (0xFAB6, 'M', u'襁'), (0xFAB7, 'M', u'覆'), (0xFAB8, 'M', u'視'), (0xFAB9, 'M', u'調'), (0xFABA, 'M', u'諸'), (0xFABB, 'M', u'請'), (0xFABC, 'M', u'謁'), (0xFABD, 'M', u'諾'), (0xFABE, 'M', u'諭'), (0xFABF, 'M', u'謹'), (0xFAC0, 'M', u'變'), (0xFAC1, 'M', u'贈'), (0xFAC2, 'M', u'輸'), (0xFAC3, 'M', u'遲'), (0xFAC4, 'M', u'醙'), (0xFAC5, 'M', u'鉶'), (0xFAC6, 'M', u'陼'), (0xFAC7, 'M', u'難'), (0xFAC8, 'M', u'靖'), (0xFAC9, 'M', u'韛'), (0xFACA, 'M', u'響'), (0xFACB, 'M', u'頋'), (0xFACC, 'M', u'頻'), (0xFACD, 'M', u'鬒'), (0xFACE, 'M', u'龜'), (0xFACF, 'M', u'𢡊'), (0xFAD0, 'M', u'𢡄'), (0xFAD1, 'M', u'𣏕'), (0xFAD2, 'M', u'㮝'), (0xFAD3, 'M', u'䀘'), (0xFAD4, 'M', u'䀹'), (0xFAD5, 'M', u'𥉉'), (0xFAD6, 'M', u'𥳐'), (0xFAD7, 'M', u'𧻓'), (0xFAD8, 'M', u'齃'), (0xFAD9, 'M', u'龎'), (0xFADA, 'X'), (0xFB00, 'M', u'ff'), (0xFB01, 'M', u'fi'), (0xFB02, 'M', u'fl'), (0xFB03, 'M', u'ffi'), (0xFB04, 'M', u'ffl'), (0xFB05, 'M', u'st'), (0xFB07, 'X'), (0xFB13, 'M', u'մն'), (0xFB14, 'M', u'մե'), (0xFB15, 'M', u'մի'), (0xFB16, 'M', u'վն'), ] def _seg_44(): return [ (0xFB17, 'M', u'մխ'), (0xFB18, 'X'), (0xFB1D, 'M', u'יִ'), (0xFB1E, 'V'), (0xFB1F, 'M', u'ײַ'), (0xFB20, 'M', u'ע'), (0xFB21, 'M', u'א'), (0xFB22, 'M', u'ד'), (0xFB23, 'M', u'ה'), (0xFB24, 'M', u'כ'), (0xFB25, 'M', u'ל'), (0xFB26, 'M', u'ם'), (0xFB27, 'M', u'ר'), (0xFB28, 'M', u'ת'), (0xFB29, '3', u'+'), (0xFB2A, 'M', u'שׁ'), (0xFB2B, 'M', u'שׂ'), (0xFB2C, 'M', u'שּׁ'), (0xFB2D, 'M', u'שּׂ'), (0xFB2E, 'M', u'אַ'), (0xFB2F, 'M', u'אָ'), (0xFB30, 'M', u'אּ'), (0xFB31, 'M', u'בּ'), (0xFB32, 'M', u'גּ'), (0xFB33, 'M', u'דּ'), (0xFB34, 'M', u'הּ'), (0xFB35, 'M', u'וּ'), (0xFB36, 'M', u'זּ'), (0xFB37, 'X'), (0xFB38, 'M', u'טּ'), (0xFB39, 'M', u'יּ'), (0xFB3A, 'M', u'ךּ'), (0xFB3B, 'M', u'כּ'), (0xFB3C, 'M', u'לּ'), (0xFB3D, 'X'), (0xFB3E, 'M', u'מּ'), (0xFB3F, 'X'), (0xFB40, 'M', u'נּ'), (0xFB41, 'M', u'סּ'), (0xFB42, 'X'), (0xFB43, 'M', u'ףּ'), (0xFB44, 'M', u'פּ'), (0xFB45, 'X'), (0xFB46, 'M', u'צּ'), (0xFB47, 'M', u'קּ'), (0xFB48, 'M', u'רּ'), (0xFB49, 'M', u'שּ'), (0xFB4A, 'M', u'תּ'), (0xFB4B, 'M', u'וֹ'), (0xFB4C, 'M', u'בֿ'), (0xFB4D, 'M', u'כֿ'), (0xFB4E, 'M', u'פֿ'), (0xFB4F, 'M', u'אל'), (0xFB50, 'M', u'ٱ'), (0xFB52, 'M', u'ٻ'), (0xFB56, 'M', u'پ'), (0xFB5A, 'M', u'ڀ'), (0xFB5E, 'M', u'ٺ'), (0xFB62, 'M', u'ٿ'), (0xFB66, 'M', u'ٹ'), (0xFB6A, 'M', u'ڤ'), (0xFB6E, 'M', u'ڦ'), (0xFB72, 'M', u'ڄ'), (0xFB76, 'M', u'ڃ'), (0xFB7A, 'M', u'چ'), (0xFB7E, 'M', u'ڇ'), (0xFB82, 'M', u'ڍ'), (0xFB84, 'M', u'ڌ'), (0xFB86, 'M', u'ڎ'), (0xFB88, 'M', u'ڈ'), (0xFB8A, 'M', u'ژ'), (0xFB8C, 'M', u'ڑ'), (0xFB8E, 'M', u'ک'), (0xFB92, 'M', u'گ'), (0xFB96, 'M', u'ڳ'), (0xFB9A, 'M', u'ڱ'), (0xFB9E, 'M', u'ں'), (0xFBA0, 'M', u'ڻ'), (0xFBA4, 'M', u'ۀ'), (0xFBA6, 'M', u'ہ'), (0xFBAA, 'M', u'ھ'), (0xFBAE, 'M', u'ے'), (0xFBB0, 'M', u'ۓ'), (0xFBB2, 'V'), (0xFBC2, 'X'), (0xFBD3, 'M', u'ڭ'), (0xFBD7, 'M', u'ۇ'), (0xFBD9, 'M', u'ۆ'), (0xFBDB, 'M', u'ۈ'), (0xFBDD, 'M', u'ۇٴ'), (0xFBDE, 'M', u'ۋ'), (0xFBE0, 'M', u'ۅ'), (0xFBE2, 'M', u'ۉ'), (0xFBE4, 'M', u'ې'), (0xFBE8, 'M', u'ى'), (0xFBEA, 'M', u'ئا'), (0xFBEC, 'M', u'ئە'), (0xFBEE, 'M', u'ئو'), (0xFBF0, 'M', u'ئۇ'), (0xFBF2, 'M', u'ئۆ'), ] def _seg_45(): return [ (0xFBF4, 'M', u'ئۈ'), (0xFBF6, 'M', u'ئې'), (0xFBF9, 'M', u'ئى'), (0xFBFC, 'M', u'ی'), (0xFC00, 'M', u'ئج'), (0xFC01, 'M', u'ئح'), (0xFC02, 'M', u'ئم'), (0xFC03, 'M', u'ئى'), (0xFC04, 'M', u'ئي'), (0xFC05, 'M', u'بج'), (0xFC06, 'M', u'بح'), (0xFC07, 'M', u'بخ'), (0xFC08, 'M', u'بم'), (0xFC09, 'M', u'بى'), (0xFC0A, 'M', u'بي'), (0xFC0B, 'M', u'تج'), (0xFC0C, 'M', u'تح'), (0xFC0D, 'M', u'تخ'), (0xFC0E, 'M', u'تم'), (0xFC0F, 'M', u'تى'), (0xFC10, 'M', u'تي'), (0xFC11, 'M', u'ثج'), (0xFC12, 'M', u'ثم'), (0xFC13, 'M', u'ثى'), (0xFC14, 'M', u'ثي'), (0xFC15, 'M', u'جح'), (0xFC16, 'M', u'جم'), (0xFC17, 'M', u'حج'), (0xFC18, 'M', u'حم'), (0xFC19, 'M', u'خج'), (0xFC1A, 'M', u'خح'), (0xFC1B, 'M', u'خم'), (0xFC1C, 'M', u'سج'), (0xFC1D, 'M', u'سح'), (0xFC1E, 'M', u'سخ'), (0xFC1F, 'M', u'سم'), (0xFC20, 'M', u'صح'), (0xFC21, 'M', u'صم'), (0xFC22, 'M', u'ضج'), (0xFC23, 'M', u'ضح'), (0xFC24, 'M', u'ضخ'), (0xFC25, 'M', u'ضم'), (0xFC26, 'M', u'طح'), (0xFC27, 'M', u'طم'), (0xFC28, 'M', u'ظم'), (0xFC29, 'M', u'عج'), (0xFC2A, 'M', u'عم'), (0xFC2B, 'M', u'غج'), (0xFC2C, 'M', u'غم'), (0xFC2D, 'M', u'فج'), (0xFC2E, 'M', u'فح'), (0xFC2F, 'M', u'فخ'), (0xFC30, 'M', u'فم'), (0xFC31, 'M', u'فى'), (0xFC32, 'M', u'في'), (0xFC33, 'M', u'قح'), (0xFC34, 'M', u'قم'), (0xFC35, 'M', u'قى'), (0xFC36, 'M', u'قي'), (0xFC37, 'M', u'كا'), (0xFC38, 'M', u'كج'), (0xFC39, 'M', u'كح'), (0xFC3A, 'M', u'كخ'), (0xFC3B, 'M', u'كل'), (0xFC3C, 'M', u'كم'), (0xFC3D, 'M', u'كى'), (0xFC3E, 'M', u'كي'), (0xFC3F, 'M', u'لج'), (0xFC40, 'M', u'لح'), (0xFC41, 'M', u'لخ'), (0xFC42, 'M', u'لم'), (0xFC43, 'M', u'لى'), (0xFC44, 'M', u'لي'), (0xFC45, 'M', u'مج'), (0xFC46, 'M', u'مح'), (0xFC47, 'M', u'مخ'), (0xFC48, 'M', u'مم'), (0xFC49, 'M', u'مى'), (0xFC4A, 'M', u'مي'), (0xFC4B, 'M', u'نج'), (0xFC4C, 'M', u'نح'), (0xFC4D, 'M', u'نخ'), (0xFC4E, 'M', u'نم'), (0xFC4F, 'M', u'نى'), (0xFC50, 'M', u'ني'), (0xFC51, 'M', u'هج'), (0xFC52, 'M', u'هم'), (0xFC53, 'M', u'هى'), (0xFC54, 'M', u'هي'), (0xFC55, 'M', u'يج'), (0xFC56, 'M', u'يح'), (0xFC57, 'M', u'يخ'), (0xFC58, 'M', u'يم'), (0xFC59, 'M', u'يى'), (0xFC5A, 'M', u'يي'), (0xFC5B, 'M', u'ذٰ'), (0xFC5C, 'M', u'رٰ'), (0xFC5D, 'M', u'ىٰ'), (0xFC5E, '3', u' ٌّ'), (0xFC5F, '3', u' ٍّ'), ] def _seg_46(): return [ (0xFC60, '3', u' َّ'), (0xFC61, '3', u' ُّ'), (0xFC62, '3', u' ِّ'), (0xFC63, '3', u' ّٰ'), (0xFC64, 'M', u'ئر'), (0xFC65, 'M', u'ئز'), (0xFC66, 'M', u'ئم'), (0xFC67, 'M', u'ئن'), (0xFC68, 'M', u'ئى'), (0xFC69, 'M', u'ئي'), (0xFC6A, 'M', u'بر'), (0xFC6B, 'M', u'بز'), (0xFC6C, 'M', u'بم'), (0xFC6D, 'M', u'بن'), (0xFC6E, 'M', u'بى'), (0xFC6F, 'M', u'بي'), (0xFC70, 'M', u'تر'), (0xFC71, 'M', u'تز'), (0xFC72, 'M', u'تم'), (0xFC73, 'M', u'تن'), (0xFC74, 'M', u'تى'), (0xFC75, 'M', u'تي'), (0xFC76, 'M', u'ثر'), (0xFC77, 'M', u'ثز'), (0xFC78, 'M', u'ثم'), (0xFC79, 'M', u'ثن'), (0xFC7A, 'M', u'ثى'), (0xFC7B, 'M', u'ثي'), (0xFC7C, 'M', u'فى'), (0xFC7D, 'M', u'في'), (0xFC7E, 'M', u'قى'), (0xFC7F, 'M', u'قي'), (0xFC80, 'M', u'كا'), (0xFC81, 'M', u'كل'), (0xFC82, 'M', u'كم'), (0xFC83, 'M', u'كى'), (0xFC84, 'M', u'كي'), (0xFC85, 'M', u'لم'), (0xFC86, 'M', u'لى'), (0xFC87, 'M', u'لي'), (0xFC88, 'M', u'ما'), (0xFC89, 'M', u'مم'), (0xFC8A, 'M', u'نر'), (0xFC8B, 'M', u'نز'), (0xFC8C, 'M', u'نم'), (0xFC8D, 'M', u'نن'), (0xFC8E, 'M', u'نى'), (0xFC8F, 'M', u'ني'), (0xFC90, 'M', u'ىٰ'), (0xFC91, 'M', u'ير'), (0xFC92, 'M', u'يز'), (0xFC93, 'M', u'يم'), (0xFC94, 'M', u'ين'), (0xFC95, 'M', u'يى'), (0xFC96, 'M', u'يي'), (0xFC97, 'M', u'ئج'), (0xFC98, 'M', u'ئح'), (0xFC99, 'M', u'ئخ'), (0xFC9A, 'M', u'ئم'), (0xFC9B, 'M', u'ئه'), (0xFC9C, 'M', u'بج'), (0xFC9D, 'M', u'بح'), (0xFC9E, 'M', u'بخ'), (0xFC9F, 'M', u'بم'), (0xFCA0, 'M', u'به'), (0xFCA1, 'M', u'تج'), (0xFCA2, 'M', u'تح'), (0xFCA3, 'M', u'تخ'), (0xFCA4, 'M', u'تم'), (0xFCA5, 'M', u'ته'), (0xFCA6, 'M', u'ثم'), (0xFCA7, 'M', u'جح'), (0xFCA8, 'M', u'جم'), (0xFCA9, 'M', u'حج'), (0xFCAA, 'M', u'حم'), (0xFCAB, 'M', u'خج'), (0xFCAC, 'M', u'خم'), (0xFCAD, 'M', u'سج'), (0xFCAE, 'M', u'سح'), (0xFCAF, 'M', u'سخ'), (0xFCB0, 'M', u'سم'), (0xFCB1, 'M', u'صح'), (0xFCB2, 'M', u'صخ'), (0xFCB3, 'M', u'صم'), (0xFCB4, 'M', u'ضج'), (0xFCB5, 'M', u'ضح'), (0xFCB6, 'M', u'ضخ'), (0xFCB7, 'M', u'ضم'), (0xFCB8, 'M', u'طح'), (0xFCB9, 'M', u'ظم'), (0xFCBA, 'M', u'عج'), (0xFCBB, 'M', u'عم'), (0xFCBC, 'M', u'غج'), (0xFCBD, 'M', u'غم'), (0xFCBE, 'M', u'فج'), (0xFCBF, 'M', u'فح'), (0xFCC0, 'M', u'فخ'), (0xFCC1, 'M', u'فم'), (0xFCC2, 'M', u'قح'), (0xFCC3, 'M', u'قم'), ] def _seg_47(): return [ (0xFCC4, 'M', u'كج'), (0xFCC5, 'M', u'كح'), (0xFCC6, 'M', u'كخ'), (0xFCC7, 'M', u'كل'), (0xFCC8, 'M', u'كم'), (0xFCC9, 'M', u'لج'), (0xFCCA, 'M', u'لح'), (0xFCCB, 'M', u'لخ'), (0xFCCC, 'M', u'لم'), (0xFCCD, 'M', u'له'), (0xFCCE, 'M', u'مج'), (0xFCCF, 'M', u'مح'), (0xFCD0, 'M', u'مخ'), (0xFCD1, 'M', u'مم'), (0xFCD2, 'M', u'نج'), (0xFCD3, 'M', u'نح'), (0xFCD4, 'M', u'نخ'), (0xFCD5, 'M', u'نم'), (0xFCD6, 'M', u'نه'), (0xFCD7, 'M', u'هج'), (0xFCD8, 'M', u'هم'), (0xFCD9, 'M', u'هٰ'), (0xFCDA, 'M', u'يج'), (0xFCDB, 'M', u'يح'), (0xFCDC, 'M', u'يخ'), (0xFCDD, 'M', u'يم'), (0xFCDE, 'M', u'يه'), (0xFCDF, 'M', u'ئم'), (0xFCE0, 'M', u'ئه'), (0xFCE1, 'M', u'بم'), (0xFCE2, 'M', u'به'), (0xFCE3, 'M', u'تم'), (0xFCE4, 'M', u'ته'), (0xFCE5, 'M', u'ثم'), (0xFCE6, 'M', u'ثه'), (0xFCE7, 'M', u'سم'), (0xFCE8, 'M', u'سه'), (0xFCE9, 'M', u'شم'), (0xFCEA, 'M', u'شه'), (0xFCEB, 'M', u'كل'), (0xFCEC, 'M', u'كم'), (0xFCED, 'M', u'لم'), (0xFCEE, 'M', u'نم'), (0xFCEF, 'M', u'نه'), (0xFCF0, 'M', u'يم'), (0xFCF1, 'M', u'يه'), (0xFCF2, 'M', u'ـَّ'), (0xFCF3, 'M', u'ـُّ'), (0xFCF4, 'M', u'ـِّ'), (0xFCF5, 'M', u'طى'), (0xFCF6, 'M', u'طي'), (0xFCF7, 'M', u'عى'), (0xFCF8, 'M', u'عي'), (0xFCF9, 'M', u'غى'), (0xFCFA, 'M', u'غي'), (0xFCFB, 'M', u'سى'), (0xFCFC, 'M', u'سي'), (0xFCFD, 'M', u'شى'), (0xFCFE, 'M', u'شي'), (0xFCFF, 'M', u'حى'), (0xFD00, 'M', u'حي'), (0xFD01, 'M', u'جى'), (0xFD02, 'M', u'جي'), (0xFD03, 'M', u'خى'), (0xFD04, 'M', u'خي'), (0xFD05, 'M', u'صى'), (0xFD06, 'M', u'صي'), (0xFD07, 'M', u'ضى'), (0xFD08, 'M', u'ضي'), (0xFD09, 'M', u'شج'), (0xFD0A, 'M', u'شح'), (0xFD0B, 'M', u'شخ'), (0xFD0C, 'M', u'شم'), (0xFD0D, 'M', u'شر'), (0xFD0E, 'M', u'سر'), (0xFD0F, 'M', u'صر'), (0xFD10, 'M', u'ضر'), (0xFD11, 'M', u'طى'), (0xFD12, 'M', u'طي'), (0xFD13, 'M', u'عى'), (0xFD14, 'M', u'عي'), (0xFD15, 'M', u'غى'), (0xFD16, 'M', u'غي'), (0xFD17, 'M', u'سى'), (0xFD18, 'M', u'سي'), (0xFD19, 'M', u'شى'), (0xFD1A, 'M', u'شي'), (0xFD1B, 'M', u'حى'), (0xFD1C, 'M', u'حي'), (0xFD1D, 'M', u'جى'), (0xFD1E, 'M', u'جي'), (0xFD1F, 'M', u'خى'), (0xFD20, 'M', u'خي'), (0xFD21, 'M', u'صى'), (0xFD22, 'M', u'صي'), (0xFD23, 'M', u'ضى'), (0xFD24, 'M', u'ضي'), (0xFD25, 'M', u'شج'), (0xFD26, 'M', u'شح'), (0xFD27, 'M', u'شخ'), ] def _seg_48(): return [ (0xFD28, 'M', u'شم'), (0xFD29, 'M', u'شر'), (0xFD2A, 'M', u'سر'), (0xFD2B, 'M', u'صر'), (0xFD2C, 'M', u'ضر'), (0xFD2D, 'M', u'شج'), (0xFD2E, 'M', u'شح'), (0xFD2F, 'M', u'شخ'), (0xFD30, 'M', u'شم'), (0xFD31, 'M', u'سه'), (0xFD32, 'M', u'شه'), (0xFD33, 'M', u'طم'), (0xFD34, 'M', u'سج'), (0xFD35, 'M', u'سح'), (0xFD36, 'M', u'سخ'), (0xFD37, 'M', u'شج'), (0xFD38, 'M', u'شح'), (0xFD39, 'M', u'شخ'), (0xFD3A, 'M', u'طم'), (0xFD3B, 'M', u'ظم'), (0xFD3C, 'M', u'اً'), (0xFD3E, 'V'), (0xFD40, 'X'), (0xFD50, 'M', u'تجم'), (0xFD51, 'M', u'تحج'), (0xFD53, 'M', u'تحم'), (0xFD54, 'M', u'تخم'), (0xFD55, 'M', u'تمج'), (0xFD56, 'M', u'تمح'), (0xFD57, 'M', u'تمخ'), (0xFD58, 'M', u'جمح'), (0xFD5A, 'M', u'حمي'), (0xFD5B, 'M', u'حمى'), (0xFD5C, 'M', u'سحج'), (0xFD5D, 'M', u'سجح'), (0xFD5E, 'M', u'سجى'), (0xFD5F, 'M', u'سمح'), (0xFD61, 'M', u'سمج'), (0xFD62, 'M', u'سمم'), (0xFD64, 'M', u'صحح'), (0xFD66, 'M', u'صمم'), (0xFD67, 'M', u'شحم'), (0xFD69, 'M', u'شجي'), (0xFD6A, 'M', u'شمخ'), (0xFD6C, 'M', u'شمم'), (0xFD6E, 'M', u'ضحى'), (0xFD6F, 'M', u'ضخم'), (0xFD71, 'M', u'طمح'), (0xFD73, 'M', u'طمم'), (0xFD74, 'M', u'طمي'), (0xFD75, 'M', u'عجم'), (0xFD76, 'M', u'عمم'), (0xFD78, 'M', u'عمى'), (0xFD79, 'M', u'غمم'), (0xFD7A, 'M', u'غمي'), (0xFD7B, 'M', u'غمى'), (0xFD7C, 'M', u'فخم'), (0xFD7E, 'M', u'قمح'), (0xFD7F, 'M', u'قمم'), (0xFD80, 'M', u'لحم'), (0xFD81, 'M', u'لحي'), (0xFD82, 'M', u'لحى'), (0xFD83, 'M', u'لجج'), (0xFD85, 'M', u'لخم'), (0xFD87, 'M', u'لمح'), (0xFD89, 'M', u'محج'), (0xFD8A, 'M', u'محم'), (0xFD8B, 'M', u'محي'), (0xFD8C, 'M', u'مجح'), (0xFD8D, 'M', u'مجم'), (0xFD8E, 'M', u'مخج'), (0xFD8F, 'M', u'مخم'), (0xFD90, 'X'), (0xFD92, 'M', u'مجخ'), (0xFD93, 'M', u'همج'), (0xFD94, 'M', u'همم'), (0xFD95, 'M', u'نحم'), (0xFD96, 'M', u'نحى'), (0xFD97, 'M', u'نجم'), (0xFD99, 'M', u'نجى'), (0xFD9A, 'M', u'نمي'), (0xFD9B, 'M', u'نمى'), (0xFD9C, 'M', u'يمم'), (0xFD9E, 'M', u'بخي'), (0xFD9F, 'M', u'تجي'), (0xFDA0, 'M', u'تجى'), (0xFDA1, 'M', u'تخي'), (0xFDA2, 'M', u'تخى'), (0xFDA3, 'M', u'تمي'), (0xFDA4, 'M', u'تمى'), (0xFDA5, 'M', u'جمي'), (0xFDA6, 'M', u'جحى'), (0xFDA7, 'M', u'جمى'), (0xFDA8, 'M', u'سخى'), (0xFDA9, 'M', u'صحي'), (0xFDAA, 'M', u'شحي'), (0xFDAB, 'M', u'ضحي'), (0xFDAC, 'M', u'لجي'), (0xFDAD, 'M', u'لمي'), (0xFDAE, 'M', u'يحي'), ] def _seg_49(): return [ (0xFDAF, 'M', u'يجي'), (0xFDB0, 'M', u'يمي'), (0xFDB1, 'M', u'ممي'), (0xFDB2, 'M', u'قمي'), (0xFDB3, 'M', u'نحي'), (0xFDB4, 'M', u'قمح'), (0xFDB5, 'M', u'لحم'), (0xFDB6, 'M', u'عمي'), (0xFDB7, 'M', u'كمي'), (0xFDB8, 'M', u'نجح'), (0xFDB9, 'M', u'مخي'), (0xFDBA, 'M', u'لجم'), (0xFDBB, 'M', u'كمم'), (0xFDBC, 'M', u'لجم'), (0xFDBD, 'M', u'نجح'), (0xFDBE, 'M', u'جحي'), (0xFDBF, 'M', u'حجي'), (0xFDC0, 'M', u'مجي'), (0xFDC1, 'M', u'فمي'), (0xFDC2, 'M', u'بحي'), (0xFDC3, 'M', u'كمم'), (0xFDC4, 'M', u'عجم'), (0xFDC5, 'M', u'صمم'), (0xFDC6, 'M', u'سخي'), (0xFDC7, 'M', u'نجي'), (0xFDC8, 'X'), (0xFDF0, 'M', u'صلے'), (0xFDF1, 'M', u'قلے'), (0xFDF2, 'M', u'الله'), (0xFDF3, 'M', u'اكبر'), (0xFDF4, 'M', u'محمد'), (0xFDF5, 'M', u'صلعم'), (0xFDF6, 'M', u'رسول'), (0xFDF7, 'M', u'عليه'), (0xFDF8, 'M', u'وسلم'), (0xFDF9, 'M', u'صلى'), (0xFDFA, '3', u'صلى الله عليه وسلم'), (0xFDFB, '3', u'جل جلاله'), (0xFDFC, 'M', u'ریال'), (0xFDFD, 'V'), (0xFDFE, 'X'), (0xFE00, 'I'), (0xFE10, '3', u','), (0xFE11, 'M', u'、'), (0xFE12, 'X'), (0xFE13, '3', u':'), (0xFE14, '3', u';'), (0xFE15, '3', u'!'), (0xFE16, '3', u'?'), (0xFE17, 'M', u'〖'), (0xFE18, 'M', u'〗'), (0xFE19, 'X'), (0xFE20, 'V'), (0xFE30, 'X'), (0xFE31, 'M', u'—'), (0xFE32, 'M', u'–'), (0xFE33, '3', u'_'), (0xFE35, '3', u'('), (0xFE36, '3', u')'), (0xFE37, '3', u'{'), (0xFE38, '3', u'}'), (0xFE39, 'M', u'〔'), (0xFE3A, 'M', u'〕'), (0xFE3B, 'M', u'【'), (0xFE3C, 'M', u'】'), (0xFE3D, 'M', u'《'), (0xFE3E, 'M', u'》'), (0xFE3F, 'M', u'〈'), (0xFE40, 'M', u'〉'), (0xFE41, 'M', u'「'), (0xFE42, 'M', u'」'), (0xFE43, 'M', u'『'), (0xFE44, 'M', u'』'), (0xFE45, 'V'), (0xFE47, '3', u'['), (0xFE48, '3', u']'), (0xFE49, '3', u' ̅'), (0xFE4D, '3', u'_'), (0xFE50, '3', u','), (0xFE51, 'M', u'、'), (0xFE52, 'X'), (0xFE54, '3', u';'), (0xFE55, '3', u':'), (0xFE56, '3', u'?'), (0xFE57, '3', u'!'), (0xFE58, 'M', u'—'), (0xFE59, '3', u'('), (0xFE5A, '3', u')'), (0xFE5B, '3', u'{'), (0xFE5C, '3', u'}'), (0xFE5D, 'M', u'〔'), (0xFE5E, 'M', u'〕'), (0xFE5F, '3', u'#'), (0xFE60, '3', u'&'), (0xFE61, '3', u'*'), (0xFE62, '3', u'+'), (0xFE63, 'M', u'-'), (0xFE64, '3', u'<'), (0xFE65, '3', u'>'), (0xFE66, '3', u'='), ] def _seg_50(): return [ (0xFE67, 'X'), (0xFE68, '3', u'\\'), (0xFE69, '3', u'$'), (0xFE6A, '3', u'%'), (0xFE6B, '3', u'@'), (0xFE6C, 'X'), (0xFE70, '3', u' ً'), (0xFE71, 'M', u'ـً'), (0xFE72, '3', u' ٌ'), (0xFE73, 'V'), (0xFE74, '3', u' ٍ'), (0xFE75, 'X'), (0xFE76, '3', u' َ'), (0xFE77, 'M', u'ـَ'), (0xFE78, '3', u' ُ'), (0xFE79, 'M', u'ـُ'), (0xFE7A, '3', u' ِ'), (0xFE7B, 'M', u'ـِ'), (0xFE7C, '3', u' ّ'), (0xFE7D, 'M', u'ـّ'), (0xFE7E, '3', u' ْ'), (0xFE7F, 'M', u'ـْ'), (0xFE80, 'M', u'ء'), (0xFE81, 'M', u'آ'), (0xFE83, 'M', u'أ'), (0xFE85, 'M', u'ؤ'), (0xFE87, 'M', u'إ'), (0xFE89, 'M', u'ئ'), (0xFE8D, 'M', u'ا'), (0xFE8F, 'M', u'ب'), (0xFE93, 'M', u'ة'), (0xFE95, 'M', u'ت'), (0xFE99, 'M', u'ث'), (0xFE9D, 'M', u'ج'), (0xFEA1, 'M', u'ح'), (0xFEA5, 'M', u'خ'), (0xFEA9, 'M', u'د'), (0xFEAB, 'M', u'ذ'), (0xFEAD, 'M', u'ر'), (0xFEAF, 'M', u'ز'), (0xFEB1, 'M', u'س'), (0xFEB5, 'M', u'ش'), (0xFEB9, 'M', u'ص'), (0xFEBD, 'M', u'ض'), (0xFEC1, 'M', u'ط'), (0xFEC5, 'M', u'ظ'), (0xFEC9, 'M', u'ع'), (0xFECD, 'M', u'غ'), (0xFED1, 'M', u'ف'), (0xFED5, 'M', u'ق'), (0xFED9, 'M', u'ك'), (0xFEDD, 'M', u'ل'), (0xFEE1, 'M', u'م'), (0xFEE5, 'M', u'ن'), (0xFEE9, 'M', u'ه'), (0xFEED, 'M', u'و'), (0xFEEF, 'M', u'ى'), (0xFEF1, 'M', u'ي'), (0xFEF5, 'M', u'لآ'), (0xFEF7, 'M', u'لأ'), (0xFEF9, 'M', u'لإ'), (0xFEFB, 'M', u'لا'), (0xFEFD, 'X'), (0xFEFF, 'I'), (0xFF00, 'X'), (0xFF01, '3', u'!'), (0xFF02, '3', u'"'), (0xFF03, '3', u'#'), (0xFF04, '3', u'$'), (0xFF05, '3', u'%'), (0xFF06, '3', u'&'), (0xFF07, '3', u'\''), (0xFF08, '3', u'('), (0xFF09, '3', u')'), (0xFF0A, '3', u'*'), (0xFF0B, '3', u'+'), (0xFF0C, '3', u','), (0xFF0D, 'M', u'-'), (0xFF0E, 'M', u'.'), (0xFF0F, '3', u'/'), (0xFF10, 'M', u'0'), (0xFF11, 'M', u'1'), (0xFF12, 'M', u'2'), (0xFF13, 'M', u'3'), (0xFF14, 'M', u'4'), (0xFF15, 'M', u'5'), (0xFF16, 'M', u'6'), (0xFF17, 'M', u'7'), (0xFF18, 'M', u'8'), (0xFF19, 'M', u'9'), (0xFF1A, '3', u':'), (0xFF1B, '3', u';'), (0xFF1C, '3', u'<'), (0xFF1D, '3', u'='), (0xFF1E, '3', u'>'), (0xFF1F, '3', u'?'), (0xFF20, '3', u'@'), (0xFF21, 'M', u'a'), (0xFF22, 'M', u'b'), (0xFF23, 'M', u'c'), ] def _seg_51(): return [ (0xFF24, 'M', u'd'), (0xFF25, 'M', u'e'), (0xFF26, 'M', u'f'), (0xFF27, 'M', u'g'), (0xFF28, 'M', u'h'), (0xFF29, 'M', u'i'), (0xFF2A, 'M', u'j'), (0xFF2B, 'M', u'k'), (0xFF2C, 'M', u'l'), (0xFF2D, 'M', u'm'), (0xFF2E, 'M', u'n'), (0xFF2F, 'M', u'o'), (0xFF30, 'M', u'p'), (0xFF31, 'M', u'q'), (0xFF32, 'M', u'r'), (0xFF33, 'M', u's'), (0xFF34, 'M', u't'), (0xFF35, 'M', u'u'), (0xFF36, 'M', u'v'), (0xFF37, 'M', u'w'), (0xFF38, 'M', u'x'), (0xFF39, 'M', u'y'), (0xFF3A, 'M', u'z'), (0xFF3B, '3', u'['), (0xFF3C, '3', u'\\'), (0xFF3D, '3', u']'), (0xFF3E, '3', u'^'), (0xFF3F, '3', u'_'), (0xFF40, '3', u'`'), (0xFF41, 'M', u'a'), (0xFF42, 'M', u'b'), (0xFF43, 'M', u'c'), (0xFF44, 'M', u'd'), (0xFF45, 'M', u'e'), (0xFF46, 'M', u'f'), (0xFF47, 'M', u'g'), (0xFF48, 'M', u'h'), (0xFF49, 'M', u'i'), (0xFF4A, 'M', u'j'), (0xFF4B, 'M', u'k'), (0xFF4C, 'M', u'l'), (0xFF4D, 'M', u'm'), (0xFF4E, 'M', u'n'), (0xFF4F, 'M', u'o'), (0xFF50, 'M', u'p'), (0xFF51, 'M', u'q'), (0xFF52, 'M', u'r'), (0xFF53, 'M', u's'), (0xFF54, 'M', u't'), (0xFF55, 'M', u'u'), (0xFF56, 'M', u'v'), (0xFF57, 'M', u'w'), (0xFF58, 'M', u'x'), (0xFF59, 'M', u'y'), (0xFF5A, 'M', u'z'), (0xFF5B, '3', u'{'), (0xFF5C, '3', u'|'), (0xFF5D, '3', u'}'), (0xFF5E, '3', u'~'), (0xFF5F, 'M', u'⦅'), (0xFF60, 'M', u'⦆'), (0xFF61, 'M', u'.'), (0xFF62, 'M', u'「'), (0xFF63, 'M', u'」'), (0xFF64, 'M', u'、'), (0xFF65, 'M', u'・'), (0xFF66, 'M', u'ヲ'), (0xFF67, 'M', u'ァ'), (0xFF68, 'M', u'ィ'), (0xFF69, 'M', u'ゥ'), (0xFF6A, 'M', u'ェ'), (0xFF6B, 'M', u'ォ'), (0xFF6C, 'M', u'ャ'), (0xFF6D, 'M', u'ュ'), (0xFF6E, 'M', u'ョ'), (0xFF6F, 'M', u'ッ'), (0xFF70, 'M', u'ー'), (0xFF71, 'M', u'ア'), (0xFF72, 'M', u'イ'), (0xFF73, 'M', u'ウ'), (0xFF74, 'M', u'エ'), (0xFF75, 'M', u'オ'), (0xFF76, 'M', u'カ'), (0xFF77, 'M', u'キ'), (0xFF78, 'M', u'ク'), (0xFF79, 'M', u'ケ'), (0xFF7A, 'M', u'コ'), (0xFF7B, 'M', u'サ'), (0xFF7C, 'M', u'シ'), (0xFF7D, 'M', u'ス'), (0xFF7E, 'M', u'セ'), (0xFF7F, 'M', u'ソ'), (0xFF80, 'M', u'タ'), (0xFF81, 'M', u'チ'), (0xFF82, 'M', u'ツ'), (0xFF83, 'M', u'テ'), (0xFF84, 'M', u'ト'), (0xFF85, 'M', u'ナ'), (0xFF86, 'M', u'ニ'), (0xFF87, 'M', u'ヌ'), ] def _seg_52(): return [ (0xFF88, 'M', u'ネ'), (0xFF89, 'M', u'ノ'), (0xFF8A, 'M', u'ハ'), (0xFF8B, 'M', u'ヒ'), (0xFF8C, 'M', u'フ'), (0xFF8D, 'M', u'ヘ'), (0xFF8E, 'M', u'ホ'), (0xFF8F, 'M', u'マ'), (0xFF90, 'M', u'ミ'), (0xFF91, 'M', u'ム'), (0xFF92, 'M', u'メ'), (0xFF93, 'M', u'モ'), (0xFF94, 'M', u'ヤ'), (0xFF95, 'M', u'ユ'), (0xFF96, 'M', u'ヨ'), (0xFF97, 'M', u'ラ'), (0xFF98, 'M', u'リ'), (0xFF99, 'M', u'ル'), (0xFF9A, 'M', u'レ'), (0xFF9B, 'M', u'ロ'), (0xFF9C, 'M', u'ワ'), (0xFF9D, 'M', u'ン'), (0xFF9E, 'M', u'゙'), (0xFF9F, 'M', u'゚'), (0xFFA0, 'X'), (0xFFA1, 'M', u'ᄀ'), (0xFFA2, 'M', u'ᄁ'), (0xFFA3, 'M', u'ᆪ'), (0xFFA4, 'M', u'ᄂ'), (0xFFA5, 'M', u'ᆬ'), (0xFFA6, 'M', u'ᆭ'), (0xFFA7, 'M', u'ᄃ'), (0xFFA8, 'M', u'ᄄ'), (0xFFA9, 'M', u'ᄅ'), (0xFFAA, 'M', u'ᆰ'), (0xFFAB, 'M', u'ᆱ'), (0xFFAC, 'M', u'ᆲ'), (0xFFAD, 'M', u'ᆳ'), (0xFFAE, 'M', u'ᆴ'), (0xFFAF, 'M', u'ᆵ'), (0xFFB0, 'M', u'ᄚ'), (0xFFB1, 'M', u'ᄆ'), (0xFFB2, 'M', u'ᄇ'), (0xFFB3, 'M', u'ᄈ'), (0xFFB4, 'M', u'ᄡ'), (0xFFB5, 'M', u'ᄉ'), (0xFFB6, 'M', u'ᄊ'), (0xFFB7, 'M', u'ᄋ'), (0xFFB8, 'M', u'ᄌ'), (0xFFB9, 'M', u'ᄍ'), (0xFFBA, 'M', u'ᄎ'), (0xFFBB, 'M', u'ᄏ'), (0xFFBC, 'M', u'ᄐ'), (0xFFBD, 'M', u'ᄑ'), (0xFFBE, 'M', u'ᄒ'), (0xFFBF, 'X'), (0xFFC2, 'M', u'ᅡ'), (0xFFC3, 'M', u'ᅢ'), (0xFFC4, 'M', u'ᅣ'), (0xFFC5, 'M', u'ᅤ'), (0xFFC6, 'M', u'ᅥ'), (0xFFC7, 'M', u'ᅦ'), (0xFFC8, 'X'), (0xFFCA, 'M', u'ᅧ'), (0xFFCB, 'M', u'ᅨ'), (0xFFCC, 'M', u'ᅩ'), (0xFFCD, 'M', u'ᅪ'), (0xFFCE, 'M', u'ᅫ'), (0xFFCF, 'M', u'ᅬ'), (0xFFD0, 'X'), (0xFFD2, 'M', u'ᅭ'), (0xFFD3, 'M', u'ᅮ'), (0xFFD4, 'M', u'ᅯ'), (0xFFD5, 'M', u'ᅰ'), (0xFFD6, 'M', u'ᅱ'), (0xFFD7, 'M', u'ᅲ'), (0xFFD8, 'X'), (0xFFDA, 'M', u'ᅳ'), (0xFFDB, 'M', u'ᅴ'), (0xFFDC, 'M', u'ᅵ'), (0xFFDD, 'X'), (0xFFE0, 'M', u'¢'), (0xFFE1, 'M', u'£'), (0xFFE2, 'M', u'¬'), (0xFFE3, '3', u' ̄'), (0xFFE4, 'M', u'¦'), (0xFFE5, 'M', u'¥'), (0xFFE6, 'M', u'₩'), (0xFFE7, 'X'), (0xFFE8, 'M', u'│'), (0xFFE9, 'M', u'←'), (0xFFEA, 'M', u'↑'), (0xFFEB, 'M', u'→'), (0xFFEC, 'M', u'↓'), (0xFFED, 'M', u'■'), (0xFFEE, 'M', u'○'), (0xFFEF, 'X'), (0x10000, 'V'), (0x1000C, 'X'), (0x1000D, 'V'), ] def _seg_53(): return [ (0x10027, 'X'), (0x10028, 'V'), (0x1003B, 'X'), (0x1003C, 'V'), (0x1003E, 'X'), (0x1003F, 'V'), (0x1004E, 'X'), (0x10050, 'V'), (0x1005E, 'X'), (0x10080, 'V'), (0x100FB, 'X'), (0x10100, 'V'), (0x10103, 'X'), (0x10107, 'V'), (0x10134, 'X'), (0x10137, 'V'), (0x1018F, 'X'), (0x10190, 'V'), (0x1019D, 'X'), (0x101A0, 'V'), (0x101A1, 'X'), (0x101D0, 'V'), (0x101FE, 'X'), (0x10280, 'V'), (0x1029D, 'X'), (0x102A0, 'V'), (0x102D1, 'X'), (0x102E0, 'V'), (0x102FC, 'X'), (0x10300, 'V'), (0x10324, 'X'), (0x1032D, 'V'), (0x1034B, 'X'), (0x10350, 'V'), (0x1037B, 'X'), (0x10380, 'V'), (0x1039E, 'X'), (0x1039F, 'V'), (0x103C4, 'X'), (0x103C8, 'V'), (0x103D6, 'X'), (0x10400, 'M', u'𐐨'), (0x10401, 'M', u'𐐩'), (0x10402, 'M', u'𐐪'), (0x10403, 'M', u'𐐫'), (0x10404, 'M', u'𐐬'), (0x10405, 'M', u'𐐭'), (0x10406, 'M', u'𐐮'), (0x10407, 'M', u'𐐯'), (0x10408, 'M', u'𐐰'), (0x10409, 'M', u'𐐱'), (0x1040A, 'M', u'𐐲'), (0x1040B, 'M', u'𐐳'), (0x1040C, 'M', u'𐐴'), (0x1040D, 'M', u'𐐵'), (0x1040E, 'M', u'𐐶'), (0x1040F, 'M', u'𐐷'), (0x10410, 'M', u'𐐸'), (0x10411, 'M', u'𐐹'), (0x10412, 'M', u'𐐺'), (0x10413, 'M', u'𐐻'), (0x10414, 'M', u'𐐼'), (0x10415, 'M', u'𐐽'), (0x10416, 'M', u'𐐾'), (0x10417, 'M', u'𐐿'), (0x10418, 'M', u'𐑀'), (0x10419, 'M', u'𐑁'), (0x1041A, 'M', u'𐑂'), (0x1041B, 'M', u'𐑃'), (0x1041C, 'M', u'𐑄'), (0x1041D, 'M', u'𐑅'), (0x1041E, 'M', u'𐑆'), (0x1041F, 'M', u'𐑇'), (0x10420, 'M', u'𐑈'), (0x10421, 'M', u'𐑉'), (0x10422, 'M', u'𐑊'), (0x10423, 'M', u'𐑋'), (0x10424, 'M', u'𐑌'), (0x10425, 'M', u'𐑍'), (0x10426, 'M', u'𐑎'), (0x10427, 'M', u'𐑏'), (0x10428, 'V'), (0x1049E, 'X'), (0x104A0, 'V'), (0x104AA, 'X'), (0x104B0, 'M', u'𐓘'), (0x104B1, 'M', u'𐓙'), (0x104B2, 'M', u'𐓚'), (0x104B3, 'M', u'𐓛'), (0x104B4, 'M', u'𐓜'), (0x104B5, 'M', u'𐓝'), (0x104B6, 'M', u'𐓞'), (0x104B7, 'M', u'𐓟'), (0x104B8, 'M', u'𐓠'), (0x104B9, 'M', u'𐓡'), (0x104BA, 'M', u'𐓢'), (0x104BB, 'M', u'𐓣'), (0x104BC, 'M', u'𐓤'), (0x104BD, 'M', u'𐓥'), (0x104BE, 'M', u'𐓦'), ] def _seg_54(): return [ (0x104BF, 'M', u'𐓧'), (0x104C0, 'M', u'𐓨'), (0x104C1, 'M', u'𐓩'), (0x104C2, 'M', u'𐓪'), (0x104C3, 'M', u'𐓫'), (0x104C4, 'M', u'𐓬'), (0x104C5, 'M', u'𐓭'), (0x104C6, 'M', u'𐓮'), (0x104C7, 'M', u'𐓯'), (0x104C8, 'M', u'𐓰'), (0x104C9, 'M', u'𐓱'), (0x104CA, 'M', u'𐓲'), (0x104CB, 'M', u'𐓳'), (0x104CC, 'M', u'𐓴'), (0x104CD, 'M', u'𐓵'), (0x104CE, 'M', u'𐓶'), (0x104CF, 'M', u'𐓷'), (0x104D0, 'M', u'𐓸'), (0x104D1, 'M', u'𐓹'), (0x104D2, 'M', u'𐓺'), (0x104D3, 'M', u'𐓻'), (0x104D4, 'X'), (0x104D8, 'V'), (0x104FC, 'X'), (0x10500, 'V'), (0x10528, 'X'), (0x10530, 'V'), (0x10564, 'X'), (0x1056F, 'V'), (0x10570, 'X'), (0x10600, 'V'), (0x10737, 'X'), (0x10740, 'V'), (0x10756, 'X'), (0x10760, 'V'), (0x10768, 'X'), (0x10800, 'V'), (0x10806, 'X'), (0x10808, 'V'), (0x10809, 'X'), (0x1080A, 'V'), (0x10836, 'X'), (0x10837, 'V'), (0x10839, 'X'), (0x1083C, 'V'), (0x1083D, 'X'), (0x1083F, 'V'), (0x10856, 'X'), (0x10857, 'V'), (0x1089F, 'X'), (0x108A7, 'V'), (0x108B0, 'X'), (0x108E0, 'V'), (0x108F3, 'X'), (0x108F4, 'V'), (0x108F6, 'X'), (0x108FB, 'V'), (0x1091C, 'X'), (0x1091F, 'V'), (0x1093A, 'X'), (0x1093F, 'V'), (0x10940, 'X'), (0x10980, 'V'), (0x109B8, 'X'), (0x109BC, 'V'), (0x109D0, 'X'), (0x109D2, 'V'), (0x10A04, 'X'), (0x10A05, 'V'), (0x10A07, 'X'), (0x10A0C, 'V'), (0x10A14, 'X'), (0x10A15, 'V'), (0x10A18, 'X'), (0x10A19, 'V'), (0x10A36, 'X'), (0x10A38, 'V'), (0x10A3B, 'X'), (0x10A3F, 'V'), (0x10A49, 'X'), (0x10A50, 'V'), (0x10A59, 'X'), (0x10A60, 'V'), (0x10AA0, 'X'), (0x10AC0, 'V'), (0x10AE7, 'X'), (0x10AEB, 'V'), (0x10AF7, 'X'), (0x10B00, 'V'), (0x10B36, 'X'), (0x10B39, 'V'), (0x10B56, 'X'), (0x10B58, 'V'), (0x10B73, 'X'), (0x10B78, 'V'), (0x10B92, 'X'), (0x10B99, 'V'), (0x10B9D, 'X'), (0x10BA9, 'V'), (0x10BB0, 'X'), ] def _seg_55(): return [ (0x10C00, 'V'), (0x10C49, 'X'), (0x10C80, 'M', u'𐳀'), (0x10C81, 'M', u'𐳁'), (0x10C82, 'M', u'𐳂'), (0x10C83, 'M', u'𐳃'), (0x10C84, 'M', u'𐳄'), (0x10C85, 'M', u'𐳅'), (0x10C86, 'M', u'𐳆'), (0x10C87, 'M', u'𐳇'), (0x10C88, 'M', u'𐳈'), (0x10C89, 'M', u'𐳉'), (0x10C8A, 'M', u'𐳊'), (0x10C8B, 'M', u'𐳋'), (0x10C8C, 'M', u'𐳌'), (0x10C8D, 'M', u'𐳍'), (0x10C8E, 'M', u'𐳎'), (0x10C8F, 'M', u'𐳏'), (0x10C90, 'M', u'𐳐'), (0x10C91, 'M', u'𐳑'), (0x10C92, 'M', u'𐳒'), (0x10C93, 'M', u'𐳓'), (0x10C94, 'M', u'𐳔'), (0x10C95, 'M', u'𐳕'), (0x10C96, 'M', u'𐳖'), (0x10C97, 'M', u'𐳗'), (0x10C98, 'M', u'𐳘'), (0x10C99, 'M', u'𐳙'), (0x10C9A, 'M', u'𐳚'), (0x10C9B, 'M', u'𐳛'), (0x10C9C, 'M', u'𐳜'), (0x10C9D, 'M', u'𐳝'), (0x10C9E, 'M', u'𐳞'), (0x10C9F, 'M', u'𐳟'), (0x10CA0, 'M', u'𐳠'), (0x10CA1, 'M', u'𐳡'), (0x10CA2, 'M', u'𐳢'), (0x10CA3, 'M', u'𐳣'), (0x10CA4, 'M', u'𐳤'), (0x10CA5, 'M', u'𐳥'), (0x10CA6, 'M', u'𐳦'), (0x10CA7, 'M', u'𐳧'), (0x10CA8, 'M', u'𐳨'), (0x10CA9, 'M', u'𐳩'), (0x10CAA, 'M', u'𐳪'), (0x10CAB, 'M', u'𐳫'), (0x10CAC, 'M', u'𐳬'), (0x10CAD, 'M', u'𐳭'), (0x10CAE, 'M', u'𐳮'), (0x10CAF, 'M', u'𐳯'), (0x10CB0, 'M', u'𐳰'), (0x10CB1, 'M', u'𐳱'), (0x10CB2, 'M', u'𐳲'), (0x10CB3, 'X'), (0x10CC0, 'V'), (0x10CF3, 'X'), (0x10CFA, 'V'), (0x10D28, 'X'), (0x10D30, 'V'), (0x10D3A, 'X'), (0x10E60, 'V'), (0x10E7F, 'X'), (0x10E80, 'V'), (0x10EAA, 'X'), (0x10EAB, 'V'), (0x10EAE, 'X'), (0x10EB0, 'V'), (0x10EB2, 'X'), (0x10F00, 'V'), (0x10F28, 'X'), (0x10F30, 'V'), (0x10F5A, 'X'), (0x10FB0, 'V'), (0x10FCC, 'X'), (0x10FE0, 'V'), (0x10FF7, 'X'), (0x11000, 'V'), (0x1104E, 'X'), (0x11052, 'V'), (0x11070, 'X'), (0x1107F, 'V'), (0x110BD, 'X'), (0x110BE, 'V'), (0x110C2, 'X'), (0x110D0, 'V'), (0x110E9, 'X'), (0x110F0, 'V'), (0x110FA, 'X'), (0x11100, 'V'), (0x11135, 'X'), (0x11136, 'V'), (0x11148, 'X'), (0x11150, 'V'), (0x11177, 'X'), (0x11180, 'V'), (0x111E0, 'X'), (0x111E1, 'V'), (0x111F5, 'X'), (0x11200, 'V'), (0x11212, 'X'), ] def _seg_56(): return [ (0x11213, 'V'), (0x1123F, 'X'), (0x11280, 'V'), (0x11287, 'X'), (0x11288, 'V'), (0x11289, 'X'), (0x1128A, 'V'), (0x1128E, 'X'), (0x1128F, 'V'), (0x1129E, 'X'), (0x1129F, 'V'), (0x112AA, 'X'), (0x112B0, 'V'), (0x112EB, 'X'), (0x112F0, 'V'), (0x112FA, 'X'), (0x11300, 'V'), (0x11304, 'X'), (0x11305, 'V'), (0x1130D, 'X'), (0x1130F, 'V'), (0x11311, 'X'), (0x11313, 'V'), (0x11329, 'X'), (0x1132A, 'V'), (0x11331, 'X'), (0x11332, 'V'), (0x11334, 'X'), (0x11335, 'V'), (0x1133A, 'X'), (0x1133B, 'V'), (0x11345, 'X'), (0x11347, 'V'), (0x11349, 'X'), (0x1134B, 'V'), (0x1134E, 'X'), (0x11350, 'V'), (0x11351, 'X'), (0x11357, 'V'), (0x11358, 'X'), (0x1135D, 'V'), (0x11364, 'X'), (0x11366, 'V'), (0x1136D, 'X'), (0x11370, 'V'), (0x11375, 'X'), (0x11400, 'V'), (0x1145C, 'X'), (0x1145D, 'V'), (0x11462, 'X'), (0x11480, 'V'), (0x114C8, 'X'), (0x114D0, 'V'), (0x114DA, 'X'), (0x11580, 'V'), (0x115B6, 'X'), (0x115B8, 'V'), (0x115DE, 'X'), (0x11600, 'V'), (0x11645, 'X'), (0x11650, 'V'), (0x1165A, 'X'), (0x11660, 'V'), (0x1166D, 'X'), (0x11680, 'V'), (0x116B9, 'X'), (0x116C0, 'V'), (0x116CA, 'X'), (0x11700, 'V'), (0x1171B, 'X'), (0x1171D, 'V'), (0x1172C, 'X'), (0x11730, 'V'), (0x11740, 'X'), (0x11800, 'V'), (0x1183C, 'X'), (0x118A0, 'M', u'𑣀'), (0x118A1, 'M', u'𑣁'), (0x118A2, 'M', u'𑣂'), (0x118A3, 'M', u'𑣃'), (0x118A4, 'M', u'𑣄'), (0x118A5, 'M', u'𑣅'), (0x118A6, 'M', u'𑣆'), (0x118A7, 'M', u'𑣇'), (0x118A8, 'M', u'𑣈'), (0x118A9, 'M', u'𑣉'), (0x118AA, 'M', u'𑣊'), (0x118AB, 'M', u'𑣋'), (0x118AC, 'M', u'𑣌'), (0x118AD, 'M', u'𑣍'), (0x118AE, 'M', u'𑣎'), (0x118AF, 'M', u'𑣏'), (0x118B0, 'M', u'𑣐'), (0x118B1, 'M', u'𑣑'), (0x118B2, 'M', u'𑣒'), (0x118B3, 'M', u'𑣓'), (0x118B4, 'M', u'𑣔'), (0x118B5, 'M', u'𑣕'), (0x118B6, 'M', u'𑣖'), (0x118B7, 'M', u'𑣗'), ] def _seg_57(): return [ (0x118B8, 'M', u'𑣘'), (0x118B9, 'M', u'𑣙'), (0x118BA, 'M', u'𑣚'), (0x118BB, 'M', u'𑣛'), (0x118BC, 'M', u'𑣜'), (0x118BD, 'M', u'𑣝'), (0x118BE, 'M', u'𑣞'), (0x118BF, 'M', u'𑣟'), (0x118C0, 'V'), (0x118F3, 'X'), (0x118FF, 'V'), (0x11907, 'X'), (0x11909, 'V'), (0x1190A, 'X'), (0x1190C, 'V'), (0x11914, 'X'), (0x11915, 'V'), (0x11917, 'X'), (0x11918, 'V'), (0x11936, 'X'), (0x11937, 'V'), (0x11939, 'X'), (0x1193B, 'V'), (0x11947, 'X'), (0x11950, 'V'), (0x1195A, 'X'), (0x119A0, 'V'), (0x119A8, 'X'), (0x119AA, 'V'), (0x119D8, 'X'), (0x119DA, 'V'), (0x119E5, 'X'), (0x11A00, 'V'), (0x11A48, 'X'), (0x11A50, 'V'), (0x11AA3, 'X'), (0x11AC0, 'V'), (0x11AF9, 'X'), (0x11C00, 'V'), (0x11C09, 'X'), (0x11C0A, 'V'), (0x11C37, 'X'), (0x11C38, 'V'), (0x11C46, 'X'), (0x11C50, 'V'), (0x11C6D, 'X'), (0x11C70, 'V'), (0x11C90, 'X'), (0x11C92, 'V'), (0x11CA8, 'X'), (0x11CA9, 'V'), (0x11CB7, 'X'), (0x11D00, 'V'), (0x11D07, 'X'), (0x11D08, 'V'), (0x11D0A, 'X'), (0x11D0B, 'V'), (0x11D37, 'X'), (0x11D3A, 'V'), (0x11D3B, 'X'), (0x11D3C, 'V'), (0x11D3E, 'X'), (0x11D3F, 'V'), (0x11D48, 'X'), (0x11D50, 'V'), (0x11D5A, 'X'), (0x11D60, 'V'), (0x11D66, 'X'), (0x11D67, 'V'), (0x11D69, 'X'), (0x11D6A, 'V'), (0x11D8F, 'X'), (0x11D90, 'V'), (0x11D92, 'X'), (0x11D93, 'V'), (0x11D99, 'X'), (0x11DA0, 'V'), (0x11DAA, 'X'), (0x11EE0, 'V'), (0x11EF9, 'X'), (0x11FB0, 'V'), (0x11FB1, 'X'), (0x11FC0, 'V'), (0x11FF2, 'X'), (0x11FFF, 'V'), (0x1239A, 'X'), (0x12400, 'V'), (0x1246F, 'X'), (0x12470, 'V'), (0x12475, 'X'), (0x12480, 'V'), (0x12544, 'X'), (0x13000, 'V'), (0x1342F, 'X'), (0x14400, 'V'), (0x14647, 'X'), (0x16800, 'V'), (0x16A39, 'X'), (0x16A40, 'V'), (0x16A5F, 'X'), ] def _seg_58(): return [ (0x16A60, 'V'), (0x16A6A, 'X'), (0x16A6E, 'V'), (0x16A70, 'X'), (0x16AD0, 'V'), (0x16AEE, 'X'), (0x16AF0, 'V'), (0x16AF6, 'X'), (0x16B00, 'V'), (0x16B46, 'X'), (0x16B50, 'V'), (0x16B5A, 'X'), (0x16B5B, 'V'), (0x16B62, 'X'), (0x16B63, 'V'), (0x16B78, 'X'), (0x16B7D, 'V'), (0x16B90, 'X'), (0x16E40, 'M', u'𖹠'), (0x16E41, 'M', u'𖹡'), (0x16E42, 'M', u'𖹢'), (0x16E43, 'M', u'𖹣'), (0x16E44, 'M', u'𖹤'), (0x16E45, 'M', u'𖹥'), (0x16E46, 'M', u'𖹦'), (0x16E47, 'M', u'𖹧'), (0x16E48, 'M', u'𖹨'), (0x16E49, 'M', u'𖹩'), (0x16E4A, 'M', u'𖹪'), (0x16E4B, 'M', u'𖹫'), (0x16E4C, 'M', u'𖹬'), (0x16E4D, 'M', u'𖹭'), (0x16E4E, 'M', u'𖹮'), (0x16E4F, 'M', u'𖹯'), (0x16E50, 'M', u'𖹰'), (0x16E51, 'M', u'𖹱'), (0x16E52, 'M', u'𖹲'), (0x16E53, 'M', u'𖹳'), (0x16E54, 'M', u'𖹴'), (0x16E55, 'M', u'𖹵'), (0x16E56, 'M', u'𖹶'), (0x16E57, 'M', u'𖹷'), (0x16E58, 'M', u'𖹸'), (0x16E59, 'M', u'𖹹'), (0x16E5A, 'M', u'𖹺'), (0x16E5B, 'M', u'𖹻'), (0x16E5C, 'M', u'𖹼'), (0x16E5D, 'M', u'𖹽'), (0x16E5E, 'M', u'𖹾'), (0x16E5F, 'M', u'𖹿'), (0x16E60, 'V'), (0x16E9B, 'X'), (0x16F00, 'V'), (0x16F4B, 'X'), (0x16F4F, 'V'), (0x16F88, 'X'), (0x16F8F, 'V'), (0x16FA0, 'X'), (0x16FE0, 'V'), (0x16FE5, 'X'), (0x16FF0, 'V'), (0x16FF2, 'X'), (0x17000, 'V'), (0x187F8, 'X'), (0x18800, 'V'), (0x18CD6, 'X'), (0x18D00, 'V'), (0x18D09, 'X'), (0x1B000, 'V'), (0x1B11F, 'X'), (0x1B150, 'V'), (0x1B153, 'X'), (0x1B164, 'V'), (0x1B168, 'X'), (0x1B170, 'V'), (0x1B2FC, 'X'), (0x1BC00, 'V'), (0x1BC6B, 'X'), (0x1BC70, 'V'), (0x1BC7D, 'X'), (0x1BC80, 'V'), (0x1BC89, 'X'), (0x1BC90, 'V'), (0x1BC9A, 'X'), (0x1BC9C, 'V'), (0x1BCA0, 'I'), (0x1BCA4, 'X'), (0x1D000, 'V'), (0x1D0F6, 'X'), (0x1D100, 'V'), (0x1D127, 'X'), (0x1D129, 'V'), (0x1D15E, 'M', u'𝅗𝅥'), (0x1D15F, 'M', u'𝅘𝅥'), (0x1D160, 'M', u'𝅘𝅥𝅮'), (0x1D161, 'M', u'𝅘𝅥𝅯'), (0x1D162, 'M', u'𝅘𝅥𝅰'), (0x1D163, 'M', u'𝅘𝅥𝅱'), (0x1D164, 'M', u'𝅘𝅥𝅲'), (0x1D165, 'V'), ] def _seg_59(): return [ (0x1D173, 'X'), (0x1D17B, 'V'), (0x1D1BB, 'M', u'𝆹𝅥'), (0x1D1BC, 'M', u'𝆺𝅥'), (0x1D1BD, 'M', u'𝆹𝅥𝅮'), (0x1D1BE, 'M', u'𝆺𝅥𝅮'), (0x1D1BF, 'M', u'𝆹𝅥𝅯'), (0x1D1C0, 'M', u'𝆺𝅥𝅯'), (0x1D1C1, 'V'), (0x1D1E9, 'X'), (0x1D200, 'V'), (0x1D246, 'X'), (0x1D2E0, 'V'), (0x1D2F4, 'X'), (0x1D300, 'V'), (0x1D357, 'X'), (0x1D360, 'V'), (0x1D379, 'X'), (0x1D400, 'M', u'a'), (0x1D401, 'M', u'b'), (0x1D402, 'M', u'c'), (0x1D403, 'M', u'd'), (0x1D404, 'M', u'e'), (0x1D405, 'M', u'f'), (0x1D406, 'M', u'g'), (0x1D407, 'M', u'h'), (0x1D408, 'M', u'i'), (0x1D409, 'M', u'j'), (0x1D40A, 'M', u'k'), (0x1D40B, 'M', u'l'), (0x1D40C, 'M', u'm'), (0x1D40D, 'M', u'n'), (0x1D40E, 'M', u'o'), (0x1D40F, 'M', u'p'), (0x1D410, 'M', u'q'), (0x1D411, 'M', u'r'), (0x1D412, 'M', u's'), (0x1D413, 'M', u't'), (0x1D414, 'M', u'u'), (0x1D415, 'M', u'v'), (0x1D416, 'M', u'w'), (0x1D417, 'M', u'x'), (0x1D418, 'M', u'y'), (0x1D419, 'M', u'z'), (0x1D41A, 'M', u'a'), (0x1D41B, 'M', u'b'), (0x1D41C, 'M', u'c'), (0x1D41D, 'M', u'd'), (0x1D41E, 'M', u'e'), (0x1D41F, 'M', u'f'), (0x1D420, 'M', u'g'), (0x1D421, 'M', u'h'), (0x1D422, 'M', u'i'), (0x1D423, 'M', u'j'), (0x1D424, 'M', u'k'), (0x1D425, 'M', u'l'), (0x1D426, 'M', u'm'), (0x1D427, 'M', u'n'), (0x1D428, 'M', u'o'), (0x1D429, 'M', u'p'), (0x1D42A, 'M', u'q'), (0x1D42B, 'M', u'r'), (0x1D42C, 'M', u's'), (0x1D42D, 'M', u't'), (0x1D42E, 'M', u'u'), (0x1D42F, 'M', u'v'), (0x1D430, 'M', u'w'), (0x1D431, 'M', u'x'), (0x1D432, 'M', u'y'), (0x1D433, 'M', u'z'), (0x1D434, 'M', u'a'), (0x1D435, 'M', u'b'), (0x1D436, 'M', u'c'), (0x1D437, 'M', u'd'), (0x1D438, 'M', u'e'), (0x1D439, 'M', u'f'), (0x1D43A, 'M', u'g'), (0x1D43B, 'M', u'h'), (0x1D43C, 'M', u'i'), (0x1D43D, 'M', u'j'), (0x1D43E, 'M', u'k'), (0x1D43F, 'M', u'l'), (0x1D440, 'M', u'm'), (0x1D441, 'M', u'n'), (0x1D442, 'M', u'o'), (0x1D443, 'M', u'p'), (0x1D444, 'M', u'q'), (0x1D445, 'M', u'r'), (0x1D446, 'M', u's'), (0x1D447, 'M', u't'), (0x1D448, 'M', u'u'), (0x1D449, 'M', u'v'), (0x1D44A, 'M', u'w'), (0x1D44B, 'M', u'x'), (0x1D44C, 'M', u'y'), (0x1D44D, 'M', u'z'), (0x1D44E, 'M', u'a'), (0x1D44F, 'M', u'b'), (0x1D450, 'M', u'c'), (0x1D451, 'M', u'd'), ] def _seg_60(): return [ (0x1D452, 'M', u'e'), (0x1D453, 'M', u'f'), (0x1D454, 'M', u'g'), (0x1D455, 'X'), (0x1D456, 'M', u'i'), (0x1D457, 'M', u'j'), (0x1D458, 'M', u'k'), (0x1D459, 'M', u'l'), (0x1D45A, 'M', u'm'), (0x1D45B, 'M', u'n'), (0x1D45C, 'M', u'o'), (0x1D45D, 'M', u'p'), (0x1D45E, 'M', u'q'), (0x1D45F, 'M', u'r'), (0x1D460, 'M', u's'), (0x1D461, 'M', u't'), (0x1D462, 'M', u'u'), (0x1D463, 'M', u'v'), (0x1D464, 'M', u'w'), (0x1D465, 'M', u'x'), (0x1D466, 'M', u'y'), (0x1D467, 'M', u'z'), (0x1D468, 'M', u'a'), (0x1D469, 'M', u'b'), (0x1D46A, 'M', u'c'), (0x1D46B, 'M', u'd'), (0x1D46C, 'M', u'e'), (0x1D46D, 'M', u'f'), (0x1D46E, 'M', u'g'), (0x1D46F, 'M', u'h'), (0x1D470, 'M', u'i'), (0x1D471, 'M', u'j'), (0x1D472, 'M', u'k'), (0x1D473, 'M', u'l'), (0x1D474, 'M', u'm'), (0x1D475, 'M', u'n'), (0x1D476, 'M', u'o'), (0x1D477, 'M', u'p'), (0x1D478, 'M', u'q'), (0x1D479, 'M', u'r'), (0x1D47A, 'M', u's'), (0x1D47B, 'M', u't'), (0x1D47C, 'M', u'u'), (0x1D47D, 'M', u'v'), (0x1D47E, 'M', u'w'), (0x1D47F, 'M', u'x'), (0x1D480, 'M', u'y'), (0x1D481, 'M', u'z'), (0x1D482, 'M', u'a'), (0x1D483, 'M', u'b'), (0x1D484, 'M', u'c'), (0x1D485, 'M', u'd'), (0x1D486, 'M', u'e'), (0x1D487, 'M', u'f'), (0x1D488, 'M', u'g'), (0x1D489, 'M', u'h'), (0x1D48A, 'M', u'i'), (0x1D48B, 'M', u'j'), (0x1D48C, 'M', u'k'), (0x1D48D, 'M', u'l'), (0x1D48E, 'M', u'm'), (0x1D48F, 'M', u'n'), (0x1D490, 'M', u'o'), (0x1D491, 'M', u'p'), (0x1D492, 'M', u'q'), (0x1D493, 'M', u'r'), (0x1D494, 'M', u's'), (0x1D495, 'M', u't'), (0x1D496, 'M', u'u'), (0x1D497, 'M', u'v'), (0x1D498, 'M', u'w'), (0x1D499, 'M', u'x'), (0x1D49A, 'M', u'y'), (0x1D49B, 'M', u'z'), (0x1D49C, 'M', u'a'), (0x1D49D, 'X'), (0x1D49E, 'M', u'c'), (0x1D49F, 'M', u'd'), (0x1D4A0, 'X'), (0x1D4A2, 'M', u'g'), (0x1D4A3, 'X'), (0x1D4A5, 'M', u'j'), (0x1D4A6, 'M', u'k'), (0x1D4A7, 'X'), (0x1D4A9, 'M', u'n'), (0x1D4AA, 'M', u'o'), (0x1D4AB, 'M', u'p'), (0x1D4AC, 'M', u'q'), (0x1D4AD, 'X'), (0x1D4AE, 'M', u's'), (0x1D4AF, 'M', u't'), (0x1D4B0, 'M', u'u'), (0x1D4B1, 'M', u'v'), (0x1D4B2, 'M', u'w'), (0x1D4B3, 'M', u'x'), (0x1D4B4, 'M', u'y'), (0x1D4B5, 'M', u'z'), (0x1D4B6, 'M', u'a'), (0x1D4B7, 'M', u'b'), (0x1D4B8, 'M', u'c'), ] def _seg_61(): return [ (0x1D4B9, 'M', u'd'), (0x1D4BA, 'X'), (0x1D4BB, 'M', u'f'), (0x1D4BC, 'X'), (0x1D4BD, 'M', u'h'), (0x1D4BE, 'M', u'i'), (0x1D4BF, 'M', u'j'), (0x1D4C0, 'M', u'k'), (0x1D4C1, 'M', u'l'), (0x1D4C2, 'M', u'm'), (0x1D4C3, 'M', u'n'), (0x1D4C4, 'X'), (0x1D4C5, 'M', u'p'), (0x1D4C6, 'M', u'q'), (0x1D4C7, 'M', u'r'), (0x1D4C8, 'M', u's'), (0x1D4C9, 'M', u't'), (0x1D4CA, 'M', u'u'), (0x1D4CB, 'M', u'v'), (0x1D4CC, 'M', u'w'), (0x1D4CD, 'M', u'x'), (0x1D4CE, 'M', u'y'), (0x1D4CF, 'M', u'z'), (0x1D4D0, 'M', u'a'), (0x1D4D1, 'M', u'b'), (0x1D4D2, 'M', u'c'), (0x1D4D3, 'M', u'd'), (0x1D4D4, 'M', u'e'), (0x1D4D5, 'M', u'f'), (0x1D4D6, 'M', u'g'), (0x1D4D7, 'M', u'h'), (0x1D4D8, 'M', u'i'), (0x1D4D9, 'M', u'j'), (0x1D4DA, 'M', u'k'), (0x1D4DB, 'M', u'l'), (0x1D4DC, 'M', u'm'), (0x1D4DD, 'M', u'n'), (0x1D4DE, 'M', u'o'), (0x1D4DF, 'M', u'p'), (0x1D4E0, 'M', u'q'), (0x1D4E1, 'M', u'r'), (0x1D4E2, 'M', u's'), (0x1D4E3, 'M', u't'), (0x1D4E4, 'M', u'u'), (0x1D4E5, 'M', u'v'), (0x1D4E6, 'M', u'w'), (0x1D4E7, 'M', u'x'), (0x1D4E8, 'M', u'y'), (0x1D4E9, 'M', u'z'), (0x1D4EA, 'M', u'a'), (0x1D4EB, 'M', u'b'), (0x1D4EC, 'M', u'c'), (0x1D4ED, 'M', u'd'), (0x1D4EE, 'M', u'e'), (0x1D4EF, 'M', u'f'), (0x1D4F0, 'M', u'g'), (0x1D4F1, 'M', u'h'), (0x1D4F2, 'M', u'i'), (0x1D4F3, 'M', u'j'), (0x1D4F4, 'M', u'k'), (0x1D4F5, 'M', u'l'), (0x1D4F6, 'M', u'm'), (0x1D4F7, 'M', u'n'), (0x1D4F8, 'M', u'o'), (0x1D4F9, 'M', u'p'), (0x1D4FA, 'M', u'q'), (0x1D4FB, 'M', u'r'), (0x1D4FC, 'M', u's'), (0x1D4FD, 'M', u't'), (0x1D4FE, 'M', u'u'), (0x1D4FF, 'M', u'v'), (0x1D500, 'M', u'w'), (0x1D501, 'M', u'x'), (0x1D502, 'M', u'y'), (0x1D503, 'M', u'z'), (0x1D504, 'M', u'a'), (0x1D505, 'M', u'b'), (0x1D506, 'X'), (0x1D507, 'M', u'd'), (0x1D508, 'M', u'e'), (0x1D509, 'M', u'f'), (0x1D50A, 'M', u'g'), (0x1D50B, 'X'), (0x1D50D, 'M', u'j'), (0x1D50E, 'M', u'k'), (0x1D50F, 'M', u'l'), (0x1D510, 'M', u'm'), (0x1D511, 'M', u'n'), (0x1D512, 'M', u'o'), (0x1D513, 'M', u'p'), (0x1D514, 'M', u'q'), (0x1D515, 'X'), (0x1D516, 'M', u's'), (0x1D517, 'M', u't'), (0x1D518, 'M', u'u'), (0x1D519, 'M', u'v'), (0x1D51A, 'M', u'w'), (0x1D51B, 'M', u'x'), (0x1D51C, 'M', u'y'), (0x1D51D, 'X'), ] def _seg_62(): return [ (0x1D51E, 'M', u'a'), (0x1D51F, 'M', u'b'), (0x1D520, 'M', u'c'), (0x1D521, 'M', u'd'), (0x1D522, 'M', u'e'), (0x1D523, 'M', u'f'), (0x1D524, 'M', u'g'), (0x1D525, 'M', u'h'), (0x1D526, 'M', u'i'), (0x1D527, 'M', u'j'), (0x1D528, 'M', u'k'), (0x1D529, 'M', u'l'), (0x1D52A, 'M', u'm'), (0x1D52B, 'M', u'n'), (0x1D52C, 'M', u'o'), (0x1D52D, 'M', u'p'), (0x1D52E, 'M', u'q'), (0x1D52F, 'M', u'r'), (0x1D530, 'M', u's'), (0x1D531, 'M', u't'), (0x1D532, 'M', u'u'), (0x1D533, 'M', u'v'), (0x1D534, 'M', u'w'), (0x1D535, 'M', u'x'), (0x1D536, 'M', u'y'), (0x1D537, 'M', u'z'), (0x1D538, 'M', u'a'), (0x1D539, 'M', u'b'), (0x1D53A, 'X'), (0x1D53B, 'M', u'd'), (0x1D53C, 'M', u'e'), (0x1D53D, 'M', u'f'), (0x1D53E, 'M', u'g'), (0x1D53F, 'X'), (0x1D540, 'M', u'i'), (0x1D541, 'M', u'j'), (0x1D542, 'M', u'k'), (0x1D543, 'M', u'l'), (0x1D544, 'M', u'm'), (0x1D545, 'X'), (0x1D546, 'M', u'o'), (0x1D547, 'X'), (0x1D54A, 'M', u's'), (0x1D54B, 'M', u't'), (0x1D54C, 'M', u'u'), (0x1D54D, 'M', u'v'), (0x1D54E, 'M', u'w'), (0x1D54F, 'M', u'x'), (0x1D550, 'M', u'y'), (0x1D551, 'X'), (0x1D552, 'M', u'a'), (0x1D553, 'M', u'b'), (0x1D554, 'M', u'c'), (0x1D555, 'M', u'd'), (0x1D556, 'M', u'e'), (0x1D557, 'M', u'f'), (0x1D558, 'M', u'g'), (0x1D559, 'M', u'h'), (0x1D55A, 'M', u'i'), (0x1D55B, 'M', u'j'), (0x1D55C, 'M', u'k'), (0x1D55D, 'M', u'l'), (0x1D55E, 'M', u'm'), (0x1D55F, 'M', u'n'), (0x1D560, 'M', u'o'), (0x1D561, 'M', u'p'), (0x1D562, 'M', u'q'), (0x1D563, 'M', u'r'), (0x1D564, 'M', u's'), (0x1D565, 'M', u't'), (0x1D566, 'M', u'u'), (0x1D567, 'M', u'v'), (0x1D568, 'M', u'w'), (0x1D569, 'M', u'x'), (0x1D56A, 'M', u'y'), (0x1D56B, 'M', u'z'), (0x1D56C, 'M', u'a'), (0x1D56D, 'M', u'b'), (0x1D56E, 'M', u'c'), (0x1D56F, 'M', u'd'), (0x1D570, 'M', u'e'), (0x1D571, 'M', u'f'), (0x1D572, 'M', u'g'), (0x1D573, 'M', u'h'), (0x1D574, 'M', u'i'), (0x1D575, 'M', u'j'), (0x1D576, 'M', u'k'), (0x1D577, 'M', u'l'), (0x1D578, 'M', u'm'), (0x1D579, 'M', u'n'), (0x1D57A, 'M', u'o'), (0x1D57B, 'M', u'p'), (0x1D57C, 'M', u'q'), (0x1D57D, 'M', u'r'), (0x1D57E, 'M', u's'), (0x1D57F, 'M', u't'), (0x1D580, 'M', u'u'), (0x1D581, 'M', u'v'), (0x1D582, 'M', u'w'), (0x1D583, 'M', u'x'), ] def _seg_63(): return [ (0x1D584, 'M', u'y'), (0x1D585, 'M', u'z'), (0x1D586, 'M', u'a'), (0x1D587, 'M', u'b'), (0x1D588, 'M', u'c'), (0x1D589, 'M', u'd'), (0x1D58A, 'M', u'e'), (0x1D58B, 'M', u'f'), (0x1D58C, 'M', u'g'), (0x1D58D, 'M', u'h'), (0x1D58E, 'M', u'i'), (0x1D58F, 'M', u'j'), (0x1D590, 'M', u'k'), (0x1D591, 'M', u'l'), (0x1D592, 'M', u'm'), (0x1D593, 'M', u'n'), (0x1D594, 'M', u'o'), (0x1D595, 'M', u'p'), (0x1D596, 'M', u'q'), (0x1D597, 'M', u'r'), (0x1D598, 'M', u's'), (0x1D599, 'M', u't'), (0x1D59A, 'M', u'u'), (0x1D59B, 'M', u'v'), (0x1D59C, 'M', u'w'), (0x1D59D, 'M', u'x'), (0x1D59E, 'M', u'y'), (0x1D59F, 'M', u'z'), (0x1D5A0, 'M', u'a'), (0x1D5A1, 'M', u'b'), (0x1D5A2, 'M', u'c'), (0x1D5A3, 'M', u'd'), (0x1D5A4, 'M', u'e'), (0x1D5A5, 'M', u'f'), (0x1D5A6, 'M', u'g'), (0x1D5A7, 'M', u'h'), (0x1D5A8, 'M', u'i'), (0x1D5A9, 'M', u'j'), (0x1D5AA, 'M', u'k'), (0x1D5AB, 'M', u'l'), (0x1D5AC, 'M', u'm'), (0x1D5AD, 'M', u'n'), (0x1D5AE, 'M', u'o'), (0x1D5AF, 'M', u'p'), (0x1D5B0, 'M', u'q'), (0x1D5B1, 'M', u'r'), (0x1D5B2, 'M', u's'), (0x1D5B3, 'M', u't'), (0x1D5B4, 'M', u'u'), (0x1D5B5, 'M', u'v'), (0x1D5B6, 'M', u'w'), (0x1D5B7, 'M', u'x'), (0x1D5B8, 'M', u'y'), (0x1D5B9, 'M', u'z'), (0x1D5BA, 'M', u'a'), (0x1D5BB, 'M', u'b'), (0x1D5BC, 'M', u'c'), (0x1D5BD, 'M', u'd'), (0x1D5BE, 'M', u'e'), (0x1D5BF, 'M', u'f'), (0x1D5C0, 'M', u'g'), (0x1D5C1, 'M', u'h'), (0x1D5C2, 'M', u'i'), (0x1D5C3, 'M', u'j'), (0x1D5C4, 'M', u'k'), (0x1D5C5, 'M', u'l'), (0x1D5C6, 'M', u'm'), (0x1D5C7, 'M', u'n'), (0x1D5C8, 'M', u'o'), (0x1D5C9, 'M', u'p'), (0x1D5CA, 'M', u'q'), (0x1D5CB, 'M', u'r'), (0x1D5CC, 'M', u's'), (0x1D5CD, 'M', u't'), (0x1D5CE, 'M', u'u'), (0x1D5CF, 'M', u'v'), (0x1D5D0, 'M', u'w'), (0x1D5D1, 'M', u'x'), (0x1D5D2, 'M', u'y'), (0x1D5D3, 'M', u'z'), (0x1D5D4, 'M', u'a'), (0x1D5D5, 'M', u'b'), (0x1D5D6, 'M', u'c'), (0x1D5D7, 'M', u'd'), (0x1D5D8, 'M', u'e'), (0x1D5D9, 'M', u'f'), (0x1D5DA, 'M', u'g'), (0x1D5DB, 'M', u'h'), (0x1D5DC, 'M', u'i'), (0x1D5DD, 'M', u'j'), (0x1D5DE, 'M', u'k'), (0x1D5DF, 'M', u'l'), (0x1D5E0, 'M', u'm'), (0x1D5E1, 'M', u'n'), (0x1D5E2, 'M', u'o'), (0x1D5E3, 'M', u'p'), (0x1D5E4, 'M', u'q'), (0x1D5E5, 'M', u'r'), (0x1D5E6, 'M', u's'), (0x1D5E7, 'M', u't'), ] def _seg_64(): return [ (0x1D5E8, 'M', u'u'), (0x1D5E9, 'M', u'v'), (0x1D5EA, 'M', u'w'), (0x1D5EB, 'M', u'x'), (0x1D5EC, 'M', u'y'), (0x1D5ED, 'M', u'z'), (0x1D5EE, 'M', u'a'), (0x1D5EF, 'M', u'b'), (0x1D5F0, 'M', u'c'), (0x1D5F1, 'M', u'd'), (0x1D5F2, 'M', u'e'), (0x1D5F3, 'M', u'f'), (0x1D5F4, 'M', u'g'), (0x1D5F5, 'M', u'h'), (0x1D5F6, 'M', u'i'), (0x1D5F7, 'M', u'j'), (0x1D5F8, 'M', u'k'), (0x1D5F9, 'M', u'l'), (0x1D5FA, 'M', u'm'), (0x1D5FB, 'M', u'n'), (0x1D5FC, 'M', u'o'), (0x1D5FD, 'M', u'p'), (0x1D5FE, 'M', u'q'), (0x1D5FF, 'M', u'r'), (0x1D600, 'M', u's'), (0x1D601, 'M', u't'), (0x1D602, 'M', u'u'), (0x1D603, 'M', u'v'), (0x1D604, 'M', u'w'), (0x1D605, 'M', u'x'), (0x1D606, 'M', u'y'), (0x1D607, 'M', u'z'), (0x1D608, 'M', u'a'), (0x1D609, 'M', u'b'), (0x1D60A, 'M', u'c'), (0x1D60B, 'M', u'd'), (0x1D60C, 'M', u'e'), (0x1D60D, 'M', u'f'), (0x1D60E, 'M', u'g'), (0x1D60F, 'M', u'h'), (0x1D610, 'M', u'i'), (0x1D611, 'M', u'j'), (0x1D612, 'M', u'k'), (0x1D613, 'M', u'l'), (0x1D614, 'M', u'm'), (0x1D615, 'M', u'n'), (0x1D616, 'M', u'o'), (0x1D617, 'M', u'p'), (0x1D618, 'M', u'q'), (0x1D619, 'M', u'r'), (0x1D61A, 'M', u's'), (0x1D61B, 'M', u't'), (0x1D61C, 'M', u'u'), (0x1D61D, 'M', u'v'), (0x1D61E, 'M', u'w'), (0x1D61F, 'M', u'x'), (0x1D620, 'M', u'y'), (0x1D621, 'M', u'z'), (0x1D622, 'M', u'a'), (0x1D623, 'M', u'b'), (0x1D624, 'M', u'c'), (0x1D625, 'M', u'd'), (0x1D626, 'M', u'e'), (0x1D627, 'M', u'f'), (0x1D628, 'M', u'g'), (0x1D629, 'M', u'h'), (0x1D62A, 'M', u'i'), (0x1D62B, 'M', u'j'), (0x1D62C, 'M', u'k'), (0x1D62D, 'M', u'l'), (0x1D62E, 'M', u'm'), (0x1D62F, 'M', u'n'), (0x1D630, 'M', u'o'), (0x1D631, 'M', u'p'), (0x1D632, 'M', u'q'), (0x1D633, 'M', u'r'), (0x1D634, 'M', u's'), (0x1D635, 'M', u't'), (0x1D636, 'M', u'u'), (0x1D637, 'M', u'v'), (0x1D638, 'M', u'w'), (0x1D639, 'M', u'x'), (0x1D63A, 'M', u'y'), (0x1D63B, 'M', u'z'), (0x1D63C, 'M', u'a'), (0x1D63D, 'M', u'b'), (0x1D63E, 'M', u'c'), (0x1D63F, 'M', u'd'), (0x1D640, 'M', u'e'), (0x1D641, 'M', u'f'), (0x1D642, 'M', u'g'), (0x1D643, 'M', u'h'), (0x1D644, 'M', u'i'), (0x1D645, 'M', u'j'), (0x1D646, 'M', u'k'), (0x1D647, 'M', u'l'), (0x1D648, 'M', u'm'), (0x1D649, 'M', u'n'), (0x1D64A, 'M', u'o'), (0x1D64B, 'M', u'p'), ] def _seg_65(): return [ (0x1D64C, 'M', u'q'), (0x1D64D, 'M', u'r'), (0x1D64E, 'M', u's'), (0x1D64F, 'M', u't'), (0x1D650, 'M', u'u'), (0x1D651, 'M', u'v'), (0x1D652, 'M', u'w'), (0x1D653, 'M', u'x'), (0x1D654, 'M', u'y'), (0x1D655, 'M', u'z'), (0x1D656, 'M', u'a'), (0x1D657, 'M', u'b'), (0x1D658, 'M', u'c'), (0x1D659, 'M', u'd'), (0x1D65A, 'M', u'e'), (0x1D65B, 'M', u'f'), (0x1D65C, 'M', u'g'), (0x1D65D, 'M', u'h'), (0x1D65E, 'M', u'i'), (0x1D65F, 'M', u'j'), (0x1D660, 'M', u'k'), (0x1D661, 'M', u'l'), (0x1D662, 'M', u'm'), (0x1D663, 'M', u'n'), (0x1D664, 'M', u'o'), (0x1D665, 'M', u'p'), (0x1D666, 'M', u'q'), (0x1D667, 'M', u'r'), (0x1D668, 'M', u's'), (0x1D669, 'M', u't'), (0x1D66A, 'M', u'u'), (0x1D66B, 'M', u'v'), (0x1D66C, 'M', u'w'), (0x1D66D, 'M', u'x'), (0x1D66E, 'M', u'y'), (0x1D66F, 'M', u'z'), (0x1D670, 'M', u'a'), (0x1D671, 'M', u'b'), (0x1D672, 'M', u'c'), (0x1D673, 'M', u'd'), (0x1D674, 'M', u'e'), (0x1D675, 'M', u'f'), (0x1D676, 'M', u'g'), (0x1D677, 'M', u'h'), (0x1D678, 'M', u'i'), (0x1D679, 'M', u'j'), (0x1D67A, 'M', u'k'), (0x1D67B, 'M', u'l'), (0x1D67C, 'M', u'm'), (0x1D67D, 'M', u'n'), (0x1D67E, 'M', u'o'), (0x1D67F, 'M', u'p'), (0x1D680, 'M', u'q'), (0x1D681, 'M', u'r'), (0x1D682, 'M', u's'), (0x1D683, 'M', u't'), (0x1D684, 'M', u'u'), (0x1D685, 'M', u'v'), (0x1D686, 'M', u'w'), (0x1D687, 'M', u'x'), (0x1D688, 'M', u'y'), (0x1D689, 'M', u'z'), (0x1D68A, 'M', u'a'), (0x1D68B, 'M', u'b'), (0x1D68C, 'M', u'c'), (0x1D68D, 'M', u'd'), (0x1D68E, 'M', u'e'), (0x1D68F, 'M', u'f'), (0x1D690, 'M', u'g'), (0x1D691, 'M', u'h'), (0x1D692, 'M', u'i'), (0x1D693, 'M', u'j'), (0x1D694, 'M', u'k'), (0x1D695, 'M', u'l'), (0x1D696, 'M', u'm'), (0x1D697, 'M', u'n'), (0x1D698, 'M', u'o'), (0x1D699, 'M', u'p'), (0x1D69A, 'M', u'q'), (0x1D69B, 'M', u'r'), (0x1D69C, 'M', u's'), (0x1D69D, 'M', u't'), (0x1D69E, 'M', u'u'), (0x1D69F, 'M', u'v'), (0x1D6A0, 'M', u'w'), (0x1D6A1, 'M', u'x'), (0x1D6A2, 'M', u'y'), (0x1D6A3, 'M', u'z'), (0x1D6A4, 'M', u'ı'), (0x1D6A5, 'M', u'ȷ'), (0x1D6A6, 'X'), (0x1D6A8, 'M', u'α'), (0x1D6A9, 'M', u'β'), (0x1D6AA, 'M', u'γ'), (0x1D6AB, 'M', u'δ'), (0x1D6AC, 'M', u'ε'), (0x1D6AD, 'M', u'ζ'), (0x1D6AE, 'M', u'η'), (0x1D6AF, 'M', u'θ'), (0x1D6B0, 'M', u'ι'), ] def _seg_66(): return [ (0x1D6B1, 'M', u'κ'), (0x1D6B2, 'M', u'λ'), (0x1D6B3, 'M', u'μ'), (0x1D6B4, 'M', u'ν'), (0x1D6B5, 'M', u'ξ'), (0x1D6B6, 'M', u'ο'), (0x1D6B7, 'M', u'π'), (0x1D6B8, 'M', u'ρ'), (0x1D6B9, 'M', u'θ'), (0x1D6BA, 'M', u'σ'), (0x1D6BB, 'M', u'τ'), (0x1D6BC, 'M', u'υ'), (0x1D6BD, 'M', u'φ'), (0x1D6BE, 'M', u'χ'), (0x1D6BF, 'M', u'ψ'), (0x1D6C0, 'M', u'ω'), (0x1D6C1, 'M', u'∇'), (0x1D6C2, 'M', u'α'), (0x1D6C3, 'M', u'β'), (0x1D6C4, 'M', u'γ'), (0x1D6C5, 'M', u'δ'), (0x1D6C6, 'M', u'ε'), (0x1D6C7, 'M', u'ζ'), (0x1D6C8, 'M', u'η'), (0x1D6C9, 'M', u'θ'), (0x1D6CA, 'M', u'ι'), (0x1D6CB, 'M', u'κ'), (0x1D6CC, 'M', u'λ'), (0x1D6CD, 'M', u'μ'), (0x1D6CE, 'M', u'ν'), (0x1D6CF, 'M', u'ξ'), (0x1D6D0, 'M', u'ο'), (0x1D6D1, 'M', u'π'), (0x1D6D2, 'M', u'ρ'), (0x1D6D3, 'M', u'σ'), (0x1D6D5, 'M', u'τ'), (0x1D6D6, 'M', u'υ'), (0x1D6D7, 'M', u'φ'), (0x1D6D8, 'M', u'χ'), (0x1D6D9, 'M', u'ψ'), (0x1D6DA, 'M', u'ω'), (0x1D6DB, 'M', u'∂'), (0x1D6DC, 'M', u'ε'), (0x1D6DD, 'M', u'θ'), (0x1D6DE, 'M', u'κ'), (0x1D6DF, 'M', u'φ'), (0x1D6E0, 'M', u'ρ'), (0x1D6E1, 'M', u'π'), (0x1D6E2, 'M', u'α'), (0x1D6E3, 'M', u'β'), (0x1D6E4, 'M', u'γ'), (0x1D6E5, 'M', u'δ'), (0x1D6E6, 'M', u'ε'), (0x1D6E7, 'M', u'ζ'), (0x1D6E8, 'M', u'η'), (0x1D6E9, 'M', u'θ'), (0x1D6EA, 'M', u'ι'), (0x1D6EB, 'M', u'κ'), (0x1D6EC, 'M', u'λ'), (0x1D6ED, 'M', u'μ'), (0x1D6EE, 'M', u'ν'), (0x1D6EF, 'M', u'ξ'), (0x1D6F0, 'M', u'ο'), (0x1D6F1, 'M', u'π'), (0x1D6F2, 'M', u'ρ'), (0x1D6F3, 'M', u'θ'), (0x1D6F4, 'M', u'σ'), (0x1D6F5, 'M', u'τ'), (0x1D6F6, 'M', u'υ'), (0x1D6F7, 'M', u'φ'), (0x1D6F8, 'M', u'χ'), (0x1D6F9, 'M', u'ψ'), (0x1D6FA, 'M', u'ω'), (0x1D6FB, 'M', u'∇'), (0x1D6FC, 'M', u'α'), (0x1D6FD, 'M', u'β'), (0x1D6FE, 'M', u'γ'), (0x1D6FF, 'M', u'δ'), (0x1D700, 'M', u'ε'), (0x1D701, 'M', u'ζ'), (0x1D702, 'M', u'η'), (0x1D703, 'M', u'θ'), (0x1D704, 'M', u'ι'), (0x1D705, 'M', u'κ'), (0x1D706, 'M', u'λ'), (0x1D707, 'M', u'μ'), (0x1D708, 'M', u'ν'), (0x1D709, 'M', u'ξ'), (0x1D70A, 'M', u'ο'), (0x1D70B, 'M', u'π'), (0x1D70C, 'M', u'ρ'), (0x1D70D, 'M', u'σ'), (0x1D70F, 'M', u'τ'), (0x1D710, 'M', u'υ'), (0x1D711, 'M', u'φ'), (0x1D712, 'M', u'χ'), (0x1D713, 'M', u'ψ'), (0x1D714, 'M', u'ω'), (0x1D715, 'M', u'∂'), (0x1D716, 'M', u'ε'), ] def _seg_67(): return [ (0x1D717, 'M', u'θ'), (0x1D718, 'M', u'κ'), (0x1D719, 'M', u'φ'), (0x1D71A, 'M', u'ρ'), (0x1D71B, 'M', u'π'), (0x1D71C, 'M', u'α'), (0x1D71D, 'M', u'β'), (0x1D71E, 'M', u'γ'), (0x1D71F, 'M', u'δ'), (0x1D720, 'M', u'ε'), (0x1D721, 'M', u'ζ'), (0x1D722, 'M', u'η'), (0x1D723, 'M', u'θ'), (0x1D724, 'M', u'ι'), (0x1D725, 'M', u'κ'), (0x1D726, 'M', u'λ'), (0x1D727, 'M', u'μ'), (0x1D728, 'M', u'ν'), (0x1D729, 'M', u'ξ'), (0x1D72A, 'M', u'ο'), (0x1D72B, 'M', u'π'), (0x1D72C, 'M', u'ρ'), (0x1D72D, 'M', u'θ'), (0x1D72E, 'M', u'σ'), (0x1D72F, 'M', u'τ'), (0x1D730, 'M', u'υ'), (0x1D731, 'M', u'φ'), (0x1D732, 'M', u'χ'), (0x1D733, 'M', u'ψ'), (0x1D734, 'M', u'ω'), (0x1D735, 'M', u'∇'), (0x1D736, 'M', u'α'), (0x1D737, 'M', u'β'), (0x1D738, 'M', u'γ'), (0x1D739, 'M', u'δ'), (0x1D73A, 'M', u'ε'), (0x1D73B, 'M', u'ζ'), (0x1D73C, 'M', u'η'), (0x1D73D, 'M', u'θ'), (0x1D73E, 'M', u'ι'), (0x1D73F, 'M', u'κ'), (0x1D740, 'M', u'λ'), (0x1D741, 'M', u'μ'), (0x1D742, 'M', u'ν'), (0x1D743, 'M', u'ξ'), (0x1D744, 'M', u'ο'), (0x1D745, 'M', u'π'), (0x1D746, 'M', u'ρ'), (0x1D747, 'M', u'σ'), (0x1D749, 'M', u'τ'), (0x1D74A, 'M', u'υ'), (0x1D74B, 'M', u'φ'), (0x1D74C, 'M', u'χ'), (0x1D74D, 'M', u'ψ'), (0x1D74E, 'M', u'ω'), (0x1D74F, 'M', u'∂'), (0x1D750, 'M', u'ε'), (0x1D751, 'M', u'θ'), (0x1D752, 'M', u'κ'), (0x1D753, 'M', u'φ'), (0x1D754, 'M', u'ρ'), (0x1D755, 'M', u'π'), (0x1D756, 'M', u'α'), (0x1D757, 'M', u'β'), (0x1D758, 'M', u'γ'), (0x1D759, 'M', u'δ'), (0x1D75A, 'M', u'ε'), (0x1D75B, 'M', u'ζ'), (0x1D75C, 'M', u'η'), (0x1D75D, 'M', u'θ'), (0x1D75E, 'M', u'ι'), (0x1D75F, 'M', u'κ'), (0x1D760, 'M', u'λ'), (0x1D761, 'M', u'μ'), (0x1D762, 'M', u'ν'), (0x1D763, 'M', u'ξ'), (0x1D764, 'M', u'ο'), (0x1D765, 'M', u'π'), (0x1D766, 'M', u'ρ'), (0x1D767, 'M', u'θ'), (0x1D768, 'M', u'σ'), (0x1D769, 'M', u'τ'), (0x1D76A, 'M', u'υ'), (0x1D76B, 'M', u'φ'), (0x1D76C, 'M', u'χ'), (0x1D76D, 'M', u'ψ'), (0x1D76E, 'M', u'ω'), (0x1D76F, 'M', u'∇'), (0x1D770, 'M', u'α'), (0x1D771, 'M', u'β'), (0x1D772, 'M', u'γ'), (0x1D773, 'M', u'δ'), (0x1D774, 'M', u'ε'), (0x1D775, 'M', u'ζ'), (0x1D776, 'M', u'η'), (0x1D777, 'M', u'θ'), (0x1D778, 'M', u'ι'), (0x1D779, 'M', u'κ'), (0x1D77A, 'M', u'λ'), (0x1D77B, 'M', u'μ'), ] def _seg_68(): return [ (0x1D77C, 'M', u'ν'), (0x1D77D, 'M', u'ξ'), (0x1D77E, 'M', u'ο'), (0x1D77F, 'M', u'π'), (0x1D780, 'M', u'ρ'), (0x1D781, 'M', u'σ'), (0x1D783, 'M', u'τ'), (0x1D784, 'M', u'υ'), (0x1D785, 'M', u'φ'), (0x1D786, 'M', u'χ'), (0x1D787, 'M', u'ψ'), (0x1D788, 'M', u'ω'), (0x1D789, 'M', u'∂'), (0x1D78A, 'M', u'ε'), (0x1D78B, 'M', u'θ'), (0x1D78C, 'M', u'κ'), (0x1D78D, 'M', u'φ'), (0x1D78E, 'M', u'ρ'), (0x1D78F, 'M', u'π'), (0x1D790, 'M', u'α'), (0x1D791, 'M', u'β'), (0x1D792, 'M', u'γ'), (0x1D793, 'M', u'δ'), (0x1D794, 'M', u'ε'), (0x1D795, 'M', u'ζ'), (0x1D796, 'M', u'η'), (0x1D797, 'M', u'θ'), (0x1D798, 'M', u'ι'), (0x1D799, 'M', u'κ'), (0x1D79A, 'M', u'λ'), (0x1D79B, 'M', u'μ'), (0x1D79C, 'M', u'ν'), (0x1D79D, 'M', u'ξ'), (0x1D79E, 'M', u'ο'), (0x1D79F, 'M', u'π'), (0x1D7A0, 'M', u'ρ'), (0x1D7A1, 'M', u'θ'), (0x1D7A2, 'M', u'σ'), (0x1D7A3, 'M', u'τ'), (0x1D7A4, 'M', u'υ'), (0x1D7A5, 'M', u'φ'), (0x1D7A6, 'M', u'χ'), (0x1D7A7, 'M', u'ψ'), (0x1D7A8, 'M', u'ω'), (0x1D7A9, 'M', u'∇'), (0x1D7AA, 'M', u'α'), (0x1D7AB, 'M', u'β'), (0x1D7AC, 'M', u'γ'), (0x1D7AD, 'M', u'δ'), (0x1D7AE, 'M', u'ε'), (0x1D7AF, 'M', u'ζ'), (0x1D7B0, 'M', u'η'), (0x1D7B1, 'M', u'θ'), (0x1D7B2, 'M', u'ι'), (0x1D7B3, 'M', u'κ'), (0x1D7B4, 'M', u'λ'), (0x1D7B5, 'M', u'μ'), (0x1D7B6, 'M', u'ν'), (0x1D7B7, 'M', u'ξ'), (0x1D7B8, 'M', u'ο'), (0x1D7B9, 'M', u'π'), (0x1D7BA, 'M', u'ρ'), (0x1D7BB, 'M', u'σ'), (0x1D7BD, 'M', u'τ'), (0x1D7BE, 'M', u'υ'), (0x1D7BF, 'M', u'φ'), (0x1D7C0, 'M', u'χ'), (0x1D7C1, 'M', u'ψ'), (0x1D7C2, 'M', u'ω'), (0x1D7C3, 'M', u'∂'), (0x1D7C4, 'M', u'ε'), (0x1D7C5, 'M', u'θ'), (0x1D7C6, 'M', u'κ'), (0x1D7C7, 'M', u'φ'), (0x1D7C8, 'M', u'ρ'), (0x1D7C9, 'M', u'π'), (0x1D7CA, 'M', u'ϝ'), (0x1D7CC, 'X'), (0x1D7CE, 'M', u'0'), (0x1D7CF, 'M', u'1'), (0x1D7D0, 'M', u'2'), (0x1D7D1, 'M', u'3'), (0x1D7D2, 'M', u'4'), (0x1D7D3, 'M', u'5'), (0x1D7D4, 'M', u'6'), (0x1D7D5, 'M', u'7'), (0x1D7D6, 'M', u'8'), (0x1D7D7, 'M', u'9'), (0x1D7D8, 'M', u'0'), (0x1D7D9, 'M', u'1'), (0x1D7DA, 'M', u'2'), (0x1D7DB, 'M', u'3'), (0x1D7DC, 'M', u'4'), (0x1D7DD, 'M', u'5'), (0x1D7DE, 'M', u'6'), (0x1D7DF, 'M', u'7'), (0x1D7E0, 'M', u'8'), (0x1D7E1, 'M', u'9'), (0x1D7E2, 'M', u'0'), (0x1D7E3, 'M', u'1'), ] def _seg_69(): return [ (0x1D7E4, 'M', u'2'), (0x1D7E5, 'M', u'3'), (0x1D7E6, 'M', u'4'), (0x1D7E7, 'M', u'5'), (0x1D7E8, 'M', u'6'), (0x1D7E9, 'M', u'7'), (0x1D7EA, 'M', u'8'), (0x1D7EB, 'M', u'9'), (0x1D7EC, 'M', u'0'), (0x1D7ED, 'M', u'1'), (0x1D7EE, 'M', u'2'), (0x1D7EF, 'M', u'3'), (0x1D7F0, 'M', u'4'), (0x1D7F1, 'M', u'5'), (0x1D7F2, 'M', u'6'), (0x1D7F3, 'M', u'7'), (0x1D7F4, 'M', u'8'), (0x1D7F5, 'M', u'9'), (0x1D7F6, 'M', u'0'), (0x1D7F7, 'M', u'1'), (0x1D7F8, 'M', u'2'), (0x1D7F9, 'M', u'3'), (0x1D7FA, 'M', u'4'), (0x1D7FB, 'M', u'5'), (0x1D7FC, 'M', u'6'), (0x1D7FD, 'M', u'7'), (0x1D7FE, 'M', u'8'), (0x1D7FF, 'M', u'9'), (0x1D800, 'V'), (0x1DA8C, 'X'), (0x1DA9B, 'V'), (0x1DAA0, 'X'), (0x1DAA1, 'V'), (0x1DAB0, 'X'), (0x1E000, 'V'), (0x1E007, 'X'), (0x1E008, 'V'), (0x1E019, 'X'), (0x1E01B, 'V'), (0x1E022, 'X'), (0x1E023, 'V'), (0x1E025, 'X'), (0x1E026, 'V'), (0x1E02B, 'X'), (0x1E100, 'V'), (0x1E12D, 'X'), (0x1E130, 'V'), (0x1E13E, 'X'), (0x1E140, 'V'), (0x1E14A, 'X'), (0x1E14E, 'V'), (0x1E150, 'X'), (0x1E2C0, 'V'), (0x1E2FA, 'X'), (0x1E2FF, 'V'), (0x1E300, 'X'), (0x1E800, 'V'), (0x1E8C5, 'X'), (0x1E8C7, 'V'), (0x1E8D7, 'X'), (0x1E900, 'M', u'𞤢'), (0x1E901, 'M', u'𞤣'), (0x1E902, 'M', u'𞤤'), (0x1E903, 'M', u'𞤥'), (0x1E904, 'M', u'𞤦'), (0x1E905, 'M', u'𞤧'), (0x1E906, 'M', u'𞤨'), (0x1E907, 'M', u'𞤩'), (0x1E908, 'M', u'𞤪'), (0x1E909, 'M', u'𞤫'), (0x1E90A, 'M', u'𞤬'), (0x1E90B, 'M', u'𞤭'), (0x1E90C, 'M', u'𞤮'), (0x1E90D, 'M', u'𞤯'), (0x1E90E, 'M', u'𞤰'), (0x1E90F, 'M', u'𞤱'), (0x1E910, 'M', u'𞤲'), (0x1E911, 'M', u'𞤳'), (0x1E912, 'M', u'𞤴'), (0x1E913, 'M', u'𞤵'), (0x1E914, 'M', u'𞤶'), (0x1E915, 'M', u'𞤷'), (0x1E916, 'M', u'𞤸'), (0x1E917, 'M', u'𞤹'), (0x1E918, 'M', u'𞤺'), (0x1E919, 'M', u'𞤻'), (0x1E91A, 'M', u'𞤼'), (0x1E91B, 'M', u'𞤽'), (0x1E91C, 'M', u'𞤾'), (0x1E91D, 'M', u'𞤿'), (0x1E91E, 'M', u'𞥀'), (0x1E91F, 'M', u'𞥁'), (0x1E920, 'M', u'𞥂'), (0x1E921, 'M', u'𞥃'), (0x1E922, 'V'), (0x1E94C, 'X'), (0x1E950, 'V'), (0x1E95A, 'X'), (0x1E95E, 'V'), (0x1E960, 'X'), ] def _seg_70(): return [ (0x1EC71, 'V'), (0x1ECB5, 'X'), (0x1ED01, 'V'), (0x1ED3E, 'X'), (0x1EE00, 'M', u'ا'), (0x1EE01, 'M', u'ب'), (0x1EE02, 'M', u'ج'), (0x1EE03, 'M', u'د'), (0x1EE04, 'X'), (0x1EE05, 'M', u'و'), (0x1EE06, 'M', u'ز'), (0x1EE07, 'M', u'ح'), (0x1EE08, 'M', u'ط'), (0x1EE09, 'M', u'ي'), (0x1EE0A, 'M', u'ك'), (0x1EE0B, 'M', u'ل'), (0x1EE0C, 'M', u'م'), (0x1EE0D, 'M', u'ن'), (0x1EE0E, 'M', u'س'), (0x1EE0F, 'M', u'ع'), (0x1EE10, 'M', u'ف'), (0x1EE11, 'M', u'ص'), (0x1EE12, 'M', u'ق'), (0x1EE13, 'M', u'ر'), (0x1EE14, 'M', u'ش'), (0x1EE15, 'M', u'ت'), (0x1EE16, 'M', u'ث'), (0x1EE17, 'M', u'خ'), (0x1EE18, 'M', u'ذ'), (0x1EE19, 'M', u'ض'), (0x1EE1A, 'M', u'ظ'), (0x1EE1B, 'M', u'غ'), (0x1EE1C, 'M', u'ٮ'), (0x1EE1D, 'M', u'ں'), (0x1EE1E, 'M', u'ڡ'), (0x1EE1F, 'M', u'ٯ'), (0x1EE20, 'X'), (0x1EE21, 'M', u'ب'), (0x1EE22, 'M', u'ج'), (0x1EE23, 'X'), (0x1EE24, 'M', u'ه'), (0x1EE25, 'X'), (0x1EE27, 'M', u'ح'), (0x1EE28, 'X'), (0x1EE29, 'M', u'ي'), (0x1EE2A, 'M', u'ك'), (0x1EE2B, 'M', u'ل'), (0x1EE2C, 'M', u'م'), (0x1EE2D, 'M', u'ن'), (0x1EE2E, 'M', u'س'), (0x1EE2F, 'M', u'ع'), (0x1EE30, 'M', u'ف'), (0x1EE31, 'M', u'ص'), (0x1EE32, 'M', u'ق'), (0x1EE33, 'X'), (0x1EE34, 'M', u'ش'), (0x1EE35, 'M', u'ت'), (0x1EE36, 'M', u'ث'), (0x1EE37, 'M', u'خ'), (0x1EE38, 'X'), (0x1EE39, 'M', u'ض'), (0x1EE3A, 'X'), (0x1EE3B, 'M', u'غ'), (0x1EE3C, 'X'), (0x1EE42, 'M', u'ج'), (0x1EE43, 'X'), (0x1EE47, 'M', u'ح'), (0x1EE48, 'X'), (0x1EE49, 'M', u'ي'), (0x1EE4A, 'X'), (0x1EE4B, 'M', u'ل'), (0x1EE4C, 'X'), (0x1EE4D, 'M', u'ن'), (0x1EE4E, 'M', u'س'), (0x1EE4F, 'M', u'ع'), (0x1EE50, 'X'), (0x1EE51, 'M', u'ص'), (0x1EE52, 'M', u'ق'), (0x1EE53, 'X'), (0x1EE54, 'M', u'ش'), (0x1EE55, 'X'), (0x1EE57, 'M', u'خ'), (0x1EE58, 'X'), (0x1EE59, 'M', u'ض'), (0x1EE5A, 'X'), (0x1EE5B, 'M', u'غ'), (0x1EE5C, 'X'), (0x1EE5D, 'M', u'ں'), (0x1EE5E, 'X'), (0x1EE5F, 'M', u'ٯ'), (0x1EE60, 'X'), (0x1EE61, 'M', u'ب'), (0x1EE62, 'M', u'ج'), (0x1EE63, 'X'), (0x1EE64, 'M', u'ه'), (0x1EE65, 'X'), (0x1EE67, 'M', u'ح'), (0x1EE68, 'M', u'ط'), (0x1EE69, 'M', u'ي'), (0x1EE6A, 'M', u'ك'), ] def _seg_71(): return [ (0x1EE6B, 'X'), (0x1EE6C, 'M', u'م'), (0x1EE6D, 'M', u'ن'), (0x1EE6E, 'M', u'س'), (0x1EE6F, 'M', u'ع'), (0x1EE70, 'M', u'ف'), (0x1EE71, 'M', u'ص'), (0x1EE72, 'M', u'ق'), (0x1EE73, 'X'), (0x1EE74, 'M', u'ش'), (0x1EE75, 'M', u'ت'), (0x1EE76, 'M', u'ث'), (0x1EE77, 'M', u'خ'), (0x1EE78, 'X'), (0x1EE79, 'M', u'ض'), (0x1EE7A, 'M', u'ظ'), (0x1EE7B, 'M', u'غ'), (0x1EE7C, 'M', u'ٮ'), (0x1EE7D, 'X'), (0x1EE7E, 'M', u'ڡ'), (0x1EE7F, 'X'), (0x1EE80, 'M', u'ا'), (0x1EE81, 'M', u'ب'), (0x1EE82, 'M', u'ج'), (0x1EE83, 'M', u'د'), (0x1EE84, 'M', u'ه'), (0x1EE85, 'M', u'و'), (0x1EE86, 'M', u'ز'), (0x1EE87, 'M', u'ح'), (0x1EE88, 'M', u'ط'), (0x1EE89, 'M', u'ي'), (0x1EE8A, 'X'), (0x1EE8B, 'M', u'ل'), (0x1EE8C, 'M', u'م'), (0x1EE8D, 'M', u'ن'), (0x1EE8E, 'M', u'س'), (0x1EE8F, 'M', u'ع'), (0x1EE90, 'M', u'ف'), (0x1EE91, 'M', u'ص'), (0x1EE92, 'M', u'ق'), (0x1EE93, 'M', u'ر'), (0x1EE94, 'M', u'ش'), (0x1EE95, 'M', u'ت'), (0x1EE96, 'M', u'ث'), (0x1EE97, 'M', u'خ'), (0x1EE98, 'M', u'ذ'), (0x1EE99, 'M', u'ض'), (0x1EE9A, 'M', u'ظ'), (0x1EE9B, 'M', u'غ'), (0x1EE9C, 'X'), (0x1EEA1, 'M', u'ب'), (0x1EEA2, 'M', u'ج'), (0x1EEA3, 'M', u'د'), (0x1EEA4, 'X'), (0x1EEA5, 'M', u'و'), (0x1EEA6, 'M', u'ز'), (0x1EEA7, 'M', u'ح'), (0x1EEA8, 'M', u'ط'), (0x1EEA9, 'M', u'ي'), (0x1EEAA, 'X'), (0x1EEAB, 'M', u'ل'), (0x1EEAC, 'M', u'م'), (0x1EEAD, 'M', u'ن'), (0x1EEAE, 'M', u'س'), (0x1EEAF, 'M', u'ع'), (0x1EEB0, 'M', u'ف'), (0x1EEB1, 'M', u'ص'), (0x1EEB2, 'M', u'ق'), (0x1EEB3, 'M', u'ر'), (0x1EEB4, 'M', u'ش'), (0x1EEB5, 'M', u'ت'), (0x1EEB6, 'M', u'ث'), (0x1EEB7, 'M', u'خ'), (0x1EEB8, 'M', u'ذ'), (0x1EEB9, 'M', u'ض'), (0x1EEBA, 'M', u'ظ'), (0x1EEBB, 'M', u'غ'), (0x1EEBC, 'X'), (0x1EEF0, 'V'), (0x1EEF2, 'X'), (0x1F000, 'V'), (0x1F02C, 'X'), (0x1F030, 'V'), (0x1F094, 'X'), (0x1F0A0, 'V'), (0x1F0AF, 'X'), (0x1F0B1, 'V'), (0x1F0C0, 'X'), (0x1F0C1, 'V'), (0x1F0D0, 'X'), (0x1F0D1, 'V'), (0x1F0F6, 'X'), (0x1F101, '3', u'0,'), (0x1F102, '3', u'1,'), (0x1F103, '3', u'2,'), (0x1F104, '3', u'3,'), (0x1F105, '3', u'4,'), (0x1F106, '3', u'5,'), (0x1F107, '3', u'6,'), (0x1F108, '3', u'7,'), ] def _seg_72(): return [ (0x1F109, '3', u'8,'), (0x1F10A, '3', u'9,'), (0x1F10B, 'V'), (0x1F110, '3', u'(a)'), (0x1F111, '3', u'(b)'), (0x1F112, '3', u'(c)'), (0x1F113, '3', u'(d)'), (0x1F114, '3', u'(e)'), (0x1F115, '3', u'(f)'), (0x1F116, '3', u'(g)'), (0x1F117, '3', u'(h)'), (0x1F118, '3', u'(i)'), (0x1F119, '3', u'(j)'), (0x1F11A, '3', u'(k)'), (0x1F11B, '3', u'(l)'), (0x1F11C, '3', u'(m)'), (0x1F11D, '3', u'(n)'), (0x1F11E, '3', u'(o)'), (0x1F11F, '3', u'(p)'), (0x1F120, '3', u'(q)'), (0x1F121, '3', u'(r)'), (0x1F122, '3', u'(s)'), (0x1F123, '3', u'(t)'), (0x1F124, '3', u'(u)'), (0x1F125, '3', u'(v)'), (0x1F126, '3', u'(w)'), (0x1F127, '3', u'(x)'), (0x1F128, '3', u'(y)'), (0x1F129, '3', u'(z)'), (0x1F12A, 'M', u'〔s〕'), (0x1F12B, 'M', u'c'), (0x1F12C, 'M', u'r'), (0x1F12D, 'M', u'cd'), (0x1F12E, 'M', u'wz'), (0x1F12F, 'V'), (0x1F130, 'M', u'a'), (0x1F131, 'M', u'b'), (0x1F132, 'M', u'c'), (0x1F133, 'M', u'd'), (0x1F134, 'M', u'e'), (0x1F135, 'M', u'f'), (0x1F136, 'M', u'g'), (0x1F137, 'M', u'h'), (0x1F138, 'M', u'i'), (0x1F139, 'M', u'j'), (0x1F13A, 'M', u'k'), (0x1F13B, 'M', u'l'), (0x1F13C, 'M', u'm'), (0x1F13D, 'M', u'n'), (0x1F13E, 'M', u'o'), (0x1F13F, 'M', u'p'), (0x1F140, 'M', u'q'), (0x1F141, 'M', u'r'), (0x1F142, 'M', u's'), (0x1F143, 'M', u't'), (0x1F144, 'M', u'u'), (0x1F145, 'M', u'v'), (0x1F146, 'M', u'w'), (0x1F147, 'M', u'x'), (0x1F148, 'M', u'y'), (0x1F149, 'M', u'z'), (0x1F14A, 'M', u'hv'), (0x1F14B, 'M', u'mv'), (0x1F14C, 'M', u'sd'), (0x1F14D, 'M', u'ss'), (0x1F14E, 'M', u'ppv'), (0x1F14F, 'M', u'wc'), (0x1F150, 'V'), (0x1F16A, 'M', u'mc'), (0x1F16B, 'M', u'md'), (0x1F16C, 'M', u'mr'), (0x1F16D, 'V'), (0x1F190, 'M', u'dj'), (0x1F191, 'V'), (0x1F1AE, 'X'), (0x1F1E6, 'V'), (0x1F200, 'M', u'ほか'), (0x1F201, 'M', u'ココ'), (0x1F202, 'M', u'サ'), (0x1F203, 'X'), (0x1F210, 'M', u'手'), (0x1F211, 'M', u'字'), (0x1F212, 'M', u'双'), (0x1F213, 'M', u'デ'), (0x1F214, 'M', u'二'), (0x1F215, 'M', u'多'), (0x1F216, 'M', u'解'), (0x1F217, 'M', u'天'), (0x1F218, 'M', u'交'), (0x1F219, 'M', u'映'), (0x1F21A, 'M', u'無'), (0x1F21B, 'M', u'料'), (0x1F21C, 'M', u'前'), (0x1F21D, 'M', u'後'), (0x1F21E, 'M', u'再'), (0x1F21F, 'M', u'新'), (0x1F220, 'M', u'初'), (0x1F221, 'M', u'終'), (0x1F222, 'M', u'生'), (0x1F223, 'M', u'販'), ] def _seg_73(): return [ (0x1F224, 'M', u'声'), (0x1F225, 'M', u'吹'), (0x1F226, 'M', u'演'), (0x1F227, 'M', u'投'), (0x1F228, 'M', u'捕'), (0x1F229, 'M', u'一'), (0x1F22A, 'M', u'三'), (0x1F22B, 'M', u'遊'), (0x1F22C, 'M', u'左'), (0x1F22D, 'M', u'中'), (0x1F22E, 'M', u'右'), (0x1F22F, 'M', u'指'), (0x1F230, 'M', u'走'), (0x1F231, 'M', u'打'), (0x1F232, 'M', u'禁'), (0x1F233, 'M', u'空'), (0x1F234, 'M', u'合'), (0x1F235, 'M', u'満'), (0x1F236, 'M', u'有'), (0x1F237, 'M', u'月'), (0x1F238, 'M', u'申'), (0x1F239, 'M', u'割'), (0x1F23A, 'M', u'営'), (0x1F23B, 'M', u'配'), (0x1F23C, 'X'), (0x1F240, 'M', u'〔本〕'), (0x1F241, 'M', u'〔三〕'), (0x1F242, 'M', u'〔二〕'), (0x1F243, 'M', u'〔安〕'), (0x1F244, 'M', u'〔点〕'), (0x1F245, 'M', u'〔打〕'), (0x1F246, 'M', u'〔盗〕'), (0x1F247, 'M', u'〔勝〕'), (0x1F248, 'M', u'〔敗〕'), (0x1F249, 'X'), (0x1F250, 'M', u'得'), (0x1F251, 'M', u'可'), (0x1F252, 'X'), (0x1F260, 'V'), (0x1F266, 'X'), (0x1F300, 'V'), (0x1F6D8, 'X'), (0x1F6E0, 'V'), (0x1F6ED, 'X'), (0x1F6F0, 'V'), (0x1F6FD, 'X'), (0x1F700, 'V'), (0x1F774, 'X'), (0x1F780, 'V'), (0x1F7D9, 'X'), (0x1F7E0, 'V'), (0x1F7EC, 'X'), (0x1F800, 'V'), (0x1F80C, 'X'), (0x1F810, 'V'), (0x1F848, 'X'), (0x1F850, 'V'), (0x1F85A, 'X'), (0x1F860, 'V'), (0x1F888, 'X'), (0x1F890, 'V'), (0x1F8AE, 'X'), (0x1F8B0, 'V'), (0x1F8B2, 'X'), (0x1F900, 'V'), (0x1F979, 'X'), (0x1F97A, 'V'), (0x1F9CC, 'X'), (0x1F9CD, 'V'), (0x1FA54, 'X'), (0x1FA60, 'V'), (0x1FA6E, 'X'), (0x1FA70, 'V'), (0x1FA75, 'X'), (0x1FA78, 'V'), (0x1FA7B, 'X'), (0x1FA80, 'V'), (0x1FA87, 'X'), (0x1FA90, 'V'), (0x1FAA9, 'X'), (0x1FAB0, 'V'), (0x1FAB7, 'X'), (0x1FAC0, 'V'), (0x1FAC3, 'X'), (0x1FAD0, 'V'), (0x1FAD7, 'X'), (0x1FB00, 'V'), (0x1FB93, 'X'), (0x1FB94, 'V'), (0x1FBCB, 'X'), (0x1FBF0, 'M', u'0'), (0x1FBF1, 'M', u'1'), (0x1FBF2, 'M', u'2'), (0x1FBF3, 'M', u'3'), (0x1FBF4, 'M', u'4'), (0x1FBF5, 'M', u'5'), (0x1FBF6, 'M', u'6'), (0x1FBF7, 'M', u'7'), (0x1FBF8, 'M', u'8'), (0x1FBF9, 'M', u'9'), ] def _seg_74(): return [ (0x1FBFA, 'X'), (0x20000, 'V'), (0x2A6DE, 'X'), (0x2A700, 'V'), (0x2B735, 'X'), (0x2B740, 'V'), (0x2B81E, 'X'), (0x2B820, 'V'), (0x2CEA2, 'X'), (0x2CEB0, 'V'), (0x2EBE1, 'X'), (0x2F800, 'M', u'丽'), (0x2F801, 'M', u'丸'), (0x2F802, 'M', u'乁'), (0x2F803, 'M', u'𠄢'), (0x2F804, 'M', u'你'), (0x2F805, 'M', u'侮'), (0x2F806, 'M', u'侻'), (0x2F807, 'M', u'倂'), (0x2F808, 'M', u'偺'), (0x2F809, 'M', u'備'), (0x2F80A, 'M', u'僧'), (0x2F80B, 'M', u'像'), (0x2F80C, 'M', u'㒞'), (0x2F80D, 'M', u'𠘺'), (0x2F80E, 'M', u'免'), (0x2F80F, 'M', u'兔'), (0x2F810, 'M', u'兤'), (0x2F811, 'M', u'具'), (0x2F812, 'M', u'𠔜'), (0x2F813, 'M', u'㒹'), (0x2F814, 'M', u'內'), (0x2F815, 'M', u'再'), (0x2F816, 'M', u'𠕋'), (0x2F817, 'M', u'冗'), (0x2F818, 'M', u'冤'), (0x2F819, 'M', u'仌'), (0x2F81A, 'M', u'冬'), (0x2F81B, 'M', u'况'), (0x2F81C, 'M', u'𩇟'), (0x2F81D, 'M', u'凵'), (0x2F81E, 'M', u'刃'), (0x2F81F, 'M', u'㓟'), (0x2F820, 'M', u'刻'), (0x2F821, 'M', u'剆'), (0x2F822, 'M', u'割'), (0x2F823, 'M', u'剷'), (0x2F824, 'M', u'㔕'), (0x2F825, 'M', u'勇'), (0x2F826, 'M', u'勉'), (0x2F827, 'M', u'勤'), (0x2F828, 'M', u'勺'), (0x2F829, 'M', u'包'), (0x2F82A, 'M', u'匆'), (0x2F82B, 'M', u'北'), (0x2F82C, 'M', u'卉'), (0x2F82D, 'M', u'卑'), (0x2F82E, 'M', u'博'), (0x2F82F, 'M', u'即'), (0x2F830, 'M', u'卽'), (0x2F831, 'M', u'卿'), (0x2F834, 'M', u'𠨬'), (0x2F835, 'M', u'灰'), (0x2F836, 'M', u'及'), (0x2F837, 'M', u'叟'), (0x2F838, 'M', u'𠭣'), (0x2F839, 'M', u'叫'), (0x2F83A, 'M', u'叱'), (0x2F83B, 'M', u'吆'), (0x2F83C, 'M', u'咞'), (0x2F83D, 'M', u'吸'), (0x2F83E, 'M', u'呈'), (0x2F83F, 'M', u'周'), (0x2F840, 'M', u'咢'), (0x2F841, 'M', u'哶'), (0x2F842, 'M', u'唐'), (0x2F843, 'M', u'啓'), (0x2F844, 'M', u'啣'), (0x2F845, 'M', u'善'), (0x2F847, 'M', u'喙'), (0x2F848, 'M', u'喫'), (0x2F849, 'M', u'喳'), (0x2F84A, 'M', u'嗂'), (0x2F84B, 'M', u'圖'), (0x2F84C, 'M', u'嘆'), (0x2F84D, 'M', u'圗'), (0x2F84E, 'M', u'噑'), (0x2F84F, 'M', u'噴'), (0x2F850, 'M', u'切'), (0x2F851, 'M', u'壮'), (0x2F852, 'M', u'城'), (0x2F853, 'M', u'埴'), (0x2F854, 'M', u'堍'), (0x2F855, 'M', u'型'), (0x2F856, 'M', u'堲'), (0x2F857, 'M', u'報'), (0x2F858, 'M', u'墬'), (0x2F859, 'M', u'𡓤'), (0x2F85A, 'M', u'売'), (0x2F85B, 'M', u'壷'), ] def _seg_75(): return [ (0x2F85C, 'M', u'夆'), (0x2F85D, 'M', u'多'), (0x2F85E, 'M', u'夢'), (0x2F85F, 'M', u'奢'), (0x2F860, 'M', u'𡚨'), (0x2F861, 'M', u'𡛪'), (0x2F862, 'M', u'姬'), (0x2F863, 'M', u'娛'), (0x2F864, 'M', u'娧'), (0x2F865, 'M', u'姘'), (0x2F866, 'M', u'婦'), (0x2F867, 'M', u'㛮'), (0x2F868, 'X'), (0x2F869, 'M', u'嬈'), (0x2F86A, 'M', u'嬾'), (0x2F86C, 'M', u'𡧈'), (0x2F86D, 'M', u'寃'), (0x2F86E, 'M', u'寘'), (0x2F86F, 'M', u'寧'), (0x2F870, 'M', u'寳'), (0x2F871, 'M', u'𡬘'), (0x2F872, 'M', u'寿'), (0x2F873, 'M', u'将'), (0x2F874, 'X'), (0x2F875, 'M', u'尢'), (0x2F876, 'M', u'㞁'), (0x2F877, 'M', u'屠'), (0x2F878, 'M', u'屮'), (0x2F879, 'M', u'峀'), (0x2F87A, 'M', u'岍'), (0x2F87B, 'M', u'𡷤'), (0x2F87C, 'M', u'嵃'), (0x2F87D, 'M', u'𡷦'), (0x2F87E, 'M', u'嵮'), (0x2F87F, 'M', u'嵫'), (0x2F880, 'M', u'嵼'), (0x2F881, 'M', u'巡'), (0x2F882, 'M', u'巢'), (0x2F883, 'M', u'㠯'), (0x2F884, 'M', u'巽'), (0x2F885, 'M', u'帨'), (0x2F886, 'M', u'帽'), (0x2F887, 'M', u'幩'), (0x2F888, 'M', u'㡢'), (0x2F889, 'M', u'𢆃'), (0x2F88A, 'M', u'㡼'), (0x2F88B, 'M', u'庰'), (0x2F88C, 'M', u'庳'), (0x2F88D, 'M', u'庶'), (0x2F88E, 'M', u'廊'), (0x2F88F, 'M', u'𪎒'), (0x2F890, 'M', u'廾'), (0x2F891, 'M', u'𢌱'), (0x2F893, 'M', u'舁'), (0x2F894, 'M', u'弢'), (0x2F896, 'M', u'㣇'), (0x2F897, 'M', u'𣊸'), (0x2F898, 'M', u'𦇚'), (0x2F899, 'M', u'形'), (0x2F89A, 'M', u'彫'), (0x2F89B, 'M', u'㣣'), (0x2F89C, 'M', u'徚'), (0x2F89D, 'M', u'忍'), (0x2F89E, 'M', u'志'), (0x2F89F, 'M', u'忹'), (0x2F8A0, 'M', u'悁'), (0x2F8A1, 'M', u'㤺'), (0x2F8A2, 'M', u'㤜'), (0x2F8A3, 'M', u'悔'), (0x2F8A4, 'M', u'𢛔'), (0x2F8A5, 'M', u'惇'), (0x2F8A6, 'M', u'慈'), (0x2F8A7, 'M', u'慌'), (0x2F8A8, 'M', u'慎'), (0x2F8A9, 'M', u'慌'), (0x2F8AA, 'M', u'慺'), (0x2F8AB, 'M', u'憎'), (0x2F8AC, 'M', u'憲'), (0x2F8AD, 'M', u'憤'), (0x2F8AE, 'M', u'憯'), (0x2F8AF, 'M', u'懞'), (0x2F8B0, 'M', u'懲'), (0x2F8B1, 'M', u'懶'), (0x2F8B2, 'M', u'成'), (0x2F8B3, 'M', u'戛'), (0x2F8B4, 'M', u'扝'), (0x2F8B5, 'M', u'抱'), (0x2F8B6, 'M', u'拔'), (0x2F8B7, 'M', u'捐'), (0x2F8B8, 'M', u'𢬌'), (0x2F8B9, 'M', u'挽'), (0x2F8BA, 'M', u'拼'), (0x2F8BB, 'M', u'捨'), (0x2F8BC, 'M', u'掃'), (0x2F8BD, 'M', u'揤'), (0x2F8BE, 'M', u'𢯱'), (0x2F8BF, 'M', u'搢'), (0x2F8C0, 'M', u'揅'), (0x2F8C1, 'M', u'掩'), (0x2F8C2, 'M', u'㨮'), ] def _seg_76(): return [ (0x2F8C3, 'M', u'摩'), (0x2F8C4, 'M', u'摾'), (0x2F8C5, 'M', u'撝'), (0x2F8C6, 'M', u'摷'), (0x2F8C7, 'M', u'㩬'), (0x2F8C8, 'M', u'敏'), (0x2F8C9, 'M', u'敬'), (0x2F8CA, 'M', u'𣀊'), (0x2F8CB, 'M', u'旣'), (0x2F8CC, 'M', u'書'), (0x2F8CD, 'M', u'晉'), (0x2F8CE, 'M', u'㬙'), (0x2F8CF, 'M', u'暑'), (0x2F8D0, 'M', u'㬈'), (0x2F8D1, 'M', u'㫤'), (0x2F8D2, 'M', u'冒'), (0x2F8D3, 'M', u'冕'), (0x2F8D4, 'M', u'最'), (0x2F8D5, 'M', u'暜'), (0x2F8D6, 'M', u'肭'), (0x2F8D7, 'M', u'䏙'), (0x2F8D8, 'M', u'朗'), (0x2F8D9, 'M', u'望'), (0x2F8DA, 'M', u'朡'), (0x2F8DB, 'M', u'杞'), (0x2F8DC, 'M', u'杓'), (0x2F8DD, 'M', u'𣏃'), (0x2F8DE, 'M', u'㭉'), (0x2F8DF, 'M', u'柺'), (0x2F8E0, 'M', u'枅'), (0x2F8E1, 'M', u'桒'), (0x2F8E2, 'M', u'梅'), (0x2F8E3, 'M', u'𣑭'), (0x2F8E4, 'M', u'梎'), (0x2F8E5, 'M', u'栟'), (0x2F8E6, 'M', u'椔'), (0x2F8E7, 'M', u'㮝'), (0x2F8E8, 'M', u'楂'), (0x2F8E9, 'M', u'榣'), (0x2F8EA, 'M', u'槪'), (0x2F8EB, 'M', u'檨'), (0x2F8EC, 'M', u'𣚣'), (0x2F8ED, 'M', u'櫛'), (0x2F8EE, 'M', u'㰘'), (0x2F8EF, 'M', u'次'), (0x2F8F0, 'M', u'𣢧'), (0x2F8F1, 'M', u'歔'), (0x2F8F2, 'M', u'㱎'), (0x2F8F3, 'M', u'歲'), (0x2F8F4, 'M', u'殟'), (0x2F8F5, 'M', u'殺'), (0x2F8F6, 'M', u'殻'), (0x2F8F7, 'M', u'𣪍'), (0x2F8F8, 'M', u'𡴋'), (0x2F8F9, 'M', u'𣫺'), (0x2F8FA, 'M', u'汎'), (0x2F8FB, 'M', u'𣲼'), (0x2F8FC, 'M', u'沿'), (0x2F8FD, 'M', u'泍'), (0x2F8FE, 'M', u'汧'), (0x2F8FF, 'M', u'洖'), (0x2F900, 'M', u'派'), (0x2F901, 'M', u'海'), (0x2F902, 'M', u'流'), (0x2F903, 'M', u'浩'), (0x2F904, 'M', u'浸'), (0x2F905, 'M', u'涅'), (0x2F906, 'M', u'𣴞'), (0x2F907, 'M', u'洴'), (0x2F908, 'M', u'港'), (0x2F909, 'M', u'湮'), (0x2F90A, 'M', u'㴳'), (0x2F90B, 'M', u'滋'), (0x2F90C, 'M', u'滇'), (0x2F90D, 'M', u'𣻑'), (0x2F90E, 'M', u'淹'), (0x2F90F, 'M', u'潮'), (0x2F910, 'M', u'𣽞'), (0x2F911, 'M', u'𣾎'), (0x2F912, 'M', u'濆'), (0x2F913, 'M', u'瀹'), (0x2F914, 'M', u'瀞'), (0x2F915, 'M', u'瀛'), (0x2F916, 'M', u'㶖'), (0x2F917, 'M', u'灊'), (0x2F918, 'M', u'災'), (0x2F919, 'M', u'灷'), (0x2F91A, 'M', u'炭'), (0x2F91B, 'M', u'𠔥'), (0x2F91C, 'M', u'煅'), (0x2F91D, 'M', u'𤉣'), (0x2F91E, 'M', u'熜'), (0x2F91F, 'X'), (0x2F920, 'M', u'爨'), (0x2F921, 'M', u'爵'), (0x2F922, 'M', u'牐'), (0x2F923, 'M', u'𤘈'), (0x2F924, 'M', u'犀'), (0x2F925, 'M', u'犕'), (0x2F926, 'M', u'𤜵'), ] def _seg_77(): return [ (0x2F927, 'M', u'𤠔'), (0x2F928, 'M', u'獺'), (0x2F929, 'M', u'王'), (0x2F92A, 'M', u'㺬'), (0x2F92B, 'M', u'玥'), (0x2F92C, 'M', u'㺸'), (0x2F92E, 'M', u'瑇'), (0x2F92F, 'M', u'瑜'), (0x2F930, 'M', u'瑱'), (0x2F931, 'M', u'璅'), (0x2F932, 'M', u'瓊'), (0x2F933, 'M', u'㼛'), (0x2F934, 'M', u'甤'), (0x2F935, 'M', u'𤰶'), (0x2F936, 'M', u'甾'), (0x2F937, 'M', u'𤲒'), (0x2F938, 'M', u'異'), (0x2F939, 'M', u'𢆟'), (0x2F93A, 'M', u'瘐'), (0x2F93B, 'M', u'𤾡'), (0x2F93C, 'M', u'𤾸'), (0x2F93D, 'M', u'𥁄'), (0x2F93E, 'M', u'㿼'), (0x2F93F, 'M', u'䀈'), (0x2F940, 'M', u'直'), (0x2F941, 'M', u'𥃳'), (0x2F942, 'M', u'𥃲'), (0x2F943, 'M', u'𥄙'), (0x2F944, 'M', u'𥄳'), (0x2F945, 'M', u'眞'), (0x2F946, 'M', u'真'), (0x2F948, 'M', u'睊'), (0x2F949, 'M', u'䀹'), (0x2F94A, 'M', u'瞋'), (0x2F94B, 'M', u'䁆'), (0x2F94C, 'M', u'䂖'), (0x2F94D, 'M', u'𥐝'), (0x2F94E, 'M', u'硎'), (0x2F94F, 'M', u'碌'), (0x2F950, 'M', u'磌'), (0x2F951, 'M', u'䃣'), (0x2F952, 'M', u'𥘦'), (0x2F953, 'M', u'祖'), (0x2F954, 'M', u'𥚚'), (0x2F955, 'M', u'𥛅'), (0x2F956, 'M', u'福'), (0x2F957, 'M', u'秫'), (0x2F958, 'M', u'䄯'), (0x2F959, 'M', u'穀'), (0x2F95A, 'M', u'穊'), (0x2F95B, 'M', u'穏'), (0x2F95C, 'M', u'𥥼'), (0x2F95D, 'M', u'𥪧'), (0x2F95F, 'X'), (0x2F960, 'M', u'䈂'), (0x2F961, 'M', u'𥮫'), (0x2F962, 'M', u'篆'), (0x2F963, 'M', u'築'), (0x2F964, 'M', u'䈧'), (0x2F965, 'M', u'𥲀'), (0x2F966, 'M', u'糒'), (0x2F967, 'M', u'䊠'), (0x2F968, 'M', u'糨'), (0x2F969, 'M', u'糣'), (0x2F96A, 'M', u'紀'), (0x2F96B, 'M', u'𥾆'), (0x2F96C, 'M', u'絣'), (0x2F96D, 'M', u'䌁'), (0x2F96E, 'M', u'緇'), (0x2F96F, 'M', u'縂'), (0x2F970, 'M', u'繅'), (0x2F971, 'M', u'䌴'), (0x2F972, 'M', u'𦈨'), (0x2F973, 'M', u'𦉇'), (0x2F974, 'M', u'䍙'), (0x2F975, 'M', u'𦋙'), (0x2F976, 'M', u'罺'), (0x2F977, 'M', u'𦌾'), (0x2F978, 'M', u'羕'), (0x2F979, 'M', u'翺'), (0x2F97A, 'M', u'者'), (0x2F97B, 'M', u'𦓚'), (0x2F97C, 'M', u'𦔣'), (0x2F97D, 'M', u'聠'), (0x2F97E, 'M', u'𦖨'), (0x2F97F, 'M', u'聰'), (0x2F980, 'M', u'𣍟'), (0x2F981, 'M', u'䏕'), (0x2F982, 'M', u'育'), (0x2F983, 'M', u'脃'), (0x2F984, 'M', u'䐋'), (0x2F985, 'M', u'脾'), (0x2F986, 'M', u'媵'), (0x2F987, 'M', u'𦞧'), (0x2F988, 'M', u'𦞵'), (0x2F989, 'M', u'𣎓'), (0x2F98A, 'M', u'𣎜'), (0x2F98B, 'M', u'舁'), (0x2F98C, 'M', u'舄'), (0x2F98D, 'M', u'辞'), ] def _seg_78(): return [ (0x2F98E, 'M', u'䑫'), (0x2F98F, 'M', u'芑'), (0x2F990, 'M', u'芋'), (0x2F991, 'M', u'芝'), (0x2F992, 'M', u'劳'), (0x2F993, 'M', u'花'), (0x2F994, 'M', u'芳'), (0x2F995, 'M', u'芽'), (0x2F996, 'M', u'苦'), (0x2F997, 'M', u'𦬼'), (0x2F998, 'M', u'若'), (0x2F999, 'M', u'茝'), (0x2F99A, 'M', u'荣'), (0x2F99B, 'M', u'莭'), (0x2F99C, 'M', u'茣'), (0x2F99D, 'M', u'莽'), (0x2F99E, 'M', u'菧'), (0x2F99F, 'M', u'著'), (0x2F9A0, 'M', u'荓'), (0x2F9A1, 'M', u'菊'), (0x2F9A2, 'M', u'菌'), (0x2F9A3, 'M', u'菜'), (0x2F9A4, 'M', u'𦰶'), (0x2F9A5, 'M', u'𦵫'), (0x2F9A6, 'M', u'𦳕'), (0x2F9A7, 'M', u'䔫'), (0x2F9A8, 'M', u'蓱'), (0x2F9A9, 'M', u'蓳'), (0x2F9AA, 'M', u'蔖'), (0x2F9AB, 'M', u'𧏊'), (0x2F9AC, 'M', u'蕤'), (0x2F9AD, 'M', u'𦼬'), (0x2F9AE, 'M', u'䕝'), (0x2F9AF, 'M', u'䕡'), (0x2F9B0, 'M', u'𦾱'), (0x2F9B1, 'M', u'𧃒'), (0x2F9B2, 'M', u'䕫'), (0x2F9B3, 'M', u'虐'), (0x2F9B4, 'M', u'虜'), (0x2F9B5, 'M', u'虧'), (0x2F9B6, 'M', u'虩'), (0x2F9B7, 'M', u'蚩'), (0x2F9B8, 'M', u'蚈'), (0x2F9B9, 'M', u'蜎'), (0x2F9BA, 'M', u'蛢'), (0x2F9BB, 'M', u'蝹'), (0x2F9BC, 'M', u'蜨'), (0x2F9BD, 'M', u'蝫'), (0x2F9BE, 'M', u'螆'), (0x2F9BF, 'X'), (0x2F9C0, 'M', u'蟡'), (0x2F9C1, 'M', u'蠁'), (0x2F9C2, 'M', u'䗹'), (0x2F9C3, 'M', u'衠'), (0x2F9C4, 'M', u'衣'), (0x2F9C5, 'M', u'𧙧'), (0x2F9C6, 'M', u'裗'), (0x2F9C7, 'M', u'裞'), (0x2F9C8, 'M', u'䘵'), (0x2F9C9, 'M', u'裺'), (0x2F9CA, 'M', u'㒻'), (0x2F9CB, 'M', u'𧢮'), (0x2F9CC, 'M', u'𧥦'), (0x2F9CD, 'M', u'䚾'), (0x2F9CE, 'M', u'䛇'), (0x2F9CF, 'M', u'誠'), (0x2F9D0, 'M', u'諭'), (0x2F9D1, 'M', u'變'), (0x2F9D2, 'M', u'豕'), (0x2F9D3, 'M', u'𧲨'), (0x2F9D4, 'M', u'貫'), (0x2F9D5, 'M', u'賁'), (0x2F9D6, 'M', u'贛'), (0x2F9D7, 'M', u'起'), (0x2F9D8, 'M', u'𧼯'), (0x2F9D9, 'M', u'𠠄'), (0x2F9DA, 'M', u'跋'), (0x2F9DB, 'M', u'趼'), (0x2F9DC, 'M', u'跰'), (0x2F9DD, 'M', u'𠣞'), (0x2F9DE, 'M', u'軔'), (0x2F9DF, 'M', u'輸'), (0x2F9E0, 'M', u'𨗒'), (0x2F9E1, 'M', u'𨗭'), (0x2F9E2, 'M', u'邔'), (0x2F9E3, 'M', u'郱'), (0x2F9E4, 'M', u'鄑'), (0x2F9E5, 'M', u'𨜮'), (0x2F9E6, 'M', u'鄛'), (0x2F9E7, 'M', u'鈸'), (0x2F9E8, 'M', u'鋗'), (0x2F9E9, 'M', u'鋘'), (0x2F9EA, 'M', u'鉼'), (0x2F9EB, 'M', u'鏹'), (0x2F9EC, 'M', u'鐕'), (0x2F9ED, 'M', u'𨯺'), (0x2F9EE, 'M', u'開'), (0x2F9EF, 'M', u'䦕'), (0x2F9F0, 'M', u'閷'), (0x2F9F1, 'M', u'𨵷'), ] def _seg_79(): return [ (0x2F9F2, 'M', u'䧦'), (0x2F9F3, 'M', u'雃'), (0x2F9F4, 'M', u'嶲'), (0x2F9F5, 'M', u'霣'), (0x2F9F6, 'M', u'𩅅'), (0x2F9F7, 'M', u'𩈚'), (0x2F9F8, 'M', u'䩮'), (0x2F9F9, 'M', u'䩶'), (0x2F9FA, 'M', u'韠'), (0x2F9FB, 'M', u'𩐊'), (0x2F9FC, 'M', u'䪲'), (0x2F9FD, 'M', u'𩒖'), (0x2F9FE, 'M', u'頋'), (0x2FA00, 'M', u'頩'), (0x2FA01, 'M', u'𩖶'), (0x2FA02, 'M', u'飢'), (0x2FA03, 'M', u'䬳'), (0x2FA04, 'M', u'餩'), (0x2FA05, 'M', u'馧'), (0x2FA06, 'M', u'駂'), (0x2FA07, 'M', u'駾'), (0x2FA08, 'M', u'䯎'), (0x2FA09, 'M', u'𩬰'), (0x2FA0A, 'M', u'鬒'), (0x2FA0B, 'M', u'鱀'), (0x2FA0C, 'M', u'鳽'), (0x2FA0D, 'M', u'䳎'), (0x2FA0E, 'M', u'䳭'), (0x2FA0F, 'M', u'鵧'), (0x2FA10, 'M', u'𪃎'), (0x2FA11, 'M', u'䳸'), (0x2FA12, 'M', u'𪄅'), (0x2FA13, 'M', u'𪈎'), (0x2FA14, 'M', u'𪊑'), (0x2FA15, 'M', u'麻'), (0x2FA16, 'M', u'䵖'), (0x2FA17, 'M', u'黹'), (0x2FA18, 'M', u'黾'), (0x2FA19, 'M', u'鼅'), (0x2FA1A, 'M', u'鼏'), (0x2FA1B, 'M', u'鼖'), (0x2FA1C, 'M', u'鼻'), (0x2FA1D, 'M', u'𪘀'), (0x2FA1E, 'X'), (0x30000, 'V'), (0x3134B, 'X'), (0xE0100, 'I'), (0xE01F0, 'X'), ] uts46data = tuple( _seg_0() + _seg_1() + _seg_2() + _seg_3() + _seg_4() + _seg_5() + _seg_6() + _seg_7() + _seg_8() + _seg_9() + _seg_10() + _seg_11() + _seg_12() + _seg_13() + _seg_14() + _seg_15() + _seg_16() + _seg_17() + _seg_18() + _seg_19() + _seg_20() + _seg_21() + _seg_22() + _seg_23() + _seg_24() + _seg_25() + _seg_26() + _seg_27() + _seg_28() + _seg_29() + _seg_30() + _seg_31() + _seg_32() + _seg_33() + _seg_34() + _seg_35() + _seg_36() + _seg_37() + _seg_38() + _seg_39() + _seg_40() + _seg_41() + _seg_42() + _seg_43() + _seg_44() + _seg_45() + _seg_46() + _seg_47() + _seg_48() + _seg_49() + _seg_50() + _seg_51() + _seg_52() + _seg_53() + _seg_54() + _seg_55() + _seg_56() + _seg_57() + _seg_58() + _seg_59() + _seg_60() + _seg_61() + _seg_62() + _seg_63() + _seg_64() + _seg_65() + _seg_66() + _seg_67() + _seg_68() + _seg_69() + _seg_70() + _seg_71() + _seg_72() + _seg_73() + _seg_74() + _seg_75() + _seg_76() + _seg_77() + _seg_78() + _seg_79() ) PKd]cidna/intranges.pynu[""" Given a list of integers, made up of (hopefully) a small number of long runs of consecutive integers, compute a representation of the form ((start1, end1), (start2, end2) ...). Then answer the question "was x present in the original list?" in time O(log(# runs)). """ import bisect def intranges_from_list(list_): """Represent a list of integers as a sequence of ranges: ((start_0, end_0), (start_1, end_1), ...), such that the original integers are exactly those x such that start_i <= x < end_i for some i. Ranges are encoded as single integers (start << 32 | end), not as tuples. """ sorted_list = sorted(list_) ranges = [] last_write = -1 for i in range(len(sorted_list)): if i+1 < len(sorted_list): if sorted_list[i] == sorted_list[i+1]-1: continue current_range = sorted_list[last_write+1:i+1] ranges.append(_encode_range(current_range[0], current_range[-1] + 1)) last_write = i return tuple(ranges) def _encode_range(start, end): return (start << 32) | end def _decode_range(r): return (r >> 32), (r & ((1 << 32) - 1)) def intranges_contain(int_, ranges): """Determine if `int_` falls into one of the ranges in `ranges`.""" tuple_ = _encode_range(int_, 0) pos = bisect.bisect_left(ranges, tuple_) # we could be immediately ahead of a tuple (start, end) # with start < int_ <= end if pos > 0: left, right = _decode_range(ranges[pos-1]) if left <= int_ < right: return True # or we could be immediately behind a tuple (int_, end) if pos < len(ranges): left, _ = _decode_range(ranges[pos]) if left == int_: return True return False PKd]׬J4nnidna/idnadata.pynu[# This file is automatically generated by tools/idna-data __version__ = "13.0.0" scripts = { 'Greek': ( 0x37000000374, 0x37500000378, 0x37a0000037e, 0x37f00000380, 0x38400000385, 0x38600000387, 0x3880000038b, 0x38c0000038d, 0x38e000003a2, 0x3a3000003e2, 0x3f000000400, 0x1d2600001d2b, 0x1d5d00001d62, 0x1d6600001d6b, 0x1dbf00001dc0, 0x1f0000001f16, 0x1f1800001f1e, 0x1f2000001f46, 0x1f4800001f4e, 0x1f5000001f58, 0x1f5900001f5a, 0x1f5b00001f5c, 0x1f5d00001f5e, 0x1f5f00001f7e, 0x1f8000001fb5, 0x1fb600001fc5, 0x1fc600001fd4, 0x1fd600001fdc, 0x1fdd00001ff0, 0x1ff200001ff5, 0x1ff600001fff, 0x212600002127, 0xab650000ab66, 0x101400001018f, 0x101a0000101a1, 0x1d2000001d246, ), 'Han': ( 0x2e8000002e9a, 0x2e9b00002ef4, 0x2f0000002fd6, 0x300500003006, 0x300700003008, 0x30210000302a, 0x30380000303c, 0x340000004dc0, 0x4e0000009ffd, 0xf9000000fa6e, 0xfa700000fada, 0x16ff000016ff2, 0x200000002a6de, 0x2a7000002b735, 0x2b7400002b81e, 0x2b8200002cea2, 0x2ceb00002ebe1, 0x2f8000002fa1e, 0x300000003134b, ), 'Hebrew': ( 0x591000005c8, 0x5d0000005eb, 0x5ef000005f5, 0xfb1d0000fb37, 0xfb380000fb3d, 0xfb3e0000fb3f, 0xfb400000fb42, 0xfb430000fb45, 0xfb460000fb50, ), 'Hiragana': ( 0x304100003097, 0x309d000030a0, 0x1b0010001b11f, 0x1b1500001b153, 0x1f2000001f201, ), 'Katakana': ( 0x30a1000030fb, 0x30fd00003100, 0x31f000003200, 0x32d0000032ff, 0x330000003358, 0xff660000ff70, 0xff710000ff9e, 0x1b0000001b001, 0x1b1640001b168, ), } joining_types = { 0x600: 85, 0x601: 85, 0x602: 85, 0x603: 85, 0x604: 85, 0x605: 85, 0x608: 85, 0x60b: 85, 0x620: 68, 0x621: 85, 0x622: 82, 0x623: 82, 0x624: 82, 0x625: 82, 0x626: 68, 0x627: 82, 0x628: 68, 0x629: 82, 0x62a: 68, 0x62b: 68, 0x62c: 68, 0x62d: 68, 0x62e: 68, 0x62f: 82, 0x630: 82, 0x631: 82, 0x632: 82, 0x633: 68, 0x634: 68, 0x635: 68, 0x636: 68, 0x637: 68, 0x638: 68, 0x639: 68, 0x63a: 68, 0x63b: 68, 0x63c: 68, 0x63d: 68, 0x63e: 68, 0x63f: 68, 0x640: 67, 0x641: 68, 0x642: 68, 0x643: 68, 0x644: 68, 0x645: 68, 0x646: 68, 0x647: 68, 0x648: 82, 0x649: 68, 0x64a: 68, 0x66e: 68, 0x66f: 68, 0x671: 82, 0x672: 82, 0x673: 82, 0x674: 85, 0x675: 82, 0x676: 82, 0x677: 82, 0x678: 68, 0x679: 68, 0x67a: 68, 0x67b: 68, 0x67c: 68, 0x67d: 68, 0x67e: 68, 0x67f: 68, 0x680: 68, 0x681: 68, 0x682: 68, 0x683: 68, 0x684: 68, 0x685: 68, 0x686: 68, 0x687: 68, 0x688: 82, 0x689: 82, 0x68a: 82, 0x68b: 82, 0x68c: 82, 0x68d: 82, 0x68e: 82, 0x68f: 82, 0x690: 82, 0x691: 82, 0x692: 82, 0x693: 82, 0x694: 82, 0x695: 82, 0x696: 82, 0x697: 82, 0x698: 82, 0x699: 82, 0x69a: 68, 0x69b: 68, 0x69c: 68, 0x69d: 68, 0x69e: 68, 0x69f: 68, 0x6a0: 68, 0x6a1: 68, 0x6a2: 68, 0x6a3: 68, 0x6a4: 68, 0x6a5: 68, 0x6a6: 68, 0x6a7: 68, 0x6a8: 68, 0x6a9: 68, 0x6aa: 68, 0x6ab: 68, 0x6ac: 68, 0x6ad: 68, 0x6ae: 68, 0x6af: 68, 0x6b0: 68, 0x6b1: 68, 0x6b2: 68, 0x6b3: 68, 0x6b4: 68, 0x6b5: 68, 0x6b6: 68, 0x6b7: 68, 0x6b8: 68, 0x6b9: 68, 0x6ba: 68, 0x6bb: 68, 0x6bc: 68, 0x6bd: 68, 0x6be: 68, 0x6bf: 68, 0x6c0: 82, 0x6c1: 68, 0x6c2: 68, 0x6c3: 82, 0x6c4: 82, 0x6c5: 82, 0x6c6: 82, 0x6c7: 82, 0x6c8: 82, 0x6c9: 82, 0x6ca: 82, 0x6cb: 82, 0x6cc: 68, 0x6cd: 82, 0x6ce: 68, 0x6cf: 82, 0x6d0: 68, 0x6d1: 68, 0x6d2: 82, 0x6d3: 82, 0x6d5: 82, 0x6dd: 85, 0x6ee: 82, 0x6ef: 82, 0x6fa: 68, 0x6fb: 68, 0x6fc: 68, 0x6ff: 68, 0x70f: 84, 0x710: 82, 0x712: 68, 0x713: 68, 0x714: 68, 0x715: 82, 0x716: 82, 0x717: 82, 0x718: 82, 0x719: 82, 0x71a: 68, 0x71b: 68, 0x71c: 68, 0x71d: 68, 0x71e: 82, 0x71f: 68, 0x720: 68, 0x721: 68, 0x722: 68, 0x723: 68, 0x724: 68, 0x725: 68, 0x726: 68, 0x727: 68, 0x728: 82, 0x729: 68, 0x72a: 82, 0x72b: 68, 0x72c: 82, 0x72d: 68, 0x72e: 68, 0x72f: 82, 0x74d: 82, 0x74e: 68, 0x74f: 68, 0x750: 68, 0x751: 68, 0x752: 68, 0x753: 68, 0x754: 68, 0x755: 68, 0x756: 68, 0x757: 68, 0x758: 68, 0x759: 82, 0x75a: 82, 0x75b: 82, 0x75c: 68, 0x75d: 68, 0x75e: 68, 0x75f: 68, 0x760: 68, 0x761: 68, 0x762: 68, 0x763: 68, 0x764: 68, 0x765: 68, 0x766: 68, 0x767: 68, 0x768: 68, 0x769: 68, 0x76a: 68, 0x76b: 82, 0x76c: 82, 0x76d: 68, 0x76e: 68, 0x76f: 68, 0x770: 68, 0x771: 82, 0x772: 68, 0x773: 82, 0x774: 82, 0x775: 68, 0x776: 68, 0x777: 68, 0x778: 82, 0x779: 82, 0x77a: 68, 0x77b: 68, 0x77c: 68, 0x77d: 68, 0x77e: 68, 0x77f: 68, 0x7ca: 68, 0x7cb: 68, 0x7cc: 68, 0x7cd: 68, 0x7ce: 68, 0x7cf: 68, 0x7d0: 68, 0x7d1: 68, 0x7d2: 68, 0x7d3: 68, 0x7d4: 68, 0x7d5: 68, 0x7d6: 68, 0x7d7: 68, 0x7d8: 68, 0x7d9: 68, 0x7da: 68, 0x7db: 68, 0x7dc: 68, 0x7dd: 68, 0x7de: 68, 0x7df: 68, 0x7e0: 68, 0x7e1: 68, 0x7e2: 68, 0x7e3: 68, 0x7e4: 68, 0x7e5: 68, 0x7e6: 68, 0x7e7: 68, 0x7e8: 68, 0x7e9: 68, 0x7ea: 68, 0x7fa: 67, 0x840: 82, 0x841: 68, 0x842: 68, 0x843: 68, 0x844: 68, 0x845: 68, 0x846: 82, 0x847: 82, 0x848: 68, 0x849: 82, 0x84a: 68, 0x84b: 68, 0x84c: 68, 0x84d: 68, 0x84e: 68, 0x84f: 68, 0x850: 68, 0x851: 68, 0x852: 68, 0x853: 68, 0x854: 82, 0x855: 68, 0x856: 82, 0x857: 82, 0x858: 82, 0x860: 68, 0x861: 85, 0x862: 68, 0x863: 68, 0x864: 68, 0x865: 68, 0x866: 85, 0x867: 82, 0x868: 68, 0x869: 82, 0x86a: 82, 0x8a0: 68, 0x8a1: 68, 0x8a2: 68, 0x8a3: 68, 0x8a4: 68, 0x8a5: 68, 0x8a6: 68, 0x8a7: 68, 0x8a8: 68, 0x8a9: 68, 0x8aa: 82, 0x8ab: 82, 0x8ac: 82, 0x8ad: 85, 0x8ae: 82, 0x8af: 68, 0x8b0: 68, 0x8b1: 82, 0x8b2: 82, 0x8b3: 68, 0x8b4: 68, 0x8b6: 68, 0x8b7: 68, 0x8b8: 68, 0x8b9: 82, 0x8ba: 68, 0x8bb: 68, 0x8bc: 68, 0x8bd: 68, 0x8be: 68, 0x8bf: 68, 0x8c0: 68, 0x8c1: 68, 0x8c2: 68, 0x8c3: 68, 0x8c4: 68, 0x8c5: 68, 0x8c6: 68, 0x8c7: 68, 0x8e2: 85, 0x1806: 85, 0x1807: 68, 0x180a: 67, 0x180e: 85, 0x1820: 68, 0x1821: 68, 0x1822: 68, 0x1823: 68, 0x1824: 68, 0x1825: 68, 0x1826: 68, 0x1827: 68, 0x1828: 68, 0x1829: 68, 0x182a: 68, 0x182b: 68, 0x182c: 68, 0x182d: 68, 0x182e: 68, 0x182f: 68, 0x1830: 68, 0x1831: 68, 0x1832: 68, 0x1833: 68, 0x1834: 68, 0x1835: 68, 0x1836: 68, 0x1837: 68, 0x1838: 68, 0x1839: 68, 0x183a: 68, 0x183b: 68, 0x183c: 68, 0x183d: 68, 0x183e: 68, 0x183f: 68, 0x1840: 68, 0x1841: 68, 0x1842: 68, 0x1843: 68, 0x1844: 68, 0x1845: 68, 0x1846: 68, 0x1847: 68, 0x1848: 68, 0x1849: 68, 0x184a: 68, 0x184b: 68, 0x184c: 68, 0x184d: 68, 0x184e: 68, 0x184f: 68, 0x1850: 68, 0x1851: 68, 0x1852: 68, 0x1853: 68, 0x1854: 68, 0x1855: 68, 0x1856: 68, 0x1857: 68, 0x1858: 68, 0x1859: 68, 0x185a: 68, 0x185b: 68, 0x185c: 68, 0x185d: 68, 0x185e: 68, 0x185f: 68, 0x1860: 68, 0x1861: 68, 0x1862: 68, 0x1863: 68, 0x1864: 68, 0x1865: 68, 0x1866: 68, 0x1867: 68, 0x1868: 68, 0x1869: 68, 0x186a: 68, 0x186b: 68, 0x186c: 68, 0x186d: 68, 0x186e: 68, 0x186f: 68, 0x1870: 68, 0x1871: 68, 0x1872: 68, 0x1873: 68, 0x1874: 68, 0x1875: 68, 0x1876: 68, 0x1877: 68, 0x1878: 68, 0x1880: 85, 0x1881: 85, 0x1882: 85, 0x1883: 85, 0x1884: 85, 0x1885: 84, 0x1886: 84, 0x1887: 68, 0x1888: 68, 0x1889: 68, 0x188a: 68, 0x188b: 68, 0x188c: 68, 0x188d: 68, 0x188e: 68, 0x188f: 68, 0x1890: 68, 0x1891: 68, 0x1892: 68, 0x1893: 68, 0x1894: 68, 0x1895: 68, 0x1896: 68, 0x1897: 68, 0x1898: 68, 0x1899: 68, 0x189a: 68, 0x189b: 68, 0x189c: 68, 0x189d: 68, 0x189e: 68, 0x189f: 68, 0x18a0: 68, 0x18a1: 68, 0x18a2: 68, 0x18a3: 68, 0x18a4: 68, 0x18a5: 68, 0x18a6: 68, 0x18a7: 68, 0x18a8: 68, 0x18aa: 68, 0x200c: 85, 0x200d: 67, 0x202f: 85, 0x2066: 85, 0x2067: 85, 0x2068: 85, 0x2069: 85, 0xa840: 68, 0xa841: 68, 0xa842: 68, 0xa843: 68, 0xa844: 68, 0xa845: 68, 0xa846: 68, 0xa847: 68, 0xa848: 68, 0xa849: 68, 0xa84a: 68, 0xa84b: 68, 0xa84c: 68, 0xa84d: 68, 0xa84e: 68, 0xa84f: 68, 0xa850: 68, 0xa851: 68, 0xa852: 68, 0xa853: 68, 0xa854: 68, 0xa855: 68, 0xa856: 68, 0xa857: 68, 0xa858: 68, 0xa859: 68, 0xa85a: 68, 0xa85b: 68, 0xa85c: 68, 0xa85d: 68, 0xa85e: 68, 0xa85f: 68, 0xa860: 68, 0xa861: 68, 0xa862: 68, 0xa863: 68, 0xa864: 68, 0xa865: 68, 0xa866: 68, 0xa867: 68, 0xa868: 68, 0xa869: 68, 0xa86a: 68, 0xa86b: 68, 0xa86c: 68, 0xa86d: 68, 0xa86e: 68, 0xa86f: 68, 0xa870: 68, 0xa871: 68, 0xa872: 76, 0xa873: 85, 0x10ac0: 68, 0x10ac1: 68, 0x10ac2: 68, 0x10ac3: 68, 0x10ac4: 68, 0x10ac5: 82, 0x10ac6: 85, 0x10ac7: 82, 0x10ac8: 85, 0x10ac9: 82, 0x10aca: 82, 0x10acb: 85, 0x10acc: 85, 0x10acd: 76, 0x10ace: 82, 0x10acf: 82, 0x10ad0: 82, 0x10ad1: 82, 0x10ad2: 82, 0x10ad3: 68, 0x10ad4: 68, 0x10ad5: 68, 0x10ad6: 68, 0x10ad7: 76, 0x10ad8: 68, 0x10ad9: 68, 0x10ada: 68, 0x10adb: 68, 0x10adc: 68, 0x10add: 82, 0x10ade: 68, 0x10adf: 68, 0x10ae0: 68, 0x10ae1: 82, 0x10ae2: 85, 0x10ae3: 85, 0x10ae4: 82, 0x10aeb: 68, 0x10aec: 68, 0x10aed: 68, 0x10aee: 68, 0x10aef: 82, 0x10b80: 68, 0x10b81: 82, 0x10b82: 68, 0x10b83: 82, 0x10b84: 82, 0x10b85: 82, 0x10b86: 68, 0x10b87: 68, 0x10b88: 68, 0x10b89: 82, 0x10b8a: 68, 0x10b8b: 68, 0x10b8c: 82, 0x10b8d: 68, 0x10b8e: 82, 0x10b8f: 82, 0x10b90: 68, 0x10b91: 82, 0x10ba9: 82, 0x10baa: 82, 0x10bab: 82, 0x10bac: 82, 0x10bad: 68, 0x10bae: 68, 0x10baf: 85, 0x10d00: 76, 0x10d01: 68, 0x10d02: 68, 0x10d03: 68, 0x10d04: 68, 0x10d05: 68, 0x10d06: 68, 0x10d07: 68, 0x10d08: 68, 0x10d09: 68, 0x10d0a: 68, 0x10d0b: 68, 0x10d0c: 68, 0x10d0d: 68, 0x10d0e: 68, 0x10d0f: 68, 0x10d10: 68, 0x10d11: 68, 0x10d12: 68, 0x10d13: 68, 0x10d14: 68, 0x10d15: 68, 0x10d16: 68, 0x10d17: 68, 0x10d18: 68, 0x10d19: 68, 0x10d1a: 68, 0x10d1b: 68, 0x10d1c: 68, 0x10d1d: 68, 0x10d1e: 68, 0x10d1f: 68, 0x10d20: 68, 0x10d21: 68, 0x10d22: 82, 0x10d23: 68, 0x10f30: 68, 0x10f31: 68, 0x10f32: 68, 0x10f33: 82, 0x10f34: 68, 0x10f35: 68, 0x10f36: 68, 0x10f37: 68, 0x10f38: 68, 0x10f39: 68, 0x10f3a: 68, 0x10f3b: 68, 0x10f3c: 68, 0x10f3d: 68, 0x10f3e: 68, 0x10f3f: 68, 0x10f40: 68, 0x10f41: 68, 0x10f42: 68, 0x10f43: 68, 0x10f44: 68, 0x10f45: 85, 0x10f51: 68, 0x10f52: 68, 0x10f53: 68, 0x10f54: 82, 0x10fb0: 68, 0x10fb1: 85, 0x10fb2: 68, 0x10fb3: 68, 0x10fb4: 82, 0x10fb5: 82, 0x10fb6: 82, 0x10fb7: 85, 0x10fb8: 68, 0x10fb9: 82, 0x10fba: 82, 0x10fbb: 68, 0x10fbc: 68, 0x10fbd: 82, 0x10fbe: 68, 0x10fbf: 68, 0x10fc0: 85, 0x10fc1: 68, 0x10fc2: 82, 0x10fc3: 82, 0x10fc4: 68, 0x10fc5: 85, 0x10fc6: 85, 0x10fc7: 85, 0x10fc8: 85, 0x10fc9: 82, 0x10fca: 68, 0x10fcb: 76, 0x110bd: 85, 0x110cd: 85, 0x1e900: 68, 0x1e901: 68, 0x1e902: 68, 0x1e903: 68, 0x1e904: 68, 0x1e905: 68, 0x1e906: 68, 0x1e907: 68, 0x1e908: 68, 0x1e909: 68, 0x1e90a: 68, 0x1e90b: 68, 0x1e90c: 68, 0x1e90d: 68, 0x1e90e: 68, 0x1e90f: 68, 0x1e910: 68, 0x1e911: 68, 0x1e912: 68, 0x1e913: 68, 0x1e914: 68, 0x1e915: 68, 0x1e916: 68, 0x1e917: 68, 0x1e918: 68, 0x1e919: 68, 0x1e91a: 68, 0x1e91b: 68, 0x1e91c: 68, 0x1e91d: 68, 0x1e91e: 68, 0x1e91f: 68, 0x1e920: 68, 0x1e921: 68, 0x1e922: 68, 0x1e923: 68, 0x1e924: 68, 0x1e925: 68, 0x1e926: 68, 0x1e927: 68, 0x1e928: 68, 0x1e929: 68, 0x1e92a: 68, 0x1e92b: 68, 0x1e92c: 68, 0x1e92d: 68, 0x1e92e: 68, 0x1e92f: 68, 0x1e930: 68, 0x1e931: 68, 0x1e932: 68, 0x1e933: 68, 0x1e934: 68, 0x1e935: 68, 0x1e936: 68, 0x1e937: 68, 0x1e938: 68, 0x1e939: 68, 0x1e93a: 68, 0x1e93b: 68, 0x1e93c: 68, 0x1e93d: 68, 0x1e93e: 68, 0x1e93f: 68, 0x1e940: 68, 0x1e941: 68, 0x1e942: 68, 0x1e943: 68, 0x1e94b: 84, } codepoint_classes = { 'PVALID': ( 0x2d0000002e, 0x300000003a, 0x610000007b, 0xdf000000f7, 0xf800000100, 0x10100000102, 0x10300000104, 0x10500000106, 0x10700000108, 0x1090000010a, 0x10b0000010c, 0x10d0000010e, 0x10f00000110, 0x11100000112, 0x11300000114, 0x11500000116, 0x11700000118, 0x1190000011a, 0x11b0000011c, 0x11d0000011e, 0x11f00000120, 0x12100000122, 0x12300000124, 0x12500000126, 0x12700000128, 0x1290000012a, 0x12b0000012c, 0x12d0000012e, 0x12f00000130, 0x13100000132, 0x13500000136, 0x13700000139, 0x13a0000013b, 0x13c0000013d, 0x13e0000013f, 0x14200000143, 0x14400000145, 0x14600000147, 0x14800000149, 0x14b0000014c, 0x14d0000014e, 0x14f00000150, 0x15100000152, 0x15300000154, 0x15500000156, 0x15700000158, 0x1590000015a, 0x15b0000015c, 0x15d0000015e, 0x15f00000160, 0x16100000162, 0x16300000164, 0x16500000166, 0x16700000168, 0x1690000016a, 0x16b0000016c, 0x16d0000016e, 0x16f00000170, 0x17100000172, 0x17300000174, 0x17500000176, 0x17700000178, 0x17a0000017b, 0x17c0000017d, 0x17e0000017f, 0x18000000181, 0x18300000184, 0x18500000186, 0x18800000189, 0x18c0000018e, 0x19200000193, 0x19500000196, 0x1990000019c, 0x19e0000019f, 0x1a1000001a2, 0x1a3000001a4, 0x1a5000001a6, 0x1a8000001a9, 0x1aa000001ac, 0x1ad000001ae, 0x1b0000001b1, 0x1b4000001b5, 0x1b6000001b7, 0x1b9000001bc, 0x1bd000001c4, 0x1ce000001cf, 0x1d0000001d1, 0x1d2000001d3, 0x1d4000001d5, 0x1d6000001d7, 0x1d8000001d9, 0x1da000001db, 0x1dc000001de, 0x1df000001e0, 0x1e1000001e2, 0x1e3000001e4, 0x1e5000001e6, 0x1e7000001e8, 0x1e9000001ea, 0x1eb000001ec, 0x1ed000001ee, 0x1ef000001f1, 0x1f5000001f6, 0x1f9000001fa, 0x1fb000001fc, 0x1fd000001fe, 0x1ff00000200, 0x20100000202, 0x20300000204, 0x20500000206, 0x20700000208, 0x2090000020a, 0x20b0000020c, 0x20d0000020e, 0x20f00000210, 0x21100000212, 0x21300000214, 0x21500000216, 0x21700000218, 0x2190000021a, 0x21b0000021c, 0x21d0000021e, 0x21f00000220, 0x22100000222, 0x22300000224, 0x22500000226, 0x22700000228, 0x2290000022a, 0x22b0000022c, 0x22d0000022e, 0x22f00000230, 0x23100000232, 0x2330000023a, 0x23c0000023d, 0x23f00000241, 0x24200000243, 0x24700000248, 0x2490000024a, 0x24b0000024c, 0x24d0000024e, 0x24f000002b0, 0x2b9000002c2, 0x2c6000002d2, 0x2ec000002ed, 0x2ee000002ef, 0x30000000340, 0x34200000343, 0x3460000034f, 0x35000000370, 0x37100000372, 0x37300000374, 0x37700000378, 0x37b0000037e, 0x39000000391, 0x3ac000003cf, 0x3d7000003d8, 0x3d9000003da, 0x3db000003dc, 0x3dd000003de, 0x3df000003e0, 0x3e1000003e2, 0x3e3000003e4, 0x3e5000003e6, 0x3e7000003e8, 0x3e9000003ea, 0x3eb000003ec, 0x3ed000003ee, 0x3ef000003f0, 0x3f3000003f4, 0x3f8000003f9, 0x3fb000003fd, 0x43000000460, 0x46100000462, 0x46300000464, 0x46500000466, 0x46700000468, 0x4690000046a, 0x46b0000046c, 0x46d0000046e, 0x46f00000470, 0x47100000472, 0x47300000474, 0x47500000476, 0x47700000478, 0x4790000047a, 0x47b0000047c, 0x47d0000047e, 0x47f00000480, 0x48100000482, 0x48300000488, 0x48b0000048c, 0x48d0000048e, 0x48f00000490, 0x49100000492, 0x49300000494, 0x49500000496, 0x49700000498, 0x4990000049a, 0x49b0000049c, 0x49d0000049e, 0x49f000004a0, 0x4a1000004a2, 0x4a3000004a4, 0x4a5000004a6, 0x4a7000004a8, 0x4a9000004aa, 0x4ab000004ac, 0x4ad000004ae, 0x4af000004b0, 0x4b1000004b2, 0x4b3000004b4, 0x4b5000004b6, 0x4b7000004b8, 0x4b9000004ba, 0x4bb000004bc, 0x4bd000004be, 0x4bf000004c0, 0x4c2000004c3, 0x4c4000004c5, 0x4c6000004c7, 0x4c8000004c9, 0x4ca000004cb, 0x4cc000004cd, 0x4ce000004d0, 0x4d1000004d2, 0x4d3000004d4, 0x4d5000004d6, 0x4d7000004d8, 0x4d9000004da, 0x4db000004dc, 0x4dd000004de, 0x4df000004e0, 0x4e1000004e2, 0x4e3000004e4, 0x4e5000004e6, 0x4e7000004e8, 0x4e9000004ea, 0x4eb000004ec, 0x4ed000004ee, 0x4ef000004f0, 0x4f1000004f2, 0x4f3000004f4, 0x4f5000004f6, 0x4f7000004f8, 0x4f9000004fa, 0x4fb000004fc, 0x4fd000004fe, 0x4ff00000500, 0x50100000502, 0x50300000504, 0x50500000506, 0x50700000508, 0x5090000050a, 0x50b0000050c, 0x50d0000050e, 0x50f00000510, 0x51100000512, 0x51300000514, 0x51500000516, 0x51700000518, 0x5190000051a, 0x51b0000051c, 0x51d0000051e, 0x51f00000520, 0x52100000522, 0x52300000524, 0x52500000526, 0x52700000528, 0x5290000052a, 0x52b0000052c, 0x52d0000052e, 0x52f00000530, 0x5590000055a, 0x56000000587, 0x58800000589, 0x591000005be, 0x5bf000005c0, 0x5c1000005c3, 0x5c4000005c6, 0x5c7000005c8, 0x5d0000005eb, 0x5ef000005f3, 0x6100000061b, 0x62000000640, 0x64100000660, 0x66e00000675, 0x679000006d4, 0x6d5000006dd, 0x6df000006e9, 0x6ea000006f0, 0x6fa00000700, 0x7100000074b, 0x74d000007b2, 0x7c0000007f6, 0x7fd000007fe, 0x8000000082e, 0x8400000085c, 0x8600000086b, 0x8a0000008b5, 0x8b6000008c8, 0x8d3000008e2, 0x8e300000958, 0x96000000964, 0x96600000970, 0x97100000984, 0x9850000098d, 0x98f00000991, 0x993000009a9, 0x9aa000009b1, 0x9b2000009b3, 0x9b6000009ba, 0x9bc000009c5, 0x9c7000009c9, 0x9cb000009cf, 0x9d7000009d8, 0x9e0000009e4, 0x9e6000009f2, 0x9fc000009fd, 0x9fe000009ff, 0xa0100000a04, 0xa0500000a0b, 0xa0f00000a11, 0xa1300000a29, 0xa2a00000a31, 0xa3200000a33, 0xa3500000a36, 0xa3800000a3a, 0xa3c00000a3d, 0xa3e00000a43, 0xa4700000a49, 0xa4b00000a4e, 0xa5100000a52, 0xa5c00000a5d, 0xa6600000a76, 0xa8100000a84, 0xa8500000a8e, 0xa8f00000a92, 0xa9300000aa9, 0xaaa00000ab1, 0xab200000ab4, 0xab500000aba, 0xabc00000ac6, 0xac700000aca, 0xacb00000ace, 0xad000000ad1, 0xae000000ae4, 0xae600000af0, 0xaf900000b00, 0xb0100000b04, 0xb0500000b0d, 0xb0f00000b11, 0xb1300000b29, 0xb2a00000b31, 0xb3200000b34, 0xb3500000b3a, 0xb3c00000b45, 0xb4700000b49, 0xb4b00000b4e, 0xb5500000b58, 0xb5f00000b64, 0xb6600000b70, 0xb7100000b72, 0xb8200000b84, 0xb8500000b8b, 0xb8e00000b91, 0xb9200000b96, 0xb9900000b9b, 0xb9c00000b9d, 0xb9e00000ba0, 0xba300000ba5, 0xba800000bab, 0xbae00000bba, 0xbbe00000bc3, 0xbc600000bc9, 0xbca00000bce, 0xbd000000bd1, 0xbd700000bd8, 0xbe600000bf0, 0xc0000000c0d, 0xc0e00000c11, 0xc1200000c29, 0xc2a00000c3a, 0xc3d00000c45, 0xc4600000c49, 0xc4a00000c4e, 0xc5500000c57, 0xc5800000c5b, 0xc6000000c64, 0xc6600000c70, 0xc8000000c84, 0xc8500000c8d, 0xc8e00000c91, 0xc9200000ca9, 0xcaa00000cb4, 0xcb500000cba, 0xcbc00000cc5, 0xcc600000cc9, 0xcca00000cce, 0xcd500000cd7, 0xcde00000cdf, 0xce000000ce4, 0xce600000cf0, 0xcf100000cf3, 0xd0000000d0d, 0xd0e00000d11, 0xd1200000d45, 0xd4600000d49, 0xd4a00000d4f, 0xd5400000d58, 0xd5f00000d64, 0xd6600000d70, 0xd7a00000d80, 0xd8100000d84, 0xd8500000d97, 0xd9a00000db2, 0xdb300000dbc, 0xdbd00000dbe, 0xdc000000dc7, 0xdca00000dcb, 0xdcf00000dd5, 0xdd600000dd7, 0xdd800000de0, 0xde600000df0, 0xdf200000df4, 0xe0100000e33, 0xe3400000e3b, 0xe4000000e4f, 0xe5000000e5a, 0xe8100000e83, 0xe8400000e85, 0xe8600000e8b, 0xe8c00000ea4, 0xea500000ea6, 0xea700000eb3, 0xeb400000ebe, 0xec000000ec5, 0xec600000ec7, 0xec800000ece, 0xed000000eda, 0xede00000ee0, 0xf0000000f01, 0xf0b00000f0c, 0xf1800000f1a, 0xf2000000f2a, 0xf3500000f36, 0xf3700000f38, 0xf3900000f3a, 0xf3e00000f43, 0xf4400000f48, 0xf4900000f4d, 0xf4e00000f52, 0xf5300000f57, 0xf5800000f5c, 0xf5d00000f69, 0xf6a00000f6d, 0xf7100000f73, 0xf7400000f75, 0xf7a00000f81, 0xf8200000f85, 0xf8600000f93, 0xf9400000f98, 0xf9900000f9d, 0xf9e00000fa2, 0xfa300000fa7, 0xfa800000fac, 0xfad00000fb9, 0xfba00000fbd, 0xfc600000fc7, 0x10000000104a, 0x10500000109e, 0x10d0000010fb, 0x10fd00001100, 0x120000001249, 0x124a0000124e, 0x125000001257, 0x125800001259, 0x125a0000125e, 0x126000001289, 0x128a0000128e, 0x1290000012b1, 0x12b2000012b6, 0x12b8000012bf, 0x12c0000012c1, 0x12c2000012c6, 0x12c8000012d7, 0x12d800001311, 0x131200001316, 0x13180000135b, 0x135d00001360, 0x138000001390, 0x13a0000013f6, 0x14010000166d, 0x166f00001680, 0x16810000169b, 0x16a0000016eb, 0x16f1000016f9, 0x17000000170d, 0x170e00001715, 0x172000001735, 0x174000001754, 0x17600000176d, 0x176e00001771, 0x177200001774, 0x1780000017b4, 0x17b6000017d4, 0x17d7000017d8, 0x17dc000017de, 0x17e0000017ea, 0x18100000181a, 0x182000001879, 0x1880000018ab, 0x18b0000018f6, 0x19000000191f, 0x19200000192c, 0x19300000193c, 0x19460000196e, 0x197000001975, 0x1980000019ac, 0x19b0000019ca, 0x19d0000019da, 0x1a0000001a1c, 0x1a2000001a5f, 0x1a6000001a7d, 0x1a7f00001a8a, 0x1a9000001a9a, 0x1aa700001aa8, 0x1ab000001abe, 0x1abf00001ac1, 0x1b0000001b4c, 0x1b5000001b5a, 0x1b6b00001b74, 0x1b8000001bf4, 0x1c0000001c38, 0x1c4000001c4a, 0x1c4d00001c7e, 0x1cd000001cd3, 0x1cd400001cfb, 0x1d0000001d2c, 0x1d2f00001d30, 0x1d3b00001d3c, 0x1d4e00001d4f, 0x1d6b00001d78, 0x1d7900001d9b, 0x1dc000001dfa, 0x1dfb00001e00, 0x1e0100001e02, 0x1e0300001e04, 0x1e0500001e06, 0x1e0700001e08, 0x1e0900001e0a, 0x1e0b00001e0c, 0x1e0d00001e0e, 0x1e0f00001e10, 0x1e1100001e12, 0x1e1300001e14, 0x1e1500001e16, 0x1e1700001e18, 0x1e1900001e1a, 0x1e1b00001e1c, 0x1e1d00001e1e, 0x1e1f00001e20, 0x1e2100001e22, 0x1e2300001e24, 0x1e2500001e26, 0x1e2700001e28, 0x1e2900001e2a, 0x1e2b00001e2c, 0x1e2d00001e2e, 0x1e2f00001e30, 0x1e3100001e32, 0x1e3300001e34, 0x1e3500001e36, 0x1e3700001e38, 0x1e3900001e3a, 0x1e3b00001e3c, 0x1e3d00001e3e, 0x1e3f00001e40, 0x1e4100001e42, 0x1e4300001e44, 0x1e4500001e46, 0x1e4700001e48, 0x1e4900001e4a, 0x1e4b00001e4c, 0x1e4d00001e4e, 0x1e4f00001e50, 0x1e5100001e52, 0x1e5300001e54, 0x1e5500001e56, 0x1e5700001e58, 0x1e5900001e5a, 0x1e5b00001e5c, 0x1e5d00001e5e, 0x1e5f00001e60, 0x1e6100001e62, 0x1e6300001e64, 0x1e6500001e66, 0x1e6700001e68, 0x1e6900001e6a, 0x1e6b00001e6c, 0x1e6d00001e6e, 0x1e6f00001e70, 0x1e7100001e72, 0x1e7300001e74, 0x1e7500001e76, 0x1e7700001e78, 0x1e7900001e7a, 0x1e7b00001e7c, 0x1e7d00001e7e, 0x1e7f00001e80, 0x1e8100001e82, 0x1e8300001e84, 0x1e8500001e86, 0x1e8700001e88, 0x1e8900001e8a, 0x1e8b00001e8c, 0x1e8d00001e8e, 0x1e8f00001e90, 0x1e9100001e92, 0x1e9300001e94, 0x1e9500001e9a, 0x1e9c00001e9e, 0x1e9f00001ea0, 0x1ea100001ea2, 0x1ea300001ea4, 0x1ea500001ea6, 0x1ea700001ea8, 0x1ea900001eaa, 0x1eab00001eac, 0x1ead00001eae, 0x1eaf00001eb0, 0x1eb100001eb2, 0x1eb300001eb4, 0x1eb500001eb6, 0x1eb700001eb8, 0x1eb900001eba, 0x1ebb00001ebc, 0x1ebd00001ebe, 0x1ebf00001ec0, 0x1ec100001ec2, 0x1ec300001ec4, 0x1ec500001ec6, 0x1ec700001ec8, 0x1ec900001eca, 0x1ecb00001ecc, 0x1ecd00001ece, 0x1ecf00001ed0, 0x1ed100001ed2, 0x1ed300001ed4, 0x1ed500001ed6, 0x1ed700001ed8, 0x1ed900001eda, 0x1edb00001edc, 0x1edd00001ede, 0x1edf00001ee0, 0x1ee100001ee2, 0x1ee300001ee4, 0x1ee500001ee6, 0x1ee700001ee8, 0x1ee900001eea, 0x1eeb00001eec, 0x1eed00001eee, 0x1eef00001ef0, 0x1ef100001ef2, 0x1ef300001ef4, 0x1ef500001ef6, 0x1ef700001ef8, 0x1ef900001efa, 0x1efb00001efc, 0x1efd00001efe, 0x1eff00001f08, 0x1f1000001f16, 0x1f2000001f28, 0x1f3000001f38, 0x1f4000001f46, 0x1f5000001f58, 0x1f6000001f68, 0x1f7000001f71, 0x1f7200001f73, 0x1f7400001f75, 0x1f7600001f77, 0x1f7800001f79, 0x1f7a00001f7b, 0x1f7c00001f7d, 0x1fb000001fb2, 0x1fb600001fb7, 0x1fc600001fc7, 0x1fd000001fd3, 0x1fd600001fd8, 0x1fe000001fe3, 0x1fe400001fe8, 0x1ff600001ff7, 0x214e0000214f, 0x218400002185, 0x2c3000002c5f, 0x2c6100002c62, 0x2c6500002c67, 0x2c6800002c69, 0x2c6a00002c6b, 0x2c6c00002c6d, 0x2c7100002c72, 0x2c7300002c75, 0x2c7600002c7c, 0x2c8100002c82, 0x2c8300002c84, 0x2c8500002c86, 0x2c8700002c88, 0x2c8900002c8a, 0x2c8b00002c8c, 0x2c8d00002c8e, 0x2c8f00002c90, 0x2c9100002c92, 0x2c9300002c94, 0x2c9500002c96, 0x2c9700002c98, 0x2c9900002c9a, 0x2c9b00002c9c, 0x2c9d00002c9e, 0x2c9f00002ca0, 0x2ca100002ca2, 0x2ca300002ca4, 0x2ca500002ca6, 0x2ca700002ca8, 0x2ca900002caa, 0x2cab00002cac, 0x2cad00002cae, 0x2caf00002cb0, 0x2cb100002cb2, 0x2cb300002cb4, 0x2cb500002cb6, 0x2cb700002cb8, 0x2cb900002cba, 0x2cbb00002cbc, 0x2cbd00002cbe, 0x2cbf00002cc0, 0x2cc100002cc2, 0x2cc300002cc4, 0x2cc500002cc6, 0x2cc700002cc8, 0x2cc900002cca, 0x2ccb00002ccc, 0x2ccd00002cce, 0x2ccf00002cd0, 0x2cd100002cd2, 0x2cd300002cd4, 0x2cd500002cd6, 0x2cd700002cd8, 0x2cd900002cda, 0x2cdb00002cdc, 0x2cdd00002cde, 0x2cdf00002ce0, 0x2ce100002ce2, 0x2ce300002ce5, 0x2cec00002ced, 0x2cee00002cf2, 0x2cf300002cf4, 0x2d0000002d26, 0x2d2700002d28, 0x2d2d00002d2e, 0x2d3000002d68, 0x2d7f00002d97, 0x2da000002da7, 0x2da800002daf, 0x2db000002db7, 0x2db800002dbf, 0x2dc000002dc7, 0x2dc800002dcf, 0x2dd000002dd7, 0x2dd800002ddf, 0x2de000002e00, 0x2e2f00002e30, 0x300500003008, 0x302a0000302e, 0x303c0000303d, 0x304100003097, 0x30990000309b, 0x309d0000309f, 0x30a1000030fb, 0x30fc000030ff, 0x310500003130, 0x31a0000031c0, 0x31f000003200, 0x340000004dc0, 0x4e0000009ffd, 0xa0000000a48d, 0xa4d00000a4fe, 0xa5000000a60d, 0xa6100000a62c, 0xa6410000a642, 0xa6430000a644, 0xa6450000a646, 0xa6470000a648, 0xa6490000a64a, 0xa64b0000a64c, 0xa64d0000a64e, 0xa64f0000a650, 0xa6510000a652, 0xa6530000a654, 0xa6550000a656, 0xa6570000a658, 0xa6590000a65a, 0xa65b0000a65c, 0xa65d0000a65e, 0xa65f0000a660, 0xa6610000a662, 0xa6630000a664, 0xa6650000a666, 0xa6670000a668, 0xa6690000a66a, 0xa66b0000a66c, 0xa66d0000a670, 0xa6740000a67e, 0xa67f0000a680, 0xa6810000a682, 0xa6830000a684, 0xa6850000a686, 0xa6870000a688, 0xa6890000a68a, 0xa68b0000a68c, 0xa68d0000a68e, 0xa68f0000a690, 0xa6910000a692, 0xa6930000a694, 0xa6950000a696, 0xa6970000a698, 0xa6990000a69a, 0xa69b0000a69c, 0xa69e0000a6e6, 0xa6f00000a6f2, 0xa7170000a720, 0xa7230000a724, 0xa7250000a726, 0xa7270000a728, 0xa7290000a72a, 0xa72b0000a72c, 0xa72d0000a72e, 0xa72f0000a732, 0xa7330000a734, 0xa7350000a736, 0xa7370000a738, 0xa7390000a73a, 0xa73b0000a73c, 0xa73d0000a73e, 0xa73f0000a740, 0xa7410000a742, 0xa7430000a744, 0xa7450000a746, 0xa7470000a748, 0xa7490000a74a, 0xa74b0000a74c, 0xa74d0000a74e, 0xa74f0000a750, 0xa7510000a752, 0xa7530000a754, 0xa7550000a756, 0xa7570000a758, 0xa7590000a75a, 0xa75b0000a75c, 0xa75d0000a75e, 0xa75f0000a760, 0xa7610000a762, 0xa7630000a764, 0xa7650000a766, 0xa7670000a768, 0xa7690000a76a, 0xa76b0000a76c, 0xa76d0000a76e, 0xa76f0000a770, 0xa7710000a779, 0xa77a0000a77b, 0xa77c0000a77d, 0xa77f0000a780, 0xa7810000a782, 0xa7830000a784, 0xa7850000a786, 0xa7870000a789, 0xa78c0000a78d, 0xa78e0000a790, 0xa7910000a792, 0xa7930000a796, 0xa7970000a798, 0xa7990000a79a, 0xa79b0000a79c, 0xa79d0000a79e, 0xa79f0000a7a0, 0xa7a10000a7a2, 0xa7a30000a7a4, 0xa7a50000a7a6, 0xa7a70000a7a8, 0xa7a90000a7aa, 0xa7af0000a7b0, 0xa7b50000a7b6, 0xa7b70000a7b8, 0xa7b90000a7ba, 0xa7bb0000a7bc, 0xa7bd0000a7be, 0xa7bf0000a7c0, 0xa7c30000a7c4, 0xa7c80000a7c9, 0xa7ca0000a7cb, 0xa7f60000a7f8, 0xa7fa0000a828, 0xa82c0000a82d, 0xa8400000a874, 0xa8800000a8c6, 0xa8d00000a8da, 0xa8e00000a8f8, 0xa8fb0000a8fc, 0xa8fd0000a92e, 0xa9300000a954, 0xa9800000a9c1, 0xa9cf0000a9da, 0xa9e00000a9ff, 0xaa000000aa37, 0xaa400000aa4e, 0xaa500000aa5a, 0xaa600000aa77, 0xaa7a0000aac3, 0xaadb0000aade, 0xaae00000aaf0, 0xaaf20000aaf7, 0xab010000ab07, 0xab090000ab0f, 0xab110000ab17, 0xab200000ab27, 0xab280000ab2f, 0xab300000ab5b, 0xab600000ab6a, 0xabc00000abeb, 0xabec0000abee, 0xabf00000abfa, 0xac000000d7a4, 0xfa0e0000fa10, 0xfa110000fa12, 0xfa130000fa15, 0xfa1f0000fa20, 0xfa210000fa22, 0xfa230000fa25, 0xfa270000fa2a, 0xfb1e0000fb1f, 0xfe200000fe30, 0xfe730000fe74, 0x100000001000c, 0x1000d00010027, 0x100280001003b, 0x1003c0001003e, 0x1003f0001004e, 0x100500001005e, 0x10080000100fb, 0x101fd000101fe, 0x102800001029d, 0x102a0000102d1, 0x102e0000102e1, 0x1030000010320, 0x1032d00010341, 0x103420001034a, 0x103500001037b, 0x103800001039e, 0x103a0000103c4, 0x103c8000103d0, 0x104280001049e, 0x104a0000104aa, 0x104d8000104fc, 0x1050000010528, 0x1053000010564, 0x1060000010737, 0x1074000010756, 0x1076000010768, 0x1080000010806, 0x1080800010809, 0x1080a00010836, 0x1083700010839, 0x1083c0001083d, 0x1083f00010856, 0x1086000010877, 0x108800001089f, 0x108e0000108f3, 0x108f4000108f6, 0x1090000010916, 0x109200001093a, 0x10980000109b8, 0x109be000109c0, 0x10a0000010a04, 0x10a0500010a07, 0x10a0c00010a14, 0x10a1500010a18, 0x10a1900010a36, 0x10a3800010a3b, 0x10a3f00010a40, 0x10a6000010a7d, 0x10a8000010a9d, 0x10ac000010ac8, 0x10ac900010ae7, 0x10b0000010b36, 0x10b4000010b56, 0x10b6000010b73, 0x10b8000010b92, 0x10c0000010c49, 0x10cc000010cf3, 0x10d0000010d28, 0x10d3000010d3a, 0x10e8000010eaa, 0x10eab00010ead, 0x10eb000010eb2, 0x10f0000010f1d, 0x10f2700010f28, 0x10f3000010f51, 0x10fb000010fc5, 0x10fe000010ff7, 0x1100000011047, 0x1106600011070, 0x1107f000110bb, 0x110d0000110e9, 0x110f0000110fa, 0x1110000011135, 0x1113600011140, 0x1114400011148, 0x1115000011174, 0x1117600011177, 0x11180000111c5, 0x111c9000111cd, 0x111ce000111db, 0x111dc000111dd, 0x1120000011212, 0x1121300011238, 0x1123e0001123f, 0x1128000011287, 0x1128800011289, 0x1128a0001128e, 0x1128f0001129e, 0x1129f000112a9, 0x112b0000112eb, 0x112f0000112fa, 0x1130000011304, 0x113050001130d, 0x1130f00011311, 0x1131300011329, 0x1132a00011331, 0x1133200011334, 0x113350001133a, 0x1133b00011345, 0x1134700011349, 0x1134b0001134e, 0x1135000011351, 0x1135700011358, 0x1135d00011364, 0x113660001136d, 0x1137000011375, 0x114000001144b, 0x114500001145a, 0x1145e00011462, 0x11480000114c6, 0x114c7000114c8, 0x114d0000114da, 0x11580000115b6, 0x115b8000115c1, 0x115d8000115de, 0x1160000011641, 0x1164400011645, 0x116500001165a, 0x11680000116b9, 0x116c0000116ca, 0x117000001171b, 0x1171d0001172c, 0x117300001173a, 0x118000001183b, 0x118c0000118ea, 0x118ff00011907, 0x119090001190a, 0x1190c00011914, 0x1191500011917, 0x1191800011936, 0x1193700011939, 0x1193b00011944, 0x119500001195a, 0x119a0000119a8, 0x119aa000119d8, 0x119da000119e2, 0x119e3000119e5, 0x11a0000011a3f, 0x11a4700011a48, 0x11a5000011a9a, 0x11a9d00011a9e, 0x11ac000011af9, 0x11c0000011c09, 0x11c0a00011c37, 0x11c3800011c41, 0x11c5000011c5a, 0x11c7200011c90, 0x11c9200011ca8, 0x11ca900011cb7, 0x11d0000011d07, 0x11d0800011d0a, 0x11d0b00011d37, 0x11d3a00011d3b, 0x11d3c00011d3e, 0x11d3f00011d48, 0x11d5000011d5a, 0x11d6000011d66, 0x11d6700011d69, 0x11d6a00011d8f, 0x11d9000011d92, 0x11d9300011d99, 0x11da000011daa, 0x11ee000011ef7, 0x11fb000011fb1, 0x120000001239a, 0x1248000012544, 0x130000001342f, 0x1440000014647, 0x1680000016a39, 0x16a4000016a5f, 0x16a6000016a6a, 0x16ad000016aee, 0x16af000016af5, 0x16b0000016b37, 0x16b4000016b44, 0x16b5000016b5a, 0x16b6300016b78, 0x16b7d00016b90, 0x16e6000016e80, 0x16f0000016f4b, 0x16f4f00016f88, 0x16f8f00016fa0, 0x16fe000016fe2, 0x16fe300016fe5, 0x16ff000016ff2, 0x17000000187f8, 0x1880000018cd6, 0x18d0000018d09, 0x1b0000001b11f, 0x1b1500001b153, 0x1b1640001b168, 0x1b1700001b2fc, 0x1bc000001bc6b, 0x1bc700001bc7d, 0x1bc800001bc89, 0x1bc900001bc9a, 0x1bc9d0001bc9f, 0x1da000001da37, 0x1da3b0001da6d, 0x1da750001da76, 0x1da840001da85, 0x1da9b0001daa0, 0x1daa10001dab0, 0x1e0000001e007, 0x1e0080001e019, 0x1e01b0001e022, 0x1e0230001e025, 0x1e0260001e02b, 0x1e1000001e12d, 0x1e1300001e13e, 0x1e1400001e14a, 0x1e14e0001e14f, 0x1e2c00001e2fa, 0x1e8000001e8c5, 0x1e8d00001e8d7, 0x1e9220001e94c, 0x1e9500001e95a, 0x1fbf00001fbfa, 0x200000002a6de, 0x2a7000002b735, 0x2b7400002b81e, 0x2b8200002cea2, 0x2ceb00002ebe1, 0x300000003134b, ), 'CONTEXTJ': ( 0x200c0000200e, ), 'CONTEXTO': ( 0xb7000000b8, 0x37500000376, 0x5f3000005f5, 0x6600000066a, 0x6f0000006fa, 0x30fb000030fc, ), } PKd]|pidna/compat.pynu[from .core import * from .codec import * def ToASCII(label): return encode(label) def ToUnicode(label): return decode(label) def nameprep(s): raise NotImplementedError("IDNA 2008 does not utilise nameprep protocol") PKd]4,.. idna/core.pynu[from . import idnadata import bisect import unicodedata import re import sys from .intranges import intranges_contain _virama_combining_class = 9 _alabel_prefix = b'xn--' _unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]') if sys.version_info[0] >= 3: unicode = str unichr = chr class IDNAError(UnicodeError): """ Base exception for all IDNA-encoding related problems """ pass class IDNABidiError(IDNAError): """ Exception when bidirectional requirements are not satisfied """ pass class InvalidCodepoint(IDNAError): """ Exception when a disallowed or unallocated codepoint is used """ pass class InvalidCodepointContext(IDNAError): """ Exception when the codepoint is not valid in the context it is used """ pass def _combining_class(cp): v = unicodedata.combining(unichr(cp)) if v == 0: if not unicodedata.name(unichr(cp)): raise ValueError("Unknown character in unicodedata") return v def _is_script(cp, script): return intranges_contain(ord(cp), idnadata.scripts[script]) def _punycode(s): return s.encode('punycode') def _unot(s): return 'U+{0:04X}'.format(s) def valid_label_length(label): if len(label) > 63: return False return True def valid_string_length(label, trailing_dot): if len(label) > (254 if trailing_dot else 253): return False return True def check_bidi(label, check_ltr=False): # Bidi rules should only be applied if string contains RTL characters bidi_label = False for (idx, cp) in enumerate(label, 1): direction = unicodedata.bidirectional(cp) if direction == '': # String likely comes from a newer version of Unicode raise IDNABidiError('Unknown directionality in label {0} at position {1}'.format(repr(label), idx)) if direction in ['R', 'AL', 'AN']: bidi_label = True if not bidi_label and not check_ltr: return True # Bidi rule 1 direction = unicodedata.bidirectional(label[0]) if direction in ['R', 'AL']: rtl = True elif direction == 'L': rtl = False else: raise IDNABidiError('First codepoint in label {0} must be directionality L, R or AL'.format(repr(label))) valid_ending = False number_type = False for (idx, cp) in enumerate(label, 1): direction = unicodedata.bidirectional(cp) if rtl: # Bidi rule 2 if not direction in ['R', 'AL', 'AN', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM']: raise IDNABidiError('Invalid direction for codepoint at position {0} in a right-to-left label'.format(idx)) # Bidi rule 3 if direction in ['R', 'AL', 'EN', 'AN']: valid_ending = True elif direction != 'NSM': valid_ending = False # Bidi rule 4 if direction in ['AN', 'EN']: if not number_type: number_type = direction else: if number_type != direction: raise IDNABidiError('Can not mix numeral types in a right-to-left label') else: # Bidi rule 5 if not direction in ['L', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM']: raise IDNABidiError('Invalid direction for codepoint at position {0} in a left-to-right label'.format(idx)) # Bidi rule 6 if direction in ['L', 'EN']: valid_ending = True elif direction != 'NSM': valid_ending = False if not valid_ending: raise IDNABidiError('Label ends with illegal codepoint directionality') return True def check_initial_combiner(label): if unicodedata.category(label[0])[0] == 'M': raise IDNAError('Label begins with an illegal combining character') return True def check_hyphen_ok(label): if label[2:4] == '--': raise IDNAError('Label has disallowed hyphens in 3rd and 4th position') if label[0] == '-' or label[-1] == '-': raise IDNAError('Label must not start or end with a hyphen') return True def check_nfc(label): if unicodedata.normalize('NFC', label) != label: raise IDNAError('Label must be in Normalization Form C') def valid_contextj(label, pos): cp_value = ord(label[pos]) if cp_value == 0x200c: if pos > 0: if _combining_class(ord(label[pos - 1])) == _virama_combining_class: return True ok = False for i in range(pos-1, -1, -1): joining_type = idnadata.joining_types.get(ord(label[i])) if joining_type == ord('T'): continue if joining_type in [ord('L'), ord('D')]: ok = True break if not ok: return False ok = False for i in range(pos+1, len(label)): joining_type = idnadata.joining_types.get(ord(label[i])) if joining_type == ord('T'): continue if joining_type in [ord('R'), ord('D')]: ok = True break return ok if cp_value == 0x200d: if pos > 0: if _combining_class(ord(label[pos - 1])) == _virama_combining_class: return True return False else: return False def valid_contexto(label, pos, exception=False): cp_value = ord(label[pos]) if cp_value == 0x00b7: if 0 < pos < len(label)-1: if ord(label[pos - 1]) == 0x006c and ord(label[pos + 1]) == 0x006c: return True return False elif cp_value == 0x0375: if pos < len(label)-1 and len(label) > 1: return _is_script(label[pos + 1], 'Greek') return False elif cp_value == 0x05f3 or cp_value == 0x05f4: if pos > 0: return _is_script(label[pos - 1], 'Hebrew') return False elif cp_value == 0x30fb: for cp in label: if cp == u'\u30fb': continue if _is_script(cp, 'Hiragana') or _is_script(cp, 'Katakana') or _is_script(cp, 'Han'): return True return False elif 0x660 <= cp_value <= 0x669: for cp in label: if 0x6f0 <= ord(cp) <= 0x06f9: return False return True elif 0x6f0 <= cp_value <= 0x6f9: for cp in label: if 0x660 <= ord(cp) <= 0x0669: return False return True def check_label(label): if isinstance(label, (bytes, bytearray)): label = label.decode('utf-8') if len(label) == 0: raise IDNAError('Empty Label') check_nfc(label) check_hyphen_ok(label) check_initial_combiner(label) for (pos, cp) in enumerate(label): cp_value = ord(cp) if intranges_contain(cp_value, idnadata.codepoint_classes['PVALID']): continue elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTJ']): try: if not valid_contextj(label, pos): raise InvalidCodepointContext('Joiner {0} not allowed at position {1} in {2}'.format( _unot(cp_value), pos+1, repr(label))) except ValueError: raise IDNAError('Unknown codepoint adjacent to joiner {0} at position {1} in {2}'.format( _unot(cp_value), pos+1, repr(label))) elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTO']): if not valid_contexto(label, pos): raise InvalidCodepointContext('Codepoint {0} not allowed at position {1} in {2}'.format(_unot(cp_value), pos+1, repr(label))) else: raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label))) check_bidi(label) def alabel(label): try: label = label.encode('ascii') ulabel(label) if not valid_label_length(label): raise IDNAError('Label too long') return label except UnicodeEncodeError: pass if not label: raise IDNAError('No Input') label = unicode(label) check_label(label) label = _punycode(label) label = _alabel_prefix + label if not valid_label_length(label): raise IDNAError('Label too long') return label def ulabel(label): if not isinstance(label, (bytes, bytearray)): try: label = label.encode('ascii') except UnicodeEncodeError: check_label(label) return label label = label.lower() if label.startswith(_alabel_prefix): label = label[len(_alabel_prefix):] if not label: raise IDNAError('Malformed A-label, no Punycode eligible content found') if label.decode('ascii')[-1] == '-': raise IDNAError('A-label must not end with a hyphen') else: check_label(label) return label.decode('ascii') label = label.decode('punycode') check_label(label) return label def uts46_remap(domain, std3_rules=True, transitional=False): """Re-map the characters in the string according to UTS46 processing.""" from .uts46data import uts46data output = u"" try: for pos, char in enumerate(domain): code_point = ord(char) uts46row = uts46data[code_point if code_point < 256 else bisect.bisect_left(uts46data, (code_point, "Z")) - 1] status = uts46row[1] replacement = uts46row[2] if len(uts46row) == 3 else None if (status == "V" or (status == "D" and not transitional) or (status == "3" and not std3_rules and replacement is None)): output += char elif replacement is not None and (status == "M" or (status == "3" and not std3_rules) or (status == "D" and transitional)): output += replacement elif status != "I": raise IndexError() return unicodedata.normalize("NFC", output) except IndexError: raise InvalidCodepoint( "Codepoint {0} not allowed at position {1} in {2}".format( _unot(code_point), pos + 1, repr(domain))) def encode(s, strict=False, uts46=False, std3_rules=False, transitional=False): if isinstance(s, (bytes, bytearray)): s = s.decode("ascii") if uts46: s = uts46_remap(s, std3_rules, transitional) trailing_dot = False result = [] if strict: labels = s.split('.') else: labels = _unicode_dots_re.split(s) if not labels or labels == ['']: raise IDNAError('Empty domain') if labels[-1] == '': del labels[-1] trailing_dot = True for label in labels: s = alabel(label) if s: result.append(s) else: raise IDNAError('Empty label') if trailing_dot: result.append(b'') s = b'.'.join(result) if not valid_string_length(s, trailing_dot): raise IDNAError('Domain too long') return s def decode(s, strict=False, uts46=False, std3_rules=False): if isinstance(s, (bytes, bytearray)): s = s.decode("ascii") if uts46: s = uts46_remap(s, std3_rules, False) trailing_dot = False result = [] if not strict: labels = _unicode_dots_re.split(s) else: labels = s.split(u'.') if not labels or labels == ['']: raise IDNAError('Empty domain') if not labels[-1]: del labels[-1] trailing_dot = True for label in labels: s = ulabel(label) if s: result.append(s) else: raise IDNAError('Empty label') if trailing_dot: result.append(u'') return u'.'.join(result) PKd]G\::idna/__init__.pynu[from .package_data import __version__ from .core import * PKd]kidna/package_data.pynu[__version__ = '2.10' PKd]H idna/codec.pynu[from .core import encode, decode, alabel, ulabel, IDNAError import codecs import re _unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]') class Codec(codecs.Codec): def encode(self, data, errors='strict'): if errors != 'strict': raise IDNAError("Unsupported error handling \"{0}\"".format(errors)) if not data: return "", 0 return encode(data), len(data) def decode(self, data, errors='strict'): if errors != 'strict': raise IDNAError("Unsupported error handling \"{0}\"".format(errors)) if not data: return u"", 0 return decode(data), len(data) class IncrementalEncoder(codecs.BufferedIncrementalEncoder): def _buffer_encode(self, data, errors, final): if errors != 'strict': raise IDNAError("Unsupported error handling \"{0}\"".format(errors)) if not data: return ("", 0) labels = _unicode_dots_re.split(data) trailing_dot = u'' if labels: if not labels[-1]: trailing_dot = '.' del labels[-1] elif not final: # Keep potentially unfinished label until the next call del labels[-1] if labels: trailing_dot = '.' result = [] size = 0 for label in labels: result.append(alabel(label)) if size: size += 1 size += len(label) # Join with U+002E result = ".".join(result) + trailing_dot size += len(trailing_dot) return (result, size) class IncrementalDecoder(codecs.BufferedIncrementalDecoder): def _buffer_decode(self, data, errors, final): if errors != 'strict': raise IDNAError("Unsupported error handling \"{0}\"".format(errors)) if not data: return (u"", 0) # IDNA allows decoding to operate on Unicode strings, too. if isinstance(data, unicode): labels = _unicode_dots_re.split(data) else: # Must be ASCII string data = str(data) unicode(data, "ascii") labels = data.split(".") trailing_dot = u'' if labels: if not labels[-1]: trailing_dot = u'.' del labels[-1] elif not final: # Keep potentially unfinished label until the next call del labels[-1] if labels: trailing_dot = u'.' result = [] size = 0 for label in labels: result.append(ulabel(label)) if size: size += 1 size += len(label) result = u".".join(result) + trailing_dot size += len(trailing_dot) return (result, size) class StreamWriter(Codec, codecs.StreamWriter): pass class StreamReader(Codec, codecs.StreamReader): pass def getregentry(): return codecs.CodecInfo( name='idna', encode=Codec().encode, decode=Codec().decode, incrementalencoder=IncrementalEncoder, incrementaldecoder=IncrementalDecoder, streamwriter=StreamWriter, streamreader=StreamReader, ) PKd]ڜ>*OO(__pycache__/appdirs.cpython-38.opt-1.pycnu[U .e_ @s`dZdZdeeeZddlZddlZejddkZ e r>eZ ej drddl Z e ddZe drrdZqe d rd Zqd Znej Zd4d dZd5ddZd6ddZd7ddZd8ddZd9ddZd:ddZGdddeZddZd d!Zd"d#Zd$d%Zedkrfzdd&lmZeZWnBe k rdzddl!Z"eZWne k r^eZYnXYnXe#d'kr\d(Z$d)Z%d*Z&e'd+ee'd,ee$e%d-d.Z(e&D]Z)e'd/e)e*e(e)fqe'd0ee$e%Z(e&D]Z)e'd/e)e*e(e)fqe'd1ee$Z(e&D]Z)e'd/e)e*e(e)fqe'd2ee$d d3Z(e&D]Z)e'd/e)e*e(e)fq>dS);zyUtilities for determining application-specific dirs. See for details and usage. ).NrjavaZWindowswin32ZMacdarwinZlinux2FcCstdkr^|dkr|}|rdpd}tjt|}|r|dk rNtj|||}qtj||}nNtdkrtjd}|rtj||}n&tdtjd }|rtj||}|r|rtj||}|S) aJReturn full path to the user-specific data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user data directories are: Mac OS X: ~/Library/Application Support/ Unix: ~/.local/share/ # or in $XDG_DATA_HOME, if defined Win XP (not roaming): C:\Documents and Settings\\Application Data\\ Win XP (roaming): C:\Documents and Settings\\Local Settings\Application Data\\ Win 7 (not roaming): C:\Users\\AppData\Local\\ Win 7 (roaming): C:\Users\\AppData\Roaming\\ For Unix, we follow the XDG spec and support $XDG_DATA_HOME. That means, by default "~/.local/share/". rN CSIDL_APPDATACSIDL_LOCAL_APPDATAFrz~/Library/Application Support/Z XDG_DATA_HOMEz~/.local/sharesystemospathnormpath_get_win_folderjoin expandusergetenv)appname appauthorversionroamingconstrr7/usr/lib/python3.8/site-packages/pip/_vendor/appdirs.py user_data_dir-s&   rcs tdkrR|dkr}tjtd}r|dk rBtj||}qtj|}ntdkrztjd}rtj|}nttdtjdd g}d d | tjD}r|rtj|fd d |D}|rtj|}n|d }|Sr|rtj||}|S)aiReturn full path to the user-shared data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "multipath" is an optional parameter only applicable to *nix which indicates that the entire list of data dirs should be returned. By default, the first item from XDG_DATA_DIRS is returned, or '/usr/local/share/', if XDG_DATA_DIRS is not set Typical site data directories are: Mac OS X: /Library/Application Support/ Unix: /usr/local/share/ or /usr/share/ Win XP: C:\Documents and Settings\All Users\Application Data\\ Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) Win 7: C:\ProgramData\\ # Hidden, but writeable on Win 7. For Unix, this is using the $XDG_DATA_DIRS[0] default. WARNING: Do not use this on Windows. See the Vista-Fail note above for why. rNCSIDL_COMMON_APPDATAFrz/Library/Application SupportZ XDG_DATA_DIRSz/usr/local/sharez /usr/sharecSs g|]}tj|tjqSrr rrrstripsep.0xrrr sz!site_data_dir..csg|]}tj|gqSrr rrr rrrr#sr) r r rrrrrrpathsepsplitrrr multipathrZpathlistrr%r site_data_dirds6  r*cCsXtdkrt||d|}n&tdtjd}|r>tj||}|rT|rTtj||}|S)aReturn full path to the user-specific config dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user config directories are: Mac OS X: same as user_data_dir Unix: ~/.config/ # or in $XDG_CONFIG_HOME, if defined Win *: same as user_data_dir For Unix, we follow the XDG spec and support $XDG_CONFIG_HOME. That means, by default "~/.config/". rrNZXDG_CONFIG_HOMEz ~/.configr rr rrrrrrrrrrrruser_config_dirsr.cstdkr*t|}r|rtj||}ndtdd}dd|tjD}rt|rbtj|fdd|D}|rtj|}n|d}|S)aReturn full path to the user-shared data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "multipath" is an optional parameter only applicable to *nix which indicates that the entire list of config dirs should be returned. By default, the first item from XDG_CONFIG_DIRS is returned, or '/etc/xdg/', if XDG_CONFIG_DIRS is not set Typical site config directories are: Mac OS X: same as site_data_dir Unix: /etc/xdg/ or $XDG_CONFIG_DIRS[i]/ for each value in $XDG_CONFIG_DIRS Win *: same as site_data_dir Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) For Unix, this is using the $XDG_CONFIG_DIRS[0] default, if multipath=False WARNING: Do not use this on Windows. See the Vista-Fail note above for why. r+ZXDG_CONFIG_DIRSz/etc/xdgcSs g|]}tj|tjqSrrr rrrr#sz#site_config_dir..csg|]}tj|gqSrr$r r%rrr#sr)r r*r rrrr'r&r(rr%rsite_config_dirs  r/TcCstdkrd|dkr|}tjtd}|r|dk rBtj|||}ntj||}|rtj|d}nNtdkrtjd}|rtj||}n&tdtjd }|rtj||}|r|rtj||}|S) aReturn full path to the user-specific cache dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "opinion" (boolean) can be False to disable the appending of "Cache" to the base app data dir for Windows. See discussion below. Typical user cache directories are: Mac OS X: ~/Library/Caches/ Unix: ~/.cache/ (XDG default) Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Cache Vista: C:\Users\\AppData\Local\\\Cache On Windows the only suggestion in the MSDN docs is that local settings go in the `CSIDL_LOCAL_APPDATA` directory. This is identical to the non-roaming app data dir (the default returned by `user_data_dir` above). Apps typically put cache data somewhere *under* the given dir here. Some examples: ...\Mozilla\Firefox\Profiles\\Cache ...\Acme\SuperApp\Cache\1.0 OPINION: This function appends "Cache" to the `CSIDL_LOCAL_APPDATA` value. This can be disabled with the `opinion=False` option. rNr FZCacherz~/Library/CachesZXDG_CACHE_HOMEz~/.cacher rrrZopinionrrrruser_cache_dirs(! r1cCsXtdkrt||d|}n&tdtjd}|r>tj||}|rT|rTtj||}|S)aReturn full path to the user-specific state dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user state directories are: Mac OS X: same as user_data_dir Unix: ~/.local/state/ # or in $XDG_STATE_HOME, if defined Win *: same as user_data_dir For Unix, we follow this Debian proposal to extend the XDG spec and support $XDG_STATE_HOME. That means, by default "~/.local/state/". r+NZXDG_STATE_HOMEz~/.local/stater,r-rrruser_state_dir:sr2cCstdkr tjtjd|}nNtdkrLt|||}d}|rntj|d}n"t|||}d}|rntj|d}|r|rtj||}|S)aReturn full path to the user-specific log dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "opinion" (boolean) can be False to disable the appending of "Logs" to the base app data dir for Windows, and "log" to the base cache dir for Unix. See discussion below. Typical user log directories are: Mac OS X: ~/Library/Logs/ Unix: ~/.cache//log # or under $XDG_CACHE_HOME if defined Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Logs Vista: C:\Users\\AppData\Local\\\Logs On Windows the only suggestion in the MSDN docs is that local settings go in the `CSIDL_LOCAL_APPDATA` directory. (Note: I'm interested in examples of what some windows apps use for a logs dir.) OPINION: This function appends "Logs" to the `CSIDL_LOCAL_APPDATA` value for Windows and appends "log" to the user cache dir for Unix. This can be disabled with the `opinion=False` option. rz~/Library/LogsrFZLogslog)r r rrrrr1r0rrr user_log_dirds"    r4c@sneZdZdZdddZeddZedd Zed d Zed d Z eddZ eddZ eddZ dS)AppDirsz1Convenience wrapper for getting application dirs.NFcCs"||_||_||_||_||_dS)N)rrrrr))selfrrrrr)rrr__init__s zAppDirs.__init__cCst|j|j|j|jdSN)rr)rrrrrr6rrrrs zAppDirs.user_data_dircCst|j|j|j|jdSN)rr))r*rrrr)r9rrrr*s zAppDirs.site_data_dircCst|j|j|j|jdSr8)r.rrrrr9rrrr.s zAppDirs.user_config_dircCst|j|j|j|jdSr:)r/rrrr)r9rrrr/s zAppDirs.site_config_dircCst|j|j|jdSNr)r1rrrr9rrrr1s zAppDirs.user_cache_dircCst|j|j|jdSr;)r2rrrr9rrrr2s zAppDirs.user_state_dircCst|j|j|jdSr;)r4rrrr9rrrr4s zAppDirs.user_log_dir)NNNFF) __name__ __module__ __qualname____doc__r7propertyrr*r.r/r1r2r4rrrrr5s&       r5cCsHtrddl}nddl}dddd|}||jd}|||\}}|S)zThis is a fallback technique at best. I'm not sure if using the registry for this guarantees us the correct answer for all CSIDL_* names. rNZAppDatazCommon AppDataz Local AppDatar rr z@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)PY3winreg_winregOpenKeyHKEY_CURRENT_USERZ QueryValueEx) csidl_namerEZshell_folder_namekeydirtyperrr_get_win_folder_from_registrys rLcCsddlm}m}|dt||dd}z^t|}d}|D]}t|dkr8d}qRq8|rzddl}||}Wnt k rYnXWnt k rYnX|S)Nr)shellconshellFT) Zwin32com.shellrMrNSHGetFolderPathgetattrunicodeordwin32apiGetShortPathName ImportError UnicodeError)rHrMrNrJ has_high_charcrTrrr_get_win_folder_with_pywin32s$  rZcCsddl}dddd|}|d}|jjd|dd|d}|D]}t|dkr@d }qZq@|r|d}|jj|j|dr|}|jS) Nr#rBiFrOT) ctypesZcreate_unicode_bufferwindllZshell32ZSHGetFolderPathWrSZkernel32ZGetShortPathNameWvalue)rHr^Z csidl_constbufrXrYZbuf2rrr_get_win_folder_with_ctypess&   rbc Csddl}ddlm}ddlm}|jjd}|d|}|jj }| dt |j |d|j j ||j|d}d}|D]} t| dkr|d }qq||r|d|}|jj } | |||r|j|d}|S) Nr)jna)rrYFrOT)arrayZcom.sunrcZcom.sun.jna.platformrZWinDefZMAX_PATHZzerosZShell32ZINSTANCErPrQZShlObjZSHGFP_TYPE_CURRENTZNativeZtoStringZtostringrrSZKernel32rU) rHrfrcrZbuf_sizerarNrJrXrYZkernelrrr_get_win_folder_with_jnas&      rg)r___main__ZMyAppZ MyCompany)rr.r1r2r4r*r/z-- app dirs %s --z%-- app dirs (with optional 'version')z1.0r<z%s: %sz) -- app dirs (without optional 'version')z+ -- app dirs (without optional 'appauthor')z( -- app dirs (with disabled 'appauthor'))r)NNNF)NNNF)NNNF)NNNF)NNNT)NNNF)NNNT)+r@Z__version_info__rmapstr __version__sysr version_inforCrRplatform startswithZjava_verZos_namer rr*r.r/r1r2r4objectr5rLrZrbrgr^r_rrVZ com.sun.jnaZcomr=rrZpropsprintdirsZproprQrrrrsv     7 B ( 3 9 * 30      PKd]FF#__pycache__/retrying.cpython-38.pycnu[U .e&@slddlZddlmZddlZddlZddlZdZddZGdddeZ Gdd d eZ Gd d d e Z dS) N)sixi?csBtdkr,tdr,dd}|dSfdd}|SdS)z Decorator function that instantiates the Retrying object @param *dargs: positional arguments passed to Retrying object @param **dkw: keyword arguments passed to the Retrying object rcstfdd}|S)Ncstjf||SNRetryingcallargskwf8/usr/lib/python3.8/site-packages/pip/_vendor/retrying.py wrapped_f$sz-retry..wrap_simple..wrapped_frwrapsr rr r r wrap_simple"szretry..wrap_simplecstfdd}|S)Ncstjf||Srrr)dargsdkwr r rr/sz&retry..wrap..wrapped_frrrrr rwrap-szretry..wrapN)lencallable)rrrrr rrretrys  rc@sneZdZdddZddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ ddZ ddZdS)rNFcs |dkr dn||_|dkrdn||_|dkr0dn||_|dkrBdn||_|dkrTdn||_|dkrfdn||_| dkrxdn| |_| dkrdn| |_| dkrtn| |_ |dkrdn||_ g|dk r̈ |j |dk r |j |dk r||_n&|dkr fdd|_n t|||_ddg|dk r6 |j|dk sJ|dk rV |j|dk sj| dk rv |j| dk s| dk r |j|dk r||_n&|dkr‡fd d|_n t|||_| dkr|j|_n| |_| dkr|j|_n| |_||_dS) NdrrcstfddDS)Nc3s|]}|VqdSrr .0r ZattemptsZdelayr r as6Retrying.__init__....)anyr ) stop_funcsr raz#Retrying.__init__..c_sdS)Nrr )r kwargsr r rr%hr&cstfddDS)Nc3s|]}|VqdSrr rr r rr!ysr")maxr ) wait_funcsr rr%yr&)_stop_max_attempt_number_stop_max_delay _wait_fixed_wait_random_min_wait_random_max_wait_incrementing_start_wait_incrementing_increment_wait_exponential_multiplierMAX_WAIT_wait_exponential_max_wait_jitter_maxappendstop_after_attemptstop_after_delaystopgetattr fixed_sleep random_sleepincrementing_sleepexponential_sleepwait always_reject_retry_on_exception never_reject_retry_on_result_wrap_exception)selfr8r>Zstop_max_attempt_numberZstop_max_delayZ wait_fixedZwait_random_minZwait_random_maxZwait_incrementing_startZwait_incrementing_incrementZwait_exponential_multiplierZwait_exponential_maxZretry_on_exceptionZretry_on_resultwrap_exceptionZ stop_funcZ wait_funcZwait_jitter_maxr )r$r)r__init__:sR                 zRetrying.__init__cCs ||jkS)z;Stop after the previous attempt >= stop_max_attempt_number.)r*rDprevious_attempt_numberdelay_since_first_attempt_msr r rr6szRetrying.stop_after_attemptcCs ||jkS)z=Stop after the time from the first attempt >= stop_max_delay.)r+rGr r rr7szRetrying.stop_after_delaycCsdS)z#Don't sleep at all before retrying.rr rGr r rno_sleepszRetrying.no_sleepcCs|jS)z0Sleep a fixed amount of time between each retry.)r,rGr r rr:szRetrying.fixed_sleepcCst|j|jS)zISleep a random amount of time between wait_random_min and wait_random_max)randomZrandintr-r.rGr r rr;szRetrying.random_sleepcCs$|j|j|d}|dkr d}|S)z Sleep an incremental amount of time after each attempt, starting at wait_incrementing_start and incrementing by wait_incrementing_increment rr)r/r0)rDrHrIresultr r rr<szRetrying.incrementing_sleepcCs2d|}|j|}||jkr"|j}|dkr.d}|S)Nr)r1r3)rDrHrIZexprLr r rr=s  zRetrying.exponential_sleepcCsdS)NFr rDrLr r rrAszRetrying.never_rejectcCsdS)NTr rNr r rr?szRetrying.always_rejectcCs4d}|jr |||jdO}n|||jO}|S)NFr) has_exceptionr@valuerB)rDattemptZrejectr r r should_rejects zRetrying.should_rejectc Ostttd}d}zt||||d}Wn t}t||d}YnX||sf||jStttd|}| ||r|js|j r|qt |n<| ||} |j rt|j } | td| } t| d|d7}qdS)NrrFTrg@@)introundtimeAttemptsysexc_inforRgetrCr8rO RetryErrorr>r4rKr(sleep) rDfnr r'Z start_timeattempt_numberrQtbrIr[Zjitterr r rrs(       z Retrying.call)NNNNNNNNNNNNNFNNN)__name__ __module__ __qualname__rFr6r7rJr:r;r<r=rAr?rRrr r r rr8s: S   rc@s*eZdZdZddZd ddZddZd S) rVz An Attempt encapsulates a call to a target function that may end as a normal return value from the function or an Exception depending on what occurred during the execution. cCs||_||_||_dSr)rPr]rO)rDrPr]rOr r rrFszAttempt.__init__FcCs@|jr6|rt|qs *!PKd]Zd$__pycache__/ipaddress.cpython-38.pycnu[U .e7@sldZddlmZddlZddlZdZefZz eefZWne k rJYnXze Z Wn$e k rxe Z e e ksttYnXddkrddZnddZz ejZWnek rdd ZYnXd d Zeed rd dZnddZdNddZGdddeZdZdZGdddeZGdddeZddZdOddZd d!Z d"d#Z!d$d%Z"d&d'Z#d(d)Z$d*d+Z%d,d-Z&d.d/Z'd0d1Z(d2d3Z)Gd4d5d5eZ*Gd6d7d7e*Z+Gd8d9d9e*Z,Gd:d;d;eZ-Gdd?d?e.Z/Gd@dAdAe-e,Z0GdBdCdCeZ1e1e._2GdDdEdEeZ3GdFdGdGe3e+Z4GdHdIdIe4Z5GdJdKdKe3e,Z6GdLdMdMeZ7e7e4_2dS)PzA fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. )unicode_literalsNz1.0.22cCs|SNZbytrr9/usr/lib/python3.8/site-packages/pip/_vendor/ipaddress.py_compat_bytes_to_byte_valssrcCsdd|DS)NcSsg|]}td|dqS)!Br)structunpack.0brrr #sz._compat_bytes_to_byte_vals..rrrrrr"scCs8|dks td}|D]}t|ts&t|d>|}q|S)Nbigr)AssertionError isinstance_compat_int_types)Zbytvals endianessresZbvrrr_compat_int_from_byte_vals's  rcCst|tst|dkst|dkrH|dks2|dkr7}|d|j krqqdS) aSummarize a network range given the first and last IP addresses. Example: >>> list(summarize_address_range(IPv4Address('192.0.2.0'), ... IPv4Address('192.0.2.130'))) ... #doctest: +NORMALIZE_WHITESPACE [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'), IPv4Network('192.0.2.130/32')] Args: first: the first IPv4Address or IPv6Address in the range. last: the last IPv4Address or IPv6Address in the range. Returns: An iterator of the summarized IPv(4|6) network objects. Raise: TypeError: If the first and last objects are not IP addresses. If the first and last objects are not the same version. ValueError: If the last object is not greater than the first. If the version of the first address is not 4 or 6. z1first and last must be IP addresses, not networks%%s and %s are not of the same versionz*last IP address must be greater than firstrzunknown IP versionr&N) r _BaseAddress TypeErrorversionrGrKrL_max_prefixlenr^rergr" _ALL_ONES)rarbrcZip_bitsZ first_intZlast_intZnbitsnetrrrsummarize_address_rangeBs8      rpccst|}i}|rV|}|}||}|dkr<|||<q ||kr ||=||q d}t|D]$}|dk r|j|jkrqf|V|}qfdS)auLoops through the addresses, collapsing concurrent netblocks. Example: ip1 = IPv4Network('192.0.2.0/26') ip2 = IPv4Network('192.0.2.64/26') ip3 = IPv4Network('192.0.2.128/26') ip4 = IPv4Network('192.0.2.192/26') _collapse_addresses_internal([ip1, ip2, ip3, ip4]) -> [IPv4Network('192.0.2.0/24')] This shouldn't be called directly; it is called via collapse_addresses([]). Args: addresses: A list of IPv4Network's or IPv6Network's Returns: A list of IPv4Network's or IPv6Network's depending on what we were passed. N)listpopsupernetgetappendsortedvaluesbroadcast_address)r_Zto_mergesubnetsrorsZexistingrbrrr_collapse_addresses_internalys$    rzc Cs0g}g}g}|D]}t|trR|rF|dj|jkrFtd||df||q|j|jkr|r|dj|jkrtd||dfz||jWqtk r||j YqXq|r|dj|jkrtd||df||qt t |}|r$t |D]\}}| t||qt||S)aCollapse a list of IP objects. Example: collapse_addresses([IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/25')]) -> [IPv4Network('192.0.2.0/24')] Args: addresses: An iterator of IPv4Network or IPv6Network objects. Returns: An iterator of the collapsed IPv(4|6)Network objects. Raises: TypeError: If passed a list of mixed version objects. rh)rrj_versionrkru _prefixlenrmrcAttributeErrornetwork_addressrvsetrdextendrprz)r_ZaddrsZipsZnetsrcrarbrrrcollapse_addressess@     rcCs(t|tr|St|tr$|StS)a2Return a key suitable for sorting between networks and addresses. Address and Network objects are not sortable by default; they're fundamentally different so the expression IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24') doesn't make any sense. There are some times however, where you may wish to have ipaddress sort these for you anyway. If you need to do this, you can use this function as the key= argument to sorted(). Args: obj: either a Network or Address object. Returns: appropriate key. )r _BaseNetwork_get_networks_keyrj_get_address_keyr1)objrrrget_mixed_type_keys   rc@seZdZdZdZeddZeddZeddZed d Z d d Z d dZ e ddZ e ddZe ddZe ddZe ddZddZdS)_IPAddressBasezThe mother class.rcCs|S)z:Return the longhand version of the IP address as a string.)_explode_shorthand_ip_stringr.rrrexplodedsz_IPAddressBase.explodedcCst|S)z;Return the shorthand version of the IP address as a string.rWrrrr compressedsz_IPAddressBase.compressedcCs|S)aIThe name of the reverse DNS pointer for the IP address, e.g.: >>> ipaddress.ip_address("127.0.0.1").reverse_pointer '1.0.0.127.in-addr.arpa' >>> ipaddress.ip_address("2001:db8::1").reverse_pointer '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa' )_reverse_pointerrrrrreverse_pointer s z_IPAddressBase.reverse_pointercCsdt|f}t|dS)Nz%200s has no version specifiedtyperr.msgrrrrlsz_IPAddressBase.versioncCsF|dkrd}t|||jf||jkrBd}t|||j|jfdS)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)r@r|rnrm)r.rIrrrr_check_int_addresss  z!_IPAddressBase._check_int_addresscCs.t|}||kr*d}t|||||jfdS)Nz~%r (len %d != %d) is not permitted as an IPv%d address. Did you pass in a bytes (str in Python 2) instead of a unicode object?)rYr@r|)r.rIZ expected_lenZ address_lenrrrr_check_packed_address"sz$_IPAddressBase._check_packed_addresscCs|j|j|?AS)zTurn the prefix length into a bitwise netmask Args: prefixlen: An integer, the prefix length. Returns: An integer. )rn)cls prefixlenrrr_ip_int_from_prefix,s z"_IPAddressBase._ip_int_from_prefixc Cs\t||j}|j|}||?}d|>d}||krX|jd}t||d}d}t|||S)aReturn prefix length from the bitwise netmask. Args: ip_int: An integer, the netmask in expanded bitwise format Returns: An integer, the prefix length. Raises: ValueError: If the input intermingles zeroes & ones r&rrz&Netmask pattern %r mixes zeroes & ones)rgrmrrG) rip_intZtrailing_zeroesrZ leading_onesZall_onesZbyteslenZdetailsrrrr_prefix_from_ip_int9s      z"_IPAddressBase._prefix_from_ip_intcCsd|}t|dS)Nz%r is not a valid netmask)rC)rZ netmask_strrrrr_report_invalid_netmaskRsz&_IPAddressBase._report_invalid_netmaskcCshtj|s||z t|}Wntk r@||YnXd|krX|jksdn|||S)a Return prefix length from a numeric string Args: prefixlen_str: The string to be converted Returns: An integer, the prefix length. Raises: NetmaskValueError: If the input is not a valid netmask r)_BaseV4_DECIMAL_DIGITS issupersetrintrGrm)rZ prefixlen_strrrrr_prefix_from_prefix_stringWs    z)_IPAddressBase._prefix_from_prefix_stringcCsz||}Wntk r,||YnXz ||WStk rNYnX||jN}z ||WStk r||YnXdS)aTurn a netmask/hostmask string into a prefix length Args: ip_str: The netmask/hostmask to be converted Returns: An integer, the prefix length. Raises: NetmaskValueError: If the input is not a valid netmask/hostmask N)_ip_int_from_stringr@rrrGrn)rip_strrrrr_prefix_from_ip_stringps   z%_IPAddressBase._prefix_from_ip_stringcCs|jt|ffSr) __class__rWrrrr __reduce__sz_IPAddressBase.__reduce__N)r;r<r=rBr>propertyrrrrlrr classmethodrrrrrrrrrrrs.           !rc@sdeZdZdZdZddZddZddZd d Zd d Z d dZ ddZ ddZ ddZ ddZdS)rjzA generic IP object. This IP class contains the version independent methods which are used by single IP addresses. rcCs|jSrr^rrrr__int__sz_BaseAddress.__int__cCs8z|j|jko|j|jkWStk r2tYSXdSr)r^r|r~r1r-rrrr0s   z_BaseAddress.__eq__cCs`t|tstSt|ts(td||f|j|jkrDtd||f|j|jkr\|j|jkSdSN"%s and %s are not of the same typerhF)rrr1rjrkr|r^r-rrrr4s     z_BaseAddress.__lt__cCs t|tstS|t||Srrrr1rrr-rrr__add__s z_BaseAddress.__add__cCs t|tstS|t||Srrr-rrr__sub__s z_BaseAddress.__sub__cCsd|jjt|fSNz%s(%r)rr;rWrrrr__repr__sz_BaseAddress.__repr__cCst||jSr)rW_string_from_ip_intr^rrrr__str__sz_BaseAddress.__str__cCsttt|jSr)hashhexrr^rrrr__hash__sz_BaseAddress.__hash__cCs |j|fSrr|rrrrrsz_BaseAddress._get_address_keycCs|j|jffSr)rr^rrrrrsz_BaseAddress.__reduce__N)r;r<r=rBr>rr0r4rrrrrrrrrrrrjsrjc@sdeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZeddZeddZeddZeddZed d!Zed"d#Zed$d%Zed&d'Zd(d)Zd*d+Zd,d-ZdHd0d1ZdId2d3Zed4d5Zed6d7Zd8d9Z d:d;Z!edd?Z#ed@dAZ$edBdCZ%edDdEZ&edFdGZ'd/S)Jrz~A generic IP network object. This IP class contains the version independent methods which are used by networks. cCs i|_dSr)_cache)r.rIrrr__init__sz_BaseNetwork.__init__cCsd|jjt|fSrrrrrrrsz_BaseNetwork.__repr__cCsd|j|jfSN%s/%d)rrrrrrrsz_BaseNetwork.__str__ccs8t|j}t|j}t|d|D]}||Vq"dS)zGenerate Iterator over usable hosts in a network. This is like __iter__ except it doesn't return the network or broadcast addresses. r&Nrrrxr*_address_classr.network broadcastxrrrhostss  z_BaseNetwork.hostsccs8t|j}t|j}t||dD]}||Vq"dSNr&rrrrr__iter__s  z_BaseNetwork.__iter__cCslt|j}t|j}|dkr>|||kr0td|||S|d7}|||krZtd|||SdS)Nrzaddress out of ranger&)rrrx IndexErrorr)r.nrrrrr __getitem__s    z_BaseNetwork.__getitem__cCsxt|tstSt|ts(td||f|j|jkrDtd||f|j|jkr\|j|jkS|j|jkrt|j|jkSdSr)rrr1rrkr|rnetmaskr-rrrr4s"       z_BaseNetwork.__lt__cCsLz.|j|jko,|j|jko,t|jt|jkWStk rFtYSXdSr)r|rrrr~r1r-rrrr0s  z_BaseNetwork.__eq__cCstt|jt|jASr)rrrrrrrrrsz_BaseNetwork.__hash__cCsL|j|jkrdSt|trdSt|jt|jkoBt|jkSSdSNF)r|rrrrr^rxr-rrr __contains__s  z_BaseNetwork.__contains__cCs(|j|kp&|j|kp&|j|kp&|j|kS)z*Tell if self is partly contained in other.)rrxr-rrroverlaps*s    z_BaseNetwork.overlapscCs<|jd}|dkr8|t|jt|jB}||jd<|S)Nrx)rrtrrrhostmaskr.rrrrrx1s   z_BaseNetwork.broadcast_addresscCs8|jd}|dkr4|t|j|jA}||jd<|S)Nr)rrtrrrrnrrrrr:s   z_BaseNetwork.hostmaskcCsd|j|jfSr)rr}rrrrwith_prefixlenBsz_BaseNetwork.with_prefixlencCsd|j|jfSN%s/%s)rrrrrr with_netmaskFsz_BaseNetwork.with_netmaskcCsd|j|jfSr)rrrrrr with_hostmaskJsz_BaseNetwork.with_hostmaskcCst|jt|jdS)z&Number of hosts in the current subnet.r&)rrxrrrrr num_addressesNsz_BaseNetwork.num_addressescCsdt|f}t|dS)Nz%%200s has no associated address classrrrrrrSsz_BaseNetwork._address_classcCs|jSr)r}rrrrr[sz_BaseNetwork.prefixlenccs|j|jkstd||ft|ts2td|||sLtd||f||krXdS|d|j|jf}| \}}||kr||kr||r|V| \}}qz||r|V| \}}qzt d|||fqz||kr|Vn"||kr|Vnt d|||fdS)aRemove an address from a larger block. For example: addr1 = ip_network('192.0.2.0/28') addr2 = ip_network('192.0.2.1/32') list(addr1.address_exclude(addr2)) = [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'), IPv4Network('192.0.2.4/30'), IPv4Network('192.0.2.8/29')] or IPv6: addr1 = ip_network('2001:db8::1/32') addr2 = ip_network('2001:db8::1/128') list(addr1.address_exclude(addr2)) = [ip_network('2001:db8::1/128'), ip_network('2001:db8::2/127'), ip_network('2001:db8::4/126'), ip_network('2001:db8::8/125'), ... ip_network('2001:db8:8000::/33')] Args: other: An IPv4Network or IPv6Network object of the same type. Returns: An iterator of the IPv(4|6)Network objects which is self minus other. Raises: TypeError: If self and other are of differing address versions, or if other is not a network object. ValueError: If other is not completely contained by self. rhz%s is not a network objectz%s not contained in %sNrz3Error performing exclusion: s1: %s s2: %s other: %s) r|rkrr subnet_ofrGrrrryr)r.r/s1s2rrraddress_exclude_s@$        z_BaseNetwork.address_excludecCs`|j|jkrtd||f|j|jkr,dS|j|jkr other eg: IPv4Network('192.0.2.128/25') > IPv4Network('192.0.2.0/25') IPv6Network('2001:db8::2000/124') > IPv6Network('2001:db8::1000/124') Raises: TypeError if the IP versions are different. rr{r&r)r|rkrrr-rrrcompare_networkss!     z_BaseNetwork.compare_networkscCs|j|j|jfS)zNetwork-only key function. Returns an object that identifies this address' network and netmask. This function is a suitable "key" argument for sorted() and list.sort(). )r|rrrrrrrsz_BaseNetwork._get_networks_keyr&Nc cs|j|jkr|VdS|dk rJ||jkr0td|dkr@td||j}|dkrZtd|j|}||jkr~td||ft|j}t|jd}t|jd|?}t|||D]}|||f}|VqdS)aThe subnets which join to make the current subnet. In the case that self contains only one IP (self._prefixlen == 32 for IPv4 or self._prefixlen == 128 for IPv6), yield an iterator with just ourself. Args: prefixlen_diff: An integer, the amount the prefix length should be increased by. This should not be set if new_prefix is also set. new_prefix: The desired new prefix length. This must be a larger number (smaller prefix) than the existing prefix. This should not be set if prefixlen_diff is also set. Returns: An iterator of IPv(4|6) objects. Raises: ValueError: The prefixlen_diff is too small or too large. OR prefixlen_diff and new_prefix are both set or new_prefix is a smaller number than the current prefix (smaller number means a larger network) Nznew prefix must be longerr&(cannot set prefixlen_diff and new_prefixrzprefix length diff must be > 0z0prefix length diff %d is invalid for netblock %s) r}rmrGrrrxrr*r) r.prefixlen_diff new_prefix new_prefixlenr'r(r)Znew_addrZcurrentrrrrys2      z_BaseNetwork.subnetscCs|jdkr|S|dk rB||jkr(td|dkr8td|j|}|j|}|dkrftd|j|f|t|jt|j|>@|fS)aThe supernet containing the current network. Args: prefixlen_diff: An integer, the amount the prefix length of the network should be decreased by. For example, given a /24 network and a prefixlen_diff of 3, a supernet with a /21 netmask is returned. Returns: An IPv4 network object. Raises: ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have a negative prefix length. OR If prefixlen_diff and new_prefix are both set or new_prefix is a larger number than the current prefix (larger number means a smaller network) rNznew prefix must be shorterr&rz;current prefixlen is %d, cannot have a prefixlen_diff of %d)r}rGrrrrr)r.rrrrrrrss&    z_BaseNetwork.supernetcCs|jjo|jjSzTest if the address is reserved for multicast use. Returns: A boolean, True if the address is a multicast address. See RFC 2373 2.7 for details. )r is_multicastrxrrrrrAs z_BaseNetwork.is_multicastcCs^z4|j|jkrtd|||j|jko2|j|jkWStk rXtd||fYnXdS)Nrhz3Unable to test subnet containment between %s and %s)r|rkrrxr~)ar rrr _is_subnet_ofMs   z_BaseNetwork._is_subnet_ofcCs |||S)z1Return True if this network is a subnet of other.rr-rrrrYsz_BaseNetwork.subnet_ofcCs |||S)z3Return True if this network is a supernet of other.rr-rrr supernet_of]sz_BaseNetwork.supernet_ofcCs|jjo|jjS)Test if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within one of the reserved IPv6 Network ranges. )r is_reservedrxrrrrras z_BaseNetwork.is_reservedcCs|jjo|jjSzTest if the address is reserved for link-local. Returns: A boolean, True if the address is reserved per RFC 4291. )r is_link_localrxrrrrrmsz_BaseNetwork.is_link_localcCs|jjo|jjS)zTest if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per iana-ipv4-special-registry or iana-ipv6-special-registry. )r is_privaterxrrrrrxs z_BaseNetwork.is_privatecCs|j S)zTest if this address is allocated for public networks. Returns: A boolean, True if the address is not reserved per iana-ipv4-special-registry or iana-ipv6-special-registry. rrrrr is_globals z_BaseNetwork.is_globalcCs|jjo|jjS)Test if the address is unspecified. Returns: A boolean, True if this is the unspecified address as defined in RFC 2373 2.5.2. )ris_unspecifiedrxrrrrrs z_BaseNetwork.is_unspecifiedcCs|jjo|jjS)Test if the address is a loopback address. Returns: A boolean, True if the address is a loopback address as defined in RFC 2373 2.5.3. )r is_loopbackrxrrrrrs z_BaseNetwork.is_loopback)r&N)r&N)(r;r<r=rBrrrrrrr4r0rrrrrxrrrrrrrrrrryrsr staticmethodrrrrrrrrrrrrrrsf           K0 5 (       rc @seZdZdZdZdZdedZedZ eddd d d d d ddg Z eZ iZ ddZ eddZeddZeddZeddZddZddZeddZed d!Zd"S)#rzyBase IPv4 object. The following methods are used by IPv4 objects in both single IP addresses and networks. rrrr& 0123456789rrcCst|Srrrrrrrsz$_BaseV4._explode_shorthand_ip_stringcCsn||jkrdt|tr|}n.z||}Wntk rF||}YnXt||}||f|j|<|j|SaMake a (netmask, prefix_len) tuple from the given argument. Argument can be: - an integer (the prefix length) - a string representing the prefix length (e.g. "24") - a string representing the prefix netmask (e.g. "255.255.255.0") )_netmask_cacherrrrCrrDrrargrrrrr _make_netmasks  z_BaseV4._make_netmaskc Csz|s td|d}t|dkr.td|ztt|j|dWStk rt}ztd||fW5d}~XYnXdS)aTurn the given IP string into an integer for comparison. Args: ip_str: A string, the IP ip_str. Returns: The IP ip_str as an integer. Raises: AddressValueError: if ip_str isn't a valid IPv4 Address. Address cannot be empty.rzExpected 4 octets in %rr%s in %rN)r@rXrYrmap _parse_octetrG)rrZoctetsexcrrrrs    z_BaseV4._ip_int_from_stringcCs|s td|j|s(d}t||t|dkrDd}t||t|d}|dkrr|ddkrrd }t|||d krtd ||S) a Convert a decimal octet into an integer. Args: octet_str: A string, the number to parse. Returns: The octet as an integer. Raises: ValueError: if the octet isn't strictly a decimal from [0..255]. zEmpty octet not permittedz#Only decimal digits permitted in %rz$At most 3 characters permitted in %r r0z3Ambiguous (octal/decimal) value in %r not permittedrzOctet %d (> 255) not permitted)rGrrrYr)rZ octet_strrZ octet_intrrrrs       z_BaseV4._parse_octetcCsdddt|ddDS)zTurns a 32-bit integer into dotted decimal notation. Args: ip_int: An integer, the IP address. Returns: The IP address as a string in dotted decimal notation. rcss0|](}tt|tr"td|dn|VqdS)rrN)rWrrFr r r rrr %s z._BaseV4._string_from_ip_int..rr)joinr)rrrrrrs  z_BaseV4._string_from_ip_intcsj|d}zfddtt|D}Wntk r<YdSXt|t|krRdS|d|dkrfdSdS)zTest if the IP string is a hostmask (rather than a netmask). Args: ip_str: A string, the potential hostmask. Returns: A boolean, True if the IP string is a hostmask. rcsg|]}|jkr|qSr)_valid_mask_octetsr rrrrr6s z(_BaseV4._is_hostmask..Frr{T)rXrrrGrY)r.rrfpartsrrr _is_hostmask*s z_BaseV4._is_hostmaskcCs&t|dddd}d|dS)zReturn the reverse DNS pointer name for the IPv4 address. This implements the method described in RFC1035 3.5. rNr{z .in-addr.arpa)rWrXr)r.Zreverse_octetsrrrr?sz_BaseV4._reverse_pointercCs|jSrrmrrrr max_prefixlenHsz_BaseV4.max_prefixlencCs|jSrrrrrrrlLsz_BaseV4.versionN)r;r<r=rBr>r| IPV4LENGTHrn frozensetrrrmrrrrrrrr rrr rlrrrrrs.    $   rc@s|eZdZdZdZddZeddZeddZed d Z ed d Z ed dZ eddZ eddZ eddZdS)rDz/Represent and manipulate single IPv4 Addresses.r^ __weakref__cCsxt|tr||||_dSt|trL||dt|}t|d|_dSt|}d|krht d|| ||_dS)a Args: address: A string or integer representing the IP Additionally, an integer can be passed, so IPv4Address('192.0.2.1') == IPv4Address(3221225985). or, more generally IPv4Address(int(IPv4Address('192.0.2.1'))) == IPv4Address('192.0.2.1') Raises: AddressValueError: If ipaddress isn't a valid IPv4 address. NrrrVUnexpected '/' in %r rrrr^rFrrrrWr@rr.rIZbvsZaddr_strrrrrWs      zIPv4Address.__init__cCs t|jSz*The binary representation of this address.)rTr^rrrrpacked{szIPv4Address.packedcCs ||jjkS)zTest if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within the reserved IPv4 Network range. ) _constants_reserved_networkrrrrrs zIPv4Address.is_reservedcstfddjjDS)zTest if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per iana-ipv4-special-registry. c3s|]}|kVqdSrrr rorrrrsz)IPv4Address.is_private..anyr_private_networksrrrrrs zIPv4Address.is_privatecCs||jjko|j Sr)r_public_networkrrrrrrs zIPv4Address.is_globalcCs ||jjkS)zTest if the address is reserved for multicast use. Returns: A boolean, True if the address is multicast. See RFC 3171 for details. r_multicast_networkrrrrrs zIPv4Address.is_multicastcCs ||jjkS)zTest if the address is unspecified. Returns: A boolean, True if this is the unspecified address as defined in RFC 5735 3. )r_unspecified_addressrrrrrs zIPv4Address.is_unspecifiedcCs ||jjkS)zTest if the address is a loopback address. Returns: A boolean, True if the address is a loopback per RFC 3330. )r_loopback_networkrrrrrszIPv4Address.is_loopbackcCs ||jjkS)zTest if the address is reserved for link-local. Returns: A boolean, True if the address is link-local per RFC 3927. r_linklocal_networkrrrrrszIPv4Address.is_link_localN)r;r<r=rBr>rrrrrrrrrrrrrrrDQs&$       rDc@sjeZdZddZddZddZddZd d Zej Z e d d Z e d dZ e ddZ e ddZdS)rOcCst|ttfr2t||t|j|_|j|_ dSt|t rt||dt |dkrht |d|_ n|j|_ t|dd|_|jj |_ |jj|_dSt|}t||dt|dd|_|jj |_ |jj |_ |jj|_dSNrr&F)rM)rrFrrDrrKr^rrmr}tuplerYrrrr[r.rIrZrrrrs(        zIPv4Interface.__init__cCsd||j|jjfSrrr^rrrrrrrs zIPv4Interface.__str__cCsFt||}|r|tkr|Sz|j|jkWStk r@YdSXdSr)rDr0r1rr~r.r/Z address_equalrrrr0s  zIPv4Interface.__eq__cCsRt||}|tkrtSz|j|jkp4|j|jko4|WStk rLYdSXdSr)rDr4r1rr~r.r/Z address_lessrrrr4s  zIPv4Interface.__lt__cCs|j|jAt|jjASrr^r}rrrrrrrrszIPv4Interface.__hash__cCs t|jSr)rDr^rrrrrcszIPv4Interface.ipcCsd||j|jfSrrr^r}rrrrr s zIPv4Interface.with_prefixlencCsd||j|jfSrrr^rrrrrrs zIPv4Interface.with_netmaskcCsd||j|jfSrrr^rrrrrrs zIPv4Interface.with_hostmaskN)r;r<r=rrr0r4rrrrrcrrrrrrrrOs     rOc@s*eZdZdZeZdddZeddZdS) rKaeThis class represents and manipulates 32-bit IPv4 network + addresses.. Attributes: [examples for IPv4Network('192.0.2.0/27')] .network_address: IPv4Address('192.0.2.0') .hostmask: IPv4Address('0.0.0.31') .broadcast_address: IPv4Address('192.0.2.32') .netmask: IPv4Address('255.255.255.224') .prefixlen: 27 TcCs|t||t|ttfr| d | K} t | dD] } | d K} | | || O} qx| WSt k r}ztd||fW5d}~XYnXdS)zTurn an IPv6 ip_str into an integer. Args: ip_str: A string, the IPv6 ip_str. Returns: An int, the IPv6 address Raises: AddressValueError: if ip_str isn't a valid IPv6 Address. r:rz At least %d parts expected in %rrr{rN%xrr&z!At most %d colons permitted in %rz At most one '::' permitted in %rrz0Leading ':' only permitted as part of '::' in %rz1Trailing ':' only permitted as part of '::' in %rz/Expected at most %d other parts with '::' in %rz,Exactly %d parts expected without '::' in %r) r@rXrYrDrrr^ru _HEXTET_COUNTr*range _parse_hextetrG)rrr Z _min_partsrZipv4_intrZ _max_partsZ skip_indexr!Zparts_hiZparts_loZ parts_skippedrrrrrs    "               z_BaseV6._ip_int_from_stringcCs>|j|std|t|dkr4d}t||t|dS)a&Convert an IPv6 hextet string into an integer. Args: hextet_str: A string, the number to parse. Returns: The hextet as an integer. Raises: ValueError: if the input isn't strictly a hex number from [0..FFFF]. zOnly hex digits permitted in %rrz$At most 4 characters permitted in %rr) _HEX_DIGITSrrGrYr)rZ hextet_strrrrrr8>s     z_BaseV6._parse_hextetc Csd}d}d}d}t|D]>\}}|dkrN|d7}|dkr<|}||krV|}|}qd}d}q|dkr||}|t|kr~|dg7}dg|||<|dkrdg|}|S)aCompresses a list of hextets. Compresses a list of strings, replacing the longest continuous sequence of "0" in the list with "" and adding empty strings at the beginning or at the end of the string such that subsequently calling ":".join(hextets) will produce the compressed version of the IPv6 address. Args: hextets: A list of strings, the hextets to compress. Returns: A list of strings. r{rrr&) enumeraterY) rhextetsZbest_doublecolon_startZbest_doublecolon_lenZdoublecolon_startZdoublecolon_lenindexZhextetZbest_doublecolon_endrrr_compress_hextetsXs0   z_BaseV6._compress_hextetsNcsZ|dkrt|j}||jkr$tdd|fddtdddD}||}d |S) a,Turns a 128-bit integer into hexadecimal notation. Args: ip_int: An integer, the IP address. Returns: A string, the hexadecimal representation of the address. Raises: ValueError: The address is bigger than 128 bits of all ones. NzIPv6 address is too large%032xcs&g|]}dt||ddqS)r4rr)rr Zhex_strrrrsz/_BaseV6._string_from_ip_int..rr?rr3)rr^rnrGr7r>r)rrr<rr@rrs   z_BaseV6._string_from_ip_intcst|trt|j}nt|tr,t|j}nt|}||}d|fddtdddD}t|ttfrdd ||j fSd |S) zExpand a shortened IPv6 address. Args: ip_str: A string, the IPv6 address. Returns: A string, the expanded IPv6 address. r?csg|]}||dqS)rrr r@rrrsz8_BaseV6._explode_shorthand_ip_string..rr?rrr3) rrLrWrrPrcrr7rrr})r.rrr rr@rrs     z$_BaseV6._explode_shorthand_ip_stringcCs&|jddddd}d|dS)zReturn the reverse DNS pointer name for the IPv6 address. This implements the method described in RFC3596 2.5. Nr{r3r:rz .ip6.arpa)rreplacer)r.Z reverse_charsrrrrsz_BaseV6._reverse_pointercCs|jSrr rrrrr sz_BaseV6.max_prefixlencCs|jSrrrrrrrlsz_BaseV6.version)N)r;r<r=rBr>r| IPV6LENGTHrnr6rr9rmrrrrr8r>rrrrr rlrrrrr2s0   h  /   r2c@seZdZdZdZddZeddZeddZed d Z ed d Z ed dZ eddZ eddZ eddZeddZeddZeddZeddZdS)rEz/Represent and manipulate single IPv6 Addresses.rcCsxt|tr||||_dSt|trL||dt|}t|d|_dSt|}d|krht d|| ||_dS)aInstantiate a new IPv6 address object. Args: address: A string or integer representing the IP Additionally, an integer can be passed, so IPv6Address('2001:db8::') == IPv6Address(42540766411282592856903984951653826560) or, more generally IPv6Address(int(IPv6Address('2001:db8::'))) == IPv6Address('2001:db8::') Raises: AddressValueError: If address isn't a valid IPv6 address. NrrrVrrrrrrrs      zIPv6Address.__init__cCs t|jSr)rUr^rrrrrszIPv6Address.packedcCs ||jjkSrrrrrrrs zIPv6Address.is_multicastcstfddjjDS)rc3s|]}|kVqdSrrr rrrrsz*IPv6Address.is_reserved..)rr_reserved_networksrrrrrs zIPv6Address.is_reservedcCs ||jjkSrr"rrrrrszIPv6Address.is_link_localcCs ||jjkSa`Test if the address is reserved for site-local. Note that the site-local address space has been deprecated by RFC 3879. Use is_private to test if this address is in the space of unique local addresses as defined by RFC 4193. Returns: A boolean, True if the address is reserved per RFC 3513 2.5.6. )r_sitelocal_networkrrrr is_site_locals zIPv6Address.is_site_localcstfddjjDS)zTest if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per iana-ipv6-special-registry. c3s|]}|kVqdSrrrrrrr3sz)IPv6Address.is_private..rrrrrr*s zIPv6Address.is_privatecCs|j S)zTest if this address is allocated for public networks. Returns: A boolean, true if the address is not reserved per iana-ipv6-special-registry. rrrrrr5s zIPv6Address.is_globalcCs |jdkS)rrrrrrrr@s zIPv6Address.is_unspecifiedcCs |jdkS)rr&rrrrrrKs zIPv6Address.is_loopbackcCs |jd?dkrdSt|jd@S)zReturn the IPv4 mapped address. Returns: If the IPv6 address is a v4 mapped address, return the IPv4 mapped address. Return None otherwise. r?r5Nr^rDrrrr ipv4_mappedVs zIPv6Address.ipv4_mappedcCs4|jd?dkrdSt|jd?d@t|jd@fS)zTuple of embedded teredo IPs. Returns: Tuple of the (server, client) IPs or None if the address doesn't appear to be a teredo address (doesn't start with 2001::/32) `i NrrGrHrrrrteredocs zIPv6Address.teredocCs$|jd?dkrdSt|jd?d@S)zReturn the IPv4 6to4 embedded address. Returns: The IPv4 6to4-embedded address if present or None if the address doesn't appear to contain a 6to4 embedded address. pi NPrGrHrrrr sixtofourrs zIPv6Address.sixtofourN)r;r<r=rBr>rrrrrrrFrrrrrIrKrNrrrrrEs6%           rEc@seZdZddZddZddZddZd d Zej Z e d d Z e d dZ e ddZ e ddZe ddZe ddZdS)rPcCst|ttfr2t||t|j|_|j|_ dSt|t rt||dt |dkrht |d|_ n|j|_ t|dd|_|jj |_ |jj|_dSt|}t||dt|dd|_|jj |_ |jj |_ |jj|_dSr$)rrFrrErrLr^rrmr}r%rYrrrr[r&rrrrs(        zIPv6Interface.__init__cCsd||j|jjfSrr'rrrrrs zIPv6Interface.__str__cCsFt||}|r|tkr|Sz|j|jkWStk r@YdSXdSr)rEr0r1rr~r(rrrr0s  zIPv6Interface.__eq__cCsRt||}|tkrtSz|j|jkp4|j|jko4|WStk rLYdSXdSr)rEr4r1rr~r)rrrr4s  zIPv6Interface.__lt__cCs|j|jAt|jjASrr*rrrrrszIPv6Interface.__hash__cCs t|jSr)rEr^rrrrrcszIPv6Interface.ipcCsd||j|jfSrr+rrrrrs zIPv6Interface.with_prefixlencCsd||j|jfSrr,rrrrrs zIPv6Interface.with_netmaskcCsd||j|jfSrr-rrrrrs zIPv6Interface.with_hostmaskcCs|jdko|jjSr#)r^rrrrrrrszIPv6Interface.is_unspecifiedcCs|jdko|jjSr)r^rrrrrrrszIPv6Interface.is_loopbackN)r;r<r=rrr0r4rrrrrcrrrrrrrrrrPs$       rPc@s2eZdZdZeZd ddZddZeddZ d S) rLavThis class represents and manipulates 128-bit IPv6 networks. Attributes: [examples for IPv6('2001:db8::1000/124')] .network_address: IPv6Address('2001:db8::1000') .hostmask: IPv6Address('::f') .broadcast_address: IPv6Address('2001:db8::100f') .netmask: IPv6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0') .prefixlen: 124 TcCs|t||t|ttfrs        )$ $#716=X*vSr 5W{!PKd]3<<,__pycache__/contextlib2.cpython-38.opt-1.pycnu[U .eB @sdZddlZddlZddlZddlmZddlmZddddd d d d d g Zedg7Zej dddkrnej Z ne de fddiZ ddZddZGddde ZGdd d e ZGdddeZddZGddde ZGddde ZGd d d eZGd!d d eZGd"d d e Zej dd#kZer@d$d%Zd&d'Znd(d%Zd)d'Zzdd*lmZWnek rzeZ Yn Xd+d,Z Gd-d d e Z!Gd.dde!Z"Gd/ddeZ#dS)0zAcontextlib2 - backports and enhancements to the contextlib moduleN)dequewrapscontextmanagerclosing nullcontextAbstractContextManagerContextDecorator ExitStackredirect_stdoutredirect_stderrsuppress ContextStack)ABC __slots__cCs0||kr dS|||jD]}t||q|SN)append __bases__ _classic_mro)CresultBrr;/usr/lib/python3.8/site-packages/pip/_vendor/contextlib2.pyrs    rcGsvz |j}Wn"tk r,tt|g}YnX|D]>}|D],}||jkr:|j|dkrbtSq2q:tSq2dS)NT)__mro__AttributeErrortupler__dict__NotImplemented)rmethodsmromethodrrrr_check_methods$s    r%c@s2eZdZdZddZejddZeddZ dS) rz,An abstract base class for context managers.cCs|S)z0Return `self` upon entering the runtime context.rselfrrr __enter__8sz AbstractContextManager.__enter__cCsdS)z9Raise any exception triggered within the runtime context.Nr)r'exc_type exc_value tracebackrrr__exit__<szAbstractContextManager.__exit__cCs|tkrt|ddStS)z.innerr)r'r?r@rr>r__call__iszContextDecorator.__call__N)r/r0r1r2r:r9rArrrrr Is c@s0eZdZdZddZddZddZdd Zd S) _GeneratorContextManagerz%Helper for @contextmanager decorator.cCsJ||||_||||_|_|_t|dd}|dkr@t|j}||_dS)Nr2)genr?r<r=getattrtyper2)r'r?r<r=docrrr__init__ts    z!_GeneratorContextManager.__init__cCs||j|j|jSr) __class__r?r<r=r&rrrr9sz%_GeneratorContextManager._recreate_cmcCs.z t|jWStk r(tdYnXdS)Nzgenerator didn't yield)nextrC StopIteration RuntimeErrorr&rrrr(s z"_GeneratorContextManager.__enter__c Cs|dkr8zt|jWntk r,YdSXtdn|dkrF|}z|j|||tdWntk r}z||k WYSd}~XYnjtk r}z0||krWY"dStr|j|krWY dSW5d}~XYntd|k rYnXdS)Nzgenerator didn't stopz#generator didn't stop after throw()F) rIrCrJrKthrow_HAVE_EXCEPTION_CHAINING __cause__sysexc_info)r'rEvaluer+excrrrr,s,    z!_GeneratorContextManager.__exit__N)r/r0r1r2rGr9r(r,rrrrrBqs rBcstfdd}|S)a@contextmanager decorator. Typical usage: @contextmanager def some_generator(): try: yield finally: This makes this: with some_generator() as : equivalent to this: try: = finally: cs t||Sr)rBr;r?rrhelperszcontextmanager..helperr)r?rUrrTrrsc@s(eZdZdZddZddZddZdS) ra2Context to automatically close something at the end of a block. Code like this: with closing(.open()) as f: is equivalent to this: f = .open() try: finally: f.close() cCs ||_dSrthing)r'rWrrrrGszclosing.__init__cCs|jSrrVr&rrrr(szclosing.__enter__cGs|jdSr)rWclose)r'rQrrrr,szclosing.__exit__Nr/r0r1r2rGr(r,rrrrrsc@s(eZdZdZddZddZddZdS)_RedirectStreamNcCs||_g|_dSr) _new_target _old_targets)r' new_targetrrrrGsz_RedirectStream.__init__cCs*|jtt|jtt|j|j|jSr)r\rrDrP_streamsetattrr[r&rrrr(sz_RedirectStream.__enter__cCstt|j|jdSr)r_rPr^r\popr'exctypeexcinstexctbrrrr,sz_RedirectStream.__exit__)r/r0r1r^rGr(r,rrrrrZsrZc@seZdZdZdZdS)r aAContext manager for temporarily redirecting stdout to another file. # How to send help() to stderr with redirect_stdout(sys.stderr): help(dir) # How to write help() to a file with open('help.txt', 'w') as f: with redirect_stdout(f): help(pow) stdoutNr/r0r1r2r^rrrrr s c@seZdZdZdZdS)r zCContext manager for temporarily redirecting stderr to another file.stderrNrfrrrrr sc@s(eZdZdZddZddZddZdS) r a?Context manager to suppress specified exceptions After the exception is suppressed, execution proceeds with the next statement following the with statement. with suppress(FileNotFoundError): os.remove(somefile) # Execution still resumes here if the file was already removed cGs ||_dSr) _exceptions)r' exceptionsrrrrG)szsuppress.__init__cCsdSrrr&rrrr(,szsuppress.__enter__cCs|dk ot||jSr) issubclassrhrarrrr,/s zsuppress.__exit__NrYrrrrr s rcsfdd}|S)Ncs4|j}||krdS|dks*|kr$q*|}q||_dSr) __context__)new_excold_exc exc_context frame_excrr_fix_exception_context@sz3_make_context_fixer.._fix_exception_contextr)rprqrror_make_context_fixer?s rrcCs<z|dj}|dWn tk r6||d_YnXdS)NrL)rk BaseException) exc_details fixed_ctxrrr_reraise_with_existing_contextOs    rvcCsddS)NcSsdSrr)rlrmrrr[z%_make_context_fixer..rrorrrrrZscCs|\}}}tddS)Nz!raise exc_type, exc_value, exc_tb)exec)rtr)r*Zexc_tbrrrrv_s ) InstanceTypecCst|}|tkr|jS|Sr)rErzrH)objZobj_typerrr _get_typeksr|c@sXeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ dS)r aContext manager for dynamic management of a stack of exit callbacks For example: with ExitStack() as stack: files = [stack.enter_context(open(fname)) for fname in filenames] # All opened files will automatically be closed at the end of # the with statement, even if attempts to open files later # in the list raise an exception cCs t|_dSr)r_exit_callbacksr&rrrrGszExitStack.__init__cCst|}|j|_t|_|S)z?Preserve the context stack by transferring it to a new instance)rEr}r)r' new_stackrrrpop_alls zExitStack.pop_allcs"fdd}|_||dS)z:Helper to correctly register callbacks to __exit__ methodscsf|Srr)rtcmcm_exitrr _exit_wrappersz.ExitStack._push_cm_exit.._exit_wrapperN)__self__push)r'rrrrrr _push_cm_exitszExitStack._push_cm_exitcCsDt|}z |j}Wn tk r2|j|YnX||||S)aRegisters a callback with the standard __exit__ method signature Can suppress exceptions the same way __exit__ methods can. Also accepts any object with an __exit__ method (registering a call to the method instead of the object itself) )r|r,rr}rr)r'exit_cb_type exit_methodrrrrs   zExitStack.pushcs$fdd}|_||S)z\Registers an arbitrary callback and arguments. Cannot suppress exceptions. csdSrr)r)rStbr<callbackr=rrrsz)ExitStack.callback.._exit_wrapper) __wrapped__r)r'rr<r=rrrrrs zExitStack.callbackcCs(t|}|j}||}||||S)zEnters the supplied context manager If successful, also pushes its __exit__ method as a callback and returns the result of the __enter__ method. )r|r,r(r)r'r_cm_type_exitrrrr enter_contexts   zExitStack.enter_contextcCs|ddddS)z$Immediately unwind the context stackN)r,r&rrrrXszExitStack.closecCs|Srrr&rrrr(szExitStack.__enter__c Gs|ddk }td}t|}d}d}|jr|j}z||rNd}d}d}Wq(t}||d|dd}|}Yq(Xq(|rt||o|S)NrrLFT)NNN)rPrQrrr}r`rv) r'rt received_excrprqsuppressed_exc pending_raisecbnew_exc_detailsrrrr,s(    zExitStack.__exit__N) r/r0r1r2rGrrrrrrXr(r,rrrrr ss   cs8eZdZdZfddZddZddZdd ZZS) rz+Backwards compatibility alias for ExitStackcstdttt|dS)Nz*ContextStack has been renamed to ExitStack)r6r7r8superrrGr&rHrrrGszContextStack.__init__cCs ||Sr)r)r'rrrr register_exitszContextStack.register_exitcOs|j|f||Sr)r)r'rr<r=rrrregisterszContextStack.registercCs|Sr)rr&rrrpreserveszContextStack.preserve) r/r0r1r2rGrrr __classcell__rrrrrs  c@s*eZdZdZd ddZddZddZdS) raMContext manager that does no additional processing. Used as a stand-in for a normal context manager, when a particular block of code is only sometimes used with a normal context manager: cm = optional_cm if condition else nullcontext() with cm: # Perform operation, using optional_cm if condition is True NcCs ||_dSr enter_result)r'rrrrrGsznullcontext.__init__cCs|jSrrr&rrrr(sznullcontext.__enter__cGsdSrr)r'excinforrrr,sznullcontext.__exit__)NrYrrrrrs )$r2r3rPr6 collectionsr functoolsr__all__ version_inforZ_abc_ABCABCMetaobjectrr%rr rBrrrZr r r rNrrrvtypesrz ImportErrorrEr|r rrrrrrsT    (H"  qPKd]xx'__pycache__/distro.cpython-38.opt-1.pycnu[U .e@s~dZddlZddlZddlZddlZddlZddlZddlZddlZej ddZ dZ ddiZ dddd Zd diZed Zed Zd dde dfZd@ddZddZdAddZdBddZdCddZdDddZdEdd ZdFd!d"Zd#d$Zd%d&ZdGd'd(Zd)d*Zd+d,Z d-d.Z!d/d0Z"d1d2Z#d3d4Z$d5d6Z%d7d8Z&Gd9d:d:e'Z(Gd;d<dZ+e,d?krze+dS)Ha  The ``distro`` package (``distro`` stands for Linux Distribution) provides information about the Linux distribution it runs on, such as a reliable machine-readable distro ID, or version information. It is the recommended replacement for Python's original :py:func:`platform.linux_distribution` function, but it provides much more functionality. An alternative implementation became necessary because Python 3.5 deprecated this function, and Python 3.8 will remove it altogether. Its predecessor function :py:func:`platform.dist` was already deprecated since Python 2.6 and will also be removed in Python 3.8. Still, there are many cases in which access to OS distribution information is needed. See `Python issue 1322 `_ for more information. NZ UNIXCONFDIRz/etcz os-releaseZolZoracleZrhel)ZenterpriseenterpriseZredhatenterpriseworkstationZredhatenterpriseserverZredhatzA(?:[^)]*\)(.*)\()? *(?:STL )?([\d.+\-a-z]*\d) *(?:esaeler *)?(.+)z(\w+)[-_](release|version)$Zdebian_versionz lsb-releasez oem-releasezsystem-releaseTcCs t|S)a Return information about the current OS distribution as a tuple ``(id_name, version, codename)`` with items as follows: * ``id_name``: If *full_distribution_name* is false, the result of :func:`distro.id`. Otherwise, the result of :func:`distro.name`. * ``version``: The result of :func:`distro.version`. * ``codename``: The result of :func:`distro.codename`. The interface of this function is compatible with the original :py:func:`platform.linux_distribution` function, supporting a subset of its parameters. The data it returns may not exactly be the same, because it uses more data sources than the original function, and that may lead to different data if the OS distribution is not consistent across multiple data sources it provides (there are indeed such distributions ...). Another reason for differences is the fact that the :func:`distro.id` method normalizes the distro ID string to a reliable machine-readable value for a number of popular OS distributions. )_distrolinux_distribution)full_distribution_namer6/usr/lib/python3.8/site-packages/pip/_vendor/distro.pyrasrcCstS)a$ Return the distro ID of the current distribution, as a machine-readable string. For a number of OS distributions, the returned distro ID value is *reliable*, in the sense that it is documented and that it does not change across releases of the distribution. This package maintains the following reliable distro ID values: ============== ========================================= Distro ID Distribution ============== ========================================= "ubuntu" Ubuntu "debian" Debian "rhel" RedHat Enterprise Linux "centos" CentOS "fedora" Fedora "sles" SUSE Linux Enterprise Server "opensuse" openSUSE "amazon" Amazon Linux "arch" Arch Linux "cloudlinux" CloudLinux OS "exherbo" Exherbo Linux "gentoo" GenToo Linux "ibm_powerkvm" IBM PowerKVM "kvmibm" KVM for IBM z Systems "linuxmint" Linux Mint "mageia" Mageia "mandriva" Mandriva Linux "parallels" Parallels "pidora" Pidora "raspbian" Raspbian "oracle" Oracle Linux (and Oracle Enterprise Linux) "scientific" Scientific Linux "slackware" Slackware "xenserver" XenServer "openbsd" OpenBSD "netbsd" NetBSD "freebsd" FreeBSD ============== ========================================= If you have a need to get distros for reliable IDs added into this set, or if you find that the :func:`distro.id` function returns a different distro ID for one of the listed distros, please create an issue in the `distro issue tracker`_. **Lookup hierarchy and transformations:** First, the ID is obtained from the following sources, in the specified order. The first available and non-empty value is used: * the value of the "ID" attribute of the os-release file, * the value of the "Distributor ID" attribute returned by the lsb_release command, * the first part of the file name of the distro release file, The so determined ID value then passes the following transformations, before it is returned by this method: * it is translated to lower case, * blanks (which should not be there anyway) are translated to underscores, * a normalization of the ID is performed, based upon `normalization tables`_. The purpose of this normalization is to ensure that the ID is as reliable as possible, even across incompatible changes in the OS distributions. A common reason for an incompatible change is the addition of an os-release file, or the addition of the lsb_release command, with ID values that differ from what was previously determined from the distro release file name. )ridrrrrr}sKrFcCs t|S)ak Return the name of the current OS distribution, as a human-readable string. If *pretty* is false, the name is returned without version or codename. (e.g. "CentOS Linux") If *pretty* is true, the version and codename are appended. (e.g. "CentOS Linux 7.1.1503 (Core)") **Lookup hierarchy:** The name is obtained from the following sources, in the specified order. The first available and non-empty value is used: * If *pretty* is false: - the value of the "NAME" attribute of the os-release file, - the value of the "Distributor ID" attribute returned by the lsb_release command, - the value of the "" field of the distro release file. * If *pretty* is true: - the value of the "PRETTY_NAME" attribute of the os-release file, - the value of the "Description" attribute returned by the lsb_release command, - the value of the "" field of the distro release file, appended with the value of the pretty version ("" and "" fields) of the distro release file, if available. )rnameprettyrrrrs$rcCs t||S)av Return the version of the current OS distribution, as a human-readable string. If *pretty* is false, the version is returned without codename (e.g. "7.0"). If *pretty* is true, the codename in parenthesis is appended, if the codename is non-empty (e.g. "7.0 (Maipo)"). Some distributions provide version numbers with different precisions in the different sources of distribution information. Examining the different sources in a fixed priority order does not always yield the most precise version (e.g. for Debian 8.2, or CentOS 7.1). The *best* parameter can be used to control the approach for the returned version: If *best* is false, the first non-empty version number in priority order of the examined sources is returned. If *best* is true, the most precise version number out of all examined sources is returned. **Lookup hierarchy:** In all cases, the version number is obtained from the following sources. If *best* is false, this order represents the priority order: * the value of the "VERSION_ID" attribute of the os-release file, * the value of the "Release" attribute returned by the lsb_release command, * the version number parsed from the "" field of the first line of the distro release file, * the version number parsed from the "PRETTY_NAME" attribute of the os-release file, if it follows the format of the distro release files. * the version number parsed from the "Description" attribute returned by the lsb_release command, if it follows the format of the distro release files. )rversionr bestrrrr s)r cCs t|S)a Return the version of the current OS distribution as a tuple ``(major, minor, build_number)`` with items as follows: * ``major``: The result of :func:`distro.major_version`. * ``minor``: The result of :func:`distro.minor_version`. * ``build_number``: The result of :func:`distro.build_number`. For a description of the *best* parameter, see the :func:`distro.version` method. )r version_partsr rrrrsrcCs t|S)a5 Return the major version of the current OS distribution, as a string, if provided. Otherwise, the empty string is returned. The major version is the first part of the dot-separated version string. For a description of the *best* parameter, see the :func:`distro.version` method. )r major_versionrrrrr/s rcCs t|S)a6 Return the minor version of the current OS distribution, as a string, if provided. Otherwise, the empty string is returned. The minor version is the second part of the dot-separated version string. For a description of the *best* parameter, see the :func:`distro.version` method. )r minor_versionrrrrr<s rcCs t|S)a3 Return the build number of the current OS distribution, as a string, if provided. Otherwise, the empty string is returned. The build number is the third part of the dot-separated version string. For a description of the *best* parameter, see the :func:`distro.version` method. )r build_numberrrrrrIs rcCstS)a Return a space-separated list of distro IDs of distributions that are closely related to the current OS distribution in regards to packaging and programming interfaces, for example distributions the current distribution is a derivative from. **Lookup hierarchy:** This information item is only provided by the os-release file. For details, see the description of the "ID_LIKE" attribute in the `os-release man page `_. )rlikerrrrrVsrcCstS)a Return the codename for the release of the current OS distribution, as a string. If the distribution does not have a codename, an empty string is returned. Note that the returned codename is not always really a codename. For example, openSUSE returns "x86_64". This function does not handle such cases in any special way and just returns the string it finds, if any. **Lookup hierarchy:** * the codename within the "VERSION" attribute of the os-release file, if provided, * the value of the "Codename" attribute returned by the lsb_release command, * the value of the "" field of the distro release file. )rcodenamerrrrrgsrcCs t||S)a Return certain machine-readable information items about the current OS distribution in a dictionary, as shown in the following example: .. sourcecode:: python { 'id': 'rhel', 'version': '7.0', 'version_parts': { 'major': '7', 'minor': '0', 'build_number': '' }, 'like': 'fedora', 'codename': 'Maipo' } The dictionary structure and keys are always the same, regardless of which information items are available in the underlying data sources. The values for the various keys are as follows: * ``id``: The result of :func:`distro.id`. * ``version``: The result of :func:`distro.version`. * ``version_parts -> major``: The result of :func:`distro.major_version`. * ``version_parts -> minor``: The result of :func:`distro.minor_version`. * ``version_parts -> build_number``: The result of :func:`distro.build_number`. * ``like``: The result of :func:`distro.like`. * ``codename``: The result of :func:`distro.codename`. For a description of the *pretty* and *best* parameters, see the :func:`distro.version` method. )rinfor rrrrs)rcCstS)z Return a dictionary containing key-value pairs for the information items from the os-release file data source of the current OS distribution. See `os-release file`_ for details about these information items. )ros_release_inforrrrrsrcCstS)z Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the current OS distribution. See `lsb_release command output`_ for details about these information items. )rlsb_release_inforrrrrsrcCstS)z Return a dictionary containing key-value pairs for the information items from the distro release file data source of the current OS distribution. See `distro release file`_ for details about these information items. )rdistro_release_inforrrrrsrcCstS)z Return a dictionary containing key-value pairs for the information items from the distro release file data source of the current OS distribution. )r uname_inforrrrrsrcCs t|S)a Return a single named information item from the os-release file data source of the current OS distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. See `os-release file`_ for details about these information items. )ros_release_attr attributerrrrsrcCs t|S)a Return a single named information item from the lsb_release command output data source of the current OS distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. See `lsb_release command output`_ for details about these information items. )rlsb_release_attrrrrrrsrcCs t|S)a Return a single named information item from the distro release file data source of the current OS distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. See `distro release file`_ for details about these information items. )rdistro_release_attrrrrrrsrcCs t|S)aZ Return a single named information item from the distro release file data source of the current OS distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. )r uname_attrrrrrr src@s eZdZdZddZddZdS)cached_propertyzA version of @property which caches the value. On access, it calls the underlying function and sets the value in `__dict__` so future accesses will not re-call the property. cCs|j|_||_dSN)__name___fname_f)selffrrr__init__"szcached_property.__init__cCs||}|j|j<|Sr!)r$__dict__r#)r%objownerretrrr__get__&szcached_property.__get__N)r" __module__ __qualname____doc__r'r,rrrrr sr c@s2eZdZdZdBddZddZdCdd Zd d ZdDd dZdEddZ dFddZ dGddZ dHddZ dIddZ ddZddZdJddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zed/d0Zed1d2Zed3d4Zed5d6Zed7d8Zed9d:Z ed;d<Z!d=d>Z"ed?d@Z#dAS)KLinuxDistributiona  Provides information about a OS distribution. This package creates a private module-global instance of this class with default initialization arguments, that is used by the `consolidated accessor functions`_ and `single source accessor functions`_. By using default initialization arguments, that module-global instance returns data about the current OS distribution (i.e. the distro this package runs on). Normally, it is not necessary to create additional instances of this class. However, in situations where control is needed over the exact data sources that are used, instances of this class can be created with a specific distro release file, or a specific os-release file, or without invoking the lsb_release command. TcCs.|ptjtt|_|pd|_||_||_dS)ao The initialization method of this class gathers information from the available data sources, and stores that in private instance attributes. Subsequent access to the information items uses these private instance attributes, so that the data sources are read only once. Parameters: * ``include_lsb`` (bool): Controls whether the `lsb_release command output`_ is included as a data source. If the lsb_release command is not available in the program execution path, the data source for the lsb_release command will be empty. * ``os_release_file`` (string): The path name of the `os-release file`_ that is to be used as a data source. An empty string (the default) will cause the default path name to be used (see `os-release file`_ for details). If the specified or defaulted os-release file does not exist, the data source for the os-release file will be empty. * ``distro_release_file`` (string): The path name of the `distro release file`_ that is to be used as a data source. An empty string (the default) will cause a default search algorithm to be used (see `distro release file`_ for details). If the specified distro release file does not exist, or if no default distro release file can be found, the data source for the distro release file will be empty. * ``include_name`` (bool): Controls whether uname command output is included as a data source. If the uname command is not available in the program execution path the data source for the uname command will be empty. Public instance attributes: * ``os_release_file`` (string): The path name of the `os-release file`_ that is actually used as a data source. The empty string if no distro release file is used as a data source. * ``distro_release_file`` (string): The path name of the `distro release file`_ that is actually used as a data source. The empty string if no distro release file is used as a data source. * ``include_lsb`` (bool): The result of the ``include_lsb`` parameter. This controls whether the lsb information will be loaded. * ``include_uname`` (bool): The result of the ``include_uname`` parameter. This controls whether the uname information will be loaded. Raises: * :py:exc:`IOError`: Some I/O issue with an os-release file or distro release file. * :py:exc:`subprocess.CalledProcessError`: The lsb_release command had some issue (other than not being available in the program execution path). * :py:exc:`UnicodeError`: A data source has unexpected characters or uses an unexpected encoding. r1N) ospathjoin _UNIXCONFDIR_OS_RELEASE_BASENAMEos_release_filedistro_release_file include_lsb include_uname)r%r9r7r8r:rrrr'>s H  zLinuxDistribution.__init__cCs dj|dS)z Return repr of all info aeLinuxDistribution(os_release_file={self.os_release_file!r}, distro_release_file={self.distro_release_file!r}, include_lsb={self.include_lsb!r}, include_uname={self.include_uname!r}, _os_release_info={self._os_release_info!r}, _lsb_release_info={self._lsb_release_info!r}, _distro_release_info={self._distro_release_info!r}, _uname_info={self._uname_info!r})r%)formatr;rrr__repr__s zLinuxDistribution.__repr__cCs"|r |n|||fS)z Return information about the OS distribution that is compatible with Python's :func:`platform.linux_distribution`, supporting a subset of its parameters. For details, see :func:`distro.linux_distribution`. )rrr r)r%rrrrrs z$LinuxDistribution.linux_distributioncCsldd}|d}|r ||tS|d}|r8||tS|d}|rP||tS|d}|rh||tSdS)zoReturn the distro ID of the OS distribution, as a string. For details, see :func:`distro.id`. cSs|dd}|||S)N _)lowerreplaceget) distro_idtablerrr normalizesz'LinuxDistribution.id..normalizerdistributor_idr1)rNORMALIZED_OS_IDrNORMALIZED_LSB_IDrNORMALIZED_DISTRO_IDr)r%rErCrrrrs        zLinuxDistribution.idFcCs||dp&|dp&|dp&|d}|rt|dp>|d}|st|dpV|d}|jdd}|rt|d|}|pzdS) zu Return the name of the OS distribution, as a string. For details, see :func:`distro.name`. rrF pretty_name descriptionTr r>r1)rrrrr )r%r rr rrrrs&     zLinuxDistribution.namec Cs|d|d|d||ddd||ddd|dg}d}|r|D]$}|d|dks||dkr\|}q\n|D]}|dkr|}qq|r|r|rd||}|S)z{ Return the version of the OS distribution, as a string. For details, see :func:`distro.version`. version_idreleaserJr1rK.z {0} ({1})) rrr_parse_distro_release_contentrBrcountrr<)r%r r Zversionsr vrrrr s: zLinuxDistribution.versioncCsL|j|d}|rHtd}||}|rH|\}}}||p>d|pDdfSdS)z Return the version of the OS distribution, as a tuple of version numbers. For details, see :func:`distro.version_parts`. rz(\d+)\.?(\d+)?\.?(\d+)?r1)r1r1r1)r recompilematchgroups)r%r Z version_strZ version_regexmatchesmajorminorrrrrrs   zLinuxDistribution.version_partscCs||dS)z Return the major version number of the current distribution. For details, see :func:`distro.major_version`. rrr%r rrrr szLinuxDistribution.major_versioncCs||dS)z Return the minor version number of the current distribution. For details, see :func:`distro.minor_version`. rYrZrrrrszLinuxDistribution.minor_versioncCs||dS)z} Return the build number of the current distribution. For details, see :func:`distro.build_number`. rYrZrrrrszLinuxDistribution.build_numbercCs|dp dS)z Return the IDs of distributions that are like the OS distribution. For details, see :func:`distro.like`. Zid_liker1)rr;rrrr#szLinuxDistribution.likecCs>z |jdWStk r8|dp2|dp2dYSXdS)zp Return the codename of the OS distribution. For details, see :func:`distro.codename`. rr1N)_os_release_infoKeyErrorrrr;rrrr+s  zLinuxDistribution.codenamec CsBt||||t||||||d||dS)z Return certain machine-readable information about the OS distribution. For details, see :func:`distro.info`. )rWrXr)rr rrr)dictrr rrrrr)r%r r rrrr:s zLinuxDistribution.infocCs|jS)z Return a dictionary containing key-value pairs for the information items from the os-release file data source of the OS distribution. For details, see :func:`distro.os_release_info`. )r]r;rrrrMsz!LinuxDistribution.os_release_infocCs|jS)z Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the OS distribution. For details, see :func:`distro.lsb_release_info`. )_lsb_release_infor;rrrrVsz"LinuxDistribution.lsb_release_infocCs|jS)z Return a dictionary containing key-value pairs for the information items from the distro release file data source of the OS distribution. For details, see :func:`distro.distro_release_info`. )_distro_release_infor;rrrr`sz%LinuxDistribution.distro_release_infocCs|jS)z Return a dictionary containing key-value pairs for the information items from the uname command data source of the OS distribution. For details, see :func:`distro.uname_info`. ) _uname_infor;rrrrjszLinuxDistribution.uname_infocCs|j|dS)z Return a single named information item from the os-release file data source of the OS distribution. For details, see :func:`distro.os_release_attr`. r1)r]rBr%rrrrrssz!LinuxDistribution.os_release_attrcCs|j|dS)z Return a single named information item from the lsb_release command output data source of the OS distribution. For details, see :func:`distro.lsb_release_attr`. r1)r`rBrcrrrr|sz"LinuxDistribution.lsb_release_attrcCs|j|dS)z Return a single named information item from the distro release file data source of the OS distribution. For details, see :func:`distro.distro_release_attr`. r1)rarBrcrrrrsz%LinuxDistribution.distro_release_attrcCs|j|dS)z Return a single named information item from the uname command output data source of the OS distribution. For details, see :func:`distro.uname_release_attr`. r1)rbrBrcrrrrszLinuxDistribution.uname_attrc Cs:tj|jr6t|j}||W5QRSQRXiS)z Get the information items from the specified os-release file. Returns: A dictionary containing all information items. )r2r3isfiler7open_parse_os_release_content)r%Z release_filerrrr]s z"LinuxDistribution._os_release_infocCsi}tj|dd}d|_tjddkr@t|jtr@|jd|_t|}|D]>}d|krL| dd\}}t|tr||d}||| <qLqLd |kr|d |d <nbd |kr|d |d <nLd |krt d |d }|r| }|d}|d}|}||d <|S)aD Parse the lines of an os-release file. Parameters: * lines: Iterable through the lines in the os-release file. Each line must be a unicode string or a UTF-8 encoded byte string. Returns: A dictionary containing all information items. T)posixrr\z iso-8859-1=r[utf-8Zversion_codenamerZubuntu_codenamer z(\(\D+\))|,(\s+)?\D+z(),)shlexZwhitespace_splitsys version_info isinstanceZ wordcharsbytesdecodelistsplitr@rRsearchgroupstrip)linespropsZlexertokenstokenkrQrrrrrfs4      z+LinuxDistribution._parse_os_release_contentc Csz|js iSttjdB}zd}tj||d}Wn$tk rRiYW5QRSXW5QRX|t  }| |S)z Get the information items from the lsb_release command output. Returns: A dictionary containing all information items. w)Z lsb_releasez-astderr) r9rer2devnull subprocess check_outputOSErrorrprlgetfilesystemencoding splitlines_parse_lsb_release_contentr%r~cmdstdoutZcontentrrrr`s z#LinuxDistribution._lsb_release_infocCsXi}|D]J}|ddd}t|dkr,q|\}}||dd|iq|S)aM Parse the output of the lsb_release command. Parameters: * lines: Iterable through the lines of the lsb_release output. Each line must be a unicode string or a UTF-8 encoded byte string. Returns: A dictionary containing all information items.  :r[r\r>r?)rurrlenupdaterAr@)rvrwlineZkvrzrQrrrrs  z,LinuxDistribution._parse_lsb_release_contentc CspttjdB}zd}tj||d}Wn$tk rHiYW5QRSXW5QRX|t }| |S)Nr{)unamez-rsr|) rer2r~rrrrprlrr_parse_uname_contentrrrrrbs zLinuxDistribution._uname_infocCsTi}td|d}|rP|\}}|dkr4iS||d<||d<||d<|S)Nz^([^\s]+)\s+([\d\.]+)rZLinuxrrrM)rRrsrurUr@)rvrwrTrr rrrrs  z&LinuxDistribution._parse_uname_contentcCs0|jrb||j}tj|j}t|}d|krLd|dkrLd|d<n|r^|d|d<|Szt t }| Wn6t k rddddd d d d d ddddddg}YnX|D]r}|t krqt|}|rtjt |}||}d|kr||_|d|d<d|dkrd|d<|SqiSdS)z Get the information items from the specified distro release file. Returns: A dictionary containing all information items. rZ cloudlinuxrr[z SuSE-releasez arch-releasez base-releasezcentos-releasezfedora-releasezgentoo-releasezmageia-releasezmandrake-releasezmandriva-releasezmandrivalinux-releasezmanjaro-releasezoracle-releasezredhat-releasez sl-releasezslackware-versionN)r8_parse_distro_release_filer2r3basename _DISTRO_RELEASE_BASENAME_PATTERNrTr@rtlistdirr5sortr _DISTRO_RELEASE_IGNORE_BASENAMESr4)r% distro_inforrTZ basenamesfilepathrrrra.s^        z&LinuxDistribution._distro_release_infoc CsRz0t|}||W5QRWSQRXWnttfk rLiYSXdS)z Parse a distro release file. Parameters: * filepath: Path name of the distro release file. Returns: A dictionary containing all information items. N)rerOreadlinerIOError)r%rfprrrrrs  &z,LinuxDistribution._parse_distro_release_filecCst|tr|d}t|ddd}i}|r|dddd|d<|drn|dddd|d<|dr|dddd|d <n|r||d<|S) a Parse a line from a distro release file. Parameters: * line: Line from the distro release file. Must be a unicode string or a UTF-8 encoded byte string. Returns: A dictionary containing all information items. riNrr\rLr[r)rnrorp(_DISTRO_RELEASE_CONTENT_REVERSED_PATTERNrTrurt)rrVrrrrrOs     z/LinuxDistribution._parse_distro_release_contentN)Tr1r1T)T)F)FF)F)F)F)F)FF)$r"r-r.r/r'r=rrrr rrrrrrrrrrrrrrrr r] staticmethodrfr`rrbrrarrOrrrrr0,sV N   "               B     Cr0cCstt}|tj|ttjt j dd}|j ddddd| }|j rn|t jtdd d n:|d td d td d }|d |t}|d|dS)NzOS distro info tool)rKz--jsonz-jz!Output in machine readable format store_true)helpactionT)indentZ sort_keyszName: %sr z Version: %sz Codename: %s)loggingZ getLoggerr"ZsetLevelDEBUGZ addHandlerZ StreamHandlerrlrargparseArgumentParser add_argument parse_argsjsonrdumpsrr r)ZloggerparserargsZdistribution_versionZdistribution_codenamerrrmains$     r__main__)T)F)FF)F)F)F)F)FF)-r/r2rRrlrrkrrrenvironrBr5r6rGrHrIrSrrrrrrr rrrrrrrrrrrrrrrobjectr r0rrr"rrrrsz   N ' ,   ,   } PKd]FV V #__pycache__/__init__.cpython-38.pycnu[U ʗRef@sNdZddlmZddlZddlZddlZdZej ej e Z ddZ erJeeje dejejdd<e de d e d e d e d e d e de de de de de de de de de de de de de de de de de de d e d!e d"e d#e d$e d%e d&e d'e d(e d)e d*e d+e d,e d-e d.e d/e d0e d1e d2e d3e d4e d5e d6e d7e d8e d9e d:e d;e d<e d=e d>e d?e d@e dAe dBdS)Cz pip._vendor is for vendoring dependencies of pip to prevent needing pip to depend on something external. Files inside of pip._vendor should be considered immutable and should only be updated to versions from upstream. )absolute_importNFcCsvdt|}zt|ttddWntk r8Yn:Xtj|tj|<|dd\}}t tj||tj|dS)Nz{0}.{1}r)level.) format__name__ __import__globalslocals ImportErrorsysmodulesrsplitsetattr) modulename vendored_namebaseheadr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/__init__.pyvendoreds  rz*.whl cachecontrolcertifiZcoloramadistlibdistrosixz six.moveszsix.moves.urllibzsix.moves.urllib.parse packagingzpackaging.versionzpackaging.specifierspep517 pkg_resources platformdirsprogressrequestszrequests.exceptionszrequests.packageszrequests.packages.urllib3z&requests.packages.urllib3._collectionsz$requests.packages.urllib3.connectionz(requests.packages.urllib3.connectionpoolz!requests.packages.urllib3.contribz*requests.packages.urllib3.contrib.ntlmpoolz+requests.packages.urllib3.contrib.pyopensslz$requests.packages.urllib3.exceptionsz requests.packages.urllib3.fieldsz"requests.packages.urllib3.filepostz"requests.packages.urllib3.packagesz/requests.packages.urllib3.packages.ordered_dictz&requests.packages.urllib3.packages.sixz5requests.packages.urllib3.packages.ssl_match_hostnamezErequests.packages.urllib3.packages.ssl_match_hostname._implementationz%requests.packages.urllib3.poolmanagerz!requests.packages.urllib3.requestz"requests.packages.urllib3.responsezrequests.packages.urllib3.utilz)requests.packages.urllib3.util.connectionz&requests.packages.urllib3.util.requestz'requests.packages.urllib3.util.responsez$requests.packages.urllib3.util.retryz#requests.packages.urllib3.util.ssl_z&requests.packages.urllib3.util.timeoutz"requests.packages.urllib3.util.url resolvelibrichz rich.consolezrich.highlighterz rich.loggingz rich.markupz rich.progressz rich.segmentz rich.stylez rich.textzrich.tracebacktenacitytomliurllib3)__doc__ __future__rglobos.pathosr DEBUNDLEDpathabspathdirname__file__ WHEEL_DIRrjoinrrrrs $PKd]1EŽ*__pycache__/ipaddress.cpython-38.opt-1.pycnu[U .e7@s`dZddlmZddlZddlZdZefZz eefZWne k rJYnXze Z Wne k rle Z YnXddkrddZ nddZ z ejZWnek rdd ZYnXd d Zeed rd dZnddZdNddZGdddeZdZdZGdddeZGdddeZddZdOddZd d!Zd"d#Zd$d%Z d&d'Z!d(d)Z"d*d+Z#d,d-Z$d.d/Z%d0d1Z&d2d3Z'Gd4d5d5eZ(Gd6d7d7e(Z)Gd8d9d9e(Z*Gd:d;d;eZ+Gdd?d?e,Z-Gd@dAdAe+e*Z.GdBdCdCeZ/e/e,_0GdDdEdEeZ1GdFdGdGe1e)Z2GdHdIdIe2Z3GdJdKdKe1e*Z4GdLdMdMeZ5e5e2_0dS)PzA fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. )unicode_literalsNz1.0.22cCs|SNZbytrr9/usr/lib/python3.8/site-packages/pip/_vendor/ipaddress.py_compat_bytes_to_byte_valssrcCsdd|DS)NcSsg|]}td|dqS)!Br)structunpack.0brrr #sz._compat_bytes_to_byte_vals..rrrrrr"scCsd}|D]}|d>|}q|S)Nrr)Zbytvals endianessresZbvrrr_compat_int_from_byte_vals'srcCst|dkr.|dks|dkr"tdtd|S|dkrj|dksJ|ddkrTtd td |d ?|d @StdS) Nrlz(integer out of range for 'I' format codes!Iz)integer out of range for 'QQ' format codes!QQ@l)r errorpackNotImplementedError)ZintvalZlengthrrrr_compat_to_bytes0s   r bit_lengthcCs|Sr)r)irrr_compat_bit_lengthAsrcCs&tD]}||?dkr|SqdSNr) itertoolscount)rrrrrrDs  ccs |}||kr|V||7}qdSrr)startendsteprrrr _compat_rangeJsr&c@s@eZdZdZddZddZddZdd Zd d Zd d Z dS)_TotalOrderingMixinrcCstdSrrselfotherrrr__eq__Ysz_TotalOrderingMixin.__eq__cCs||}|tkrtS| Sr)r,NotImplemented)r*r+equalrrr__ne__\s z_TotalOrderingMixin.__ne__cCstdSrr(r)rrr__lt__bsz_TotalOrderingMixin.__lt__cCs$||}|tks|s ||S|Srr0r-r,r*r+lessrrr__le__es   z_TotalOrderingMixin.__le__cCs6||}|tkrtS||}|tkr,tS|p2| Srr1)r*r+r3r.rrr__gt__ks  z_TotalOrderingMixin.__gt__cCs||}|tkrtS| Sr)r0r-r2rrr__ge__ts z_TotalOrderingMixin.__ge__N) __name__ __module__ __qualname__ __slots__r,r/r0r4r5r6rrrrr'Rs r' rc@seZdZdZdS)AddressValueErrorz%A Value Error related to the address.Nr7r8r9__doc__rrrrr<sr<c@seZdZdZdS)NetmaskValueErrorz%A Value Error related to the netmask.Nr=rrrrr?sr?c Csnz t|WSttfk r"YnXz t|WSttfk rFYnXt|tr^td|td|dS)aTake an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP address. Either IPv4 or IPv6 addresses may be supplied; integers less than 2**32 will be considered to be IPv4 by default. Returns: An IPv4Address or IPv6Address object. Raises: ValueError: if the *address* passed isn't either a v4 or a v6 address zx%r does not appear to be an IPv4 or IPv6 address. Did you pass in a bytes (str in Python 2) instead of a unicode object?z0%r does not appear to be an IPv4 or IPv6 addressN) IPv4Addressr<r? IPv6Address isinstancebytes ValueErroraddressrrr ip_addresss"   rGTc Csrz t||WSttfk r$YnXz t||WSttfk rJYnXt|trbtd|td|dS)aTake an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP network. Either IPv4 or IPv6 networks may be supplied; integers less than 2**32 will be considered to be IPv4 by default. Returns: An IPv4Network or IPv6Network object. Raises: ValueError: if the string passed isn't either a v4 or a v6 address. Or if the network has host bits set. zx%r does not appear to be an IPv4 or IPv6 network. Did you pass in a bytes (str in Python 2) instead of a unicode object?z0%r does not appear to be an IPv4 or IPv6 networkN) IPv4Networkr<r? IPv6NetworkrBrCrD)rFstrictrrr ip_networks"   rKc CsXz t|WSttfk r"YnXz t|WSttfk rFYnXtd|dS)agTake an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP address. Either IPv4 or IPv6 addresses may be supplied; integers less than 2**32 will be considered to be IPv4 by default. Returns: An IPv4Interface or IPv6Interface object. Raises: ValueError: if the string passed isn't either a v4 or a v6 address. Notes: The IPv?Interface classes describe an Address on a particular Network, so they're basically a combination of both the Address and Network classes. z2%r does not appear to be an IPv4 or IPv6 interfaceN) IPv4Interfacer<r? IPv6InterfacerDrErrr ip_interfaces  rNc Cs6zt|ddWStjtfk r0tdYnXdS)a`Represent an address as 4 packed bytes in network (big-endian) order. Args: address: An integer representation of an IPv4 IP address. Returns: The integer address packed as 4 bytes in network (big-endian) order. Raises: ValueError: If the integer is negative or too large to be an IPv4 IP address. rbigz&Address negative or too large for IPv4Nrr r OverflowErrorrDrErrrv4_int_to_packedsrRc Cs6zt|ddWStjtfk r0tdYnXdS)zRepresent an address as 16 packed bytes in network (big-endian) order. Args: address: An integer representation of an IPv6 IP address. Returns: The integer address packed as 16 bytes in network (big-endian) order. rrOz&Address negative or too large for IPv6NrPrErrrv6_int_to_packeds rScCs*t|d}t|dkr&td||S)zAHelper to split the netmask and raise AddressValueError if needed/rzOnly one '/' permitted in %r) _compat_strsplitlenr<)rFaddrrrr_split_optional_netmasks  rYccsNt|}t|}}|D]&}|j|jdkr:||fV|}|}q||fVdS)zFind a sequence of sorted deduplicated IPv#Address. Args: addresses: a list of IPv#Address objects. Yields: A tuple containing the first and last IP addresses in the sequence. r"N)iternext_ip) addressesitfirstlastiprrr_find_address_ranges   rbcCs$|dkr |St|t||d@S)zCount the number of zero bits on the right hand side. Args: number: an integer. bits: maximum number of bits to count. Returns: The number of zero bits on the right hand side of the number. rr")minr)Znumberbitsrrr_count_righthand_zero_bits2s reccst|trt|tstd|j|jkr8td||f||krHtd|jdkrXt}n|jdkrht}ntd|j}|j}|j}||krt t ||t ||dd}||||f}|V|d|>7}|d|j krqqdS) aSummarize a network range given the first and last IP addresses. Example: >>> list(summarize_address_range(IPv4Address('192.0.2.0'), ... IPv4Address('192.0.2.130'))) ... #doctest: +NORMALIZE_WHITESPACE [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'), IPv4Network('192.0.2.130/32')] Args: first: the first IPv4Address or IPv6Address in the range. last: the last IPv4Address or IPv6Address in the range. Returns: An iterator of the summarized IPv(4|6) network objects. Raise: TypeError: If the first and last objects are not IP addresses. If the first and last objects are not the same version. ValueError: If the last object is not greater than the first. If the version of the first address is not 4 or 6. z1first and last must be IP addresses, not networks%%s and %s are not of the same versionz*last IP address must be greater than firstrzunknown IP versionr"N) rB _BaseAddress TypeErrorversionrDrHrI_max_prefixlenr\rcrer _ALL_ONES)r_r`raZip_bitsZ first_intZlast_intZnbitsnetrrrsummarize_address_rangeBs8      rnccst|}i}|rV|}|}||}|dkr<|||<q ||kr ||=||q d}t|D]$}|dk r|j|jkrqf|V|}qfdS)auLoops through the addresses, collapsing concurrent netblocks. Example: ip1 = IPv4Network('192.0.2.0/26') ip2 = IPv4Network('192.0.2.64/26') ip3 = IPv4Network('192.0.2.128/26') ip4 = IPv4Network('192.0.2.192/26') _collapse_addresses_internal([ip1, ip2, ip3, ip4]) -> [IPv4Network('192.0.2.0/24')] This shouldn't be called directly; it is called via collapse_addresses([]). Args: addresses: A list of IPv4Network's or IPv6Network's Returns: A list of IPv4Network's or IPv6Network's depending on what we were passed. N)listpopsupernetgetappendsortedvaluesbroadcast_address)r]Zto_mergesubnetsrmrqZexistingr`rrr_collapse_addresses_internalys$    rxc Cs0g}g}g}|D]}t|trR|rF|dj|jkrFtd||df||q|j|jkr|r|dj|jkrtd||dfz||jWqtk r||j YqXq|r|dj|jkrtd||df||qt t |}|r$t |D]\}}| t||qt||S)aCollapse a list of IP objects. Example: collapse_addresses([IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/25')]) -> [IPv4Network('192.0.2.0/24')] Args: addresses: An iterator of IPv4Network or IPv6Network objects. Returns: An iterator of the collapsed IPv(4|6)Network objects. Raises: TypeError: If passed a list of mixed version objects. rf)rBrh_versionrirs _prefixlenrkraAttributeErrornetwork_addressrtsetrbextendrnrx)r]ZaddrsZipsZnetsrar_r`rrrcollapse_addressess@     rcCs(t|tr|St|tr$|StS)a2Return a key suitable for sorting between networks and addresses. Address and Network objects are not sortable by default; they're fundamentally different so the expression IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24') doesn't make any sense. There are some times however, where you may wish to have ipaddress sort these for you anyway. If you need to do this, you can use this function as the key= argument to sorted(). Args: obj: either a Network or Address object. Returns: appropriate key. )rB _BaseNetwork_get_networks_keyrh_get_address_keyr-)objrrrget_mixed_type_keys   rc@seZdZdZdZeddZeddZeddZed d Z d d Z d dZ e ddZ e ddZe ddZe ddZe ddZddZdS)_IPAddressBasezThe mother class.rcCs|S)z:Return the longhand version of the IP address as a string.)_explode_shorthand_ip_stringr*rrrexplodedsz_IPAddressBase.explodedcCst|S)z;Return the shorthand version of the IP address as a string.rUrrrr compressedsz_IPAddressBase.compressedcCs|S)aIThe name of the reverse DNS pointer for the IP address, e.g.: >>> ipaddress.ip_address("127.0.0.1").reverse_pointer '1.0.0.127.in-addr.arpa' >>> ipaddress.ip_address("2001:db8::1").reverse_pointer '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa' )_reverse_pointerrrrrreverse_pointer s z_IPAddressBase.reverse_pointercCsdt|f}t|dS)Nz%200s has no version specifiedtyperr*msgrrrrjsz_IPAddressBase.versioncCsF|dkrd}t|||jf||jkrBd}t|||j|jfdS)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)r<rzrlrk)r*rFrrrr_check_int_addresss  z!_IPAddressBase._check_int_addresscCs.t|}||kr*d}t|||||jfdS)Nz~%r (len %d != %d) is not permitted as an IPv%d address. Did you pass in a bytes (str in Python 2) instead of a unicode object?)rWr<rz)r*rFZ expected_lenZ address_lenrrrr_check_packed_address"sz$_IPAddressBase._check_packed_addresscCs|j|j|?AS)zTurn the prefix length into a bitwise netmask Args: prefixlen: An integer, the prefix length. Returns: An integer. )rl)cls prefixlenrrr_ip_int_from_prefix,s z"_IPAddressBase._ip_int_from_prefixc Cs\t||j}|j|}||?}d|>d}||krX|jd}t||d}d}t|||S)aReturn prefix length from the bitwise netmask. Args: ip_int: An integer, the netmask in expanded bitwise format Returns: An integer, the prefix length. Raises: ValueError: If the input intermingles zeroes & ones r"rrOz&Netmask pattern %r mixes zeroes & ones)rerkrrD) rip_intZtrailing_zeroesrZ leading_onesZall_onesZbyteslenZdetailsrrrr_prefix_from_ip_int9s      z"_IPAddressBase._prefix_from_ip_intcCsd|}t|dS)Nz%r is not a valid netmask)r?)rZ netmask_strrrrr_report_invalid_netmaskRsz&_IPAddressBase._report_invalid_netmaskcCshtj|s||z t|}Wntk r@||YnXd|krX|jksdn|||S)a Return prefix length from a numeric string Args: prefixlen_str: The string to be converted Returns: An integer, the prefix length. Raises: NetmaskValueError: If the input is not a valid netmask r)_BaseV4_DECIMAL_DIGITS issupersetrintrDrk)rZ prefixlen_strrrrr_prefix_from_prefix_stringWs    z)_IPAddressBase._prefix_from_prefix_stringcCsz||}Wntk r,||YnXz ||WStk rNYnX||jN}z ||WStk r||YnXdS)aTurn a netmask/hostmask string into a prefix length Args: ip_str: The netmask/hostmask to be converted Returns: An integer, the prefix length. Raises: NetmaskValueError: If the input is not a valid netmask/hostmask N)_ip_int_from_stringr<rrrDrl)rip_strrrrr_prefix_from_ip_stringps   z%_IPAddressBase._prefix_from_ip_stringcCs|jt|ffSr) __class__rUrrrr __reduce__sz_IPAddressBase.__reduce__N)r7r8r9r>r:propertyrrrrjrr classmethodrrrrrrrrrrrs.           !rc@sdeZdZdZdZddZddZddZd d Zd d Z d dZ ddZ ddZ ddZ ddZdS)rhzA generic IP object. This IP class contains the version independent methods which are used by single IP addresses. rcCs|jSrr\rrrr__int__sz_BaseAddress.__int__cCs8z|j|jko|j|jkWStk r2tYSXdSr)r\rzr|r-r)rrrr,s   z_BaseAddress.__eq__cCs`t|tstSt|ts(td||f|j|jkrDtd||f|j|jkr\|j|jkSdSN"%s and %s are not of the same typerfF)rBrr-rhrirzr\r)rrrr0s     z_BaseAddress.__lt__cCs t|tstS|t||SrrB_compat_int_typesr-rrr)rrr__add__s z_BaseAddress.__add__cCs t|tstS|t||Srrr)rrr__sub__s z_BaseAddress.__sub__cCsd|jjt|fSNz%s(%r)rr7rUrrrr__repr__sz_BaseAddress.__repr__cCst||jSr)rU_string_from_ip_intr\rrrr__str__sz_BaseAddress.__str__cCsttt|jSr)hashhexrr\rrrr__hash__sz_BaseAddress.__hash__cCs |j|fSrrzrrrrrsz_BaseAddress._get_address_keycCs|j|jffSr)rr\rrrrrsz_BaseAddress.__reduce__N)r7r8r9r>r:rr,r0rrrrrrrrrrrrhsrhc@sdeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZeddZeddZeddZeddZed d!Zed"d#Zed$d%Zed&d'Zd(d)Zd*d+Zd,d-ZdHd0d1ZdId2d3Zed4d5Zed6d7Zd8d9Z d:d;Z!edd?Z#ed@dAZ$edBdCZ%edDdEZ&edFdGZ'd/S)Jrz~A generic IP network object. This IP class contains the version independent methods which are used by networks. cCs i|_dSr)_cache)r*rFrrr__init__sz_BaseNetwork.__init__cCsd|jjt|fSrrrrrrrsz_BaseNetwork.__repr__cCsd|j|jfSN%s/%d)r}rrrrrrsz_BaseNetwork.__str__ccs8t|j}t|j}t|d|D]}||Vq"dS)zGenerate Iterator over usable hosts in a network. This is like __iter__ except it doesn't return the network or broadcast addresses. r"Nrr}rvr&_address_classr*network broadcastxrrrhostss  z_BaseNetwork.hostsccs8t|j}t|j}t||dD]}||Vq"dSNr"rrrrr__iter__s  z_BaseNetwork.__iter__cCslt|j}t|j}|dkr>|||kr0td|||S|d7}|||krZtd|||SdS)Nrzaddress out of ranger")rr}rv IndexErrorr)r*nrrrrr __getitem__s    z_BaseNetwork.__getitem__cCsxt|tstSt|ts(td||f|j|jkrDtd||f|j|jkr\|j|jkS|j|jkrt|j|jkSdSr)rBrr-rrirzr}netmaskr)rrrr0s"       z_BaseNetwork.__lt__cCsLz.|j|jko,|j|jko,t|jt|jkWStk rFtYSXdSr)rzr}rrr|r-r)rrrr,s  z_BaseNetwork.__eq__cCstt|jt|jASr)rrr}rrrrrrsz_BaseNetwork.__hash__cCsL|j|jkrdSt|trdSt|jt|jkoBt|jkSSdSNF)rzrBrrr}r\rvr)rrr __contains__s  z_BaseNetwork.__contains__cCs(|j|kp&|j|kp&|j|kp&|j|kS)z*Tell if self is partly contained in other.)r}rvr)rrroverlaps*s    z_BaseNetwork.overlapscCs<|jd}|dkr8|t|jt|jB}||jd<|S)Nrv)rrrrrr}hostmaskr*rrrrrv1s   z_BaseNetwork.broadcast_addresscCs8|jd}|dkr4|t|j|jA}||jd<|S)Nr)rrrrrrrlrrrrr:s   z_BaseNetwork.hostmaskcCsd|j|jfSr)r}r{rrrrwith_prefixlenBsz_BaseNetwork.with_prefixlencCsd|j|jfSN%s/%s)r}rrrrr with_netmaskFsz_BaseNetwork.with_netmaskcCsd|j|jfSr)r}rrrrr with_hostmaskJsz_BaseNetwork.with_hostmaskcCst|jt|jdS)z&Number of hosts in the current subnet.r")rrvr}rrrr num_addressesNsz_BaseNetwork.num_addressescCsdt|f}t|dS)Nz%%200s has no associated address classrrrrrrSsz_BaseNetwork._address_classcCs|jSr)r{rrrrr[sz_BaseNetwork.prefixlenccs|j|jkstd||ft|ts2td|||sLtd||f||krXdS|d|j|jf}| \}}||kr||kr||r|V| \}}qz||r|V| \}}qzt d|||fqz||kr|Vn"||kr|Vnt d|||fdS)aRemove an address from a larger block. For example: addr1 = ip_network('192.0.2.0/28') addr2 = ip_network('192.0.2.1/32') list(addr1.address_exclude(addr2)) = [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'), IPv4Network('192.0.2.4/30'), IPv4Network('192.0.2.8/29')] or IPv6: addr1 = ip_network('2001:db8::1/32') addr2 = ip_network('2001:db8::1/128') list(addr1.address_exclude(addr2)) = [ip_network('2001:db8::1/128'), ip_network('2001:db8::2/127'), ip_network('2001:db8::4/126'), ip_network('2001:db8::8/125'), ... ip_network('2001:db8:8000::/33')] Args: other: An IPv4Network or IPv6Network object of the same type. Returns: An iterator of the IPv(4|6)Network objects which is self minus other. Raises: TypeError: If self and other are of differing address versions, or if other is not a network object. ValueError: If other is not completely contained by self. rfz%s is not a network objectz%s not contained in %sNrz3Error performing exclusion: s1: %s s2: %s other: %s) rzrirBr subnet_ofrDrr}rrwAssertionError)r*r+s1s2rrraddress_exclude_s@$        z_BaseNetwork.address_excludecCs`|j|jkrtd||f|j|jkr,dS|j|jkr other eg: IPv4Network('192.0.2.128/25') > IPv4Network('192.0.2.0/25') IPv6Network('2001:db8::2000/124') > IPv6Network('2001:db8::1000/124') Raises: TypeError if the IP versions are different. rryr"r)rzrir}rr)rrrcompare_networkss!     z_BaseNetwork.compare_networkscCs|j|j|jfS)zNetwork-only key function. Returns an object that identifies this address' network and netmask. This function is a suitable "key" argument for sorted() and list.sort(). )rzr}rrrrrrsz_BaseNetwork._get_networks_keyr"Nc cs|j|jkr|VdS|dk rJ||jkr0td|dkr@td||j}|dkrZtd|j|}||jkr~td||ft|j}t|jd}t|jd|?}t|||D]}|||f}|VqdS)aThe subnets which join to make the current subnet. In the case that self contains only one IP (self._prefixlen == 32 for IPv4 or self._prefixlen == 128 for IPv6), yield an iterator with just ourself. Args: prefixlen_diff: An integer, the amount the prefix length should be increased by. This should not be set if new_prefix is also set. new_prefix: The desired new prefix length. This must be a larger number (smaller prefix) than the existing prefix. This should not be set if prefixlen_diff is also set. Returns: An iterator of IPv(4|6) objects. Raises: ValueError: The prefixlen_diff is too small or too large. OR prefixlen_diff and new_prefix are both set or new_prefix is a smaller number than the current prefix (smaller number means a larger network) Nznew prefix must be longerr"(cannot set prefixlen_diff and new_prefixrzprefix length diff must be > 0z0prefix length diff %d is invalid for netblock %s) r{rkrDrr}rvrr&r) r*prefixlen_diff new_prefix new_prefixlenr#r$r%Znew_addrZcurrentrrrrws2      z_BaseNetwork.subnetscCs|jdkr|S|dk rB||jkr(td|dkr8td|j|}|j|}|dkrftd|j|f|t|jt|j|>@|fS)aThe supernet containing the current network. Args: prefixlen_diff: An integer, the amount the prefix length of the network should be decreased by. For example, given a /24 network and a prefixlen_diff of 3, a supernet with a /21 netmask is returned. Returns: An IPv4 network object. Raises: ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have a negative prefix length. OR If prefixlen_diff and new_prefix are both set or new_prefix is a larger number than the current prefix (larger number means a smaller network) rNznew prefix must be shorterr"rz;current prefixlen is %d, cannot have a prefixlen_diff of %d)r{rDrrrr}r)r*rrrrrrrqs&    z_BaseNetwork.supernetcCs|jjo|jjSzTest if the address is reserved for multicast use. Returns: A boolean, True if the address is a multicast address. See RFC 2373 2.7 for details. )r} is_multicastrvrrrrrAs z_BaseNetwork.is_multicastcCs^z4|j|jkrtd|||j|jko2|j|jkWStk rXtd||fYnXdS)Nrfz3Unable to test subnet containment between %s and %s)rzrir}rvr|)ar rrr _is_subnet_ofMs   z_BaseNetwork._is_subnet_ofcCs |||S)z1Return True if this network is a subnet of other.rr)rrrrYsz_BaseNetwork.subnet_ofcCs |||S)z3Return True if this network is a supernet of other.rr)rrr supernet_of]sz_BaseNetwork.supernet_ofcCs|jjo|jjS)Test if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within one of the reserved IPv6 Network ranges. )r} is_reservedrvrrrrras z_BaseNetwork.is_reservedcCs|jjo|jjSzTest if the address is reserved for link-local. Returns: A boolean, True if the address is reserved per RFC 4291. )r} is_link_localrvrrrrrmsz_BaseNetwork.is_link_localcCs|jjo|jjS)zTest if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per iana-ipv4-special-registry or iana-ipv6-special-registry. )r} is_privatervrrrrrxs z_BaseNetwork.is_privatecCs|j S)zTest if this address is allocated for public networks. Returns: A boolean, True if the address is not reserved per iana-ipv4-special-registry or iana-ipv6-special-registry. rrrrr is_globals z_BaseNetwork.is_globalcCs|jjo|jjS)Test if the address is unspecified. Returns: A boolean, True if this is the unspecified address as defined in RFC 2373 2.5.2. )r}is_unspecifiedrvrrrrrs z_BaseNetwork.is_unspecifiedcCs|jjo|jjS)Test if the address is a loopback address. Returns: A boolean, True if the address is a loopback address as defined in RFC 2373 2.5.3. )r} is_loopbackrvrrrrrs z_BaseNetwork.is_loopback)r"N)r"N)(r7r8r9r>rrrrrrr0r,rrrrrvrrrrrrrrrrrwrqr staticmethodrrrrrrrrrrrrrrsf           K0 5 (       rc @seZdZdZdZdZdedZedZ eddd d d d d ddg Z eZ iZ ddZ eddZeddZeddZeddZddZddZeddZed d!Zd"S)#rzyBase IPv4 object. The following methods are used by IPv4 objects in both single IP addresses and networks. rrrr" 0123456789rrcCst|Srrrrrrrsz$_BaseV4._explode_shorthand_ip_stringcCsn||jkrdt|tr|}n.z||}Wntk rF||}YnXt||}||f|j|<|j|SaMake a (netmask, prefix_len) tuple from the given argument. Argument can be: - an integer (the prefix length) - a string representing the prefix length (e.g. "24") - a string representing the prefix netmask (e.g. "255.255.255.0") )_netmask_cacherBrrr?rr@rrargrrrrr _make_netmasks  z_BaseV4._make_netmaskc Csz|s td|d}t|dkr.td|ztt|j|dWStk rt}ztd||fW5d}~XYnXdS)aTurn the given IP string into an integer for comparison. Args: ip_str: A string, the IP ip_str. Returns: The IP ip_str as an integer. Raises: AddressValueError: if ip_str isn't a valid IPv4 Address. Address cannot be empty.rzExpected 4 octets in %rrO%s in %rN)r<rVrWrmap _parse_octetrD)rrZoctetsexcrrrrs    z_BaseV4._ip_int_from_stringcCs|s td|j|s(d}t||t|dkrDd}t||t|d}|dkrr|ddkrrd }t|||d krtd ||S) a Convert a decimal octet into an integer. Args: octet_str: A string, the number to parse. Returns: The octet as an integer. Raises: ValueError: if the octet isn't strictly a decimal from [0..255]. zEmpty octet not permittedz#Only decimal digits permitted in %rz$At most 3 characters permitted in %r r0z3Ambiguous (octal/decimal) value in %r not permittedrzOctet %d (> 255) not permitted)rDrrrWr)rZ octet_strrZ octet_intrrrrs       z_BaseV4._parse_octetcCsdddt|ddDS)zTurns a 32-bit integer into dotted decimal notation. Args: ip_int: An integer, the IP address. Returns: The IP address as a string in dotted decimal notation. rcss0|](}tt|tr"td|dn|VqdS)rrN)rUrBrCr r r rrr %s z._BaseV4._string_from_ip_int..rrO)joinr)rrrrrrs  z_BaseV4._string_from_ip_intcsj|d}zfddtt|D}Wntk r<YdSXt|t|krRdS|d|dkrfdSdS)zTest if the IP string is a hostmask (rather than a netmask). Args: ip_str: A string, the potential hostmask. Returns: A boolean, True if the IP string is a hostmask. rcsg|]}|jkr|qSr)_valid_mask_octetsr rrrrr6s z(_BaseV4._is_hostmask..FrryT)rVrrrDrW)r*rrdpartsrrr _is_hostmask*s z_BaseV4._is_hostmaskcCs&t|dddd}d|dS)zReturn the reverse DNS pointer name for the IPv4 address. This implements the method described in RFC1035 3.5. rNryz .in-addr.arpa)rUrVr)r*Zreverse_octetsrrrr?sz_BaseV4._reverse_pointercCs|jSrrkrrrr max_prefixlenHsz_BaseV4.max_prefixlencCs|jSrrrrrrrjLsz_BaseV4.versionN)r7r8r9r>r:rz IPV4LENGTHrl frozensetrrrkrrrrrrrr rrr rjrrrrrs.    $   rc@s|eZdZdZdZddZeddZeddZed d Z ed d Z ed dZ eddZ eddZ eddZdS)r@z/Represent and manipulate single IPv4 Addresses.r\ __weakref__cCsxt|tr||||_dSt|trL||dt|}t|d|_dSt|}d|krht d|| ||_dS)a Args: address: A string or integer representing the IP Additionally, an integer can be passed, so IPv4Address('192.0.2.1') == IPv4Address(3221225985). or, more generally IPv4Address(int(IPv4Address('192.0.2.1'))) == IPv4Address('192.0.2.1') Raises: AddressValueError: If ipaddress isn't a valid IPv4 address. NrrOrTUnexpected '/' in %r rBrrr\rCrrrrUr<rr*rFZbvsZaddr_strrrrrWs      zIPv4Address.__init__cCs t|jSz*The binary representation of this address.)rRr\rrrrpacked{szIPv4Address.packedcCs ||jjkS)zTest if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within the reserved IPv4 Network range. ) _constants_reserved_networkrrrrrs zIPv4Address.is_reservedcstfddjjDS)zTest if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per iana-ipv4-special-registry. c3s|]}|kVqdSrrr rmrrrrsz)IPv4Address.is_private..anyr_private_networksrrrrrs zIPv4Address.is_privatecCs||jjko|j Sr)r_public_networkrrrrrrs zIPv4Address.is_globalcCs ||jjkS)zTest if the address is reserved for multicast use. Returns: A boolean, True if the address is multicast. See RFC 3171 for details. r_multicast_networkrrrrrs zIPv4Address.is_multicastcCs ||jjkS)zTest if the address is unspecified. Returns: A boolean, True if this is the unspecified address as defined in RFC 5735 3. )r_unspecified_addressrrrrrs zIPv4Address.is_unspecifiedcCs ||jjkS)zTest if the address is a loopback address. Returns: A boolean, True if the address is a loopback per RFC 3330. )r_loopback_networkrrrrrszIPv4Address.is_loopbackcCs ||jjkS)zTest if the address is reserved for link-local. Returns: A boolean, True if the address is link-local per RFC 3927. r_linklocal_networkrrrrrszIPv4Address.is_link_localN)r7r8r9r>r:rrrrrrrrrrrrrrr@Qs&$       r@c@sjeZdZddZddZddZddZd d Zej Z e d d Z e d dZ e ddZ e ddZdS)rLcCst|ttfr2t||t|j|_|j|_ dSt|t rt||dt |dkrht |d|_ n|j|_ t|dd|_|jj |_ |jj|_dSt|}t||dt|dd|_|jj |_ |jj |_ |jj|_dSNrr"F)rJ)rBrCrr@rrHr\rrkr{tuplerWrrrrYr*rFrXrrrrs(        zIPv4Interface.__init__cCsd||j|jjfSrrr\rrrrrrrs zIPv4Interface.__str__cCsFt||}|r|tkr|Sz|j|jkWStk r@YdSXdSr)r@r,r-rr|r*r+Z address_equalrrrr,s  zIPv4Interface.__eq__cCsRt||}|tkrtSz|j|jkp4|j|jko4|WStk rLYdSXdSr)r@r0r-rr|r*r+Z address_lessrrrr0s  zIPv4Interface.__lt__cCs|j|jAt|jjASrr\r{rrr}rrrrrszIPv4Interface.__hash__cCs t|jSr)r@r\rrrrraszIPv4Interface.ipcCsd||j|jfSrrr\r{rrrrr s zIPv4Interface.with_prefixlencCsd||j|jfSrrr\rrrrrrs zIPv4Interface.with_netmaskcCsd||j|jfSrrr\rrrrrrs zIPv4Interface.with_hostmaskN)r7r8r9rrr,r0rrrrrarrrrrrrrLs     rLc@s*eZdZdZeZdddZeddZdS) rHaeThis class represents and manipulates 32-bit IPv4 network + addresses.. Attributes: [examples for IPv4Network('192.0.2.0/27')] .network_address: IPv4Address('192.0.2.0') .hostmask: IPv4Address('0.0.0.31') .broadcast_address: IPv4Address('192.0.2.32') .netmask: IPv4Address('255.255.255.224') .prefixlen: 27 TcCs|t||t|ttfrr@rrrrrrrrrHs   UrHc@seZdZedZedZedZedZededededededed ed ed ed ed edededgZedZ e dZ dS)_IPv4Constantsz169.254.0.0/16z 127.0.0.0/8z 224.0.0.0/4r0z 0.0.0.0/8z 10.0.0.0/8z 172.16.0.0/12z 192.0.0.0/29z192.0.0.170/31z 192.0.2.0/24z192.168.0.0/16z 198.18.0.0/15z198.51.100.0/24z203.0.113.0/24z 240.0.0.0/4z255.255.255.255/32z0.0.0.0N) r7r8r9rHr#r!rrrrr@r rrrrr1s*r1c@seZdZdZdZdZdedZdZe dZ eZ iZ e dd Ze d d Ze d d Ze ddZe dddZddZddZeddZeddZdS)_BaseV6zyBase IPv6 object. The following methods are used by IPv6 objects in both single IP addresses and networks. rrgrr"rZ0123456789ABCDEFabcdefcCsJ||jkr@t|tr|}n ||}t||}||f|j|<|j|Sr)rrBrrrArrrrrrs   z_BaseV6._make_netmaskc Cs|s td|d}d}t||kr:d||f}t|d|dkrzt|j}Wn2tk r}ztd||fW5d}~XYnX|d |d ?d @|d |d @|jd }t||krd |d |f}t|d}td t|d D]*} || s|dk rd|}t|| }q|dk r|} t||d } |dsj| d 8} | rjd}t|||ds| d 8} | rd}t|||j| | } | d kr0d}t||jd |fnjt||jkrd}t||j|f|dsd}t|||ds d}t||t|} d} d} znd} t | D] } | d K} | | || O} q>| d | K} t | dD] } | d K} | | || O} qx| WSt k r}ztd||fW5d}~XYnXdS)zTurn an IPv6 ip_str into an integer. Args: ip_str: A string, the IPv6 ip_str. Returns: An int, the IPv6 address Raises: AddressValueError: if ip_str isn't a valid IPv6 Address. r:rz At least %d parts expected in %rrryrN%xrr"z!At most %d colons permitted in %rz At most one '::' permitted in %rrz0Leading ':' only permitted as part of '::' in %rz1Trailing ':' only permitted as part of '::' in %rz/Expected at most %d other parts with '::' in %rz,Exactly %d parts expected without '::' in %r) r<rVrWr@rpr\rs _HEXTET_COUNTr&range _parse_hextetrD)rrr Z _min_partsrZipv4_intrZ _max_partsZ skip_indexrZparts_hiZparts_loZ parts_skippedrrrrrs    "               z_BaseV6._ip_int_from_stringcCs>|j|std|t|dkr4d}t||t|dS)a&Convert an IPv6 hextet string into an integer. Args: hextet_str: A string, the number to parse. Returns: The hextet as an integer. Raises: ValueError: if the input isn't strictly a hex number from [0..FFFF]. zOnly hex digits permitted in %rrz$At most 4 characters permitted in %rr) _HEX_DIGITSrrDrWr)rZ hextet_strrrrrr8>s     z_BaseV6._parse_hextetc Csd}d}d}d}t|D]>\}}|dkrN|d7}|dkr<|}||krV|}|}qd}d}q|dkr||}|t|kr~|dg7}dg|||<|dkrdg|}|S)aCompresses a list of hextets. Compresses a list of strings, replacing the longest continuous sequence of "0" in the list with "" and adding empty strings at the beginning or at the end of the string such that subsequently calling ":".join(hextets) will produce the compressed version of the IPv6 address. Args: hextets: A list of strings, the hextets to compress. Returns: A list of strings. ryrrr") enumeraterW) rhextetsZbest_doublecolon_startZbest_doublecolon_lenZdoublecolon_startZdoublecolon_lenindexZhextetZbest_doublecolon_endrrr_compress_hextetsXs0   z_BaseV6._compress_hextetsNcsZ|dkrt|j}||jkr$tdd|fddtdddD}||}d |S) a,Turns a 128-bit integer into hexadecimal notation. Args: ip_int: An integer, the IP address. Returns: A string, the hexadecimal representation of the address. Raises: ValueError: The address is bigger than 128 bits of all ones. NzIPv6 address is too large%032xcs&g|]}dt||ddqS)r4rr)rr Zhex_strrrrsz/_BaseV6._string_from_ip_int..rr;rr3)rr\rlrDr7r>r)rrr<rr@rrs   z_BaseV6._string_from_ip_intcst|trt|j}nt|tr,t|j}nt|}||}d|fddtdddD}t|ttfrdd ||j fSd |S) zExpand a shortened IPv6 address. Args: ip_str: A string, the IPv6 address. Returns: A string, the expanded IPv6 address. r?csg|]}||dqS)rrr r@rrrsz8_BaseV6._explode_shorthand_ip_string..rr;rrr3) rBrIrUr}rMrarr7rrr{)r*rrr rr@rrs     z$_BaseV6._explode_shorthand_ip_stringcCs&|jddddd}d|dS)zReturn the reverse DNS pointer name for the IPv6 address. This implements the method described in RFC3596 2.5. Nryr3r:rz .ip6.arpa)rreplacer)r*Z reverse_charsrrrrsz_BaseV6._reverse_pointercCs|jSrr rrrrr sz_BaseV6.max_prefixlencCs|jSrrrrrrrjsz_BaseV6.version)N)r7r8r9r>r:rz IPV6LENGTHrlr6rr9rkrrrrr8r>rrrrr rjrrrrr2s0   h  /   r2c@seZdZdZdZddZeddZeddZed d Z ed d Z ed dZ eddZ eddZ eddZeddZeddZeddZeddZdS)rAz/Represent and manipulate single IPv6 Addresses.rcCsxt|tr||||_dSt|trL||dt|}t|d|_dSt|}d|krht d|| ||_dS)aInstantiate a new IPv6 address object. Args: address: A string or integer representing the IP Additionally, an integer can be passed, so IPv6Address('2001:db8::') == IPv6Address(42540766411282592856903984951653826560) or, more generally IPv6Address(int(IPv6Address('2001:db8::'))) == IPv6Address('2001:db8::') Raises: AddressValueError: If address isn't a valid IPv6 address. NrrOrTrrrrrrrs      zIPv6Address.__init__cCs t|jSr)rSr\rrrrrszIPv6Address.packedcCs ||jjkSrrrrrrrs zIPv6Address.is_multicastcstfddjjDS)rc3s|]}|kVqdSrrr rrrrsz*IPv6Address.is_reserved..)rr_reserved_networksrrrrrs zIPv6Address.is_reservedcCs ||jjkSrr"rrrrrszIPv6Address.is_link_localcCs ||jjkSa`Test if the address is reserved for site-local. Note that the site-local address space has been deprecated by RFC 3879. Use is_private to test if this address is in the space of unique local addresses as defined by RFC 4193. Returns: A boolean, True if the address is reserved per RFC 3513 2.5.6. )r_sitelocal_networkrrrr is_site_locals zIPv6Address.is_site_localcstfddjjDS)zTest if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per iana-ipv6-special-registry. c3s|]}|kVqdSrrrrrrr3sz)IPv6Address.is_private..rrrrrr*s zIPv6Address.is_privatecCs|j S)zTest if this address is allocated for public networks. Returns: A boolean, true if the address is not reserved per iana-ipv6-special-registry. rrrrrr5s zIPv6Address.is_globalcCs |jdkS)rrrrrrrr@s zIPv6Address.is_unspecifiedcCs |jdkS)rr"rrrrrrKs zIPv6Address.is_loopbackcCs |jd?dkrdSt|jd@S)zReturn the IPv4 mapped address. Returns: If the IPv6 address is a v4 mapped address, return the IPv4 mapped address. Return None otherwise. r;r5Nr\r@rrrr ipv4_mappedVs zIPv6Address.ipv4_mappedcCs4|jd?dkrdSt|jd?d@t|jd@fS)zTuple of embedded teredo IPs. Returns: Tuple of the (server, client) IPs or None if the address doesn't appear to be a teredo address (doesn't start with 2001::/32) `i NrrGrHrrrrteredocs zIPv6Address.teredocCs$|jd?dkrdSt|jd?d@S)zReturn the IPv4 6to4 embedded address. Returns: The IPv4 6to4-embedded address if present or None if the address doesn't appear to contain a 6to4 embedded address. pi NPrGrHrrrr sixtofourrs zIPv6Address.sixtofourN)r7r8r9r>r:rrrrrrrFrrrrrIrKrNrrrrrAs6%           rAc@seZdZddZddZddZddZd d Zej Z e d d Z e d dZ e ddZ e ddZe ddZe ddZdS)rMcCst|ttfr2t||t|j|_|j|_ dSt|t rt||dt |dkrht |d|_ n|j|_ t|dd|_|jj |_ |jj|_dSt|}t||dt|dd|_|jj |_ |jj |_ |jj|_dSr$)rBrCrrArrIr\rrkr{r%rWrrrrYr&rrrrs(        zIPv6Interface.__init__cCsd||j|jjfSrr'rrrrrs zIPv6Interface.__str__cCsFt||}|r|tkr|Sz|j|jkWStk r@YdSXdSr)rAr,r-rr|r(rrrr,s  zIPv6Interface.__eq__cCsRt||}|tkrtSz|j|jkp4|j|jko4|WStk rLYdSXdSr)rAr0r-rr|r)rrrr0s  zIPv6Interface.__lt__cCs|j|jAt|jjASrr*rrrrrszIPv6Interface.__hash__cCs t|jSr)rAr\rrrrraszIPv6Interface.ipcCsd||j|jfSrr+rrrrrs zIPv6Interface.with_prefixlencCsd||j|jfSrr,rrrrrs zIPv6Interface.with_netmaskcCsd||j|jfSrr-rrrrrs zIPv6Interface.with_hostmaskcCs|jdko|jjSr)r\rrrrrrrszIPv6Interface.is_unspecifiedcCs|jdko|jjSr)r\rrrrrrrszIPv6Interface.is_loopbackN)r7r8r9rrr,r0rrrrrarrrrrrrrrrMs$       rMc@s2eZdZdZeZd ddZddZeddZ d S) rIavThis class represents and manipulates 128-bit IPv6 networks. Attributes: [examples for IPv6('2001:db8::1000/124')] .network_address: IPv6Address('2001:db8::1000') .hostmask: IPv6Address('::f') .broadcast_address: IPv6Address('2001:db8::100f') .netmask: IPv6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0') .prefixlen: 124 TcCs|t||t|ttfrrArrrrrFrrrrrIs   O rIc@seZdZedZedZededededededed ed ed edg Zed ed edededededededededededededgZedZdS)_IPv6Constantsz fe80::/10zff00::/8z::1/128z::/128z ::ffff:0:0/96z100::/64z 2001::/23z 2001:2::/48z 2001:db8::/32z 2001:10::/28zfc00::/7z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z fec0::/10N) r7r8r9rIr#rrrCrErrrrrOR s< rO)r")T)6r>Z __future__rr r __version__rrZlong NameErrorZunicoderUstrr from_bytesrr|rhasattrrr&objectr'rrBrDr<r?rGrKrNrRrSrYrbrernrxrrrrhrrr@rLrHr1rr2rArMrIrOrrrrs        )$ $#716=X*vSr 5W{!PKd]+Vk'AA*__pycache__/pyparsing.cpython-38.opt-1.pycnu[U .e,s@sdZdZdZdZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZddlZdd lmZzdd lmZWn ek rdd lmZYnXzdd lmZWn ek rdd lmZYnXz dd lmZddlmZm Z Wn2ek rNdd l mZddl mZm Z YnXzddl m!Z"WnBek rzddl#m!Z"Wnek rdZ"YnXYnXzddlm$Z$Wn$ek rGdddZ$YnXe$Z%de%_de%_&e$Z'de'_de'_(de'_)de'_*de'_+de'_,dddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dddddddddddgsZ-e.e j/ddZ0e0ddkZ1e1rVe j2Z3e4Z5e6Z7e4Z8e4Z9e:e;ee.e?e@eAeBeCg ZDn`e jEZ3eFZGddZ9gZDddlHZHdID]8ZJzeDKeLeHeJWneMk rYq|YnXq|eNddeGdDZOddZPejQejRZSdZTeTdZUeSeTZVe6dZWdXddejYDZZdYddZ[Gdd4d4e\Z]Gdd6d6e]Z^Gdd8d8e]Z_Gdd:d:e_Z`Gdd=d=e\ZaGdddebZcGdd9d9ebZdeeedddQZfddbZgdd_ZhddZiddZjddZkddiZldZddZmGdd;d;ebZnGdddenZoGddCdCenZpGdd#d#epZqGdd.d.epZrGdd+d+epZsGdddesZtesZuesen_vGdd(d(epZwGdddesZxGdddewZyGdddepZzGddFdFepZ{Gddde{Z|GddJdJe|Z}Gdd>d>epZ~Gdd<dddeZejjjejjjejjjej_e1 rXeed?ejeed@ejeedAejeedBejeedCejeedDejeejdEejjeejdFejjeejdGejjeedHejeedIejeedJejedKkrexdLZexdMZe{eSeVdNZeedOddPeZeeedQZdReBZeedOddPeZeeedSZedTedQeedSZedUejdVejdVejdWddlZejeejejdXdS(aa pyparsing module - Classes and methods to define and execute parsing grammars ============================================================================= The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new syntax for defining grammars or matching expressions - the parsing module provides a library of classes that you use to construct the grammar directly in Python. Here is a program to parse "Hello, World!" (or any greeting of the form ``", !"``), built up using :class:`Word`, :class:`Literal`, and :class:`And` elements (the :class:`'+'` operators create :class:`And` expressions, and the strings are auto-converted to :class:`Literal` expressions):: from pip._vendor.pyparsing import Word, alphas # define grammar of a greeting greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] The Python representation of the grammar is quite readable, owing to the self-explanatory class names, and the use of '+', '|' and '^' operators. The :class:`ParseResults` object returned from :class:`ParserElement.parseString` can be accessed as a nested list, a dictionary, or an object with named attributes. The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - quoted strings - embedded comments Getting Started - ----------------- Visit the classes :class:`ParserElement` and :class:`ParseResults` to see the base classes that most other pyparsing classes inherit from. Use the docstrings for examples of how to: - construct literal match expressions from :class:`Literal` and :class:`CaselessLiteral` classes - construct character word-group expressions using the :class:`Word` class - see how to create repetitive expressions using :class:`ZeroOrMore` and :class:`OneOrMore` classes - use :class:`'+'`, :class:`'|'`, :class:`'^'`, and :class:`'&'` operators to combine simple expressions into more complex ones - associate names with your parsed results using :class:`ParserElement.setResultsName` - access the parsed data, which is returned as a :class:`ParseResults` object - find some helpful expression short-cuts like :class:`delimitedList` and :class:`oneOf` - find more useful common expressions in the :class:`pyparsing_common` namespace class z2.4.2z29 Jul 2019 02:58 UTCz*Paul McGuire N)ref)datetime) itemgetter)wraps) filterfalse) ifilterfalse)RLock)Iterable)MutableMappingMapping) OrderedDict)SimpleNamespacec@s eZdZdS)r N)__name__ __module__ __qualname__rr9/usr/lib/python3.8/site-packages/pip/_vendor/pyparsing.pyr sr aA A cross-version compatibility configuration for pyparsing features that will be released in a future version. By setting values in this configuration to True, those features can be enabled in prior versions for compatibility development and testing. - collect_all_And_tokens - flag to enable fix for Issue #63 that fixes erroneous grouping of results names when an And expression is nested within an Or or MatchFirst; set to True to enable bugfix released in pyparsing 2.3.0, or False to preserve pre-2.3.0 handling of named results Ta Diagnostic configuration (all default to False) - warn_multiple_tokens_in_named_alternation - flag to enable warnings when a results name is defined on a MatchFirst or Or expression with one or more And subexpressions (only warns if __compat__.collect_all_And_tokens is False) - warn_ungrouped_named_tokens_in_collection - flag to enable warnings when a results name is defined on a containing expression with ungrouped subexpressions that also have results names - warn_name_set_on_empty_Forward - flag to enable warnings whan a Forward is defined with a results name, but has no contents defined - warn_on_multiple_string_args_to_oneof - flag to enable warnings whan oneOf is incorrectly called with multiple str arguments - enable_debug_on_named_expressions - flag to auto-enable debug on all subsequent calls to ParserElement.setName() F __version____versionTime__ __author__ __compat____diag__AndCaselessKeywordCaselessLiteral CharsNotInCombineDictEachEmpty FollowedByForward GoToColumnGroupKeywordLineEnd LineStartLiteral PrecededBy MatchFirstNoMatchNotAny OneOrMoreOnlyOnceOptionalOrParseBaseExceptionParseElementEnhanceParseExceptionParseExpressionParseFatalException ParseResultsParseSyntaxException ParserElement QuotedStringRecursiveGrammarExceptionRegexSkipTo StringEnd StringStartSuppressTokenTokenConverterWhiteWordWordEnd WordStart ZeroOrMoreChar alphanumsalphas alphas8bit anyCloseTag anyOpenTag cStyleCommentcolcommaSeparatedListcommonHTMLEntity countedArraycppStyleCommentdblQuotedStringdblSlashComment delimitedListdictOfdowncaseTokensemptyhexnums htmlCommentjavaStyleCommentlinelineEnd lineStartlineno makeHTMLTags makeXMLTagsmatchOnlyAtColmatchPreviousExprmatchPreviousLiteral nestedExprnullDebugActionnumsoneOfopAssocoperatorPrecedence printablespunc8bitpythonStyleComment quotedString removeQuotesreplaceHTMLEntity replaceWith restOfLinesglQuotedStringsrange stringEnd stringStarttraceParseAction unicodeString upcaseTokens withAttribute indentedBlockoriginalTextForungroup infixNotation locatedExpr withClass CloseMatchtokenMappyparsing_commonpyparsing_unicode unicode_setconditionAsParseActioncCsft|tr|Sz t|WStk r`t|td}td}|dd| |YSXdS)aDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It then < returns the unicode object | encodes it with the default encoding | ... >. xmlcharrefreplacez&#\d+;cSs$dtt|dddddS)Nz\ur)hexinttrrrz_ustr..N) isinstanceunicodestrUnicodeEncodeErrorencodesysgetdefaultencodingr:setParseActiontransformString)objretZ xmlcharrefrrr_ustrs  rz6sum len sorted reversed list tuple set any all min maxccs|] }|VqdSNr).0yrrr srcCs:d}dddD}t||D]\}}|||}q |S)z/Escape &, <, >, ", ', etc. in a string of data.z&><"'css|]}d|dVqdS)&;Nr)rsrrrr sz_xml_escape..zamp gt lt quot apos)splitzipreplace)dataZ from_symbolsZ to_symbolsZfrom_Zto_rrr _xml_escapes r 0123456789Z ABCDEFabcdef\ccs|]}|tjkr|VqdSr)stringZ whitespacercrrrrs cs@|dk r |nd|rtntttfdd}|S)Nzfailed user-defined conditioncs t|||s||dSr)boolrlrexc_typefnmsgrrpasz"conditionAsParseAction..pa)r4r2 _trim_arityr)rmessagefatalrrrrrs  c@sPeZdZdZdddZeddZdd Zd d Zd d Z dddZ ddZ dS)r0z7base exception class for all parsing runtime exceptionsrNcCs>||_|dkr||_d|_n ||_||_||_|||f|_dSNr)locrpstr parserElementargs)selfrrrelemrrr__init__(szParseBaseException.__init__cCs||j|j|j|jS)z internal factory method to simplify creating one type of ParseException from another - avoids having __init__ signature conflicts among subclasses )rrrr)clsperrr_from_exception3sz"ParseBaseException._from_exceptioncCsN|dkrt|j|jS|dkr,t|j|jS|dkrBt|j|jSt|dS)zsupported attributes by name are: - lineno - returns the line number of the exception text - col - returns the column number of the exception text - line - returns the line containing the exception text r^)rMcolumnr[N)r^rrrMr[AttributeError)rZanamerrr __getattr__;szParseBaseException.__getattr__cCs^|jr@|jt|jkrd}qDd|j|j|jddd}nd}d|j||j|j|jfS)Nz, found end of textz , found %rrz\\\rz%%s%s (at char %d), (line:%d, col:%d))rrlenrrr^r)rZfoundstrrrr__str__Js$zParseBaseException.__str__cCst|Srrrrrr__repr__TszParseBaseException.__repr__>!z{0} )inspectrgetrecursionlimitrr0appendr[rMformatrrZgetinnerframes __traceback__set enumeratef_localsgetr7f_codeco_nameaddrr) excdepthrrZcallersseeniZffZfrmZf_selfZ self_typecoderrrexplainzsL          zParseException.explainN)r)rrrr staticmethodrrrrrr2csc@seZdZdZdS)r4znuser-throwable exception thrown when inconsistent parse content is found; stops all parsing immediatelyNrrrrrrrrr4sc@seZdZdZdS)r6zjust like :class:`ParseFatalException`, but thrown internally when an :class:`ErrorStop` ('-' operator) indicates that parsing is to stop immediately because an unbacktrackable syntax error has been found. Nrrrrrr6sc@s eZdZdZddZddZdS)r9ziexception thrown by :class:`ParserElement.validate` if the grammar could be improperly recursive cCs ||_dSrZparseElementTracerparseElementListrrrrsz"RecursiveGrammarException.__init__cCs d|jS)NzRecursiveGrammarException: %srrrrrrsz!RecursiveGrammarException.__str__N)rrrrrrrrrrr9sc@s,eZdZddZddZddZddZd S) _ParseResultsWithOffsetcCs||f|_dSrtup)rZp1Zp2rrrrsz _ParseResultsWithOffset.__init__cCs |j|Srrrrrrr __getitem__sz#_ParseResultsWithOffset.__getitem__cCst|jdSNr)reprrrrrrrsz _ParseResultsWithOffset.__repr__cCs|jd|f|_dSrrrrrr setOffsetsz!_ParseResultsWithOffset.setOffsetN)rrrrrrrrrrrrsrc@seZdZdZd]ddZddddefddZdd Zefd d Zd d Z ddZ ddZ ddZ e Z ddZddZddZddZddZereZeZeZn$eZeZeZddZd d!Zd"d#Zd$d%Zd&d'Zd^d(d)Zd*d+Zd,d-Zd.d/Zd0d1Z d2d3Z!d4d5Z"d6d7Z#d8d9Z$d:d;Z%d`` - see :class:`ParserElement.setResultsName`) Example:: integer = Word(nums) date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: # date_str = integer("year") + '/' + integer("month") + '/' + integer("day") # parseString returns a ParseResults object result = date_str.parseString("1999/12/31") def test(s, fn=repr): print("%s -> %s" % (s, fn(eval(s)))) test("list(result)") test("result[0]") test("result['month']") test("result.day") test("'month' in result") test("'minutes' in result") test("result.dump()", str) prints:: list(result) -> ['1999', '/', '12', '/', '31'] result[0] -> '1999' result['month'] -> '12' result.day -> '31' 'month' in result -> True 'minutes' in result -> False result.dump() -> ['1999', '/', '12', '/', '31'] - day: 31 - month: 12 - year: 1999 NTcCs"t||r|St|}d|_|SNT)robject__new___ParseResults__doinit)rtoklistnameasListmodalZretobjrrrrs   zParseResults.__new__c Csd|jrvd|_d|_d|_i|_||_||_|dkr6g}||trP|dd|_n||trft||_n|g|_t |_ |dk r`|r`|sd|j|<||t rt |}||_||t dttfr|ddgfks`||tr|g}|r*||trtt|jd||<ntt|dd||<|||_n6z|d||<Wn$tttfk r^|||<YnXdS)NFrr)r_ParseResults__name_ParseResults__parent_ParseResults__accumNames_ParseResults__asList_ParseResults__modallist_ParseResults__toklist_generatorTypedict_ParseResults__tokdictrrr basestringr5rKeyError TypeError IndexError)rrrrrrrrrr"sB     $   zParseResults.__init__cCsPt|ttfr|j|S||jkr4|j|ddStdd|j|DSdS)NrrcSsg|] }|dqSrrrvrrr Psz,ParseResults.__getitem__..)rrslicer rrr5rrrrrIs   zParseResults.__getitem__cCs||tr0|j|t|g|j|<|d}nD||ttfrN||j|<|}n&|j|tt|dg|j|<|}||trt||_ dSr) rrrr rrr r5wkrefr)rkrrsubrrr __setitem__Rs   " zParseResults.__setitem__c Cst|ttfrt|j}|j|=t|trH|dkr:||7}t||d}tt||}||j D]>\}}|D]0}t |D]"\}\}} t || | |k||<qqxqln|j |=dSNrr) rrrrr r rangeindicesreverseritemsrr) rrZmylenZremovedr occurrencesjrvaluepositionrrr __delitem___s  zParseResults.__delitem__cCs ||jkSr)r)rrrrr __contains__tszParseResults.__contains__cCs t|jSr)rr rrrr__len__wszParseResults.__len__cCs |j Srr rrrr__bool__zszParseResults.__bool__cCs t|jSriterr rrrr__iter__~szParseResults.__iter__cCst|jdddSNrr+rrrr __reversed__szParseResults.__reversed__cCs$t|jdr|jSt|jSdS)Niterkeys)hasattrrr0r,rrrr _iterkeyss  zParseResults._iterkeyscsfddDS)Nc3s|]}|VqdSrrrrrrrrsz+ParseResults._itervalues..r2rrrr _itervaluesszParseResults._itervaluescsfddDS)Nc3s|]}||fVqdSrrr3rrrrsz*ParseResults._iteritems..r4rrrr _iteritemsszParseResults._iteritemscCs t|S)zVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).)r r0rrrrkeysszParseResults.keyscCs t|S)zXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).)r  itervaluesrrrrvaluesszParseResults.valuescCs t|S)zfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).)r  iteritemsrrrrr!szParseResults.itemscCs t|jS)zSince keys() returns an iterator, this method is helpful in bypassing code that looks for the existence of any defined results names.)rrrrrrhaskeysszParseResults.haskeyscOs|s dg}|D]*\}}|dkr0|d|f}qtd|qt|dtsdt|dksd|d|kr~|d}||}||=|S|d}|SdS)a Removes and returns item at specified index (default= ``last``). Supports both ``list`` and ``dict`` semantics for ``pop()``. If passed no argument or an integer argument, it will use ``list`` semantics and pop tokens from the list of parsed tokens. If passed a non-integer argument (most likely a string), it will use ``dict`` semantics and pop the corresponding value from any defined results names. A second default return value argument is supported, just as in ``dict.pop()``. Example:: def remove_first(tokens): tokens.pop(0) print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321'] label = Word(alphas) patt = label("LABEL") + OneOrMore(Word(nums)) print(patt.parseString("AAB 123 321").dump()) # Use pop() in a parse action to remove named result (note that corresponding value is not # removed from list form of results) def remove_LABEL(tokens): tokens.pop("LABEL") return tokens patt.addParseAction(remove_LABEL) print(patt.parseString("AAB 123 321").dump()) prints:: ['AAB', '123', '321'] - LABEL: AAB ['AAB', '123', '321'] rdefaultrz-pop() got an unexpected keyword argument '%s'rN)r!rrrr)rrkwargsrrindexrZ defaultvaluerrrpops"%  zParseResults.popcCs||kr||S|SdS)a[ Returns named result matching the given key, or if there is no such name, then returns the given ``defaultValue`` or ``None`` if no ``defaultValue`` is specified. Similar to ``dict.get()``. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString("1999/12/31") print(result.get("year")) # -> '1999' print(result.get("hour", "not specified")) # -> 'not specified' print(result.get("hour")) # -> None Nr)rkey defaultValuerrrrszParseResults.getcCsR|j|||jD]4\}}t|D]"\}\}}t||||k||<q(qdS)a Inserts new element at location index in the list of parsed tokens. Similar to ``list.insert()``. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to insert the parse location in the front of the parsed results def insert_locn(locn, tokens): tokens.insert(0, locn) print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321'] N)r insertrr!rr)rr>ZinsStrrr"rr$r%rrrrBszParseResults.insertcCs|j|dS)a Add single element to end of ParseResults list of elements. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to compute the sum of the parsed integers, and add it to the end def append_sum(tokens): tokens.append(sum(map(int, tokens))) print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444] N)r r)ritemrrrrs zParseResults.appendcCs&t|tr||n |j|dS)a  Add sequence of elements to end of ParseResults list of elements. Example:: patt = OneOrMore(Word(alphas)) # use a parse action to append the reverse of the matched strings, to make a palindrome def make_palindrome(tokens): tokens.extend(reversed([t[::-1] for t in tokens])) return ''.join(tokens) print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl' N)rr5__iadd__r extend)rZitemseqrrrrE's  zParseResults.extendcCs|jdd=|jdS)z7 Clear all elements and results names. N)r rclearrrrrrF:s zParseResults.clearcCs&z ||WStk r YdSXdSr)rrrrrrrAs zParseResults.__getattr__cCs|}||7}|Srcopy)rotherrrrr__add__GszParseResults.__add__cs|jrjt|jfdd|j}fdd|D}|D],\}}|||<t|dtr.c s4g|],\}}|D]}|t|d|dfqqSrr)rrrvlistr) addoffsetrrrQsz)ParseResults.__iadd__..r) rrr r!rr5rrrupdate)rrJZ otheritemsZotherdictitemsrrr)rQrMrrDLs     zParseResults.__iadd__cCs&t|tr|dkr|S||SdSr)rrrIrrJrrr__radd__\szParseResults.__radd__cCsdt|jt|jfS)Nz(%s, %s))rr rrrrrrdszParseResults.__repr__cCsdddd|jDdS)N[, css(|] }t|trt|nt|VqdSr)rr5rrrrrrrrhsz'ParseResults.__str__..])rr rrrrrgszParseResults.__str__rcCsLg}|jD]<}|r |r ||t|tr8||7}q |t|q |Sr)r rrr5 _asStringListr)rsepoutrCrrrrYjs   zParseResults._asStringListcCsdd|jDS)ax Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = OneOrMore(Word(alphas)) result = patt.parseString("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults print(type(result), result) # -> ['sldkj', 'lsdkj', 'sldkj'] # Use asList() to create an actual list result_list = result.asList() print(type(result_list), result_list) # -> ['sldkj', 'lsdkj', 'sldkj'] cSs"g|]}t|tr|n|qSr)rr5r)rresrrrrsz'ParseResults.asList..r)rrrrruszParseResults.asListcs6tr |j}n|j}fddtfdd|DS)a Returns the named parse results as a nested dictionary. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString('12/31/1999') print(type(result), repr(result)) # -> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]}) result_dict = result.asDict() print(type(result_dict), repr(result_dict)) # -> {'day': '1999', 'year': '12', 'month': '31'} # even though a ParseResults supports dict-like access, sometime you just need to have a dict import json print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"} cs6t|tr.|r|Sfdd|DSn|SdS)Ncsg|] }|qSrrrtoItemrrrsz7ParseResults.asDict..toItem..)rr5r;asDictrr]rrr^s  z#ParseResults.asDict..toItemc3s|]\}}||fVqdSrrrrrr]rrrsz&ParseResults.asDict..)PY_3r!r:r)rZitem_fnrr]rr_s  zParseResults.asDictcCs<t|j}t|j|_|j|_|j|j|j|_|S)zG Returns a new copy of a :class:`ParseResults` object. ) r5r rrr!rrrRrrrrrrrIs  zParseResults.copyFc CsLd}g}tdd|jD}|d}|s8d}d}d}d} |dk rJ|} n |jrV|j} | sf|rbdSd} |||d| d g7}t|jD]\} } t| tr| |kr|| || |o|dk||g7}n|| d|o|dk||g7}qd} | |kr|| } | s|rqnd} t t | } |||d| d | d | d g 7}q|||d | d g7}d |S) z (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names. rcss(|] \}}|D]}|d|fVqqdSrNrrOrrrrsz%ParseResults.asXML.. rNZITEM<>.z %s%s- %s: rer)rjfull include_list_depthcss|]}t|tVqdSr)rr5)rvvrrrrKsz %s%s[%d]: %s%s%s) rrrr;sortedr!rr5dumpranyrr) rrjrprqrrr[NLr!rrrrsrrrru!sP         zParseResults.dumpcOstj|f||dS)a# Pretty-printer for parsed results as a list, using the `pprint `_ module. Accepts additional positional or keyword args as defined for `pprint.pprint `_ . Example:: ident = Word(alphas, alphanums) num = Word(nums) func = Forward() term = ident | num | Group('(' + func + ')') func <<= ident + Group(Optional(delimitedList(term))) result = func.parseString("fna a,b,(fnb c,d,200),100") result.pprint(width=40) prints:: ['fna', ['a', 'b', ['(', 'fnb', ['c', 'd', '200'], ')'], '100']] N)pprintrrrr=rrrrxbszParseResults.pprintcCs.|j|j|jdk r|p d|j|jffSr)r rrIrrrrrrr __getstate__~szParseResults.__getstate__cCsN|d|_|d\|_}}|_i|_|j||dk rDt||_nd|_dSr)r rrrrRrr)rstaternZ inAccumNamesrrr __setstate__s   zParseResults.__setstate__cCs|j|j|j|jfSr)r rr r rrrr__getnewargs__szParseResults.__getnewargs__cCstt|t|Sr)rrr r7rrrrrszParseResults.__dir__cCsrdd}|g}|D]>\}}t|tr>||j||d7}q|||g|||d7}q|dk rn||g|d}|S)z Helper classmethod to construct a ParseResults from a dict, preserving the name-value relations as results names. If an optional 'name' argument is given, a nested ParseResults will be returned cSsHz t|Wntk r"YdSXtr8t|ttf St|t SdSNF)r, Exceptionrbrrbytesrr`rrr is_iterables z+ParseResults.from_dict..is_iterabler)rrN)r!rr from_dict)rrJrrrrrrrrrs  zParseResults.from_dict)NNTT)N)r)NFrT)rTTr)N)6rrrrrrrrrr&r'r(r* __nonzero__r-r/r2r5r6rbr7r9r!r0r8r:r;r?rrBrrErFrrKrDrTrrrYrr_rIrirlrorurxrzr|r}rrrrrrrr5sl* ' 7  $ =( A cCsF|}d|krt|kr4nn||ddkr4dS||dd|S)aReturns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`ParserElement.parseString` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. rrr)rrfind)rstrgrrrrrMs cCs|dd|dS)aReturns current line number within a string, counting newlines as line separators. The first line is number 1. Note - the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`ParserElement.parseString` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. rrr)count)rrrrrr^s cCsF|dd|}|d|}|dkr2||d|S||ddSdS)zfReturns the line of text containing loc within a string, counting newlines as line separators. rrrN)rfind)rrZlastCRZnextCRrrrr[s  cCs8tdt|dt|dt||t||fdS)NzMatch z at loc z(%d,%d))printrr^rM)instringrexprrrr_defaultStartDebugActionsrcCs$tdt|dt|dS)NzMatched z -> )rrrr)rstartlocZendlocrtoksrrr_defaultSuccessDebugActionsrcCstdt|dS)NzException raised:)rr)rrrrrrr_defaultExceptionDebugActionsrcGsdS)zG'Do-nothing' debug action, to suppress debugging output during parsing.Nr)rrrrresrcstkrfddSdgdgtdddkrFddd}dd d n tj}tjd }|dd d }|d|d|ffdd}d}ztdtdj}Wntk rt}YnX||_|S)Ncs|Srrr)funcrrrrz_trim_arity..rFr)rcSs8tdkr dnd}tj| |dd|}|ddgS)N)rrrrlimitr)system_version traceback extract_stack)rrM frame_summaryrrrrsz"_trim_arity..extract_stackcSs$tj||d}|d}|ddgS)Nrrr)r extract_tb)tbrZframesrrrrrsz_trim_arity..extract_tbrrrcsz"|dd}dd<|WStk rdr>nNz.td}|dddddksjW5z~Wntk rYnXXdkrdd7<YqYqXqdS)NrTrrrr)r NameErrorrexc_info)rrrrZ foundArityrrmaxargsZpa_call_line_synthrrrs&  z_trim_arity..wrapperzr __class__)r)r) singleArgBuiltinsrrrrgetattrrrr)rrrZ LINE_DIFFZ this_liner func_namerrrrs,    rcseZdZdZdZdZeddZeddZddd Z d d Z d d Z dddZ dddZ dddZddZddZddZddZddZdd Zdd!d"Zd#d$Zdd%d&Zd'd(Zd)d*ZGd+d,d,eZed-k rGd.d/d/eZnGd0d/d/eZiZeZ d1d1gZ!dd2d3Z"eZ#ed4d5Z$dZ%edd7d8Z&dd9d:Z'e(dfd;d<Z)d=d>Z*e(fd?d@Z+e(dfdAdBZ,dCdDZ-dEdFZ.dGdHZ/dIdJZ0dKdLZ1dMdNZ2dOdPZ3dQdRZ4dSdTZ5dUdVZ6dWdXZ7dYdZZ8d[d\Z9d]d^Z:d_d`Z;ddadbZdgdhZ?didjZ@dkdlZAdmdnZBddodpZCdqdrZDdsdtZEdudvZFdwdxZGddydzZHdd{d|ZIfd}d~ZJddZKddZLddZMddZNdddZOdddZPZQS)r7z)Abstract base level parser element class.z FcCs |t_dS)a Overrides the default whitespace chars Example:: # default whitespace chars are space, and newline OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # change to just treat newline as significant ParserElement.setDefaultWhitespaceChars(" \t") OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def'] N)r7DEFAULT_WHITE_CHARScharsrrrsetDefaultWhitespaceCharsDsz'ParserElement.setDefaultWhitespaceCharscCs |t_dS)ah Set class to be used for inclusion of string literals into a parser. Example:: # default literal class used is Literal integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # change to Suppress ParserElement.inlineLiteralsUsing(Suppress) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '12', '31'] N)r7_literalStringClassrrrrinlineLiteralsUsingTsz!ParserElement.inlineLiteralsUsingcCst|_d|_d|_d|_||_d|_ttj |_ d|_ d|_ d|_ t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NTFr)NNN)r  parseAction failActionstrRepr resultsName saveAsListskipWhitespacerr7r whiteCharscopyDefaultWhiteCharsmayReturnEmptykeepTabs ignoreExprsdebug streamlined mayIndexErrorerrmsg modalResults debugActionsre callPreparse callDuringTry)rsavelistrrrrjs( zParserElement.__init__cCs<t|}|jdd|_|jdd|_|jr8tj|_|S)a/ Make a copy of this :class:`ParserElement`. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParseAction(lambda toks: toks[0] * 1024) + Suppress("K") integerM = integer.copy().addParseAction(lambda toks: toks[0] * 1024 * 1024) + Suppress("M") print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M")) prints:: [5120, 100, 655360, 268435456] Equivalent form of ``expr.copy()`` is just ``expr()``:: integerM = integer().addParseAction(lambda toks: toks[0] * 1024 * 1024) + Suppress("M") N)rIrrrr7rr)rZcpyrrrrIs  zParserElement.copycCs$||_d|j|_tjr ||S)a_ Define name for this expression, makes debugging and exception messages clearer. Example:: Word(nums).parseString("ABC") # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1) Word(nums).setName("integer").parseString("ABC") # -> Exception: Expected integer (at char 0), (line:1, col:1) Expected )rrr!enable_debug_on_named_expressionssetDebugrGrrrsetNames  zParserElement.setNamecCs |||S)aO Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original :class:`ParserElement` object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names. You can also set results names using the abbreviated syntax, ``expr("name")`` in place of ``expr.setResultsName("name")`` - see :class:`__call__`. Example:: date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: date_str = integer("year") + '/' + integer("month") + '/' + integer("day") )_setResultsNamerrlistAllMatchesrrrsetResultsNameszParserElement.setResultsNamecCs4|}|dr"|dd}d}||_| |_|S)N*rT)rIendswithrr)rrrZnewselfrrrrs  zParserElement._setResultsNameTcs@|r&|jdfdd }|_||_nt|jdr<|jj|_|S)zMethod to invoke the Python pdb debugger when this element is about to be parsed. Set ``breakFlag`` to True to enable, False to disable. Tcsddl}|||||Sr)pdbZ set_trace)rr doActions callPreParserZ _parseMethodrrbreakersz'ParserElement.setBreak..breaker_originalParseMethod)TT)_parserr1)rZ breakFlagrrrrsetBreaks  zParserElement.setBreakcOsVt|dgkrg|_n`` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. Example:: integer = Word(nums) date_str = integer + '/' + integer + '/' + integer date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # use parse action to convert to ints at parse time integer = Word(nums).setParseAction(lambda toks: int(toks[0])) date_str = integer + '/' + integer + '/' + integer # note that integer fields are now ints, not strings date_str.parseString("1999/12/31") # -> [1999, '/', 12, '/', 31] Ncss|]}t|VqdSr)callable)rrrrrr sz/ParserElement.setParseAction..zparse actions must be callablerF)r rallrmaprrrrfnsr=rrrrs(zParserElement.setParseActioncOs4|jtttt|7_|jp,|dd|_|S)z Add one or more parse actions to expression's list of parse actions. See :class:`setParseAction`. See examples in :class:`copy`. rF)rr rrrrrrrraddParseActionszParserElement.addParseActionc OsF|D](}|jt||d|dddq|jp>|dd|_|S)aAdd a boolean predicate function to expression's list of parse actions. See :class:`setParseAction` for function call signatures. Unlike ``setParseAction``, functions passed to ``addCondition`` need to return boolean success/fail of the condition. Optional keyword arguments: - message = define a custom message to be used in the raised exception - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) year_int = integer.copy() year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later") date_str = year_int + '/' + integer + '/' + integer result = date_str.parseString("1999/12/31") # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1) rrF)rrr)rrrrr)rrr=rrrr addConditions  zParserElement.addConditioncCs ||_|S)aDefine action to perform if parsing fails at this expression. Fail acton fn is a callable function that takes the arguments ``fn(s, loc, expr, err)`` where: - s = string being parsed - loc = location where expression match was attempted and failed - expr = the parse expression that failed - err = the exception thrown The function returns no value. It may throw :class:`ParseFatalException` if it is desired to stop parsing immediately.)rrrrrr setFailAction4s zParserElement.setFailActionc CsNd}|rJd}|jD]4}z|||\}}d}qWqtk rDYqXqq|SNTF)rrr2)rrrZ exprsFoundeZdummyrrr_skipIgnorablesAs   zParserElement._skipIgnorablescCsH|jr|||}|jrD|j}t|}||krD|||krD|d7}q&|SNr)rrrrr)rrrZwtinstrlenrrrpreParseNs  zParserElement.preParsecCs|gfSrrrrrrrrrrZszParserElement.parseImplcCs|Srrrrr tokenlistrrr postParse]szParserElement.postParsec Csd\}}}|j}|s|jr"|j|r8|j||||z|rR|jrR|||} n|} | } |jsl| t|krz||| |\}} Wqtk rt |t||j |YqXn||| |\}} Wn\t k r} z<|j|r|j||| || |jr ||| || W5d} ~ XYnXn|r>|jr>|||} n|} | } |js\| t|krz||| |\}} Wn*tk rt |t||j |YnXn||| |\}} | ||| } t | |j|j|jd} |jr`|s|jr`|rz|jD]}z||| | } Wn6tk rD}zt d}||_|W5d}~XYnX| dk r| | k rt | |j|jovt| t tf|jd} qWnFt k r} z&|j|r|j||| || W5d} ~ XYnXn|jD]}z||| | } Wn6tk r }zt d}||_|W5d}~XYnX| dk r| | k rt | |j|joRt| t tf|jd} q|r|j|r|j||| ||| || fS)N)rrr)rrz exception raised in parse action)rrrrrrrrrr2rrrr5rrrrr __cause__rr )rrrrrZTRYZMATCHZFAILZ debuggingprelocZ tokensStarttokenserrZ retTokensrZparse_action_excrrrrras          zParserElement._parseNoCachecCs@z|j||dddWStk r:t|||j|YnXdS)NFrr)rr4r2rrrrrrrtryParseszParserElement.tryParsec Cs4z|||Wnttfk r*YdSXdSdS)NFT)rr2rrrrr canParseNexts zParserElement.canParseNextc@seZdZddZdS)zParserElement._UnboundedCachecs~it|_fdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS) Ncs |Srrrr@cache not_in_cacherrrsz3ParserElement._UnboundedCache.__init__..getcs ||<dSrrrr@r$rrrrsz3ParserElement._UnboundedCache.__init__..setcs dSrrFrrrrrFsz5ParserElement._UnboundedCache.__init__..clearcstSrrrrrr cache_lensz9ParserElement._UnboundedCache.__init__..cache_len)rrtypes MethodTyperrrFr()rrrrFrrrrrs    z&ParserElement._UnboundedCache.__init__Nrrrrrrrr_UnboundedCachesrNc@seZdZddZdS)ParserElement._FifoCachecst|_tfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS) Ncs |Srrrrrrrs.ParserElement._FifoCache.__init__..getcs>||<tkr:zdWqtk r6YqXqdSr~)rpopitemrr)rsizerrrs  .ParserElement._FifoCache.__init__..setcs dSrrrrrrrFs0ParserElement._FifoCache.__init__..clearcstSrrrrrrrs4ParserElement._FifoCache.__init__..cache_len) rr _OrderedDictrrrrrFr(rrrrrFrr)rrrrrs   !ParserElement._FifoCache.__init__Nrrrrr _FifoCachesrc@seZdZddZdS)rcst|_itgfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_ dS) Ncs |Srrrrrrrsrcs4||<tkr&dq|dSr)rr?popleftrr)rkey_fiforrrrs rcsdSrrr)rr rrrF srcstSrrrrrrrsr) rr collectionsdequerrrrrFr(rr)rr rrrrs   rNrrrrrrsrc Csd\}}|||||f}tjtj}||} | |jkrtj|d7<z|||||} Wn8tk r} z||| j | j W5d} ~ XYn.X||| d| d f| W5QRSn@tj|d7<t | t r| | d| d fW5QRSW5QRXdS)NrNrr)r7packrat_cache_lock packrat_cacherrpackrat_cache_statsrr0rrrrIrr) rrrrrZHITZMISSlookuprr$rrrr _parseCaches$   zParserElement._parseCachecCs(tjdgttjtjdd<dSr)r7r rFrrrrrr resetCache6s zParserElement.resetCachecCs8tjs4dt_|dkr tt_n t|t_tjt_dS)aEnables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happens often in many complex grammars) can immediately return a cached value, instead of re-executing parsing/validating code. Memoizing is done of both valid results and parsing exceptions. Parameters: - cache_size_limit - (default= ``128``) - if an integer value is provided will limit the size of the packrat cache; if None is passed, then the cache size will be unbounded; if 0 is passed, the cache will be effectively disabled. This speedup may break existing programs that use parse actions that have side-effects. For this reason, packrat parsing is disabled when you first import pyparsing. To activate the packrat feature, your program must call the class method :class:`ParserElement.enablePackrat`. For best results, call ``enablePackrat()`` immediately after importing pyparsing. Example:: from pip._vendor import pyparsing pyparsing.ParserElement.enablePackrat() TN)r7_packratEnabledrr rrr)Zcache_size_limitrrr enablePackrat<s   zParserElement.enablePackratc Cst|js||jD] }|q|js8|}z<||d\}}|rr|||}t t }|||Wn0t k r}ztj rn|W5d}~XYnX|SdS)a Execute the parse expression with the given string. This is the main interface to the client code, once the complete expression has been built. Returns the parsed data as a :class:`ParseResults` object, which may be accessed as a list, or as a dict or object with attributes if the given parser includes results names. If you want the grammar to require that the entire input string be successfully parsed, then set ``parseAll`` to True (equivalent to ending the grammar with ``StringEnd()``). Note: ``parseString`` implicitly calls ``expandtabs()`` on the input string, in order to report proper column numbers in parse actions. If the input string contains tabs and the grammar uses parse actions that use the ``loc`` argument to index into the string being parsed, you can ensure you have a consistent view of the input string by: - calling ``parseWithTabs`` on your grammar before calling ``parseString`` (see :class:`parseWithTabs`) - define your parse action using the full ``(s, loc, toks)`` signature, and reference the input string using the parse action's ``s`` argument - explictly expand the tabs in your input string before calling ``parseString`` Example:: Word('a').parseString('aaaaabaaa') # -> ['aaaaa'] Word('a').parseString('aaaaabaaa', parseAll=True) # -> Exception: Expected end of text rN) r7rr streamlinerr expandtabsrrrr<r0verbose_stacktrace)rrparseAllrrrZserrrr parseString_s$!    zParserElement.parseStringc cs6|js||jD] }|q|js4t|}t|}d}|j}|j}t d} z||kr| |krz |||} ||| dd\} } Wnt k r| d}YqZX| |kr| d7} | | | fV|r|||} | |kr| }q|d7}q| }qZ| d}qZWn4t k r0}zt j rn|W5d}~XYnXdS)aq Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional ``maxMatches`` argument, to clip scanning after 'n' matches are found. If ``overlap`` is specified, then overlapping matches will be reported. Note that the start and end locations are reported relative to the string being parsed. See :class:`parseString` for more information on parsing strings with embedded tabs. Example:: source = "sldjf123lsdjjkf345sldkjf879lkjsfd987" print(source) for tokens, start, end in Word(alphas).scanString(source): print(' '*start + '^'*(end-start)) print(' '*start + tokens[0]) prints:: sldjf123lsdjjkf345sldkjf879lkjsfd987 ^^^^^ sldjf ^^^^^^^ lsdjjkf ^^^^^^ sldkjf ^^^^^^ lkjsfd rFrrN)rrrrrrrrrr7rr2r0r)rr maxMatchesZoverlaprrrZ preparseFnZparseFnmatchesrZnextLocrZnextlocrrrr scanStringsB       zParserElement.scanStringc Csg}d}d|_z||D]Z\}}}|||||rpt|trR||7}nt|trf||7}n |||}q|||ddd|D}dtt t |WSt k r}zt j rƂn|W5d}~XYnXdS)a[ Extension to :class:`scanString`, to modify matching text with modified tokens that may be returned from a parse action. To use ``transformString``, define a grammar and attach a parse action to it that modifies the returned token list. Invoking ``transformString()`` on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse action. ``transformString()`` returns the resulting transformed string. Example:: wd = Word(alphas) wd.setParseAction(lambda toks: toks[0].title()) print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york.")) prints:: Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York. rTNcSsg|] }|r|qSrrrorrrrsz1ParserElement.transformString..r)rrrrr5rr rrr_flattenr0r7r)rrr[ZlastErrrrrrrrs(    zParserElement.transformStringc CsRztdd|||DWStk rL}ztjr8n|W5d}~XYnXdS)a Another extension to :class:`scanString`, simplifying the access to the tokens found to match the given parse expression. May be called with optional ``maxMatches`` argument, to clip searching after 'n' matches are found. Example:: # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters cap_word = Word(alphas.upper(), alphas.lower()) print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")) # the sum() builtin can be used to merge results into a single ParseResults object print(sum(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))) prints:: [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']] ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity'] cSsg|]\}}}|qSrr)rrrrrrrr#sz.ParserElement.searchString..N)r5rr0r7r)rrrrrrr searchString s zParserElement.searchStringc csTd}d}|j||dD]*\}}}|||V|r<|dV|}q||dVdS)aR Generator method to split a string using the given expression as a separator. May be called with optional ``maxsplit`` argument, to limit the number of splits; and the optional ``includeSeparators`` argument (default= ``False``), if the separating matching text should be included in the split results. Example:: punc = oneOf(list(".,;:/-!?")) print(list(punc.split("This, this?, this sentence, is badly punctuated!"))) prints:: ['This', ' this', '', ' this sentence', ' is badly punctuated', ''] r)rN)r) rrmaxsplitZincludeSeparatorsZsplitsZlastrrrrrrr+s zParserElement.splitcCsV|tkrt|St|tr$||}t|tsJtjdt|t dddSt ||gS)a[ Implementation of + operator - returns :class:`And`. Adding strings to a ParserElement converts them to :class:`Literal`s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) prints:: Hello, World! -> ['Hello', ',', 'World', '!'] ``...`` may be used as a parse expression as a short form of :class:`SkipTo`. Literal('start') + ... + Literal('end') is equivalent to: Literal('start') + SkipTo('end')("_skipped*") + Literal('end') Note that the skipped text is returned with '_skipped' as a results name, and to support having multiple skips in the same parser, the value returned is a list of all skipped text. 4Cannot combine element of type %s with ParserElementr stacklevelN) Ellipsis _PendingSkiprrrr7warningswarnr SyntaxWarningrrSrrrrKDs   zParserElement.__add__cCsZ|tkrt|d|St|tr,||}t|tsRtjdt|t dddS||S)z` Implementation of + operator when left operand is not a :class:`ParserElement` _skipped*r#rr$N) r&r;rrrr7r(r)rr*rSrrrrTjs   zParserElement.__radd__cCsJt|tr||}t|ts:tjdt|tdddS|t |S)zT Implementation of - operator, returns :class:`And` with error stop r#rr$N) rrrr7r(r)rr*r _ErrorStoprSrrr__sub__ys   zParserElement.__sub__cCsBt|tr||}t|ts:tjdt|tdddS||S)z` Implementation of - operator when left operand is not a :class:`ParserElement` r#rr$Nrrrr7r(r)rr*rSrrr__rsub__s   zParserElement.__rsub__cs|tkrd}n8t|trF|ddtfkrFd|ddddd}t|tr\|d}}nt|trJtdd |D}|d dd}|ddkrd|df}t|dtr|ddkr|ddkrtS|ddkrtS|dtSnNt|dtr,t|dtr,|\}}||8}ntd t|dt|dntd t||dkrjtd |dkr|td||krdkrnntd|rfdd|r|dkr҈|}nt g||}n|}n|dkr}nt g|}|S)a Implementation of * operator, allows use of ``expr * 3`` in place of ``expr + expr + expr``. Expressions may also me multiplied by a 2-integer tuple, similar to ``{min, max}`` multipliers in regular expressions. Tuples may also include ``None`` as in: - ``expr*(n, None)`` or ``expr*(n, )`` is equivalent to ``expr*n + ZeroOrMore(expr)`` (read as "at least n instances of ``expr``") - ``expr*(None, n)`` is equivalent to ``expr*(0, n)`` (read as "0 to n instances of ``expr``") - ``expr*(None, None)`` is equivalent to ``ZeroOrMore(expr)`` - ``expr*(1, None)`` is equivalent to ``OneOrMore(expr)`` Note that ``expr*(None, n)`` does not raise an exception if more than n exprs exist in the input stream; that is, ``expr*(None, n)`` does not enforce a maximum number of expr occurrences. If this behavior is desired, then write ``expr*(None, n) + ~expr`` )rNNrrrrrcss|]}|tk r|ndVqdSr)r&rrrrrsz(ParserElement.__mul__..)NNz8cannot multiply 'ParserElement' and ('%s', '%s') objectsz0cannot multiply 'ParserElement' and '%s' objectsz/cannot multiply ParserElement by negative valuez@second tuple value must be greater or equal to first tuple valuez,cannot multiply ParserElement by 0 or (0, 0)cs(|dkrt|dStSdSr)r.nmakeOptionalListrrrr3sz/ParserElement.__mul__..makeOptionalList) r&rtuplerrEr,rr ValueErrorr)rrJZ minElementsZ optElementsrrr2r__mul__sN              zParserElement.__mul__cCs ||Sr)r6rSrrr__rmul__szParserElement.__rmul__cCsZ|tkrt|ddSt|tr(||}t|tsNtjdt|t dddSt ||gS)zL Implementation of | operator - returns :class:`MatchFirst` T) must_skipr#rr$N) r&r'rrrr7r(r)rr*r)rSrrr__or__s    zParserElement.__or__cCsBt|tr||}t|ts:tjdt|tdddS||BS)z` Implementation of | operator when left operand is not a :class:`ParserElement` r#rr$Nr.rSrrr__ror__s   zParserElement.__ror__cCsFt|tr||}t|ts:tjdt|tdddSt||gS)zD Implementation of ^ operator - returns :class:`Or` r#rr$N) rrrr7r(r)rr*r/rSrrr__xor__s   zParserElement.__xor__cCsBt|tr||}t|ts:tjdt|tdddS||AS)z` Implementation of ^ operator when left operand is not a :class:`ParserElement` r#rr$Nr.rSrrr__rxor__ s   zParserElement.__rxor__cCsFt|tr||}t|ts:tjdt|tdddSt||gS)zF Implementation of & operator - returns :class:`Each` r#rr$N) rrrr7r(r)rr*rrSrrr__and__ s   zParserElement.__and__cCsBt|tr||}t|ts:tjdt|tdddS||@S)z` Implementation of & operator when left operand is not a :class:`ParserElement` r#rr$Nr.rSrrr__rand__ s   zParserElement.__rand__cCst|S)zH Implementation of ~ operator - returns :class:`NotAny` )r+rrrr __invert__) szParserElement.__invert__cCstd|jjdS)Nz%r object is not iterable)rrrrrrrr-/ szParserElement.__iter__c Cszt|tr|f}t|Wntk r8||f}YnXt|dkrztd|ddt|dkrrdt|nd|t|dd}|S)a use ``[]`` indexing notation as a short form for expression repetition: - ``expr[n]`` is equivalent to ``expr*n`` - ``expr[m, n]`` is equivalent to ``expr*(m, n)`` - ``expr[n, ...]`` or ``expr[n,]`` is equivalent to ``expr*n + ZeroOrMore(expr)`` (read as "at least n instances of ``expr``") - ``expr[..., n]`` is equivalent to ``expr*(0, n)`` (read as "0 to n instances of ``expr``") - ``expr[...]`` and ``expr[0, ...]`` are equivalent to ``ZeroOrMore(expr)`` - ``expr[1, ...]`` is equivalent to ``OneOrMore(expr)`` ``None`` may be used in place of ``...``. Note that ``expr[..., n]`` and ``expr[m, n]``do not raise an exception if more than ``n`` ``expr``s exist in the input stream. If this behavior is desired, then write ``expr[..., n] + ~expr``. rz.only 1 or 2 index arguments supported ({0}{1})Nrz ... [{0}]r) rrr,rrr(r)rr4)rr@rrrrr4 s    zParserElement.__getitem__cCs|dk r||S|SdS)a Shortcut for :class:`setResultsName`, with ``listAllMatches=False``. If ``name`` is given with a trailing ``'*'`` character, then ``listAllMatches`` will be passed as ``True``. If ``name` is omitted, same as calling :class:`copy`. Example:: # these are equivalent userdata = Word(alphas).setResultsName("name") + Word(nums + "-").setResultsName("socsecno") userdata = Word(alphas)("name") + Word(nums + "-")("socsecno") N)rrIrGrrr__call__X s zParserElement.__call__cCst|S)z Suppresses the output of this :class:`ParserElement`; useful to keep punctuation from cluttering up returned output. )r>rrrrsuppressl szParserElement.suppresscCs d|_|S)a Disables the skipping of whitespace before matching the characters in the :class:`ParserElement`'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. FrrrrrleaveWhitespaces szParserElement.leaveWhitespacecCsd|_||_d|_|S)z8 Overrides the default whitespace chars TF)rrr)rrrrrsetWhitespaceChars| sz ParserElement.setWhitespaceCharscCs d|_|S)z Overrides default behavior to expand ````s to spaces before parsing the input string. Must be called before ``parseString`` when the input grammar contains elements that match ```` characters. T)rrrrr parseWithTabs szParserElement.parseWithTabscCsLt|trt|}t|tr4||jkrH|j|n|jt||S)a Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment or other ignorable patterns. Example:: patt = OneOrMore(Word(alphas)) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj'] patt.ignore(cStyleComment) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd'] )rrr>rrrIrSrrrignore s   zParserElement.ignorecCs"|pt|p t|ptf|_d|_|S)zT Enable display of debugging messages while doing pattern matching. T)rrrrr)rZ startActionZ successActionZexceptionActionrrrsetDebugActions s zParserElement.setDebugActionscCs|r|tttnd|_|S)a Enable display of debugging messages while doing pattern matching. Set ``flag`` to True to enable, False to disable. Example:: wd = Word(alphas).setName("alphaword") integer = Word(nums).setName("numword") term = wd | integer # turn on debugging for wd wd.setDebug() OneOrMore(term).parseString("abc 123 xyz 890") prints:: Match alphaword at loc 0(1,1) Matched alphaword -> ['abc'] Match alphaword at loc 3(1,4) Exception raised:Expected alphaword (at char 4), (line:1, col:5) Match alphaword at loc 7(1,8) Matched alphaword -> ['xyz'] Match alphaword at loc 11(1,12) Exception raised:Expected alphaword (at char 12), (line:1, col:13) Match alphaword at loc 15(1,16) Exception raised:Expected alphaword (at char 15), (line:1, col:16) The output shown is that produced by the default debug actions - custom debug actions can be specified using :class:`setDebugActions`. Prior to attempting to match the ``wd`` expression, the debugging message ``"Match at loc (,)"`` is shown. Then if the parse succeeds, a ``"Matched"`` message is shown, or an ``"Exception raised"`` message is shown. Also note the use of :class:`setName` to assign a human-readable name to the expression, which makes debugging and exception messages easier to understand - for instance, the default name created for the :class:`Word` expression without calling ``setName`` is ``"W:(ABCD...)"``. F)rGrrrr)rflagrrrr s%zParserElement.setDebugcCs|jSrrrrrrr szParserElement.__str__cCst|Srrrrrrr szParserElement.__repr__cCsd|_d|_|Sr)rrrrrrr szParserElement.streamlinecCsdSrrrrrrcheckRecursion szParserElement.checkRecursioncCs|gdS)zj Check defined expressions for valid structure, check for infinite recursive definitions. N)rI)r validateTracerrrvalidate szParserElement.validatec Csz |}Wn2tk r>t|d}|}W5QRXYnXz|||WStk r~}ztjrjn|W5d}~XYnXdS)z Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing. rN)readropenrr0r7r)rZfile_or_filenamerZ file_contentsfrrrr parseFile s  zParserElement.parseFilecsht|trBtr(||kp$tt||qd||kp>t|t|kSn"t|trV||Stt||kSdSr)rr7rbsuper__eq__varsrrrSrrrrR s   zParserElement.__eq__cCs ||k SrrrSrrr__ne__ szParserElement.__ne__cCst|Sr)idrrrr__hash__ szParserElement.__hash__cCs||kSrrrSrrr__req__ szParserElement.__req__cCs ||k SrrrSrrr__rne__ szParserElement.__rne__cCs4z|jt||dWdStk r.YdSXdS)a Method for quick testing of a parser against a test string. Good for simple inline microtests of sub expressions while building up larger parser. Parameters: - testString - to test against this expression for a match - parseAll - (default= ``True``) - flag to pass to :class:`parseString` when running tests Example:: expr = Word(nums) assert expr.matches("100") rTFN)rrr0)rZ testStringrrrrr s zParserElement.matches#c  Cst|tr"tttj|}t|tr4t|}|dkrBt j }|j } g} g} d} td t dt} d}|D]\}|dk r||ds| r|s| |qt|sqtd| |g}g} z"| ||}|j||d}Wntk r}zt|trdnd }d|krB|t|j||d t|j|d d |n|d |jd ||d t|| ot|} |}W5d}~XYntk r}z$|dt|| o|} |}W5d}~XYnX| o| } |dk rzR|||}|dk r(t|tr||n|t|n||WnRtk r}z2||j|d|d|jt |j|W5d}~XYnXn||j|d|r|r|d | d|| ||fqt| | fS)as Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and easy way to run a parse expression against a list of sample strings. Parameters: - tests - a list of separate test strings, or a multiline string of test strings - parseAll - (default= ``True``) - flag to pass to :class:`parseString` when running tests - comment - (default= ``'#'``) - expression for indicating embedded comments in the test string; pass None to disable comment filtering - fullDump - (default= ``True``) - dump results as list followed by results names in nested outline; if False, only dump nested list - printResults - (default= ``True``) prints test output to stdout - failureTests - (default= ``False``) indicates if these tests are expected to fail parsing - postParse - (default= ``None``) optional callback for successful parse results; called as `fn(test_string, parse_results)` and returns a string to be added to the test output - file - (default=``None``) optional file-like object to which test output will be written; if None, will default to ``sys.stdout`` Returns: a (success, results) tuple, where success indicates that all tests succeeded (or failed if ``failureTests`` is True), and the results contain a list of lines of each test's output Example:: number_expr = pyparsing_common.number.copy() result = number_expr.runTests(''' # unsigned integer 100 # negative integer -100 # float with scientific notation 6.02e23 # integer with scientific notation 1e-12 ''') print("Success" if result[0] else "Failed!") result = number_expr.runTests(''' # stray character 100Z # missing leading digit before '.' -.100 # too many '.' 3.14.159 ''', failureTests=True) print("Success" if result[0] else "Failed!") prints:: # unsigned integer 100 [100] # negative integer -100 [-100] # float with scientific notation 6.02e23 [6.02e+23] # integer with scientific notation 1e-12 [1e-12] Success # stray character 100Z ^ FAIL: Expected end of text (at char 3), (line:1, col:4) # missing leading digit before '.' -.100 ^ FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1) # too many '.' 3.14.159 ^ FAIL: Expected end of text (at char 4), (line:1, col:5) Success Each test string must be on a single line. If you want to test a string that spans multiple lines, create a test like this:: expr.runTest(r"this is a test\n of strings that spans \n 3 lines") (Note that this is a raw string literal, you must include the leading 'r'.) NT\nruFrZz(FATAL)rrrrzFAIL: zFAIL-EXCEPTION: )rpz{0} failed: {1}: {2})!rrr rrrrstrip splitlinesr'rstdoutwriterrprFrmrrrrlstriprr0r4r[rrMrr5rurrr)rZtestsrZcommentZfullDumpZ printResultsZ failureTestsrfileprint_Z allResultsZcommentssuccessrwBOMrr[resultrrrZpp_valuerrrrrunTests. sn`     $       0 zParserElement.runTests)F)F)F)T)T)TT)TT)r)F)N)T)N)F)T)Tr[TTFNN)RrrrrrrrrrrrIrrrrrrrrrrrrrrrrrrrr rr rrrrrrr_MAX_INTrrr!rrKrTr-r/r6r7r9r:r;r<r=r>r?r-rr@rArCrDrErFrGrrrrrIrKrPrRrUrWrXrYrrg __classcell__rrrTrr7?s     1     W   " 8H. &  J     $     +    cs6eZdZd fdd ZddZddZdd ZZS) r'Fcs>tt|t|tdd|_|j|_||_||_ dS)Nr...) rQr'rrrrrranchorr8)rrr8rTrrr s z_PendingSkip.__init__cs\t|dd}jrNdd}fdd}j||||B|Sj||S)Nrjr+cSs,|jr|jdgkr(|d=|dddS)Nrr_skipped)rlrr?rrrrr8 sz'_PendingSkip.__add__..must_skipcs<|jdddgkr8|d}dtjd|d<dS)Nrrrlz missing .show_skip)r;rr8rkr)rrJZskipperr8rmrrrrK s  z_PendingSkip.__add__cCs|jSr)rrrrrr sz_PendingSkip.__repr__cGs tddS)NzBuse of `...` expression without following SkipTo target expression)r)rrrrrr sz_PendingSkip.parseImpl)F)rrrrrKrrrirrrTrr' sr'cs eZdZdZfddZZS)r?zYAbstract :class:`ParserElement` subclass, for defining atomic matching patterns. cstt|jdddSNFr)rQr?rrrTrrr szToken.__init__rrrrrrirrrTrr? scs eZdZdZfddZZS)rz'An empty token, will always match. cs$tt|d|_d|_d|_dS)NrTF)rQrrrrrrrTrrr szEmpty.__init__rprrrTrr scs*eZdZdZfddZdddZZS)r*z#A token that will never match. cs*tt|d|_d|_d|_d|_dS)Nr*TFzUnmatchable token)rQr*rrrrrrrTrrr s zNoMatch.__init__TcCst|||j|dSr)r2rrrrrr szNoMatch.parseImpl)TrrrrrrrirrrTrr* s cs*eZdZdZfddZdddZZS)r'aToken to exactly match a specified string. Example:: Literal('blah').parseString('blah') # -> ['blah'] Literal('blah').parseString('blahfooblah') # -> ['blah'] Literal('blah').parseString('bla') # -> Exception: Expected "blah" For case-insensitive matching, use :class:`CaselessLiteral`. For keyword matching (force word break before and after the matched string), use :class:`Keyword` or :class:`CaselessKeyword`. cstt|||_t||_z|d|_Wn*tk rVtj dt ddt |_ YnXdt |j|_d|j|_d|_d|_|jdkrt|tkrt|_ dS) Nrz2null string passed to Literal; use Empty() insteadrr$"%s"rFr)rQr'rmatchrmatchLenfirstMatchCharrr(r)r*rrrrrrrr_SingleCharLiteralr matchStringrTrrr s"   zLiteral.__init__TcCs@|||jkr,||j|r,||j|jfSt|||j|dSr)ru startswithrsrtr2rrrrrr4 szLiteral.parseImpl)TrqrrrTrr' s c@seZdZdddZdS)rvTcCs0|||jkr|d|jfSt|||j|dSr)rursr2rrrrrr: sz_SingleCharLiteral.parseImplN)Trrrrrrrrrv9 srvcsLeZdZdZedZdfdd Zddd Zfd d Ze d d Z Z S)r$aToken to exactly match a specified string as a keyword, that is, it must be immediately followed by a non-keyword character. Compare with :class:`Literal`: - ``Literal("if")`` will match the leading ``'if'`` in ``'ifAndOnlyIf'``. - ``Keyword("if")`` will not; it will only match the leading ``'if'`` in ``'if x=1'``, or ``'if(y==2)'`` Accepts two optional constructor arguments in addition to the keyword string: - ``identChars`` is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$" - ``caseless`` allows case-insensitive matching, default is ``False``. Example:: Keyword("start").parseString("start") # -> ['start'] Keyword("start").parseString("starting") # -> Exception For case-insensitive matching, use :class:`CaselessKeyword`. _$NFcstt||dkrtj}||_t||_z|d|_Wn$tk r^t j dt ddYnXd|j|_ d|j |_ d|_d|_||_|r||_|}t||_dS)Nrz2null string passed to Keyword; use Empty() insteadrr$rrrF)rQr$rDEFAULT_KEYWORD_CHARSrsrrtrurr(r)r*rrrrcaselessupper caselessmatchr identChars)rrxrr}rTrrr] s*     zKeyword.__init__TcCs|jr|||||j|jkr|t||jksL|||j|jkr|dksj||d|jkr||j|jfSnv|||jkr|jdks||j|r|t||jks|||j|jkr|dks||d|jkr||j|jfSt |||j |dSr) r}rtr~rrrrsruryr2rrrrrrr s.zKeyword.parseImplcstt|}tj|_|Sr)rQr$rIr|r)rrrTrrrI sz Keyword.copycCs |t_dS)z,Overrides the default Keyword chars N)r$r|rrrrsetDefaultKeywordChars szKeyword.setDefaultKeywordChars)NF)T) rrrrrGr|rrrIrrrirrrTrr$B s  cs*eZdZdZfddZdddZZS)rafToken to match a specified string, ignoring case of letters. Note: the matched results will always be in the case of the given match string, NOT the case of the input text. Example:: OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD'] (Contrast with example for :class:`CaselessKeyword`.) cs6tt||||_d|j|_d|j|_dS)Nz'%s'r)rQrrr~ returnStringrrrwrTrrr s zCaselessLiteral.__init__TcCs@||||j|jkr,||j|jfSt|||j|dSr)rtr~rsrr2rrrrrr szCaselessLiteral.parseImpl)TrqrrrTrr s cs"eZdZdZdfdd ZZS)rz Caseless version of :class:`Keyword`. Example:: OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD'] (Contrast with example for :class:`CaselessLiteral`.) Ncstt|j||dddS)NTr})rQrr)rrxrrTrrr szCaselessKeyword.__init__)NrprrrTrr s cs,eZdZdZdfdd Zd ddZZS) raA variation on :class:`Literal` which matches "close" matches, that is, strings with at most 'n' mismatching characters. :class:`CloseMatch` takes parameters: - ``match_string`` - string to be matched - ``maxMismatches`` - (``default=1``) maximum number of mismatches allowed to count as a match The results from a successful parse will contain the matched text from the input string and the following named results: - ``mismatches`` - a list of the positions within the match_string where mismatches were found - ``original`` - the original match_string used to compare against the input string If ``mismatches`` is an empty list, then the match was an exact match. Example:: patt = CloseMatch("ATCATCGAATGGA") patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']}) patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1) # exact match patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']}) # close match allowing up to 2 mismatches patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2) patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']}) rcsBtt|||_||_||_d|j|jf|_d|_d|_dS)Nz&Expected %r (with up to %d mismatches)F) rQrrr match_string maxMismatchesrrr)rrrrTrrr szCloseMatch.__init__TcCs|}t|}|t|j}||kr|j}d}g} |j} tt||||D]2\}} | \} } | | krL| |t| | krLqqL|d}t|||g}||d<| |d<||fSt|||j|dS)Nrroriginal mismatches) rrrrrrr5r2r)rrrrstartrmaxlocrZmatch_stringlocrrZs_msrcmatresultsrrrr s(  zCloseMatch.parseImpl)r)TrqrrrTrr s  cs8eZdZdZd fdd Zdd d Zfd d ZZS)rBaX Token for matching words composed of allowed character sets. Defined with string containing all allowed initial characters, an optional string containing allowed body characters (if omitted, defaults to the initial character set), and an optional minimum, maximum, and/or exact length. The default value for ``min`` is 1 (a minimum value < 1 is not valid); the default values for ``max`` and ``exact`` are 0, meaning no maximum or exact length restriction. An optional ``excludeChars`` parameter can list characters that might be found in the input ``bodyChars`` string; useful to define a word of all printables except for one or two characters, for instance. :class:`srange` is useful for defining custom character set strings for defining ``Word`` expressions, using range notation from regular expression character sets. A common mistake is to use :class:`Word` to match a specific literal string, as in ``Word("Address")``. Remember that :class:`Word` uses the string argument to define *sets* of matchable characters. This expression would match "Add", "AAA", "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'. To match an exact literal string, use :class:`Literal` or :class:`Keyword`. pyparsing includes helper strings for building Words: - :class:`alphas` - :class:`nums` - :class:`alphanums` - :class:`hexnums` - :class:`alphas8bit` (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.) - :class:`punc8bit` (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.) - :class:`printables` (any non-whitespace character) Example:: # a word composed of digits integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9")) # a word with a leading capital, and zero or more lowercase capital_word = Word(alphas.upper(), alphas.lower()) # hostnames are alphanumeric, with leading alpha, and '-' hostname = Word(alphas, alphanums + '-') # roman numeral (not a strict parser, accepts invalid mix of characters) roman = Word("IVXLCDM") # any string of non-whitespace characters, except for ',' csv_value = Word(printables, excludeChars=",") NrrFcstt|rNtdfdd|D}|rNdfdd|D}||_t||_|rt||_t||_n||_t||_|dk|_ |dkrt d||_ |dkr||_ nt |_ |dkr||_ ||_ t||_d|j|_d |_||_d |j|jkr|dkr|dkr|dkr|j|jkr@d t|j|_nHt|jdkrnd t|jt|jf|_nd t|jt|jf|_|jrd|jd|_zt|j|_Wntk rd|_YnX|jj|_t|_dS)Nrc3s|]}|kr|VqdSrrr excludeCharsrrr2 sz Word.__init__..c3s|]}|kr|VqdSrrrrrrr4 srrzZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permittedrFrz[%s]+z%s[%s]*z [%s][%s]*z\b)rQrBrrr initCharsOrig initChars bodyCharsOrig bodyChars maxSpecifiedr5minLenmaxLenrhrrrr asKeyword_escapeRegexRangeCharsreStringrrescapecompilerrsre_match _WordRegexr)rrrminmaxexactrrrTrrr. sZ      0     z Word.__init__Tc Cs|||jkrt|||j||}|d7}t|}|j}||j}t||}||krj|||krj|d7}qLd}|||jkrd}nV|jr||kr|||krd}n6|j r|dkr||d|ks||kr|||krd}|rt|||j|||||fS)NrFTr) rr2rrrrrrrr) rrrrrrZ bodycharsrZthrowExceptionrrrrg s2    zWord.parseImplcsvztt|WStk r$YnX|jdkrpdd}|j|jkr`d||j||jf|_nd||j|_|jS)NcSs$t|dkr|dddS|SdS)Nrjrrrrr charsAsStr s z Word.__str__..charsAsStrz W:(%s, %s)zW:(%s))rQrBrrrrr)rrrTrrr s  z Word.__str__)NrrrFN)TrrrrrrrrirrrTrrB s49 c@seZdZdddZdS)rTcCs4|||}|s t|||j||}||fSr)rr2rendgroup)rrrrrfrrrr s  z_WordRegex.parseImplN)Trzrrrrr srcs"eZdZdZdfdd ZZS)rFzA short-cut class for defining ``Word(characters, exact=1)``, when defining a match of any single character in a string of characters. FNcsZtt|j|d||ddtd|j|_|r>d|j|_t|j|_|jj |_ dS)Nr)rrr[%s]rz\b%s\b) rQrFrrrrrrrrsr)rcharsetrrrTrrr s  z Char.__init__)FNrprrrTrrF scsbeZdZdZeedZdfdd Zddd Z dd d Z dd d Z fddZ ddZ ZS)r:aToken for matching strings that match a given regular expression. Defined with string specifying the regular expression in a form recognized by the stdlib Python `re module `_. If the given regex contains named groups (defined using ``(?P...)``), these will be preserved as named parse results. Example:: realnum = Regex(r"[+-]?\d+\.\d*") date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)') # ref: https://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression roman = Regex(r"M{0,4}(CM|CD|D?{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") z[A-Z]rFcstt|t|tr|s,tjdtdd||_||_ zt |j|j |_ |j|_ Wqt jk rtjd|tddYqXn2t|tjr||_ t||_|_ ||_ ntd|j j|_t||_d|j|_d|_d|_||_||_|jr|j|_|jr|j|_d S) aThe parameters ``pattern`` and ``flags`` are passed to the ``re.compile()`` function as-is. See the Python `re module `_ module for an explanation of the acceptable patterns and flags. z0null string passed to Regex; use Empty() insteadrr$$invalid pattern (%s) passed to RegexzCRegex may only be constructed with a string or a compiled RE objectrFTN)rQr:rrrr(r)r*patternflagsrrr sre_constantserrorcompiledREtyperr5rsrrrrrr asGroupListasMatchparseImplAsGroupListrparseImplAsMatch)rrrrrrTrrr sD        zRegex.__init__Tc Csb|||}|s t|||j||}t|}|}|rZ|D]\}}|||<qH||fSr)rr2rrr5r groupdictr!) rrrrrfrdrrrrrr s   zRegex.parseImplcCs8|||}|s t|||j||}|}||fSr)rr2rrgroupsrrrrrfrrrrr s  zRegex.parseImplAsGroupListcCs4|||}|s t|||j||}|}||fSr)rr2rrrrrrr s  zRegex.parseImplAsMatchcsFztt|WStk r$YnX|jdkr@dt|j|_|jS)NzRe:(%s))rQr:rrrrrrrTrrr s z Regex.__str__csljrtjdtddtjr@tr@tjdtddtjrTfdd}nfdd}|S)a Return Regex with an attached parse action to transform the parsed result as if called using `re.sub(expr, repl, string) `_. Example:: make_html = Regex(r"(\w+):(.*?):").sub(r"<\1>\2") print(make_html.transformString("h1:main title:")) # prints "

main title

" z-cannot use sub() with Regex(asGroupList=True)rr$z9cannot use sub() with a callable with Regex(asMatch=True)cs|dSr)expandr)replrrr, szRegex.sub..pacsj|dSr)rrrrrrrr/ s)rr(r)r* SyntaxErrorrrr)rrrrrrr s z Regex.sub)rFF)T)T)T)rrrrrrrrrrrrrrrirrrTrr: s - cs8eZdZdZd fdd Zd ddZfd d ZZS) r8a& Token for matching strings that are delimited by quoting characters. Defined with the following parameters: - quoteChar - string of one or more characters defining the quote delimiting string - escChar - character to escape quotes, typically backslash (default= ``None``) - escQuote - special quote sequence to escape an embedded quote string (such as SQL's ``""`` to escape an embedded ``"``) (default= ``None``) - multiline - boolean indicating whether quotes can span multiple lines (default= ``False``) - unquoteResults - boolean indicating whether the matched text should be unquoted (default= ``True``) - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default= ``None`` => same as quoteChar) - convertWhitespaceEscapes - convert escaped whitespace (``'\t'``, ``'\n'``, etc.) to actual whitespace (default= ``True``) Example:: qs = QuotedString('"') print(qs.searchString('lsjdf "This is the quote" sldjf')) complex_qs = QuotedString('{{', endQuoteChar='}}') print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf')) sql_qs = QuotedString('"', escQuote='""') print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf')) prints:: [['This is the quote']] [['This is the "quote"']] [['This is the quote with "embedded" quotes']] NFTc sXtt|}|s0tjdtddt|dkr>|}n"|}|s`tjdtddt|_t |_ |d_ |_ t |_ |_|_|_|_|rtjtjB_dtjtj d|dk rt|pdf_n.r)z|(?:%s)z|(?:%s.)z(.)z)*%srrFT)'rQr8rrr(r)r*r quoteCharr quoteCharLenfirstQuoteCharrendQuoteCharLenescCharescQuoteunquoteResultsconvertWhitespaceEscapesr MULTILINEDOTALLrrrrrrescCharReplacePatternrrrsrrrrrrrr)rrrrZ multilinerrrrTrrrZ sv           zQuotedString.__init__c Cs|||jkr|||pd}|s2t|||j||}|}|jr||j|j }t |t rd|kr|j rddddd}| D]\}}| ||}q|jrt|jd|}|jr| |j|j}||fS)Nr r  )\tr\z\fz\rz\g<1>)rrr2rrrrrrrrrr!rrrrrrr) rrrrrfrZws_mapZwslitZwscharrrrr s* zQuotedString.parseImplcsHztt|WStk r$YnX|jdkrBd|j|jf|_|jS)Nz.quoted string, starting with %s ending with %s)rQr8rrrrrrrTrrr s zQuotedString.__str__)NNFTNT)TrrrrTrr83 s&A #cs8eZdZdZd fdd Zd ddZfd d ZZS) raToken for matching words composed of characters *not* in a given set (will include whitespace in matched characters if not listed in the provided exclusion set - see example). Defined with string containing all disallowed characters, and an optional minimum, maximum, and/or exact length. The default value for ``min`` is 1 (a minimum value < 1 is not valid); the default values for ``max`` and ``exact`` are 0, meaning no maximum or exact length restriction. Example:: # define a comma-separated-value as anything that is not a ',' csv_value = CharsNotIn(',') print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213")) prints:: ['dkls', 'lsdkjf', 's12 34', '@!#', '213'] rrcstt|d|_||_|dkr*td||_|dkr@||_nt|_|dkrZ||_||_t ||_ d|j |_ |jdk|_ d|_ dS)NFrzfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedrr)rQrrrnotCharsr5rrrhrrrrr)rrrrrrTrrr s    zCharsNotIn.__init__TcCs|||jkrt|||j||}|d7}|j}t||jt|}||krb|||krb|d7}qD|||jkrt|||j|||||fSr)rr2rrrrr)rrrrrZnotcharsmaxlenrrrr s zCharsNotIn.parseImplcsfztt|WStk r$YnX|jdkr`t|jdkrTd|jdd|_n d|j|_|jS)Nrz !W:(%s...)z!W:(%s))rQrrrrrrrrTrrrs  zCharsNotIn.__str__)rrr)TrrrrTrr s cs`eZdZdZdddddddd d d d d ddddddddddddZd"fdd Zd#d d!ZZS)$rAaSpecial matching class for matching whitespace. Normally, whitespace is ignored by pyparsing grammars. This class is included when some whitespace structures are significant. Define with a string containing the whitespace characters to be matched; default is ``" \t\r\n"``. Also takes optional ``min``, ``max``, and ``exact`` arguments, as defined for the :class:`Word` class. zzzzzzzzz z z z zzzzzz z zzzz)rrrrrzuA0zu80zu80Euu€0uu€1uu€2uu€3uu€4uu€5uu€6uu€7uu€8uu€9uu€Auu€Buu‚Fuu…FuuÀ0 rrcstt|_dfddjDdddjD_d_dj_ |_ |dkrt|_ nt _ |dkr|_ |_ dS)Nrc3s|]}|jkr|VqdSr) matchWhiterrrrr:s z!White.__init__..css|]}tj|VqdSr)rA whiteStrsrrrrr<sTrr) rQrArrrDrrrrrrrrh)rZwsrrrrTrrr7s  zWhite.__init__TcCs|||jkrt|||j||}|d7}||j}t|t|}||krb|||jkrb|d7}qB|||jkrt|||j|||||fSr)rr2rrrrr)rrrrrrrrrrKs  zWhite.parseImpl)rrrr)T)rrrrrrrrirrrTrrAs6 cseZdZfddZZS)_PositionTokencs(tt||jj|_d|_d|_dSr)rQrrrrrrrrrTrrr\s z_PositionToken.__init__rrrrrirrrTrr[srcs2eZdZdZfddZddZd ddZZS) r"zaToken to advance to a specific column of input text; useful for tabular report scraping. cstt|||_dSr)rQr"rrM)rcolnorTrrrfszGoToColumn.__init__cCs\t|||jkrXt|}|jr*|||}||krX||rXt|||jkrX|d7}q*|Sr)rMrrrisspace)rrrrrrrrjs $ zGoToColumn.preParseTcCsDt||}||jkr"t||d|||j|}|||}||fS)NzText not in expected columnrMr2)rrrrZthiscolZnewlocrrrrrss    zGoToColumn.parseImpl)T)rrrrrrrrirrrTrr"bs  cs*eZdZdZfddZdddZZS)r&aMatches if current position is at the beginning of a line within the parse string Example:: test = '''\ AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (LineStart() + 'AAA' + restOfLine).searchString(test): print(t) prints:: ['AAA', ' this line'] ['AAA', ' and this line'] cstt|d|_dS)NzExpected start of line)rQr&rrrrTrrrszLineStart.__init__TcCs*t||dkr|gfSt|||j|dSr)rMr2rrrrrrszLineStart.parseImpl)TrqrrrTrr&|s cs*eZdZdZfddZdddZZS)r%zTMatches if current position is at the end of a line within the parse string cs,tt||tjddd|_dS)NrrzExpected end of line)rQr%rrDr7rrrrrTrrrszLineEnd.__init__TcCsb|t|kr6||dkr$|ddfSt|||j|n(|t|krN|dgfSt|||j|dS)Nrrrr2rrrrrrs     zLineEnd.parseImpl)TrqrrrTrr%s cs*eZdZdZfddZdddZZS)r=zLMatches if current position is at the beginning of the parse string cstt|d|_dS)NzExpected start of text)rQr=rrrrTrrrszStringStart.__init__TcCs0|dkr(|||dkr(t|||j||gfSr)rr2rrrrrrszStringStart.parseImpl)TrqrrrTrr=s cs*eZdZdZfddZdddZZS)r<zBMatches if current position is at the end of the parse string cstt|d|_dS)NzExpected end of text)rQr<rrrrTrrrszStringEnd.__init__TcCs^|t|krt|||j|n<|t|kr6|dgfS|t|krJ|gfSt|||j|dSrrrrrrrs    zStringEnd.parseImpl)TrqrrrTrr<s cs.eZdZdZeffdd ZdddZZS)rDayMatches if the current position is at the beginning of a Word, and is not preceded by any character in a given set of ``wordChars`` (default= ``printables``). To emulate the ```` behavior of regular expressions, use ``WordStart(alphanums)``. ``WordStart`` will also match at the beginning of the string being parsed, or at the beginning of a line. cs"tt|t||_d|_dS)NzNot at the start of a word)rQrDrr wordCharsrrrrTrrrs zWordStart.__init__TcCs@|dkr8||d|jks(|||jkr8t|||j||gfSr)rr2rrrrrrs  zWordStart.parseImpl)TrrrrrjrrrirrrTrrDscs.eZdZdZeffdd ZdddZZS)rCa_Matches if the current position is at the end of a Word, and is not followed by any character in a given set of ``wordChars`` (default= ``printables``). To emulate the ```` behavior of regular expressions, use ``WordEnd(alphanums)``. ``WordEnd`` will also match at the end of the string being parsed, or at the end of a line. cs(tt|t||_d|_d|_dS)NFzNot at the end of a word)rQrCrrrrrrrTrrrs zWordEnd.__init__TcCsPt|}|dkrH||krH|||jks8||d|jkrHt|||j||gfSr)rrr2r)rrrrrrrrrszWordEnd.parseImpl)TrrrrTrrCscszeZdZdZdfdd ZddZddZfd d Zfd d Zfd dZ dddZ fddZ dfdd Z Z S)r3z]Abstract subclass of ParserElement, for combining and post-processing parsed tokens. Fcstt|t|tr"t|}t|tr<|g_nt|t rP|g_nnt|t rt|}t dd|Drfdd|D}t|_n,zt|_Wnt k r|g_YnXd_ dS)Ncss|]}t|tVqdSr)rr)rrrrrr sz+ParseExpression.__init__..c3s&|]}t|tr|n|VqdSr)rrrrrrrrr sF)rQr3rrr r rrexprsr7r rvrrrrrrTrrrs"      zParseExpression.__init__cCs|j|d|_|Sr)rrrrSrrrrs zParseExpression.appendcCs0d|_dd|jD|_|jD] }|q|S)zExtends ``leaveWhitespace`` defined in base class, and also invokes ``leaveWhitespace`` on all contained expressions.FcSsg|] }|qSrrHrrrrrsz3ParseExpression.leaveWhitespace..)rrrC)rrrrrrCs   zParseExpression.leaveWhitespacecsrt|trB||jkrntt|||jD]}||jdq*n,tt|||jD]}||jdqX|Sr.)rr>rrQr3rFr)rrJrrTrrrF#s    zParseExpression.ignorecsNztt|WStk r$YnX|jdkrHd|jjt|jf|_|jSNz%s:(%s)) rQr3rrrrrrrrrTrrr/s zParseExpression.__str__cs*tt||jD] }|qt|jdkr|jd}t||jr|js|jdkr|j s|jdd|jdg|_d|_ |j |j O_ |j |j O_ |jd}t||jr|js|jdkr|j s|jdd|jdd|_d|_ |j |j O_ |j |j O_ dt ||_|S)Nrrrrr)rQr3rrrrrrrrrrrrr)rrrJrTrrr9s<     zParseExpression.streamlineNcCsB|dk r |ngdd|g}|jD]}||q$|gdSr)rrKrI)rrJtmprrrrrK[s  zParseExpression.validatecs$tt|}dd|jD|_|S)NcSsg|] }|qSrrHrrrrrcsz(ParseExpression.copy..)rQr3rIrrcrTrrrIaszParseExpression.copycsVtjrD|jD]6}t|tr |jr tjdd|t |j |jddq t t | ||S)N]{0}: setting results name {1!r} on {2} expression collides with {3!r} on contained expression)warn_ungrouped_named_tokens_in_collectionrr$)rrrrr7rr(r)rrrrQr3rrrrrrTrrrfs zParseExpression._setResultsName)F)N)F)rrrrrrrCrFrrrKrIrrirrrTrr3s "  cs`eZdZdZGdddeZdfdd ZfddZdd d Zd d Z d dZ ddZ Z S)ra Requires all given :class:`ParseExpression` s to be found in the given order. Expressions may be separated by whitespace. May be constructed using the ``'+'`` operator. May also be constructed using the ``'-'`` operator, which will suppress backtracking. Example:: integer = Word(nums) name_expr = OneOrMore(Word(alphas)) expr = And([integer("id"), name_expr("name"), integer("age")]) # more easily written as: expr = integer("id") + name_expr("name") + integer("age") cseZdZfddZZS)zAnd._ErrorStopcs&ttj|j||d|_|dS)N-)rQrr,rrrCryrTrrrszAnd._ErrorStop.__init__rrrrTrr,sr,Tcs|rt|krg}t|D]`\}}|tkrn|t|dkrdt||djd}|t|dqxtdq||q||dd<tt | ||t dd|jD|_ | |jdj|jdj|_d|_dS) Nrrr+z0cannot construct And with sequence ending in ...css|] }|jVqdSrrrrrrrszAnd.__init__..rT)r&rrrrrr;rrQrrrrrDrrr)rrrrrrZ skipto_argrTrrrs    z And.__init__cs|jrtdd|jddDrt|jddD]^\}}|dkrFq4t|tr4|jr4t|jdtr4|jd|j|d|jd<d|j|d<q4dd|jD|_tt|t dd|jD|_ |S)Ncss.|]&}t|to$|jo$t|jdtVqdSrN)rr3rr'rrrrrsz!And.streamline..rrcSsg|]}|dk r|qSrrrrrrrsz"And.streamline..css|] }|jVqdSrrrrrrrs) rrvrrr3r'rQrrrr)rrrrTrrrs$  zAnd.streamlinec Cs|jdj|||dd\}}d}|jddD]}t|tjrDd}q.|rz||||\}}Wqtk rtYqtk r}zd|_t|W5d}~XYqt k rt|t ||j |YqXn||||\}}|s| r.||7}q.||fS)NrFrrT) rrrrr,r6r0rrrrrr;) rrrr resultlistZ errorStoprZ exprtokensrrrrrs(   z And.parseImplcCst|tr||}||SrrrrrrSrrrrDs  z And.__iadd__cCs6|dd|g}|jD]}|||jsq2qdSr)rrIrrrsubRecCheckListrrrrrIs   zAnd.checkRecursioncCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nr{rcss|]}t|VqdSrrrrrrrszAnd.__str__..}r1rrrrrrrrrs    z And.__str__)T)T) rrrrrr,rrrrDrIrrirrrTrrts  cs^eZdZdZdfdd ZfddZddd Zd d Zd d ZddZ dfdd Z Z S)r/aRequires that at least one :class:`ParseExpression` is found. If two expressions match, the expression that matches the longest string will be used. May be constructed using the ``'^'`` operator. Example:: # construct Or using '^' operator number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) prints:: [['123'], ['3.1416'], ['789']] Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|] }|jVqdSrrrrrrrszOr.__init__..T)rQr/rrrvrrrTrrrsz Or.__init__cs.tt|tjr*tdd|jD|_|S)Ncss|] }|jVqdSrrrrrrrsz Or.streamline..)rQr/rrcollect_all_And_tokensrvrrrrTrrrsz Or.streamlineTc Csd}d}g}|jD]}z|||}Wnvtk rb} zd| _| j|krR| }| j}W5d} ~ XYqtk rt||krt|t||j|}t|}YqX|||fq|r|j t ddd|s|dd} | |||Sd} |D]\} } | | dkr | Sz| |||\}}Wn@tk r`} z d| _| j|krP| }| j}W5d} ~ XYqX|| krx||fS|| dkr||f} q| dkr| S|dk r|j|_ |nt||d|dS)NrrT)r@r rr no defined alternatives to match) rrr2rrrrrrsortrrr)rrrr maxExcLoc maxExceptionrrZloc2rZ best_exprZlongestZloc1Zexpr1rrrrrsT            z Or.parseImplcCst|tr||}||SrrrSrrr__ixor__;s  z Or.__ixor__cCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz ^ css|]}t|VqdSrrrrrrrEszOr.__str__..rrrrrrr@s    z Or.__str__cCs,|dd|g}|jD]}||qdSrrrIrrrrrIIs zOr.checkRecursioncsPtjs>tjr>tdd|jDr>tjdd|t |j ddt t | ||S)Ncss|]}t|tVqdSrrrrrrrrQsz%Or._setResultsName..{0}: setting results name {1!r} on {2} expression may only return a single token for an And alternative, in future will return the full list of tokens)warn_multiple_tokens_in_named_alternationrr$)rrrrrvrr(r)rrrrQr/rrrTrrrNszOr._setResultsName)F)T)F) rrrrrrrrrrIrrirrrTrr/s  = cs^eZdZdZdfdd ZfddZddd Zd d Zd d ZddZ dfdd Z Z S)r)aRequires that at least one :class:`ParseExpression` is found. If two expressions match, the first one listed is the one that will match. May be constructed using the ``'|'`` operator. Example:: # construct MatchFirst using '|' operator # watch the order of expressions to match number = Word(nums) | Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) # Fail! -> [['123'], ['3'], ['1416'], ['789']] # put more selective expression first number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums) print(number.searchString("123 3.1416 789")) # Better -> [['123'], ['3.1416'], ['789']] Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|] }|jVqdSrrrrrrrosz&MatchFirst.__init__..T)rQr)rrrvrrrTrrrlszMatchFirst.__init__cs.tt|tjr*tdd|jD|_|S)Ncss|] }|jVqdSrrrrrrrvsz(MatchFirst.streamline..)rQr)rrrrvrrrrTrrrsszMatchFirst.streamlineTc Csd}d}|jD]}z||||}|WStk r`}z|j|krP|}|j}W5d}~XYqtk rt||krt|t||j|}t|}YqXq|dk r|j|_|nt||d|dS)Nrr)rrr2rrrrr) rrrrrrrrrrrrrys$    zMatchFirst.parseImplcCst|tr||}||SrrrSrrr__ior__s  zMatchFirst.__ior__cCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrr | css|]}t|VqdSrrrrrrrsz%MatchFirst.__str__..rrrrrrrs    zMatchFirst.__str__cCs,|dd|g}|jD]}||qdSrrrrrrrIs zMatchFirst.checkRecursioncsPtjs>tjr>tdd|jDr>tjdd|t |j ddt t | ||S)Ncss|]}t|tVqdSrrrrrrrsz-MatchFirst._setResultsName..rrrr$)rrrrrvrr(r)rrrrQr)rrrTrrrszMatchFirst._setResultsName)F)T)F) rrrrrrrrrrIrrirrrTrr)[s   csHeZdZdZd fdd ZfddZdddZd d Zd d ZZ S)rasRequires all given :class:`ParseExpression` s to be found, but in any order. Expressions may be separated by whitespace. May be constructed using the ``'&'`` operator. Example:: color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN") shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON") integer = Word(nums) shape_attr = "shape:" + shape_type("shape") posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn") color_attr = "color:" + color("color") size_attr = "size:" + integer("size") # use Each (using operator '&') to accept attributes in any order # (shape and posn are required, color and size are optional) shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr) shape_spec.runTests(''' shape: SQUARE color: BLACK posn: 100, 120 shape: CIRCLE size: 50 color: BLUE posn: 50,80 color:GREEN size:20 shape:TRIANGLE posn:20,40 ''' ) prints:: shape: SQUARE color: BLACK posn: 100, 120 ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']] - color: BLACK - posn: ['100', ',', '120'] - x: 100 - y: 120 - shape: SQUARE shape: CIRCLE size: 50 color: BLUE posn: 50,80 ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']] - color: BLUE - posn: ['50', ',', '80'] - x: 50 - y: 80 - shape: CIRCLE - size: 50 color: GREEN size: 20 shape: TRIANGLE posn: 20,40 ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']] - color: GREEN - posn: ['20', ',', '40'] - x: 20 - y: 40 - shape: TRIANGLE - size: 20 Tcs>tt|||tdd|jD|_d|_d|_d|_dS)Ncss|] }|jVqdSrrrrrrrsz Each.__init__..T) rQrrrrrrinitExprGroupsrrrTrrrs z Each.__init__cs(tt|tdd|jD|_|S)Ncss|] }|jVqdSrrrrrrrsz"Each.streamline..)rQrrrrrrrTrrrszEach.streamlinec s|jrtdd|jD|_dd|jD}dd|jD}|||_dd|jD|_dd|jD|_dd|jD|_|j|j7_d |_|}|jdd}|jddg}d } | rj||j|j} g} | D]v} z| ||}Wn t k r| | YqX| |j t | | | |kr@| | q| kr܈ | qt| t| krd } q|rd d d|D} t ||d | |fdd|jD7}g}|D]"} | |||\}}| |qt|tg}||fS)Ncss&|]}t|trt|j|fVqdSr)rr.rVrrrrrrs z!Each.parseImpl..cSsg|]}t|tr|jqSrrr.rrrrrrs z"Each.parseImpl..cSs g|]}|jrt|ts|qSr)rrr.rrrrrs cSsg|]}t|tr|jqSr)rrErrrrrrs cSsg|]}t|tr|jqSr)rr,rrrrrrs cSs g|]}t|tttfs|qSr)rr.rEr,rrrrrsFTrVcss|]}t|VqdSrrrrrrrsz*Missing one or more required elements (%s)cs$g|]}t|tr|jkr|qSrrrZtmpOptrrrs )rrrZopt1mapZ optionalsZmultioptionalsZ multirequiredZrequiredrr2rrrVremoverrrsumr5)rrrrZopt1Zopt2ZtmpLocZtmpReqdZ matchOrderZ keepMatchingZtmpExprsZfailedrZmissingrrZ finalResultsrrrrsP    zEach.parseImplcCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz & css|]}t|VqdSrrrrrrr,szEach.__str__..rrrrrrr's    z Each.__str__cCs,|dd|g}|jD]}||qdSrrrrrrrI0s zEach.checkRecursion)T)T) rrrrrrrrrIrirrrTrrs 8  1 csjeZdZdZdfdd ZdddZdd Zfd d Zfd d ZddZ dddZ fddZ Z S)r1zfAbstract subclass of :class:`ParserElement`, for combining and post-processing parsed tokens. Fcstt||t|tr@t|jtr2||}n|t|}||_ d|_ |dk r|j |_ |j |_ | |j|j|_|j|_|j|_|j|jdSr)rQr1rrr issubclassrr?r'rrrrrDrrrrrrErrrrTrrr:s    zParseElementEnhance.__init__TcCs2|jdk r|jj|||ddStd||j|dS)NFrr)rrr2rrrrrrLs zParseElementEnhance.parseImplcCs*d|_|j|_|jdk r&|j|Sr~)rrrIrCrrrrrCRs    z#ParseElementEnhance.leaveWhitespacecsrt|trB||jkrntt|||jdk rn|j|jdn,tt|||jdk rn|j|jd|Sr.)rr>rrQr1rFrrSrTrrrFYs    zParseElementEnhance.ignorecs&tt||jdk r"|j|Sr)rQr1rrrrTrrres  zParseElementEnhance.streamlinecCsB||krt||g|dd|g}|jdk r>|j|dSr)r9rrI)rrrrrrrIks  z"ParseElementEnhance.checkRecursionNcCsB|dkr g}|dd|g}|jdk r4|j||gdSrrrKrIrrJrrrrrKrs   zParseElementEnhance.validatecsXztt|WStk r$YnX|jdkrR|jdk rRd|jjt|jf|_|jSr) rQr1rrrrrrrrrTrrrzszParseElementEnhance.__str__)F)T)N) rrrrrrrCrFrrIrKrrirrrTrr16s   cs*eZdZdZfddZdddZZS)r abLookahead matching of the given parse expression. ``FollowedBy`` does *not* advance the parsing position within the input string, it only verifies that the specified parse expression matches at the current position. ``FollowedBy`` always returns a null token list. If any results names are defined in the lookahead expression, those *will* be returned for access by name. Example:: # use FollowedBy to match a label only if it is followed by a ':' data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint() prints:: [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']] cstt||d|_dSr)rQr rrrrrTrrrszFollowedBy.__init__TcCs(|jj|||d\}}|dd=||fS)Nr)rr)rrrr_rrrrrs zFollowedBy.parseImpl)TrqrrrTrr s cs,eZdZdZd fdd Zd ddZZS) r(apLookbehind matching of the given parse expression. ``PrecededBy`` does not advance the parsing position within the input string, it only verifies that the specified parse expression matches prior to the current position. ``PrecededBy`` always returns a null token list, but if a results name is defined on the given expression, it is returned. Parameters: - expr - expression that must match prior to the current parse location - retreat - (default= ``None``) - (int) maximum number of characters to lookbehind prior to the current parse location If the lookbehind expression is a string, Literal, Keyword, or a Word or CharsNotIn with a specified exact or maximum length, then the retreat parameter is not required. Otherwise, retreat must be specified to give a maximum number of characters to look back from the current parse position for a lookbehind match. Example:: # VB-style variable names with type prefixes int_var = PrecededBy("#") + pyparsing_common.identifier str_var = PrecededBy("$") + pyparsing_common.identifier Ncstt||||_d|_d|_d|_t|t rJt |}d|_nVt|t t frf|j }d|_n:t|ttfr|jtkr|j}d|_nt|trd}d|_||_dt ||_d|_dS)NTFrznot preceded by )rQr(rrrCrrrrrrr'r$rtrBrrrhrretreatrr)rrrrTrrrs(  zPrecededBy.__init__rTc Cs|jr<||jkrt|||j||j}|j||\}}n|jt}|d|}t|||j} tdt||jdD]H} z|||| \}}Wn&t k r} z| } W5d} ~ XYqxXqqx| |dd=||fSr) rrr2rrrr<rrr0) rrrrrrrZ test_exprZinstring_sliceZ last_exprrMZpberrrrs"     zPrecededBy.parseImpl)N)rTrqrrrTrr(scs2eZdZdZfddZd ddZddZZS) r+aLookahead to disallow matching with the given parse expression. ``NotAny`` does *not* advance the parsing position within the input string, it only verifies that the specified parse expression does *not* match at the current position. Also, ``NotAny`` does *not* skip over leading whitespace. ``NotAny`` always returns a null token list. May be constructed using the '~' operator. Example:: AND, OR, NOT = map(CaselessKeyword, "AND OR NOT".split()) # take care not to mistake keywords for identifiers ident = ~(AND | OR | NOT) + Word(alphas) boolean_term = Optional(NOT) + ident # very crude boolean expression - to support parenthesis groups and # operation hierarchy, use infixNotation boolean_expr = boolean_term + ZeroOrMore((AND | OR) + boolean_term) # integers that are followed by "." are actually floats integer = Word(nums) + ~Char(".") cs0tt||d|_d|_dt|j|_dS)NFTzFound unwanted token, )rQr+rrrrrrrrTrrr szNotAny.__init__TcCs&|j||rt|||j||gfSr)rrr2rrrrrrszNotAny.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrz~{rr1rrrrrrrrrs   zNotAny.__str__)TrrrrTrr+s  cs>eZdZd fdd ZddZd ddZdfd d ZZS)_MultipleMatchNcs<tt||d|_|}t|tr.||}||dSr)rQrrrrrrstopOn)rrrenderrTrrr s   z_MultipleMatch.__init__cCs,t|tr||}|dk r"|nd|_|Sr)rrr not_ender)rrrrrr(s  z_MultipleMatch.stopOnTc Cs|jj}|j}|jdk }|r$|jj}|r2|||||||dd\}}zV|j } |r`|||| rp|||} n|} ||| |\}} | s| rR|| 7}qRWnttfk rYnX||fSNFr) rrrr rrr;r2r) rrrrZself_expr_parseZself_skip_ignorablesZ check_enderZ try_not_enderrZhasIgnoreExprsrZ tmptokensrrrr.s*      z_MultipleMatch.parseImplFcsftjrT|jgt|jdgD]6}t|tr|jrtjd d|t |j |jddqt t |||S)Nrrrrr$)rrrrrr7rr(r)rrrrQrrrrTrrrKsz_MultipleMatch._setResultsName)N)T)F)rrrrrrrrirrrTrrs rc@seZdZdZddZdS)r,ajRepetition of one or more of the given expression. Parameters: - expr - expression that must match one or more times - stopOn - (default= ``None``) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: BLACK" OneOrMore(attr_expr).parseString(text).pprint() # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']] # use stopOn attribute for OneOrMore to avoid reading label string as part of the data attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']] # could also be written as (attr_expr * (1,)).parseString(text).pprint() cCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrz}...rrrrrrss   zOneOrMore.__str__N)rrrrrrrrrr,Yscs8eZdZdZd fdd Zd fdd Zdd ZZS) rEakOptional repetition of zero or more of the given expression. Parameters: - expr - expression that must match zero or more times - stopOn - (default= ``None``) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example: similar to :class:`OneOrMore` Ncstt|j||dd|_dS)N)rT)rQrErr)rrrrTrrrszZeroOrMore.__init__Tc s<ztt||||WSttfk r6|gfYSXdSr)rQrErr2rrrTrrrszZeroOrMore.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)NrrU]...rrrrrrs   zZeroOrMore.__str__)N)TrrrrTrrE|s c@s eZdZddZeZddZdS) _NullTokencCsdSr~rrrrrr*sz_NullToken.__bool__cCsdSrrrrrrrsz_NullToken.__str__N)rrrr*rrrrrrr sr cs<eZdZdZeZeffdd Zd ddZddZZ S) r.aGOptional matching of the given expression. Parameters: - expr - expression that must match zero or more times - default (optional) - value to be returned if the optional expression is not found. Example:: # US postal code can be a 5-digit zip, plus optional 4-digit qualifier zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4))) zip.runTests(''' # traditional ZIP code 12345 # ZIP+4 form 12101-0001 # invalid ZIP 98765- ''') prints:: # traditional ZIP code 12345 ['12345'] # ZIP+4 form 12101-0001 ['12101-0001'] # invalid ZIP 98765- ^ FAIL: Expected end of text (at char 5), (line:1, col:6) cs.tt|j|dd|jj|_||_d|_dS)NFroT)rQr.rrrrAr)rrr<rTrrrs zOptional.__init__Tc Cs|z|jj|||dd\}}WnVttfk rr|j|jk rj|jjr`t|jg}|j||jj<qn|jg}ng}YnX||fSr )rrr2rrA_Optional__optionalNotMatchedrr5)rrrrrrrrrs    zOptional.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)NrrUrXrrrrrrs   zOptional.__str__)T) rrrrr r rrrrirrrTrr.s $ cs,eZdZdZd fdd Zd ddZZS) r;a Token for skipping over all undefined text until the matched expression is found. Parameters: - expr - target expression marking the end of the data to be skipped - include - (default= ``False``) if True, the target expression is also parsed (the skipped text and target expression are returned as a 2-element list). - ignore - (default= ``None``) used to define grammars (typically quoted strings and comments) that might contain false matches to the target expression - failOn - (default= ``None``) define expressions that are not allowed to be included in the skipped test; if found before the target expression is found, the SkipTo is not a match Example:: report = ''' Outstanding Issues Report - 1 Jan 2000 # | Severity | Description | Days Open -----+----------+-------------------------------------------+----------- 101 | Critical | Intermittent system crash | 6 94 | Cosmetic | Spelling error on Login ('log|n') | 14 79 | Minor | System slow when running too many reports | 47 ''' integer = Word(nums) SEP = Suppress('|') # use SkipTo to simply match everything up until the next SEP # - ignore quoted strings, so that a '|' character inside a quoted string does not match # - parse action will call token.strip() for each matched token, i.e., the description body string_data = SkipTo(SEP, ignore=quotedString) string_data.setParseAction(tokenMap(str.strip)) ticket_expr = (integer("issue_num") + SEP + string_data("sev") + SEP + string_data("desc") + SEP + integer("days_open")) for tkt in ticket_expr.searchString(report): print tkt.dump() prints:: ['101', 'Critical', 'Intermittent system crash', '6'] - days_open: 6 - desc: Intermittent system crash - issue_num: 101 - sev: Critical ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14'] - days_open: 14 - desc: Spelling error on Login ('log|n') - issue_num: 94 - sev: Cosmetic ['79', 'Minor', 'System slow when running too many reports', '47'] - days_open: 47 - desc: System slow when running too many reports - issue_num: 79 - sev: Minor FNcs`tt||||_d|_d|_||_d|_t|t rF| ||_ n||_ dt |j |_dS)NTFzNo match found for )rQr;r ignoreExprrr includeMatchrrrrfailOnrrr)rrJZincluderFrrTrrr s zSkipTo.__init__Tc Cs&|}t|}|j}|jj}|jdk r,|jjnd}|jdk rB|jjnd} |} | |kr|dk rf||| rfq| dk rz| || } Wqntk rYqYqnXqnz||| dddWqtt fk r| d7} YqJXqqJt|||j || }|||} t | } |j r||||dd\}} | | 7} || fS)NF)rrrr) rrrrrrrr0r2rrr5r)rrrrrrrZ expr_parseZself_failOn_canParseNextZself_ignoreExpr_tryParseZtmplocZskiptextZ skipresultrrrrr-s:   zSkipTo.parseImpl)FNN)TrqrrrTrr;s9 csneZdZdZdfdd ZddZddZd d Zd d Zdd dZ ddZ fddZ dfdd Z Z S)r!a_Forward declaration of an expression to be defined later - used for recursive grammars, such as algebraic infix notation. When the expression is known, it is assigned to the ``Forward`` variable using the '<<' operator. Note: take care when assigning to ``Forward`` not to overlook precedence of operators. Specifically, '|' has a lower precedence than '<<', so that:: fwdExpr << a | b | c will actually be evaluated as:: (fwdExpr << a) | b | c thereby leaving b and c out as parseable alternatives. It is recommended that you explicitly group the values inserted into the ``Forward``:: fwdExpr << (a | b | c) Converting to use the '<<=' operator instead will avoid this problem. See :class:`ParseResults.pprint` for an example of a recursive parser created using ``Forward``. Ncstt|j|dddSrn)rQr!rrSrTrrrwszForward.__init__cCsjt|tr||}||_d|_|jj|_|jj|_||jj|jj |_ |jj |_ |j |jj |Sr) rrrrrrrrDrrrrrErSrrr __lshift__zs      zForward.__lshift__cCs||>SrrrSrrr __ilshift__szForward.__ilshift__cCs d|_|Sr~rBrrrrrCszForward.leaveWhitespacecCs$|js d|_|jdk r |j|Sr)rrrrrrrrs   zForward.streamlinecCsJ|dkr g}||kr<|dd|g}|jdk r<|j||gdSrrrrrrrKs  zForward.validatecCslt|dr|jS|jdk r |jSd|_d}z&|jdk rJt|jdd}nd}W5|jjd||_X|jS)Nrz: ...rjz: iNone)r1rrrrrr)rZ retStringrrrrs   zForward.__str__cs.|jdk rtt|St}||K}|SdSr)rrQr!rIrcrTrrrIs  z Forward.copyFcs@tjr.|jdkr.tjdd|t|jddtt | ||S)NzR{0}: setting results name {0!r} on {1} expression that has no contained expressionwarn_name_set_on_empty_Forwardrr$) rrrr(r)rrrrQr!rrrTrrrs zForward._setResultsName)N)N)F)rrrrrrrrCrrKrrIrrirrrTrr!\s   cs"eZdZdZdfdd ZZS)r@zW Abstract subclass of :class:`ParseExpression`, for converting parsed results. Fcstt||d|_dSr~)rQr@rrrrTrrrszTokenConverter.__init__)FrprrrTrr@scs6eZdZdZd fdd ZfddZdd ZZS) raConverter to concatenate all matching tokens to a single string. By default, the matching patterns must also be contiguous in the input string; this can be disabled by specifying ``'adjacent=False'`` in the constructor. Example:: real = Word(nums) + '.' + Word(nums) print(real.parseString('3.1416')) # -> ['3', '.', '1416'] # will also erroneously match the following print(real.parseString('3. 1416')) # -> ['3', '.', '1416'] real = Combine(Word(nums) + '.' + Word(nums)) print(real.parseString('3.1416')) # -> ['3.1416'] # no match when there are internal spaces print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...) rTcs8tt|||r|||_d|_||_d|_dSr)rQrrrCadjacentr joinStringr)rrrrrTrrrszCombine.__init__cs(|jrt||ntt|||Sr)rr7rFrQrrSrTrrrFszCombine.ignorecCsP|}|dd=|td||jg|jd7}|jrH|rH|gS|SdS)Nr)r)rIr5rrYrrrr;)rrrrZretToksrrrrs  "zCombine.postParse)rT)rrrrrrFrrirrrTrrs cs(eZdZdZfddZddZZS)r#aConverter to return the matched tokens as a list - useful for returning tokens of :class:`ZeroOrMore` and :class:`OneOrMore` expressions. Example:: ident = Word(alphas) num = Word(nums) term = ident | num func = ident + Optional(delimitedList(term)) print(func.parseString("fn a, b, 100")) # -> ['fn', 'a', 'b', '100'] func = ident + Group(Optional(delimitedList(term))) print(func.parseString("fn a, b, 100")) # -> ['fn', ['a', 'b', '100']] cstt||d|_dSr)rQr#rrrrTrrr szGroup.__init__cCs|gSrrrrrrrszGroup.postParserrrrrrrirrrTrr#s cs(eZdZdZfddZddZZS)ra?Converter to return a repetitive expression as a list, but also as a dictionary. Each element can also be referenced using the first token in the expression as its key. Useful for tabular report scraping when the first column can be used as a item key. Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) # print attributes as plain groups print(OneOrMore(attr_expr).parseString(text).dump()) # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names result = Dict(OneOrMore(Group(attr_expr))).parseString(text) print(result.dump()) # access named fields as dict entries, or output as dict print(result['shape']) print(result.asDict()) prints:: ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'} See more examples at :class:`ParseResults` of accessing fields by results name. cstt||d|_dSr)rQrrrrrTrrr8sz Dict.__init__cCst|D]\}}t|dkrq|d}t|tr@t|d}t|dkr\td|||<qt|dkrt|dtst|d|||<q|}|d=t|dkst|tr| rt||||<qt|d|||<q|j r|gS|SdS)Nrrrr) rrrrrrrr5rIr;r)rrrrrtokZikeyZ dictvaluerrrr<s$   zDict.postParserrrrTrrs& c@s eZdZdZddZddZdS)r>a[Converter for ignoring the results of a parsed expression. Example:: source = "a, b, c,d" wd = Word(alphas) wd_list1 = wd + ZeroOrMore(',' + wd) print(wd_list1.parseString(source)) # often, delimiters that are useful during parsing are just in the # way afterward - use Suppress to keep them out of the parsed output wd_list2 = wd + ZeroOrMore(Suppress(',') + wd) print(wd_list2.parseString(source)) prints:: ['a', ',', 'b', ',', 'c', ',', 'd'] ['a', 'b', 'c', 'd'] (See also :class:`delimitedList`.) cCsgSrrrrrrrkszSuppress.postParsecCs|SrrrrrrrAnszSuppress.suppressN)rrrrrrArrrrr>Usc@s(eZdZdZddZddZddZdS) r-zDWrapper for parse actions, to ensure they are only called once. cCst||_d|_dSr~)rrcalled)rZ methodCallrrrrus zOnlyOnce.__init__cCs.|js||||}d|_|St||ddS)NTr)rrr2)rrrrrrrrr@xs zOnlyOnce.__call__cCs d|_dSr~)rrrrrreset~szOnlyOnce.resetN)rrrrrr@rrrrrr-rscs:tfdd}z j|_Wntk r4YnX|S)aqDecorator for debugging parse actions. When the parse action is called, this decorator will print ``">> entering method-name(line:, , )"``. When the parse action completes, the decorator will print ``"<<"`` followed by the returned value, or any exception that the parse action raised. Example:: wd = Word(alphas) @traceParseAction def remove_duplicate_chars(tokens): return ''.join(sorted(set(''.join(tokens)))) wds = OneOrMore(wd).setParseAction(remove_duplicate_chars) print(wds.parseString("slkdjs sld sldd sdlf sdljf")) prints:: >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {})) <>entering %s(line: '%s', %d, %r) z<.z)rrr)rOrrrrrvs  ,cCs`t|dt|dt|d}|rBt|t|||S|tt|||SdS)aHelper to define a delimited list of expressions - the delimiter defaults to ','. By default, the list elements and delimiters can have intervening whitespace, and comments, but this can be overridden by passing ``combine=True`` in the constructor. If ``combine`` is set to ``True``, the matching tokens are returned as a single token string, with the delimiters included; otherwise, the matching tokens are returned as a list of tokens, with the delimiters suppressed. Example:: delimitedList(Word(alphas)).parseString("aa,bb,cc") # -> ['aa', 'bb', 'cc'] delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE'] z [rr N)rrrErr>)rZdelimcombineZdlNamerrrrTs$csjtfdd}|dkr0ttdd}n|}|d|j|dd|d td S) a>Helper to define a counted list of expressions. This helper defines a pattern of the form:: integer expr expr expr... where the leading integer tells how many expr expressions follow. The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed. If ``intExpr`` is specified, it should be a pyparsing expression that produces an integer value. Example:: countedArray(Word(alphas)).parseString('2 ab cd ef') # -> ['ab', 'cd'] # in this parser, the leading integer value is given in binary, # '10' indicating that 2 values are in the array binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2)) countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef') # -> ['ab', 'cd'] cs.|d}|r ttg|p&tt>gSr)r#rrW)rrrr1Z arrayExprrrrcountFieldParseActions"z+countedArray..countFieldParseActionNcSs t|dSr)rrrrrrrzcountedArray..ZarrayLenTrz(len) rj)r!rBrfrrIrrr)rZintExprr"rr!rrPs cCs6g}|D](}t|tr&|t|q||q|Sr)rr rEr r)Lrrrrrr s   r cs6tfdd}|j|dddt|S)a4Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousLiteral(first) matchExpr = first + ":" + second will match ``"1:1"``, but not ``"1:2"``. Because this matches a previous literal, will also match the leading ``"1:1"`` in ``"1:10"``. If this is not desired, use :class:`matchPreviousExpr`. Do *not* use with packrat parsing enabled. csP|rBt|dkr|d>qLt|}tdd|D>n t>dS)Nrrcss|]}t|VqdSr)r'rZttrrrr szDmatchPreviousLiteral..copyTokenToRepeater..)rr rrr)rrrZtflatZreprrcopyTokenToRepeaters   z1matchPreviousLiteral..copyTokenToRepeaterTr#(prev) )r!rrr)rr'rr&rrcs  csFt|}|Kfdd}|j|dddt|S)aTHelper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousExpr(first) matchExpr = first + ":" + second will match ``"1:1"``, but not ``"1:2"``. Because this matches by expressions, will *not* match the leading ``"1:1"`` in ``"1:10"``; the expressions are evaluated first, and then compared, so ``"1"`` is compared with ``"10"``. Do *not* use with packrat parsing enabled. cs*t|fdd}j|dddS)Ncs$t|}|kr tddddS)Nrr)r rr2)rrrZ theseTokensZ matchTokensrrmustMatchTheseTokens%s zLmatchPreviousExpr..copyTokenToRepeater..mustMatchTheseTokensTr#)r rr)rrrr*r&r)rr'#s  z.matchPreviousExpr..copyTokenToRepeaterTr#r()r!rIrrr)rZe2r'rr&rrbs cCs:dD]}||t|}q|dd}|dd}t|S)Nz\^-]rr\rr)r_bslashr)rrrrrr.s   rc st|trtjddd|r:dd}dd}|r4tntndd}dd}|rRtntg}t|trn|}n$t|t rt |}ntjd t dd|st S|s.d }|t |d kr.||}t||d d D]N\} } || |r||| d =qq||| r||| d =||| qq|d 7}q|s|s|rzlt |t d |krtdd dd|Dd|WStddd|Dd|WSWn&tk rtjdt ddYnXtfdd|Dd|S)aHelper to quickly define a set of alternative Literals, and makes sure to do longest-first testing when there is a conflict, regardless of the input order, but returns a :class:`MatchFirst` for best performance. Parameters: - strs - a string of space-delimited literals, or a collection of string literals - caseless - (default= ``False``) - treat all literals as caseless - useRegex - (default= ``True``) - as an optimization, will generate a Regex object; otherwise, will generate a :class:`MatchFirst` object (if ``caseless=True`` or ``asKeyword=True``, or if creating a :class:`Regex` raises an exception) - asKeyword - (default=``False``) - enforce Keyword-style matching on the generated expressions Example:: comp_oper = oneOf("< = > <= >= !=") var = Word(alphas) number = Word(nums) term = var | number comparison_expr = term + comp_oper + term print(comparison_expr.searchString("B = 12 AA=23 B<=AA AA>12")) prints:: [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']] z_More than one string argument passed to oneOf, pass choices as a list or space-delimited stringrr$cSs||kSr)r~rLbrrrr[rzoneOf..cSs||Sr)r~ryr,rrrr\rcSs||kSrrr,rrrr_rcSs ||Sr)ryr,rrrr`rz6Invalid argument to oneOf, expected string or iterablerrNrrcss|]}t|VqdSr)rrZsymrrrrszoneOf..r|css|]}t|VqdSr)rrr.rrrrsz7Exception creating Regex for oneOf, building MatchFirstc3s|]}|VqdSrrr.ZparseElementClassrrrs)rrr(r)rrr$r'rr r r*r*rrrBrr:rrr)) Zstrsr}ZuseRegexrZisequalZmasksZsymbolsrZcurr#rJrr0rrg6s\          ** cCsttt||S)aHelper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the :class:`Dict`, :class:`ZeroOrMore`, and :class:`Group` tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are suppressed, thereby leaving the significant key text. The value pattern can include named results, so that the :class:`Dict` results can include named token fields. Example:: text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) print(OneOrMore(attr_expr).parseString(text).dump()) attr_label = label attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join) # similar to Dict, but simpler call format result = dictOf(attr_label, attr_value).parseString(text) print(result.dump()) print(result['shape']) print(result.shape) # object attribute access works too print(result.asDict()) prints:: [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE SQUARE {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'} )rr,r#)r@r$rrrrUs%cCs^tdd}|}d|_|d||d}|r@dd}ndd}|||j|_|S) aHelper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. By default, returns astring containing the original parsed text. If the optional ``asString`` argument is passed as ``False``, then the return value is a :class:`ParseResults` containing any results names that were originally matched, and a single token containing the original matched text from the input string. So if the expression passed to :class:`originalTextFor` contains expressions with defined results names, you must set ``asString`` to ``False`` if you want to preserve those results name values. Example:: src = "this is test bold text normal text " for tag in ("b", "i"): opener, closer = makeHTMLTags(tag) patt = originalTextFor(opener + SkipTo(closer) + closer) print(patt.searchString(src)[0]) prints:: [' bold text '] ['text'] cSs|Srr)rrrrrrrrz!originalTextFor..F_original_start _original_endcSs||j|jSr)r1r2rrrrrrcSs&||d|dg|dd<dS)Nr1r2)r?rrrr extractTextsz$originalTextFor..extractText)rrrIrr)rZasStringZ locMarkerZ endlocMarker matchExprr3rrrr{s  cCst|ddS)zkHelper to undo pyparsing's default grouping of And expressions, even if all but one are non-empty. cSs|dSrrrrrrrrzungroup..)r@r)rrrrr|scCs4tdd}t|d|d|dS)aHelper to decorate a returned token with its starting and ending locations in the input string. This helper adds the following results names: - locn_start = location where matched expression begins - locn_end = location where matched expression ends - value = the actual parsed results Be careful if the input text contains ```` characters, you may want to call :class:`ParserElement.parseWithTabs` Example:: wd = Word(alphas) for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [[0, 'ljsdf', 5]] [[8, 'lksdjjf', 15]] [[18, 'lkkjj', 23]] cSs|SrrrrrrrrzlocatedExpr..Z locn_startr$Zlocn_end)rrr#rIrC)rZlocatorrrrr~sz\[]-*.$+^?()~ rcCs |ddSrrrrrrrrrz\\0?[xX][0-9a-fA-F]+cCstt|dddS)Nrz\0xr)unichrrrarrrrr rz \\0[0-7]+cCstt|ddddS)Nrr)r6rrrrrr rz\]rrUrnegatebodyrXcsFddz"dfddt|jDWStk r@YdSXdS)aHelper to easily define string ranges for use in Word construction. Borrows syntax from regexp '[]' string range definitions:: srange("[0-9]") -> "0123456789" srange("[a-z]") -> "abcdefghijklmnopqrstuvwxyz" srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_" The input string must be enclosed in []'s, and the returned string is the expanded character set joined into a single string. The values enclosed in the []'s may be: - a single character - an escaped character with a leading backslash (such as ``\-`` or ``\]``) - an escaped hex character with a leading ``'\x'`` (``\x21``, which is a ``'!'`` character) (``\0x##`` is also supported for backwards compatibility) - an escaped octal character with a leading ``'\0'`` (``\041``, which is a ``'!'`` character) - a range of any of the above, separated by a dash (``'a-z'``, etc.) - any combination of the above (``'aeiouy'``, ``'a-zA-Z0-9_$'``, etc.) cSs<t|ts|Sdddtt|dt|ddDS)Nrcss|]}t|VqdSrr6rrrrr)sz+srange....rr)rr5rrord)prrrr)rzsrange..rc3s|]}|VqdSrr)rpartZ _expandedrrr+szsrange..N)r_reBracketExprrr9rrrr>rrss "csfdd}|S)zoHelper method for defining parse actions that require matching at a specific column in the input text. cs"t||krt||ddS)Nzmatched token not at column %dr)rZlocnrr0rr verifyCol3sz!matchOnlyAtCol..verifyColr)r1r@rr0rra/s cs fddS)aHelper method for common parse actions that simply return a literal value. Especially useful when used with :class:`transformString` (). Example:: num = Word(nums).setParseAction(lambda toks: int(toks[0])) na = oneOf("N/A NA").setParseAction(replaceWith(math.nan)) term = na | num OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234] csgSrrrZreplStrrrrErzreplaceWith..rrArrArrp8s cCs|dddS)aHelper parse action for removing quotation marks from parsed quoted strings. Example:: # by default, quotation marks are included in parsed results quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"] # use removeQuotes to strip quotation marks from parsed results quotedString.setParseAction(removeQuotes) quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"] rrrrrrrrrnGs csNfdd}ztdtdj}Wntk rBt}YnX||_|S)aLHelper to define a parse action by mapping a function to all elements of a ParseResults list. If any additional args are passed, they are forwarded to the given function as additional arguments after the token, as in ``hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))``, which will convert the parsed data to an integer using base 16. Example (compare the last to example in :class:`ParserElement.transformString`:: hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16)) hex_ints.runTests(''' 00 11 22 aa FF 0a 0d 1a ''') upperword = Word(alphas).setParseAction(tokenMap(str.upper)) OneOrMore(upperword).runTests(''' my kingdom for a horse ''') wd = Word(alphas).setParseAction(tokenMap(str.title)) OneOrMore(wd).setParseAction(' '.join).runTests(''' now is the winter of our discontent made glorious summer by this sun of york ''') prints:: 00 11 22 aa FF 0a 0d 1a [0, 17, 34, 170, 255, 10, 13, 26] my kingdom for a horse ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE'] now is the winter of our discontent made glorious summer by this sun of york ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York'] csfdd|DS)Ncsg|]}|fqSrr)rZtoknrrrrr{sz(tokenMap..pa..rrrBrrrzsztokenMap..parr)rrrr)rrrrrrBrrVs$ cCs t|Srrr~rrrrrrcCs t|Srrlowerrrrrrrrfrgcs~t|tr|t|| d}n|jtttd}|rt t }||dt t t |td|tddgdd d d |}nlt t ttd d B}||dt t t | tttd|tddgdd d d |}ttd|d dd}|d|fdd |ddddd}|_|_t||_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag namerz_-:tag=/Fr<rWcSs |ddkSNrrHrrrrrrrz_makeTags..rgrcSs |ddkSrJrrrrrrrrh)rz<%s>c s*|dddd|S)Nrr:r)rrrtitlerrIrZresnamerrrrrrrKrz)rrr$rrBrHrGrRrIrrnrrEr#r>r.rmrjrVr_LrrrrrLrrFr;Ztag_body)tagStrZxmlZ suppress_LTZ suppress_GTZ tagAttrNameZ tagAttrValueZopenTagZcloseTagrrMr _makeTagssH , rPcCs t|dS)aKHelper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = 'More info at the pyparsing wiki page' # makeHTMLTags returns pyparsing expressions for the opening and # closing tags as a 2-tuple a, a_end = makeHTMLTags("A") link_expr = a + SkipTo(a_end)("link_text") + a_end for link in link_expr.searchString(text): # attributes in the tag (like "href" shown here) are # also accessible as named results print(link.link_text, '->', link.href) prints:: pyparsing -> https://github.com/pyparsing/pyparsing/wiki FrPrOrrrr_scCs t|dS)zHelper to construct opening and closing tag expressions for XML, given a tag name. Matches tags only in the given upper/lower case. Example: similar to :class:`makeHTMLTags` TrQrRrrrr`scs8|r|ddn|ddDfdd}|S)a7Helper to create a validating parse action to be used with start tags created with :class:`makeXMLTags` or :class:`makeHTMLTags`. Use ``withAttribute`` to qualify a starting tag with a required attribute value, to avoid false matches on common tags such as ```` or ``
``. Call ``withAttribute`` with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in ``(align="right")``, or - as an explicit dict with ``**`` operator, when an attribute name is also a Python reserved word, as in ``**{"class":"Customer", "align":"right"}`` - a list of name-value tuples, as in ``(("ns1:class", "Customer"), ("ns2:align", "right"))`` For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for ``class`` (with or without a namespace), use :class:`withClass`. To verify that the attribute exists, but without specifying a value, pass ``withAttribute.ANY_VALUE`` as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 NcSsg|]\}}||fqSrrrarrrrsz!withAttribute..csZD]P\}}||kr$t||d||tjkr|||krt||d||||fqdS)Nzno matching attribute z+attribute '%s' has value '%s', must be '%s')r2ry ANY_VALUE)rrrZattrNameZ attrValueZattrsrrrs  zwithAttribute..pa)r!)rZattrDictrrrTrrys 8 cCs|r d|nd}tf||iS)aSimplified version of :class:`withAttribute` when matching on a div class - made difficult because ``class`` is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 z%s:classclass)ry)Z classname namespaceZ classattrrrrrs#(rcCsGdddt}t}||||B}t|D]n\}}|ddd\} } } } | dkr`d| nd| } | dkr| dkst| d krtd | \}}t| }| tjkrp| d kr||| t|t | }n| d kr*| dk r ||| |t|t | |}n|||t|t |}nD| dkrf||||||t|||||}ntd n| tj krT| d krt | t st | } || j |t| |}n| d kr| dk r||| |t|t | |}n|||t|t |}nD| dkrJ||||||t|||||}ntd ntd | rt | ttfr~|j| n || ||| |BK}|}q.||K}|S)al Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See :class:`ParserElement.enablePackrat` for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form ``(opExpr, numTerms, rightLeftAssoc, parseAction)``, where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants ``opAssoc.RIGHT`` and ``opAssoc.LEFT``. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted); if the parse action is passed a tuple or list of functions, this is equivalent to calling ``setParseAction(*fn)`` (:class:`ParserElement.setParseAction`) - lpar - expression for matching left-parentheses (default= ``Suppress('(')``) - rpar - expression for matching right-parentheses (default= ``Suppress(')')``) Example:: # simple example of four-function arithmetic with ints and # variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] c@seZdZdddZdS)zinfixNotation.._FBTcSs|j|||gfSr)rrrrrrrsz$infixNotation.._FB.parseImplN)Trzrrrr_FBsrXrNrrz%s termz %s%s termrz@if numterms=3, opExpr must be a tuple or list of two expressionsrz6operator must be unary (1), binary (2), or ternary (3)z2operator must indicate right or left associativity)r r!rrr5rrhLEFTr#r,RIGHTrr.rr4r r)ZbaseExprZopListZlparZrparrXrZlastExprrZoperDefZopExprZarityZrightLeftAssocrZtermNameZopExpr1ZopExpr2ZthisExprr4rrrr}Ds`H    &       &    z4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*"z string enclosed in double quotesz4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*'z string enclosed in single quotesz*quotedString using single or double quotesuzunicode string literalcCs||krtd|dkr*t|tr"t|tr"t|dkrt|dkr|dk rtt|t||tjdd dd}n$t t||tj dd}nx|dk rtt|t |t |ttjdd dd}n4ttt |t |ttjdd d d}ntd t }|dk rd|tt|t||B|Bt|K}n$|tt|t||Bt|K}|d ||f|S) a Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default= ``"("``); can also be a pyparsing expression - closer - closing character for a nested list (default= ``")"``); can also be a pyparsing expression - content - expression for items within the nested lists (default= ``None``) - ignoreExpr - expression for ignoring opening and closing delimiters (default= :class:`quotedString`) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the ``ignoreExpr`` argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an :class:`Or` or :class:`MatchFirst`. The default is :class:`quotedString`, but if no expressions are to be ignored, then pass ``None`` for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR, RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] z.opening and closing strings cannot be the sameNrr5cSs |dSrrrrrrrrznestedExpr..cSs |dSrr^rrrrr rcSs |dSrr^rrrrr'rcSs |dSrr^rrrrr,rzOopening and closing arguments must be strings if no content expression is givenznested %s%s expression)r5rrrrr,rr7rrrWrIr'r!r#r>rEr)ZopenerZcloserZcontentrrrrrrds`A      *$c sddfddfdd}fdd}fdd }ttd }tt|d }t|d }t|d } |rtt||t|t|t|| } n(tt|t|t|t|| } | fdd| t t| dS)aHelper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the current level; set to False for block of left-most statements (default= ``True``) A valid block must contain at least one ``blockStatement``. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group("(" + Optional(delimitedList(identifier)) + ")") + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group(funcDecl + func_body) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << (funcDef | assignment | identifier) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] Ncsdd<dSrrr) backup_stack indentStackrr reset_stacksz"indentedBlock..reset_stackcsN|t|krdSt||}|dkrJ|dkr>t||dt||ddS)Nrzillegal nestingznot a peer entry)rrMr2rrrZcurColr`rrcheckPeerIndents     z&indentedBlock..checkPeerIndentcs2t||}|dkr"|n t||ddS)Nrznot a subentry)rMrr2rbrcrrcheckSubIndents   z%indentedBlock..checkSubIndentcsJ|t|krdSt||}r&|ks2t||d|dkrFdS)Nznot an unindentr)rrMr2r?rbrcrr checkUnindents     z$indentedBlock..checkUnindentz INDENTrZUNINDENTcsSrr)rLr-rr)rarrrrzindentedBlock..zindented block) r,r%rDrArrrr#r.rrFr+) ZblockStatementExprr`rjrdrerfrwrgZPEERZUNDENTZsmExprr)r_r`rarrz7s2Q    z#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]z[\0xa1-\0xbf\0xd7\0xf7]z_:zany tagzgt lt amp nbsp quot aposz><& "'z &(?Pr/z);zcommon HTML entitycCs t|jS)zRHelper parser action to replace common HTML entities with their special characters)_htmlEntityMaprZentityrrrrrosz/\*(?:[^*]|\*(?!/))*z*/zC style commentzz HTML commentz.*z rest of linez//(?:\\\n|[^\n])*z // commentzC++ style commentz#.*zPython style commentr commaItemrIc@seZdZdZeeZeeZe e  d eZ e e d eedZed d eZe ede e dZed d eeeed eB d Zeeed  d eZed d eZeeBeBZed d eZe eded dZed dZ ed dZ!e!de!d dZ"ee!de!ddee!de!d dZ#e#$dd d e  d!Z%e&e"e%Be#B d" d"Z'ed# d$Z(e)d=d&d'Z*e)d>d)d*Z+ed+ d,Z,ed- d.Z-ed/ d0Z.e/e0BZ1e)d1d2Z2e&e3e4d3e5e e6d3d4ee7d5 d6Z8e9ee:;e8Bd7d8 d9Zd`, :class:`reals`, :class:`scientific notation`) - common :class:`programming identifiers` - network addresses (:class:`MAC`, :class:`IPv4`, :class:`IPv6`) - ISO8601 :class:`dates` and :class:`datetime` - :class:`UUID` - :class:`comma-separated list` Parse actions: - :class:`convertToInteger` - :class:`convertToFloat` - :class:`convertToDate` - :class:`convertToDatetime` - :class:`stripHTMLTags` - :class:`upcaseTokens` - :class:`downcaseTokens` Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] integerz hex integerrz[+-]?\d+zsigned integerrHfractioncCs|d|dS)Nrrrrrrrrrzpyparsing_common.rz"fraction or mixed integer-fractionz[+-]?(:?\d+\.\d*|\.\d+)z real numberz@[+-]?(:?\d+(:?[eE][+-]?\d+)|(:?\d+\.\d*|\.\d+)(:?[eE][+-]?\d+)?)z$real number with scientific notationz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumberr identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}z IPv4 addressz[0-9a-fA-F]{1,4} hex_integerrKzfull IPv6 address)rrz::zshort IPv6 addresscCstdd|DdkS)Ncss|]}tj|rdVqdSrd)r _ipv6_partrr%rrrrs z,pyparsing_common...r7)rrrrrrrz::ffff:zmixed IPv6 addressz IPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}z MAC address%Y-%m-%dcsfdd}|S)a Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%d"``) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] c sNzt|dWStk rH}zt||t|W5d}~XYnXdSr)rstrptimedater5r2rrrrZvefmtrrcvt_fnsz.pyparsing_common.convertToDate..cvt_fnrrwrxrrvr convertToDates zpyparsing_common.convertToDate%Y-%m-%dT%H:%M:%S.%fcsfdd}|S)aHelper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%dT%H:%M:%S.%f"``) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] c sJzt|dWStk rD}zt||t|W5d}~XYnXdSr)rrsr5r2rrurvrrrxsz2pyparsing_common.convertToDatetime..cvt_fnrryrrvrconvertToDatetimes z"pyparsing_common.convertToDatetimez7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?z ISO8601 datez(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}UUIDcCstj|dS)aParse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td, td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) Prints:: More info at the pyparsing wiki page r)r_html_stripperr)rrrrrr stripHTMLTagsszpyparsing_common.stripHTMLTagsrrrirjrrIzcomma separated listcCs t|SrrCrrrrrrcCs t|SrrDrrrrrrN)rr)r{)?rrrrrrZconvertToIntegerfloatZconvertToFloatrBrfrrrkrXror:Zsigned_integerrlrr.rAZ mixed_integerrrealZsci_realrnumberrmrHrGrnZ ipv4_addressrqZ_full_ipv6_addressZ_short_ipv6_addressrZ_mixed_ipv6_addressrZ ipv6_addressZ mac_addressrrzr|Z iso8601_dateZiso8601_datetimeuuidrKrJr~rr,r'r%rjrA _commasepitemrTrmrIZcomma_separated_listrxrVrrrrrsv""        c@seZdZddZddZdS)_lazyclasspropertycCs||_|j|_|j|_dSr)rrrrrrrr sz_lazyclassproperty.__init__csldkrt|tdr:tfddjddDr@i_|jj}|jkrb|j|<j|S)N_internc3s |]}jt|dgkVqdS)rN)rr)rZ superclassrrrrsz-_lazyclassproperty.__get__..r)rr1rv__mro__rrr)rrrattrnamerrr__get__s  z_lazyclassproperty.__get__N)rrrrrrrrrr src@sPeZdZdZgZeddZeddZeddZ edd Z ed d Z d S) ra A set of Unicode characters, for language-specific strings for ``alphas``, ``nums``, ``alphanums``, and ``printables``. A unicode_set is defined by a list of ranges in the Unicode character set, in a class attribute ``_ranges``, such as:: _ranges = [(0x0020, 0x007e), (0x00a0, 0x00ff),] A unicode set can also be defined using multiple inheritance of other unicode sets:: class CJK(Chinese, Japanese, Korean): pass cCsZg}|jD]8}|tkrqD|jD] }|t|d|ddq q ddtt|DS)NrrrcSsg|] }t|qSrr:rrrrr4sz5unicode_set._get_chars_for_ranges..)rr_rangesrErrtr)rrZccZrrrrr_get_chars_for_ranges,s   z!unicode_set._get_chars_for_rangescCsdttj|S)z+all non-whitespace characters in this ranger)rrrrrrrrrrj6szunicode_set.printablescCsdttj|S)z'all alphabetic characters in this ranger)rfilterrisalpharrrrrrH;szunicode_set.alphascCsdttj|S)z*all numeric digit characters in this ranger)rrrisdigitrrrrrrf@szunicode_set.numscCs |j|jS)z)all alphanumeric characters in this range)rHrfrrrrrGEszunicode_set.alphanumsN) rrrrrrrrrjrHrfrGrrrrrs     c@seZdZdZdejfgZGdddeZGdddeZ GdddeZ Gd d d eZ Gd d d eZ Gd ddeZ GdddeZGdddeZGddde eeZGdddeZGdddeZGdddeZGdddeZdS)rzF A namespace class for defining common language unicode_sets. c@seZdZdZddgZdS)zpyparsing_unicode.Latin1z/Unicode set for Latin-1 Unicode Character Range)r~)NrrrrrrrrrLatin1Qsrc@seZdZdZdgZdS)zpyparsing_unicode.LatinAz/Unicode set for Latin-A Unicode Character Range)iNrrrrrLatinAUsrc@seZdZdZdgZdS)zpyparsing_unicode.LatinBz/Unicode set for Latin-B Unicode Character Range)iiONrrrrrLatinBYsrc@s6eZdZdZdddddddd d d d d dddddgZdS)zpyparsing_unicode.Greekz.Unicode set for Greek Unicode Character Ranges)ipi)ii)ii)i iE)iHiM)iPiW)iY)i[)i])i_i})ii)ii)ii)ii)ii)ii)iiNrrrrrGreek]s&rc@seZdZdZdgZdS)zpyparsing_unicode.Cyrillicz0Unicode set for Cyrillic Unicode Character Range)iiNrrrrrCyrillicesrc@seZdZdZddgZdS)zpyparsing_unicode.Chinesez/Unicode set for Chinese Unicode Character Range)Nii0i?0NrrrrrChineseisrc@sDeZdZdZgZGdddeZGdddeZGdddeZdS) zpyparsing_unicode.Japanesez`Unicode set for Japanese Unicode Character Range, combining Kanji, Hiragana, and Katakana rangesc@seZdZdZddgZdS)z pyparsing_unicode.Japanese.Kanjiz-Unicode set for Kanji Unicode Character Range)rirNrrrrrKanjiqsrc@seZdZdZdgZdS)z#pyparsing_unicode.Japanese.Hiraganaz0Unicode set for Hiragana Unicode Character Range)i@0i0NrrrrrHiraganausrc@seZdZdZdgZdS)z#pyparsing_unicode.Japanese.Katakanaz1Unicode set for Katakana Unicode Character Range)i0i0NrrrrrKatakanaysrN) rrrrrrrrrrrrrJapanesems rc@s eZdZdZddddddgZdS) zpyparsing_unicode.Koreanz.Unicode set for Korean Unicode Character Range)ii)ii)i01i1)i`i)iirNrrrrrKorean}src@seZdZdZdS)zpyparsing_unicode.CJKzTUnicode set for combined Chinese, Japanese, and Korean (CJK) Unicode Character RangeNrrrrrCJKsrc@seZdZdZddgZdS)zpyparsing_unicode.Thaiz,Unicode set for Thai Unicode Character Range)ii:)i?i[NrrrrrThaisrc@seZdZdZdddgZdS)zpyparsing_unicode.Arabicz.Unicode set for Arabic Unicode Character Range)ii)ii)iiNrrrrrArabicsrc@seZdZdZdgZdS)zpyparsing_unicode.Hebrewz.Unicode set for Hebrew Unicode Character Range)iiNrrrrrHebrewsrc@seZdZdZddgZdS)zpyparsing_unicode.Devanagariz2Unicode set for Devanagari Unicode Character Range)i i )iiNrrrrr DevanagarisrN)rrrrr maxunicoderrrrrrrrrrrrrrrrrrrrKs uالعربيةu中文uкириллицаuΕλληνικάuעִברִיתu 日本語u漢字u カタカナu ひらがなu 한국어u ไทยuदेवनागरी__main__Zselectfromr{r)r columnsrZtablesZcommandaK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual z] 100 -100 +100 3.14159 6.02e23 1e-12 z 100 FF z6 12345678-1234-5678-1234-567812345678 )NF)r)rF)N)FTF)T)r)T( rrrrrweakrefrrrIrr(rrr rxrrroperatorr itertools functoolsrr ImportErrorr_threadrZ threadingZcollections.abcr r r r rZ ordereddictr rrrrrrZ%warn_on_multiple_string_args_to_oneofr__all__r4 version_inforrbmaxsizerhrrchrr6rrrrrtreversedr rrvrrrrZmaxintZxrangerZ __builtin__rZfnamerrrrr rZascii_uppercaseZascii_lowercaserHrfrXrGr+rZ printablerjrrr0r2r4r6r9rrr5registerrMr^r[rrrrerr7r'r?rr*r'rvrNrr$rrrrBrrFr:r8rrArr"r&r%r=r<rDrCr3rr/r)rr1r r(r+rr,rEr r.r;r!r@rr#rr>r-rvrTrPr rcrbrrgrUr{r|r~rrWr]r\rurtrZ _escapedPuncZ_escapedHexCharZ_escapedOctCharZ _singleCharZ _charRangerr?rsrarprnrrxrVrPr_r`ryrSrrhrYrZr}rirRrrrmrwrdrzrIrkrKrJrrrhr7rOrorLrYrCrqrSrQrZrlrrrNrrrrrrrrrsetattrrrrrrrrrrZ selectTokenZ fromTokenZidentZ columnNameZcolumnNameListZ columnSpecZ tableNameZ tableNameListZ simpleSQLrgrrmrorr}rrrrsH            ?]  H    D! 'N E  KFyl{VO#K,:#Dvj-D0  $  W' *     4   0%   E&h~   (     ./J    &   PKd]FF)__pycache__/retrying.cpython-38.opt-1.pycnu[U .e&@slddlZddlmZddlZddlZddlZdZddZGdddeZ Gdd d eZ Gd d d e Z dS) N)sixi?csBtdkr,tdr,dd}|dSfdd}|SdS)z Decorator function that instantiates the Retrying object @param *dargs: positional arguments passed to Retrying object @param **dkw: keyword arguments passed to the Retrying object rcstfdd}|S)Ncstjf||SNRetryingcallargskwf8/usr/lib/python3.8/site-packages/pip/_vendor/retrying.py wrapped_f$sz-retry..wrap_simple..wrapped_frwrapsr rr r r wrap_simple"szretry..wrap_simplecstfdd}|S)Ncstjf||Srrr)dargsdkwr r rr/sz&retry..wrap..wrapped_frrrrr rwrap-szretry..wrapN)lencallable)rrrrr rrretrys  rc@sneZdZdddZddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ ddZ ddZdS)rNFcs |dkr dn||_|dkrdn||_|dkr0dn||_|dkrBdn||_|dkrTdn||_|dkrfdn||_| dkrxdn| |_| dkrdn| |_| dkrtn| |_ |dkrdn||_ g|dk r̈ |j |dk r |j |dk r||_n&|dkr fdd|_n t|||_ddg|dk r6 |j|dk sJ|dk rV |j|dk sj| dk rv |j| dk s| dk r |j|dk r||_n&|dkr‡fd d|_n t|||_| dkr|j|_n| |_| dkr|j|_n| |_||_dS) NdrrcstfddDS)Nc3s|]}|VqdSrr .0r ZattemptsZdelayr r as6Retrying.__init__....)anyr ) stop_funcsr raz#Retrying.__init__..c_sdS)Nrr )r kwargsr r rr%hr&cstfddDS)Nc3s|]}|VqdSrr rr r rr!ysr")maxr ) wait_funcsr rr%yr&)_stop_max_attempt_number_stop_max_delay _wait_fixed_wait_random_min_wait_random_max_wait_incrementing_start_wait_incrementing_increment_wait_exponential_multiplierMAX_WAIT_wait_exponential_max_wait_jitter_maxappendstop_after_attemptstop_after_delaystopgetattr fixed_sleep random_sleepincrementing_sleepexponential_sleepwait always_reject_retry_on_exception never_reject_retry_on_result_wrap_exception)selfr8r>Zstop_max_attempt_numberZstop_max_delayZ wait_fixedZwait_random_minZwait_random_maxZwait_incrementing_startZwait_incrementing_incrementZwait_exponential_multiplierZwait_exponential_maxZretry_on_exceptionZretry_on_resultwrap_exceptionZ stop_funcZ wait_funcZwait_jitter_maxr )r$r)r__init__:sR                 zRetrying.__init__cCs ||jkS)z;Stop after the previous attempt >= stop_max_attempt_number.)r*rDprevious_attempt_numberdelay_since_first_attempt_msr r rr6szRetrying.stop_after_attemptcCs ||jkS)z=Stop after the time from the first attempt >= stop_max_delay.)r+rGr r rr7szRetrying.stop_after_delaycCsdS)z#Don't sleep at all before retrying.rr rGr r rno_sleepszRetrying.no_sleepcCs|jS)z0Sleep a fixed amount of time between each retry.)r,rGr r rr:szRetrying.fixed_sleepcCst|j|jS)zISleep a random amount of time between wait_random_min and wait_random_max)randomZrandintr-r.rGr r rr;szRetrying.random_sleepcCs$|j|j|d}|dkr d}|S)z Sleep an incremental amount of time after each attempt, starting at wait_incrementing_start and incrementing by wait_incrementing_increment rr)r/r0)rDrHrIresultr r rr<szRetrying.incrementing_sleepcCs2d|}|j|}||jkr"|j}|dkr.d}|S)Nr)r1r3)rDrHrIZexprLr r rr=s  zRetrying.exponential_sleepcCsdS)NFr rDrLr r rrAszRetrying.never_rejectcCsdS)NTr rNr r rr?szRetrying.always_rejectcCs4d}|jr |||jdO}n|||jO}|S)NFr) has_exceptionr@valuerB)rDattemptZrejectr r r should_rejects zRetrying.should_rejectc Ostttd}d}zt||||d}Wn t}t||d}YnX||sf||jStttd|}| ||r|js|j r|qt |n<| ||} |j rt|j } | td| } t| d|d7}qdS)NrrFTrg@@)introundtimeAttemptsysexc_inforRgetrCr8rO RetryErrorr>r4rKr(sleep) rDfnr r'Z start_timeattempt_numberrQtbrIr[Zjitterr r rrs(       z Retrying.call)NNNNNNNNNNNNNFNNN)__name__ __module__ __qualname__rFr6r7rJr:r;r<r=rAr?rRrr r r rr8s: S   rc@s*eZdZdZddZd ddZddZd S) rVz An Attempt encapsulates a call to a target function that may end as a normal return value from the function or an Exception depending on what occurred during the execution. cCs||_||_||_dSr)rPr]rO)rDrPr]rOr r rrFszAttempt.__init__FcCs@|jr6|rt|qs *!PKd]*-U!__pycache__/distro.cpython-38.pycnu[U .e@s~dZddlZddlZddlZddlZddlZddlZddlZddlZej ddZ dZ ddiZ dddd Zd diZed Zed Zd dde dfZd@ddZddZdAddZdBddZdCddZdDddZdEdd ZdFd!d"Zd#d$Zd%d&ZdGd'd(Zd)d*Zd+d,Z d-d.Z!d/d0Z"d1d2Z#d3d4Z$d5d6Z%d7d8Z&Gd9d:d:e'Z(Gd;d<dZ+e,d?krze+dS)Ha  The ``distro`` package (``distro`` stands for Linux Distribution) provides information about the Linux distribution it runs on, such as a reliable machine-readable distro ID, or version information. It is the recommended replacement for Python's original :py:func:`platform.linux_distribution` function, but it provides much more functionality. An alternative implementation became necessary because Python 3.5 deprecated this function, and Python 3.8 will remove it altogether. Its predecessor function :py:func:`platform.dist` was already deprecated since Python 2.6 and will also be removed in Python 3.8. Still, there are many cases in which access to OS distribution information is needed. See `Python issue 1322 `_ for more information. NZ UNIXCONFDIRz/etcz os-releaseZolZoracleZrhel)ZenterpriseenterpriseZredhatenterpriseworkstationZredhatenterpriseserverZredhatzA(?:[^)]*\)(.*)\()? *(?:STL )?([\d.+\-a-z]*\d) *(?:esaeler *)?(.+)z(\w+)[-_](release|version)$Zdebian_versionz lsb-releasez oem-releasezsystem-releaseTcCs t|S)a Return information about the current OS distribution as a tuple ``(id_name, version, codename)`` with items as follows: * ``id_name``: If *full_distribution_name* is false, the result of :func:`distro.id`. Otherwise, the result of :func:`distro.name`. * ``version``: The result of :func:`distro.version`. * ``codename``: The result of :func:`distro.codename`. The interface of this function is compatible with the original :py:func:`platform.linux_distribution` function, supporting a subset of its parameters. The data it returns may not exactly be the same, because it uses more data sources than the original function, and that may lead to different data if the OS distribution is not consistent across multiple data sources it provides (there are indeed such distributions ...). Another reason for differences is the fact that the :func:`distro.id` method normalizes the distro ID string to a reliable machine-readable value for a number of popular OS distributions. )_distrolinux_distribution)full_distribution_namer6/usr/lib/python3.8/site-packages/pip/_vendor/distro.pyrasrcCstS)a$ Return the distro ID of the current distribution, as a machine-readable string. For a number of OS distributions, the returned distro ID value is *reliable*, in the sense that it is documented and that it does not change across releases of the distribution. This package maintains the following reliable distro ID values: ============== ========================================= Distro ID Distribution ============== ========================================= "ubuntu" Ubuntu "debian" Debian "rhel" RedHat Enterprise Linux "centos" CentOS "fedora" Fedora "sles" SUSE Linux Enterprise Server "opensuse" openSUSE "amazon" Amazon Linux "arch" Arch Linux "cloudlinux" CloudLinux OS "exherbo" Exherbo Linux "gentoo" GenToo Linux "ibm_powerkvm" IBM PowerKVM "kvmibm" KVM for IBM z Systems "linuxmint" Linux Mint "mageia" Mageia "mandriva" Mandriva Linux "parallels" Parallels "pidora" Pidora "raspbian" Raspbian "oracle" Oracle Linux (and Oracle Enterprise Linux) "scientific" Scientific Linux "slackware" Slackware "xenserver" XenServer "openbsd" OpenBSD "netbsd" NetBSD "freebsd" FreeBSD ============== ========================================= If you have a need to get distros for reliable IDs added into this set, or if you find that the :func:`distro.id` function returns a different distro ID for one of the listed distros, please create an issue in the `distro issue tracker`_. **Lookup hierarchy and transformations:** First, the ID is obtained from the following sources, in the specified order. The first available and non-empty value is used: * the value of the "ID" attribute of the os-release file, * the value of the "Distributor ID" attribute returned by the lsb_release command, * the first part of the file name of the distro release file, The so determined ID value then passes the following transformations, before it is returned by this method: * it is translated to lower case, * blanks (which should not be there anyway) are translated to underscores, * a normalization of the ID is performed, based upon `normalization tables`_. The purpose of this normalization is to ensure that the ID is as reliable as possible, even across incompatible changes in the OS distributions. A common reason for an incompatible change is the addition of an os-release file, or the addition of the lsb_release command, with ID values that differ from what was previously determined from the distro release file name. )ridrrrrr}sKrFcCs t|S)ak Return the name of the current OS distribution, as a human-readable string. If *pretty* is false, the name is returned without version or codename. (e.g. "CentOS Linux") If *pretty* is true, the version and codename are appended. (e.g. "CentOS Linux 7.1.1503 (Core)") **Lookup hierarchy:** The name is obtained from the following sources, in the specified order. The first available and non-empty value is used: * If *pretty* is false: - the value of the "NAME" attribute of the os-release file, - the value of the "Distributor ID" attribute returned by the lsb_release command, - the value of the "" field of the distro release file. * If *pretty* is true: - the value of the "PRETTY_NAME" attribute of the os-release file, - the value of the "Description" attribute returned by the lsb_release command, - the value of the "" field of the distro release file, appended with the value of the pretty version ("" and "" fields) of the distro release file, if available. )rnameprettyrrrrs$rcCs t||S)av Return the version of the current OS distribution, as a human-readable string. If *pretty* is false, the version is returned without codename (e.g. "7.0"). If *pretty* is true, the codename in parenthesis is appended, if the codename is non-empty (e.g. "7.0 (Maipo)"). Some distributions provide version numbers with different precisions in the different sources of distribution information. Examining the different sources in a fixed priority order does not always yield the most precise version (e.g. for Debian 8.2, or CentOS 7.1). The *best* parameter can be used to control the approach for the returned version: If *best* is false, the first non-empty version number in priority order of the examined sources is returned. If *best* is true, the most precise version number out of all examined sources is returned. **Lookup hierarchy:** In all cases, the version number is obtained from the following sources. If *best* is false, this order represents the priority order: * the value of the "VERSION_ID" attribute of the os-release file, * the value of the "Release" attribute returned by the lsb_release command, * the version number parsed from the "" field of the first line of the distro release file, * the version number parsed from the "PRETTY_NAME" attribute of the os-release file, if it follows the format of the distro release files. * the version number parsed from the "Description" attribute returned by the lsb_release command, if it follows the format of the distro release files. )rversionr bestrrrr s)r cCs t|S)a Return the version of the current OS distribution as a tuple ``(major, minor, build_number)`` with items as follows: * ``major``: The result of :func:`distro.major_version`. * ``minor``: The result of :func:`distro.minor_version`. * ``build_number``: The result of :func:`distro.build_number`. For a description of the *best* parameter, see the :func:`distro.version` method. )r version_partsr rrrrsrcCs t|S)a5 Return the major version of the current OS distribution, as a string, if provided. Otherwise, the empty string is returned. The major version is the first part of the dot-separated version string. For a description of the *best* parameter, see the :func:`distro.version` method. )r major_versionrrrrr/s rcCs t|S)a6 Return the minor version of the current OS distribution, as a string, if provided. Otherwise, the empty string is returned. The minor version is the second part of the dot-separated version string. For a description of the *best* parameter, see the :func:`distro.version` method. )r minor_versionrrrrr<s rcCs t|S)a3 Return the build number of the current OS distribution, as a string, if provided. Otherwise, the empty string is returned. The build number is the third part of the dot-separated version string. For a description of the *best* parameter, see the :func:`distro.version` method. )r build_numberrrrrrIs rcCstS)a Return a space-separated list of distro IDs of distributions that are closely related to the current OS distribution in regards to packaging and programming interfaces, for example distributions the current distribution is a derivative from. **Lookup hierarchy:** This information item is only provided by the os-release file. For details, see the description of the "ID_LIKE" attribute in the `os-release man page `_. )rlikerrrrrVsrcCstS)a Return the codename for the release of the current OS distribution, as a string. If the distribution does not have a codename, an empty string is returned. Note that the returned codename is not always really a codename. For example, openSUSE returns "x86_64". This function does not handle such cases in any special way and just returns the string it finds, if any. **Lookup hierarchy:** * the codename within the "VERSION" attribute of the os-release file, if provided, * the value of the "Codename" attribute returned by the lsb_release command, * the value of the "" field of the distro release file. )rcodenamerrrrrgsrcCs t||S)a Return certain machine-readable information items about the current OS distribution in a dictionary, as shown in the following example: .. sourcecode:: python { 'id': 'rhel', 'version': '7.0', 'version_parts': { 'major': '7', 'minor': '0', 'build_number': '' }, 'like': 'fedora', 'codename': 'Maipo' } The dictionary structure and keys are always the same, regardless of which information items are available in the underlying data sources. The values for the various keys are as follows: * ``id``: The result of :func:`distro.id`. * ``version``: The result of :func:`distro.version`. * ``version_parts -> major``: The result of :func:`distro.major_version`. * ``version_parts -> minor``: The result of :func:`distro.minor_version`. * ``version_parts -> build_number``: The result of :func:`distro.build_number`. * ``like``: The result of :func:`distro.like`. * ``codename``: The result of :func:`distro.codename`. For a description of the *pretty* and *best* parameters, see the :func:`distro.version` method. )rinfor rrrrs)rcCstS)z Return a dictionary containing key-value pairs for the information items from the os-release file data source of the current OS distribution. See `os-release file`_ for details about these information items. )ros_release_inforrrrrsrcCstS)z Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the current OS distribution. See `lsb_release command output`_ for details about these information items. )rlsb_release_inforrrrrsrcCstS)z Return a dictionary containing key-value pairs for the information items from the distro release file data source of the current OS distribution. See `distro release file`_ for details about these information items. )rdistro_release_inforrrrrsrcCstS)z Return a dictionary containing key-value pairs for the information items from the distro release file data source of the current OS distribution. )r uname_inforrrrrsrcCs t|S)a Return a single named information item from the os-release file data source of the current OS distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. See `os-release file`_ for details about these information items. )ros_release_attr attributerrrrsrcCs t|S)a Return a single named information item from the lsb_release command output data source of the current OS distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. See `lsb_release command output`_ for details about these information items. )rlsb_release_attrrrrrrsrcCs t|S)a Return a single named information item from the distro release file data source of the current OS distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. See `distro release file`_ for details about these information items. )rdistro_release_attrrrrrrsrcCs t|S)aZ Return a single named information item from the distro release file data source of the current OS distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. )r uname_attrrrrrr src@s eZdZdZddZddZdS)cached_propertyzA version of @property which caches the value. On access, it calls the underlying function and sets the value in `__dict__` so future accesses will not re-call the property. cCs|j|_||_dS)N)__name___fname_f)selffrrr__init__"szcached_property.__init__cCs2|dk std|j||}|j|j<|S)Nzcall {} on an instance)AssertionErrorformatr"r#__dict__)r$objownerretrrr__get__&szcached_property.__get__N)r! __module__ __qualname____doc__r&r-rrrrr sr c@s2eZdZdZdBddZddZdCdd Zd d ZdDd dZdEddZ dFddZ dGddZ dHddZ dIddZ ddZddZdJddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zed/d0Zed1d2Zed3d4Zed5d6Zed7d8Zed9d:Z ed;d<Z!d=d>Z"ed?d@Z#dAS)KLinuxDistributiona  Provides information about a OS distribution. This package creates a private module-global instance of this class with default initialization arguments, that is used by the `consolidated accessor functions`_ and `single source accessor functions`_. By using default initialization arguments, that module-global instance returns data about the current OS distribution (i.e. the distro this package runs on). Normally, it is not necessary to create additional instances of this class. However, in situations where control is needed over the exact data sources that are used, instances of this class can be created with a specific distro release file, or a specific os-release file, or without invoking the lsb_release command. TcCs.|ptjtt|_|pd|_||_||_dS)ao The initialization method of this class gathers information from the available data sources, and stores that in private instance attributes. Subsequent access to the information items uses these private instance attributes, so that the data sources are read only once. Parameters: * ``include_lsb`` (bool): Controls whether the `lsb_release command output`_ is included as a data source. If the lsb_release command is not available in the program execution path, the data source for the lsb_release command will be empty. * ``os_release_file`` (string): The path name of the `os-release file`_ that is to be used as a data source. An empty string (the default) will cause the default path name to be used (see `os-release file`_ for details). If the specified or defaulted os-release file does not exist, the data source for the os-release file will be empty. * ``distro_release_file`` (string): The path name of the `distro release file`_ that is to be used as a data source. An empty string (the default) will cause a default search algorithm to be used (see `distro release file`_ for details). If the specified distro release file does not exist, or if no default distro release file can be found, the data source for the distro release file will be empty. * ``include_name`` (bool): Controls whether uname command output is included as a data source. If the uname command is not available in the program execution path the data source for the uname command will be empty. Public instance attributes: * ``os_release_file`` (string): The path name of the `os-release file`_ that is actually used as a data source. The empty string if no distro release file is used as a data source. * ``distro_release_file`` (string): The path name of the `distro release file`_ that is actually used as a data source. The empty string if no distro release file is used as a data source. * ``include_lsb`` (bool): The result of the ``include_lsb`` parameter. This controls whether the lsb information will be loaded. * ``include_uname`` (bool): The result of the ``include_uname`` parameter. This controls whether the uname information will be loaded. Raises: * :py:exc:`IOError`: Some I/O issue with an os-release file or distro release file. * :py:exc:`subprocess.CalledProcessError`: The lsb_release command had some issue (other than not being available in the program execution path). * :py:exc:`UnicodeError`: A data source has unexpected characters or uses an unexpected encoding. r2N) ospathjoin _UNIXCONFDIR_OS_RELEASE_BASENAMEos_release_filedistro_release_file include_lsb include_uname)r$r:r8r9r;rrrr&>s H  zLinuxDistribution.__init__cCs dj|dS)z Return repr of all info aeLinuxDistribution(os_release_file={self.os_release_file!r}, distro_release_file={self.distro_release_file!r}, include_lsb={self.include_lsb!r}, include_uname={self.include_uname!r}, _os_release_info={self._os_release_info!r}, _lsb_release_info={self._lsb_release_info!r}, _distro_release_info={self._distro_release_info!r}, _uname_info={self._uname_info!r})r$)r(r<rrr__repr__s zLinuxDistribution.__repr__cCs"|r |n|||fS)z Return information about the OS distribution that is compatible with Python's :func:`platform.linux_distribution`, supporting a subset of its parameters. For details, see :func:`distro.linux_distribution`. )rrr r)r$rrrrrs z$LinuxDistribution.linux_distributioncCsldd}|d}|r ||tS|d}|r8||tS|d}|rP||tS|d}|rh||tSdS)zoReturn the distro ID of the OS distribution, as a string. For details, see :func:`distro.id`. cSs|dd}|||S)N _)lowerreplaceget) distro_idtablerrr normalizesz'LinuxDistribution.id..normalizerdistributor_idr2)rNORMALIZED_OS_IDrNORMALIZED_LSB_IDrNORMALIZED_DISTRO_IDr)r$rErCrrrrs        zLinuxDistribution.idFcCs||dp&|dp&|dp&|d}|rt|dp>|d}|st|dpV|d}|jdd}|rt|d|}|pzdS) zu Return the name of the OS distribution, as a string. For details, see :func:`distro.name`. rrF pretty_name descriptionTr r>r2)rrrrr )r$r rr rrrrs&     zLinuxDistribution.namec Cs|d|d|d||ddd||ddd|dg}d}|r|D]$}|d|dks||dkr\|}q\n|D]}|dkr|}qq|r|r|rd||}|S)z{ Return the version of the OS distribution, as a string. For details, see :func:`distro.version`. version_idreleaserJr2rK.z {0} ({1})) rrr_parse_distro_release_contentrBrcountrr()r$r r Zversionsr vrrrr s: zLinuxDistribution.versioncCsL|j|d}|rHtd}||}|rH|\}}}||p>d|pDdfSdS)z Return the version of the OS distribution, as a tuple of version numbers. For details, see :func:`distro.version_parts`. rz(\d+)\.?(\d+)?\.?(\d+)?r2)r2r2r2)r recompilematchgroups)r$r Z version_strZ version_regexmatchesmajorminorrrrrrs   zLinuxDistribution.version_partscCs||dS)z Return the major version number of the current distribution. For details, see :func:`distro.major_version`. rrr$r rrrr szLinuxDistribution.major_versioncCs||dS)z Return the minor version number of the current distribution. For details, see :func:`distro.minor_version`. rYrZrrrrszLinuxDistribution.minor_versioncCs||dS)z} Return the build number of the current distribution. For details, see :func:`distro.build_number`. rYrZrrrrszLinuxDistribution.build_numbercCs|dp dS)z Return the IDs of distributions that are like the OS distribution. For details, see :func:`distro.like`. Zid_liker2)rr<rrrr#szLinuxDistribution.likecCs>z |jdWStk r8|dp2|dp2dYSXdS)zp Return the codename of the OS distribution. For details, see :func:`distro.codename`. rr2N)_os_release_infoKeyErrorrrr<rrrr+s  zLinuxDistribution.codenamec CsBt||||t||||||d||dS)z Return certain machine-readable information about the OS distribution. For details, see :func:`distro.info`. )rWrXr)rr rrr)dictrr rrrrr)r$r r rrrr:s zLinuxDistribution.infocCs|jS)z Return a dictionary containing key-value pairs for the information items from the os-release file data source of the OS distribution. For details, see :func:`distro.os_release_info`. )r]r<rrrrMsz!LinuxDistribution.os_release_infocCs|jS)z Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the OS distribution. For details, see :func:`distro.lsb_release_info`. )_lsb_release_infor<rrrrVsz"LinuxDistribution.lsb_release_infocCs|jS)z Return a dictionary containing key-value pairs for the information items from the distro release file data source of the OS distribution. For details, see :func:`distro.distro_release_info`. )_distro_release_infor<rrrr`sz%LinuxDistribution.distro_release_infocCs|jS)z Return a dictionary containing key-value pairs for the information items from the uname command data source of the OS distribution. For details, see :func:`distro.uname_info`. ) _uname_infor<rrrrjszLinuxDistribution.uname_infocCs|j|dS)z Return a single named information item from the os-release file data source of the OS distribution. For details, see :func:`distro.os_release_attr`. r2)r]rBr$rrrrrssz!LinuxDistribution.os_release_attrcCs|j|dS)z Return a single named information item from the lsb_release command output data source of the OS distribution. For details, see :func:`distro.lsb_release_attr`. r2)r`rBrcrrrr|sz"LinuxDistribution.lsb_release_attrcCs|j|dS)z Return a single named information item from the distro release file data source of the OS distribution. For details, see :func:`distro.distro_release_attr`. r2)rarBrcrrrrsz%LinuxDistribution.distro_release_attrcCs|j|dS)z Return a single named information item from the uname command output data source of the OS distribution. For details, see :func:`distro.uname_release_attr`. r2)rbrBrcrrrrszLinuxDistribution.uname_attrc Cs:tj|jr6t|j}||W5QRSQRXiS)z Get the information items from the specified os-release file. Returns: A dictionary containing all information items. )r3r4isfiler8open_parse_os_release_content)r$Z release_filerrrr]s z"LinuxDistribution._os_release_infocCsi}tj|dd}d|_tjddkr@t|jtr@|jd|_t|}|D]>}d|krL| dd\}}t|tr||d}||| <qLqLd |kr|d |d <nbd |kr|d |d <nLd |krt d |d }|r| }|d}|d}|}||d <|S)aD Parse the lines of an os-release file. Parameters: * lines: Iterable through the lines in the os-release file. Each line must be a unicode string or a UTF-8 encoded byte string. Returns: A dictionary containing all information items. T)posixrr\z iso-8859-1=r[utf-8Zversion_codenamerZubuntu_codenamer z(\(\D+\))|,(\s+)?\D+z(),)shlexZwhitespace_splitsys version_info isinstanceZ wordcharsbytesdecodelistsplitr@rRsearchgroupstrip)linespropsZlexertokenstokenkrQrrrrrfs4      z+LinuxDistribution._parse_os_release_contentc Csz|js iSttjdB}zd}tj||d}Wn$tk rRiYW5QRSXW5QRX|t  }| |S)z Get the information items from the lsb_release command output. Returns: A dictionary containing all information items. w)Z lsb_releasez-astderr) r:rer3devnull subprocess check_outputOSErrorrprlgetfilesystemencoding splitlines_parse_lsb_release_contentr$r~cmdstdoutZcontentrrrr`s z#LinuxDistribution._lsb_release_infocCsXi}|D]J}|ddd}t|dkr,q|\}}||dd|iq|S)aM Parse the output of the lsb_release command. Parameters: * lines: Iterable through the lines of the lsb_release output. Each line must be a unicode string or a UTF-8 encoded byte string. Returns: A dictionary containing all information items.  :r[r\r>r?)rurrlenupdaterAr@)rvrwlineZkvrzrQrrrrs  z,LinuxDistribution._parse_lsb_release_contentc CspttjdB}zd}tj||d}Wn$tk rHiYW5QRSXW5QRX|t }| |S)Nr{)unamez-rsr|) rer3r~rrrrprlrr_parse_uname_contentrrrrrbs zLinuxDistribution._uname_infocCsTi}td|d}|rP|\}}|dkr4iS||d<||d<||d<|S)Nz^([^\s]+)\s+([\d\.]+)rZLinuxrrrM)rRrsrurUr@)rvrwrTrr rrrrs  z&LinuxDistribution._parse_uname_contentcCs0|jrb||j}tj|j}t|}d|krLd|dkrLd|d<n|r^|d|d<|Szt t }| Wn6t k rddddd d d d d ddddddg}YnX|D]r}|t krqt|}|rtjt |}||}d|kr||_|d|d<d|dkrd|d<|SqiSdS)z Get the information items from the specified distro release file. Returns: A dictionary containing all information items. rZ cloudlinuxrr[z SuSE-releasez arch-releasez base-releasezcentos-releasezfedora-releasezgentoo-releasezmageia-releasezmandrake-releasezmandriva-releasezmandrivalinux-releasezmanjaro-releasezoracle-releasezredhat-releasez sl-releasezslackware-versionN)r9_parse_distro_release_filer3r4basename _DISTRO_RELEASE_BASENAME_PATTERNrTr@rtlistdirr6sortr _DISTRO_RELEASE_IGNORE_BASENAMESr5)r$ distro_inforrTZ basenamesfilepathrrrra.s^        z&LinuxDistribution._distro_release_infoc CsRz0t|}||W5QRWSQRXWnttfk rLiYSXdS)z Parse a distro release file. Parameters: * filepath: Path name of the distro release file. Returns: A dictionary containing all information items. N)rerOreadlinerIOError)r$rfprrrrrs  &z,LinuxDistribution._parse_distro_release_filecCst|tr|d}t|ddd}i}|r|dddd|d<|drn|dddd|d<|dr|dddd|d <n|r||d<|S) a Parse a line from a distro release file. Parameters: * line: Line from the distro release file. Must be a unicode string or a UTF-8 encoded byte string. Returns: A dictionary containing all information items. riNrr\rLr[r)rnrorp(_DISTRO_RELEASE_CONTENT_REVERSED_PATTERNrTrurt)rrVrrrrrOs     z/LinuxDistribution._parse_distro_release_contentN)Tr2r2T)T)F)FF)F)F)F)F)FF)$r!r.r/r0r&r=rrrr rrrrrrrrrrrrrrrr r] staticmethodrfr`rrbrrarrOrrrrr1,sV N   "               B     Cr1cCstt}|tj|ttjt j dd}|j ddddd| }|j rn|t jtdd d n:|d td d td d }|d |t}|d|dS)NzOS distro info tool)rKz--jsonz-jz!Output in machine readable format store_true)helpactionT)indentZ sort_keyszName: %sr z Version: %sz Codename: %s)loggingZ getLoggerr!ZsetLevelDEBUGZ addHandlerZ StreamHandlerrlrargparseArgumentParser add_argument parse_argsjsonrdumpsrr r)ZloggerparserargsZdistribution_versionZdistribution_codenamerrrmains$     r__main__)T)F)FF)F)F)F)F)FF)-r0r3rRrlrrkrrrenvironrBr6r7rGrHrIrSrrrrrrr rrrrrrrrrrrrrrrobjectr r1rrr!rrrrsz   N ' ,   ,   } PKd]3<<&__pycache__/contextlib2.cpython-38.pycnu[U .eB @sdZddlZddlZddlZddlmZddlmZddddd d d d d g Zedg7Zej dddkrnej Z ne de fddiZ ddZddZGddde ZGdd d e ZGdddeZddZGddde ZGddde ZGd d d eZGd!d d eZGd"d d e Zej dd#kZer@d$d%Zd&d'Znd(d%Zd)d'Zzdd*lmZWnek rzeZ Yn Xd+d,Z Gd-d d e Z!Gd.dde!Z"Gd/ddeZ#dS)0zAcontextlib2 - backports and enhancements to the contextlib moduleN)dequewrapscontextmanagerclosing nullcontextAbstractContextManagerContextDecorator ExitStackredirect_stdoutredirect_stderrsuppress ContextStack)ABC __slots__cCs0||kr dS|||jD]}t||q|SN)append __bases__ _classic_mro)CresultBrr;/usr/lib/python3.8/site-packages/pip/_vendor/contextlib2.pyrs    rcGsvz |j}Wn"tk r,tt|g}YnX|D]>}|D],}||jkr:|j|dkrbtSq2q:tSq2dS)NT)__mro__AttributeErrortupler__dict__NotImplemented)rmethodsmromethodrrrr_check_methods$s    r%c@s2eZdZdZddZejddZeddZ dS) rz,An abstract base class for context managers.cCs|S)z0Return `self` upon entering the runtime context.rselfrrr __enter__8sz AbstractContextManager.__enter__cCsdS)z9Raise any exception triggered within the runtime context.Nr)r'exc_type exc_value tracebackrrr__exit__<szAbstractContextManager.__exit__cCs|tkrt|ddStS)z.innerr)r'r?r@rr>r__call__iszContextDecorator.__call__N)r/r0r1r2r:r9rArrrrr Is c@s0eZdZdZddZddZddZdd Zd S) _GeneratorContextManagerz%Helper for @contextmanager decorator.cCsJ||||_||||_|_|_t|dd}|dkr@t|j}||_dS)Nr2)genr?r<r=getattrtyper2)r'r?r<r=docrrr__init__ts    z!_GeneratorContextManager.__init__cCs||j|j|jSr) __class__r?r<r=r&rrrr9sz%_GeneratorContextManager._recreate_cmcCs.z t|jWStk r(tdYnXdS)Nzgenerator didn't yield)nextrC StopIteration RuntimeErrorr&rrrr(s z"_GeneratorContextManager.__enter__c Cs|dkr8zt|jWntk r,YdSXtdn|dkrF|}z|j|||tdWntk r}z||k WYSd}~XYnjtk r}z0||krWY"dStr|j|krWY dSW5d}~XYntd|k rYnXdS)Nzgenerator didn't stopz#generator didn't stop after throw()F) rIrCrJrKthrow_HAVE_EXCEPTION_CHAINING __cause__sysexc_info)r'rEvaluer+excrrrr,s,    z!_GeneratorContextManager.__exit__N)r/r0r1r2rGr9r(r,rrrrrBqs rBcstfdd}|S)a@contextmanager decorator. Typical usage: @contextmanager def some_generator(): try: yield finally: This makes this: with some_generator() as : equivalent to this: try: = finally: cs t||Sr)rBr;r?rrhelperszcontextmanager..helperr)r?rUrrTrrsc@s(eZdZdZddZddZddZdS) ra2Context to automatically close something at the end of a block. Code like this: with closing(.open()) as f: is equivalent to this: f = .open() try: finally: f.close() cCs ||_dSrthing)r'rWrrrrGszclosing.__init__cCs|jSrrVr&rrrr(szclosing.__enter__cGs|jdSr)rWclose)r'rQrrrr,szclosing.__exit__Nr/r0r1r2rGr(r,rrrrrsc@s(eZdZdZddZddZddZdS)_RedirectStreamNcCs||_g|_dSr) _new_target _old_targets)r' new_targetrrrrGsz_RedirectStream.__init__cCs*|jtt|jtt|j|j|jSr)r\rrDrP_streamsetattrr[r&rrrr(sz_RedirectStream.__enter__cCstt|j|jdSr)r_rPr^r\popr'exctypeexcinstexctbrrrr,sz_RedirectStream.__exit__)r/r0r1r^rGr(r,rrrrrZsrZc@seZdZdZdZdS)r aAContext manager for temporarily redirecting stdout to another file. # How to send help() to stderr with redirect_stdout(sys.stderr): help(dir) # How to write help() to a file with open('help.txt', 'w') as f: with redirect_stdout(f): help(pow) stdoutNr/r0r1r2r^rrrrr s c@seZdZdZdZdS)r zCContext manager for temporarily redirecting stderr to another file.stderrNrfrrrrr sc@s(eZdZdZddZddZddZdS) r a?Context manager to suppress specified exceptions After the exception is suppressed, execution proceeds with the next statement following the with statement. with suppress(FileNotFoundError): os.remove(somefile) # Execution still resumes here if the file was already removed cGs ||_dSr) _exceptions)r' exceptionsrrrrG)szsuppress.__init__cCsdSrrr&rrrr(,szsuppress.__enter__cCs|dk ot||jSr) issubclassrhrarrrr,/s zsuppress.__exit__NrYrrrrr s rcsfdd}|S)Ncs4|j}||krdS|dks*|kr$q*|}q||_dSr) __context__)new_excold_exc exc_context frame_excrr_fix_exception_context@sz3_make_context_fixer.._fix_exception_contextr)rprqrror_make_context_fixer?s rrcCs<z|dj}|dWn tk r6||d_YnXdS)NrL)rk BaseException) exc_details fixed_ctxrrr_reraise_with_existing_contextOs    rvcCsddS)NcSsdSrr)rlrmrrr[z%_make_context_fixer..rrorrrrrZscCs|\}}}tddS)Nz!raise exc_type, exc_value, exc_tb)exec)rtr)r*Zexc_tbrrrrv_s ) InstanceTypecCst|}|tkr|jS|Sr)rErzrH)objZobj_typerrr _get_typeksr|c@sXeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ dS)r aContext manager for dynamic management of a stack of exit callbacks For example: with ExitStack() as stack: files = [stack.enter_context(open(fname)) for fname in filenames] # All opened files will automatically be closed at the end of # the with statement, even if attempts to open files later # in the list raise an exception cCs t|_dSr)r_exit_callbacksr&rrrrGszExitStack.__init__cCst|}|j|_t|_|S)z?Preserve the context stack by transferring it to a new instance)rEr}r)r' new_stackrrrpop_alls zExitStack.pop_allcs"fdd}|_||dS)z:Helper to correctly register callbacks to __exit__ methodscsf|Srr)rtcmcm_exitrr _exit_wrappersz.ExitStack._push_cm_exit.._exit_wrapperN)__self__push)r'rrrrrr _push_cm_exitszExitStack._push_cm_exitcCsDt|}z |j}Wn tk r2|j|YnX||||S)aRegisters a callback with the standard __exit__ method signature Can suppress exceptions the same way __exit__ methods can. Also accepts any object with an __exit__ method (registering a call to the method instead of the object itself) )r|r,rr}rr)r'exit_cb_type exit_methodrrrrs   zExitStack.pushcs$fdd}|_||S)z\Registers an arbitrary callback and arguments. Cannot suppress exceptions. csdSrr)r)rStbr<callbackr=rrrsz)ExitStack.callback.._exit_wrapper) __wrapped__r)r'rr<r=rrrrrs zExitStack.callbackcCs(t|}|j}||}||||S)zEnters the supplied context manager If successful, also pushes its __exit__ method as a callback and returns the result of the __enter__ method. )r|r,r(r)r'r_cm_type_exitrrrr enter_contexts   zExitStack.enter_contextcCs|ddddS)z$Immediately unwind the context stackN)r,r&rrrrXszExitStack.closecCs|Srrr&rrrr(szExitStack.__enter__c Gs|ddk }td}t|}d}d}|jr|j}z||rNd}d}d}Wq(t}||d|dd}|}Yq(Xq(|rt||o|S)NrrLFT)NNN)rPrQrrr}r`rv) r'rt received_excrprqsuppressed_exc pending_raisecbnew_exc_detailsrrrr,s(    zExitStack.__exit__N) r/r0r1r2rGrrrrrrXr(r,rrrrr ss   cs8eZdZdZfddZddZddZdd ZZS) rz+Backwards compatibility alias for ExitStackcstdttt|dS)Nz*ContextStack has been renamed to ExitStack)r6r7r8superrrGr&rHrrrGszContextStack.__init__cCs ||Sr)r)r'rrrr register_exitszContextStack.register_exitcOs|j|f||Sr)r)r'rr<r=rrrregisterszContextStack.registercCs|Sr)rr&rrrpreserveszContextStack.preserve) r/r0r1r2rGrrr __classcell__rrrrrs  c@s*eZdZdZd ddZddZddZdS) raMContext manager that does no additional processing. Used as a stand-in for a normal context manager, when a particular block of code is only sometimes used with a normal context manager: cm = optional_cm if condition else nullcontext() with cm: # Perform operation, using optional_cm if condition is True NcCs ||_dSr enter_result)r'rrrrrGsznullcontext.__init__cCs|jSrrr&rrrr(sznullcontext.__enter__cGsdSrr)r'excinforrrr,sznullcontext.__exit__)NrYrrrrrs )$r2r3rPr6 collectionsr functoolsr__all__ version_inforZ_abc_ABCABCMetaobjectrr%rr rBrrrZr r r rNrrrvtypesrz ImportErrorrEr|r rrrrrrsT    (H"  qPKd]+Vk'AA$__pycache__/pyparsing.cpython-38.pycnu[U .e,s@sdZdZdZdZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZddlZdd lmZzdd lmZWn ek rdd lmZYnXzdd lmZWn ek rdd lmZYnXz dd lmZddlmZm Z Wn2ek rNdd l mZddl mZm Z YnXzddl m!Z"WnBek rzddl#m!Z"Wnek rdZ"YnXYnXzddlm$Z$Wn$ek rGdddZ$YnXe$Z%de%_de%_&e$Z'de'_de'_(de'_)de'_*de'_+de'_,dddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dddddddddddgsZ-e.e j/ddZ0e0ddkZ1e1rVe j2Z3e4Z5e6Z7e4Z8e4Z9e:e;ee.e?e@eAeBeCg ZDn`e jEZ3eFZGddZ9gZDddlHZHdID]8ZJzeDKeLeHeJWneMk rYq|YnXq|eNddeGdDZOddZPejQejRZSdZTeTdZUeSeTZVe6dZWdXddejYDZZdYddZ[Gdd4d4e\Z]Gdd6d6e]Z^Gdd8d8e]Z_Gdd:d:e_Z`Gdd=d=e\ZaGdddebZcGdd9d9ebZdeeedddQZfddbZgdd_ZhddZiddZjddZkddiZldZddZmGdd;d;ebZnGdddenZoGddCdCenZpGdd#d#epZqGdd.d.epZrGdd+d+epZsGdddesZtesZuesen_vGdd(d(epZwGdddesZxGdddewZyGdddepZzGddFdFepZ{Gddde{Z|GddJdJe|Z}Gdd>d>epZ~Gdd<dddeZejjjejjjejjjej_e1 rXeed?ejeed@ejeedAejeedBejeedCejeedDejeejdEejjeejdFejjeejdGejjeedHejeedIejeedJejedKkrexdLZexdMZe{eSeVdNZeedOddPeZeeedQZdReBZeedOddPeZeeedSZedTedQeedSZedUejdVejdVejdWddlZejeejejdXdS(aa pyparsing module - Classes and methods to define and execute parsing grammars ============================================================================= The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new syntax for defining grammars or matching expressions - the parsing module provides a library of classes that you use to construct the grammar directly in Python. Here is a program to parse "Hello, World!" (or any greeting of the form ``", !"``), built up using :class:`Word`, :class:`Literal`, and :class:`And` elements (the :class:`'+'` operators create :class:`And` expressions, and the strings are auto-converted to :class:`Literal` expressions):: from pip._vendor.pyparsing import Word, alphas # define grammar of a greeting greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] The Python representation of the grammar is quite readable, owing to the self-explanatory class names, and the use of '+', '|' and '^' operators. The :class:`ParseResults` object returned from :class:`ParserElement.parseString` can be accessed as a nested list, a dictionary, or an object with named attributes. The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - quoted strings - embedded comments Getting Started - ----------------- Visit the classes :class:`ParserElement` and :class:`ParseResults` to see the base classes that most other pyparsing classes inherit from. Use the docstrings for examples of how to: - construct literal match expressions from :class:`Literal` and :class:`CaselessLiteral` classes - construct character word-group expressions using the :class:`Word` class - see how to create repetitive expressions using :class:`ZeroOrMore` and :class:`OneOrMore` classes - use :class:`'+'`, :class:`'|'`, :class:`'^'`, and :class:`'&'` operators to combine simple expressions into more complex ones - associate names with your parsed results using :class:`ParserElement.setResultsName` - access the parsed data, which is returned as a :class:`ParseResults` object - find some helpful expression short-cuts like :class:`delimitedList` and :class:`oneOf` - find more useful common expressions in the :class:`pyparsing_common` namespace class z2.4.2z29 Jul 2019 02:58 UTCz*Paul McGuire N)ref)datetime) itemgetter)wraps) filterfalse) ifilterfalse)RLock)Iterable)MutableMappingMapping) OrderedDict)SimpleNamespacec@s eZdZdS)r N)__name__ __module__ __qualname__rr9/usr/lib/python3.8/site-packages/pip/_vendor/pyparsing.pyr sr aA A cross-version compatibility configuration for pyparsing features that will be released in a future version. By setting values in this configuration to True, those features can be enabled in prior versions for compatibility development and testing. - collect_all_And_tokens - flag to enable fix for Issue #63 that fixes erroneous grouping of results names when an And expression is nested within an Or or MatchFirst; set to True to enable bugfix released in pyparsing 2.3.0, or False to preserve pre-2.3.0 handling of named results Ta Diagnostic configuration (all default to False) - warn_multiple_tokens_in_named_alternation - flag to enable warnings when a results name is defined on a MatchFirst or Or expression with one or more And subexpressions (only warns if __compat__.collect_all_And_tokens is False) - warn_ungrouped_named_tokens_in_collection - flag to enable warnings when a results name is defined on a containing expression with ungrouped subexpressions that also have results names - warn_name_set_on_empty_Forward - flag to enable warnings whan a Forward is defined with a results name, but has no contents defined - warn_on_multiple_string_args_to_oneof - flag to enable warnings whan oneOf is incorrectly called with multiple str arguments - enable_debug_on_named_expressions - flag to auto-enable debug on all subsequent calls to ParserElement.setName() F __version____versionTime__ __author__ __compat____diag__AndCaselessKeywordCaselessLiteral CharsNotInCombineDictEachEmpty FollowedByForward GoToColumnGroupKeywordLineEnd LineStartLiteral PrecededBy MatchFirstNoMatchNotAny OneOrMoreOnlyOnceOptionalOrParseBaseExceptionParseElementEnhanceParseExceptionParseExpressionParseFatalException ParseResultsParseSyntaxException ParserElement QuotedStringRecursiveGrammarExceptionRegexSkipTo StringEnd StringStartSuppressTokenTokenConverterWhiteWordWordEnd WordStart ZeroOrMoreChar alphanumsalphas alphas8bit anyCloseTag anyOpenTag cStyleCommentcolcommaSeparatedListcommonHTMLEntity countedArraycppStyleCommentdblQuotedStringdblSlashComment delimitedListdictOfdowncaseTokensemptyhexnums htmlCommentjavaStyleCommentlinelineEnd lineStartlineno makeHTMLTags makeXMLTagsmatchOnlyAtColmatchPreviousExprmatchPreviousLiteral nestedExprnullDebugActionnumsoneOfopAssocoperatorPrecedence printablespunc8bitpythonStyleComment quotedString removeQuotesreplaceHTMLEntity replaceWith restOfLinesglQuotedStringsrange stringEnd stringStarttraceParseAction unicodeString upcaseTokens withAttribute indentedBlockoriginalTextForungroup infixNotation locatedExpr withClass CloseMatchtokenMappyparsing_commonpyparsing_unicode unicode_setconditionAsParseActioncCsft|tr|Sz t|WStk r`t|td}td}|dd| |YSXdS)aDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It then < returns the unicode object | encodes it with the default encoding | ... >. xmlcharrefreplacez&#\d+;cSs$dtt|dddddS)Nz\ur)hexinttrrrz_ustr..N) isinstanceunicodestrUnicodeEncodeErrorencodesysgetdefaultencodingr:setParseActiontransformString)objretZ xmlcharrefrrr_ustrs  rz6sum len sorted reversed list tuple set any all min maxccs|] }|VqdSNr).0yrrr srcCs:d}dddD}t||D]\}}|||}q |S)z/Escape &, <, >, ", ', etc. in a string of data.z&><"'css|]}d|dVqdS)&;Nr)rsrrrr sz_xml_escape..zamp gt lt quot apos)splitzipreplace)dataZ from_symbolsZ to_symbolsZfrom_Zto_rrr _xml_escapes r 0123456789Z ABCDEFabcdef\ccs|]}|tjkr|VqdSr)stringZ whitespacercrrrrs cs@|dk r |nd|rtntttfdd}|S)Nzfailed user-defined conditioncs t|||s||dSr)boolrlrexc_typefnmsgrrpasz"conditionAsParseAction..pa)r4r2 _trim_arityr)rmessagefatalrrrrrs  c@sPeZdZdZdddZeddZdd Zd d Zd d Z dddZ ddZ dS)r0z7base exception class for all parsing runtime exceptionsrNcCs>||_|dkr||_d|_n ||_||_||_|||f|_dSNr)locrpstr parserElementargs)selfrrrelemrrr__init__(szParseBaseException.__init__cCs||j|j|j|jS)z internal factory method to simplify creating one type of ParseException from another - avoids having __init__ signature conflicts among subclasses )rrrr)clsperrr_from_exception3sz"ParseBaseException._from_exceptioncCsN|dkrt|j|jS|dkr,t|j|jS|dkrBt|j|jSt|dS)zsupported attributes by name are: - lineno - returns the line number of the exception text - col - returns the column number of the exception text - line - returns the line containing the exception text r^)rMcolumnr[N)r^rrrMr[AttributeError)rZanamerrr __getattr__;szParseBaseException.__getattr__cCs^|jr@|jt|jkrd}qDd|j|j|jddd}nd}d|j||j|j|jfS)Nz, found end of textz , found %rrz\\\rz%%s%s (at char %d), (line:%d, col:%d))rrlenrrr^r)rZfoundstrrrr__str__Js$zParseBaseException.__str__cCst|Srrrrrr__repr__TszParseBaseException.__repr__>!z{0} )inspectrgetrecursionlimitrr0appendr[rMformatrrZgetinnerframes __traceback__set enumeratef_localsgetr7f_codeco_nameaddrr) excdepthrrZcallersseeniZffZfrmZf_selfZ self_typecoderrrexplainzsL          zParseException.explainN)r)rrrr staticmethodrrrrrr2csc@seZdZdZdS)r4znuser-throwable exception thrown when inconsistent parse content is found; stops all parsing immediatelyNrrrrrrrrr4sc@seZdZdZdS)r6zjust like :class:`ParseFatalException`, but thrown internally when an :class:`ErrorStop` ('-' operator) indicates that parsing is to stop immediately because an unbacktrackable syntax error has been found. Nrrrrrr6sc@s eZdZdZddZddZdS)r9ziexception thrown by :class:`ParserElement.validate` if the grammar could be improperly recursive cCs ||_dSrZparseElementTracerparseElementListrrrrsz"RecursiveGrammarException.__init__cCs d|jS)NzRecursiveGrammarException: %srrrrrrsz!RecursiveGrammarException.__str__N)rrrrrrrrrrr9sc@s,eZdZddZddZddZddZd S) _ParseResultsWithOffsetcCs||f|_dSrtup)rZp1Zp2rrrrsz _ParseResultsWithOffset.__init__cCs |j|Srrrrrrr __getitem__sz#_ParseResultsWithOffset.__getitem__cCst|jdSNr)reprrrrrrrsz _ParseResultsWithOffset.__repr__cCs|jd|f|_dSrrrrrr setOffsetsz!_ParseResultsWithOffset.setOffsetN)rrrrrrrrrrrrsrc@seZdZdZd]ddZddddefddZdd Zefd d Zd d Z ddZ ddZ ddZ e Z ddZddZddZddZddZereZeZeZn$eZeZeZddZd d!Zd"d#Zd$d%Zd&d'Zd^d(d)Zd*d+Zd,d-Zd.d/Zd0d1Z d2d3Z!d4d5Z"d6d7Z#d8d9Z$d:d;Z%d`` - see :class:`ParserElement.setResultsName`) Example:: integer = Word(nums) date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: # date_str = integer("year") + '/' + integer("month") + '/' + integer("day") # parseString returns a ParseResults object result = date_str.parseString("1999/12/31") def test(s, fn=repr): print("%s -> %s" % (s, fn(eval(s)))) test("list(result)") test("result[0]") test("result['month']") test("result.day") test("'month' in result") test("'minutes' in result") test("result.dump()", str) prints:: list(result) -> ['1999', '/', '12', '/', '31'] result[0] -> '1999' result['month'] -> '12' result.day -> '31' 'month' in result -> True 'minutes' in result -> False result.dump() -> ['1999', '/', '12', '/', '31'] - day: 31 - month: 12 - year: 1999 NTcCs"t||r|St|}d|_|SNT)robject__new___ParseResults__doinit)rtoklistnameasListmodalZretobjrrrrs   zParseResults.__new__c Csd|jrvd|_d|_d|_i|_||_||_|dkr6g}||trP|dd|_n||trft||_n|g|_t |_ |dk r`|r`|sd|j|<||t rt |}||_||t dttfr|ddgfks`||tr|g}|r*||trtt|jd||<ntt|dd||<|||_n6z|d||<Wn$tttfk r^|||<YnXdS)NFrr)r_ParseResults__name_ParseResults__parent_ParseResults__accumNames_ParseResults__asList_ParseResults__modallist_ParseResults__toklist_generatorTypedict_ParseResults__tokdictrrr basestringr5rKeyError TypeError IndexError)rrrrrrrrrr"sB     $   zParseResults.__init__cCsPt|ttfr|j|S||jkr4|j|ddStdd|j|DSdS)NrrcSsg|] }|dqSrrrvrrr Psz,ParseResults.__getitem__..)rrslicer rrr5rrrrrIs   zParseResults.__getitem__cCs||tr0|j|t|g|j|<|d}nD||ttfrN||j|<|}n&|j|tt|dg|j|<|}||trt||_ dSr) rrrr rrr r5wkrefr)rkrrsubrrr __setitem__Rs   " zParseResults.__setitem__c Cst|ttfrt|j}|j|=t|trH|dkr:||7}t||d}tt||}||j D]>\}}|D]0}t |D]"\}\}} t || | |k||<qqxqln|j |=dSNrr) rrrrr r rangeindicesreverseritemsrr) rrZmylenZremovedr occurrencesjrvaluepositionrrr __delitem___s  zParseResults.__delitem__cCs ||jkSr)r)rrrrr __contains__tszParseResults.__contains__cCs t|jSr)rr rrrr__len__wszParseResults.__len__cCs |j Srr rrrr__bool__zszParseResults.__bool__cCs t|jSriterr rrrr__iter__~szParseResults.__iter__cCst|jdddSNrr+rrrr __reversed__szParseResults.__reversed__cCs$t|jdr|jSt|jSdS)Niterkeys)hasattrrr0r,rrrr _iterkeyss  zParseResults._iterkeyscsfddDS)Nc3s|]}|VqdSrrrrrrrrsz+ParseResults._itervalues..r2rrrr _itervaluesszParseResults._itervaluescsfddDS)Nc3s|]}||fVqdSrrr3rrrrsz*ParseResults._iteritems..r4rrrr _iteritemsszParseResults._iteritemscCs t|S)zVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).)r r0rrrrkeysszParseResults.keyscCs t|S)zXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).)r  itervaluesrrrrvaluesszParseResults.valuescCs t|S)zfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).)r  iteritemsrrrrr!szParseResults.itemscCs t|jS)zSince keys() returns an iterator, this method is helpful in bypassing code that looks for the existence of any defined results names.)rrrrrrhaskeysszParseResults.haskeyscOs|s dg}|D]*\}}|dkr0|d|f}qtd|qt|dtsdt|dksd|d|kr~|d}||}||=|S|d}|SdS)a Removes and returns item at specified index (default= ``last``). Supports both ``list`` and ``dict`` semantics for ``pop()``. If passed no argument or an integer argument, it will use ``list`` semantics and pop tokens from the list of parsed tokens. If passed a non-integer argument (most likely a string), it will use ``dict`` semantics and pop the corresponding value from any defined results names. A second default return value argument is supported, just as in ``dict.pop()``. Example:: def remove_first(tokens): tokens.pop(0) print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321'] label = Word(alphas) patt = label("LABEL") + OneOrMore(Word(nums)) print(patt.parseString("AAB 123 321").dump()) # Use pop() in a parse action to remove named result (note that corresponding value is not # removed from list form of results) def remove_LABEL(tokens): tokens.pop("LABEL") return tokens patt.addParseAction(remove_LABEL) print(patt.parseString("AAB 123 321").dump()) prints:: ['AAB', '123', '321'] - LABEL: AAB ['AAB', '123', '321'] rdefaultrz-pop() got an unexpected keyword argument '%s'rN)r!rrrr)rrkwargsrrindexrZ defaultvaluerrrpops"%  zParseResults.popcCs||kr||S|SdS)a[ Returns named result matching the given key, or if there is no such name, then returns the given ``defaultValue`` or ``None`` if no ``defaultValue`` is specified. Similar to ``dict.get()``. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString("1999/12/31") print(result.get("year")) # -> '1999' print(result.get("hour", "not specified")) # -> 'not specified' print(result.get("hour")) # -> None Nr)rkey defaultValuerrrrszParseResults.getcCsR|j|||jD]4\}}t|D]"\}\}}t||||k||<q(qdS)a Inserts new element at location index in the list of parsed tokens. Similar to ``list.insert()``. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to insert the parse location in the front of the parsed results def insert_locn(locn, tokens): tokens.insert(0, locn) print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321'] N)r insertrr!rr)rr>ZinsStrrr"rr$r%rrrrBszParseResults.insertcCs|j|dS)a Add single element to end of ParseResults list of elements. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to compute the sum of the parsed integers, and add it to the end def append_sum(tokens): tokens.append(sum(map(int, tokens))) print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444] N)r r)ritemrrrrs zParseResults.appendcCs&t|tr||n |j|dS)a  Add sequence of elements to end of ParseResults list of elements. Example:: patt = OneOrMore(Word(alphas)) # use a parse action to append the reverse of the matched strings, to make a palindrome def make_palindrome(tokens): tokens.extend(reversed([t[::-1] for t in tokens])) return ''.join(tokens) print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl' N)rr5__iadd__r extend)rZitemseqrrrrE's  zParseResults.extendcCs|jdd=|jdS)z7 Clear all elements and results names. N)r rclearrrrrrF:s zParseResults.clearcCs&z ||WStk r YdSXdSr)rrrrrrrAs zParseResults.__getattr__cCs|}||7}|Srcopy)rotherrrrr__add__GszParseResults.__add__cs|jrjt|jfdd|j}fdd|D}|D],\}}|||<t|dtr.c s4g|],\}}|D]}|t|d|dfqqSrr)rrrvlistr) addoffsetrrrQsz)ParseResults.__iadd__..r) rrr r!rr5rrrupdate)rrJZ otheritemsZotherdictitemsrrr)rQrMrrDLs     zParseResults.__iadd__cCs&t|tr|dkr|S||SdSr)rrrIrrJrrr__radd__\szParseResults.__radd__cCsdt|jt|jfS)Nz(%s, %s))rr rrrrrrdszParseResults.__repr__cCsdddd|jDdS)N[, css(|] }t|trt|nt|VqdSr)rr5rrrrrrrrhsz'ParseResults.__str__..])rr rrrrrgszParseResults.__str__rcCsLg}|jD]<}|r |r ||t|tr8||7}q |t|q |Sr)r rrr5 _asStringListr)rsepoutrCrrrrYjs   zParseResults._asStringListcCsdd|jDS)ax Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = OneOrMore(Word(alphas)) result = patt.parseString("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults print(type(result), result) # -> ['sldkj', 'lsdkj', 'sldkj'] # Use asList() to create an actual list result_list = result.asList() print(type(result_list), result_list) # -> ['sldkj', 'lsdkj', 'sldkj'] cSs"g|]}t|tr|n|qSr)rr5r)rresrrrrsz'ParseResults.asList..r)rrrrruszParseResults.asListcs6tr |j}n|j}fddtfdd|DS)a Returns the named parse results as a nested dictionary. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString('12/31/1999') print(type(result), repr(result)) # -> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]}) result_dict = result.asDict() print(type(result_dict), repr(result_dict)) # -> {'day': '1999', 'year': '12', 'month': '31'} # even though a ParseResults supports dict-like access, sometime you just need to have a dict import json print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"} cs6t|tr.|r|Sfdd|DSn|SdS)Ncsg|] }|qSrrrtoItemrrrsz7ParseResults.asDict..toItem..)rr5r;asDictrr]rrr^s  z#ParseResults.asDict..toItemc3s|]\}}||fVqdSrrrrrr]rrrsz&ParseResults.asDict..)PY_3r!r:r)rZitem_fnrr]rr_s  zParseResults.asDictcCs<t|j}t|j|_|j|_|j|j|j|_|S)zG Returns a new copy of a :class:`ParseResults` object. ) r5r rrr!rrrRrrrrrrrIs  zParseResults.copyFc CsLd}g}tdd|jD}|d}|s8d}d}d}d} |dk rJ|} n |jrV|j} | sf|rbdSd} |||d| d g7}t|jD]\} } t| tr| |kr|| || |o|dk||g7}n|| d|o|dk||g7}qd} | |kr|| } | s|rqnd} t t | } |||d| d | d | d g 7}q|||d | d g7}d |S) z (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names. rcss(|] \}}|D]}|d|fVqqdSrNrrOrrrrsz%ParseResults.asXML.. rNZITEM<>.z %s%s- %s: rer)rjfull include_list_depthcss|]}t|tVqdSr)rr5)rvvrrrrKsz %s%s[%d]: %s%s%s) rrrr;sortedr!rr5dumpranyrr) rrjrprqrrr[NLr!rrrrsrrrru!sP         zParseResults.dumpcOstj|f||dS)a# Pretty-printer for parsed results as a list, using the `pprint `_ module. Accepts additional positional or keyword args as defined for `pprint.pprint `_ . Example:: ident = Word(alphas, alphanums) num = Word(nums) func = Forward() term = ident | num | Group('(' + func + ')') func <<= ident + Group(Optional(delimitedList(term))) result = func.parseString("fna a,b,(fnb c,d,200),100") result.pprint(width=40) prints:: ['fna', ['a', 'b', ['(', 'fnb', ['c', 'd', '200'], ')'], '100']] N)pprintrrrr=rrrrxbszParseResults.pprintcCs.|j|j|jdk r|p d|j|jffSr)r rrIrrrrrrr __getstate__~szParseResults.__getstate__cCsN|d|_|d\|_}}|_i|_|j||dk rDt||_nd|_dSr)r rrrrRrr)rstaternZ inAccumNamesrrr __setstate__s   zParseResults.__setstate__cCs|j|j|j|jfSr)r rr r rrrr__getnewargs__szParseResults.__getnewargs__cCstt|t|Sr)rrr r7rrrrrszParseResults.__dir__cCsrdd}|g}|D]>\}}t|tr>||j||d7}q|||g|||d7}q|dk rn||g|d}|S)z Helper classmethod to construct a ParseResults from a dict, preserving the name-value relations as results names. If an optional 'name' argument is given, a nested ParseResults will be returned cSsHz t|Wntk r"YdSXtr8t|ttf St|t SdSNF)r, Exceptionrbrrbytesrr`rrr is_iterables z+ParseResults.from_dict..is_iterabler)rrN)r!rr from_dict)rrJrrrrrrrrrs  zParseResults.from_dict)NNTT)N)r)NFrT)rTTr)N)6rrrrrrrrrr&r'r(r* __nonzero__r-r/r2r5r6rbr7r9r!r0r8r:r;r?rrBrrErFrrKrDrTrrrYrr_rIrirlrorurxrzr|r}rrrrrrrr5sl* ' 7  $ =( A cCsF|}d|krt|kr4nn||ddkr4dS||dd|S)aReturns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`ParserElement.parseString` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. rrr)rrfind)rstrgrrrrrMs cCs|dd|dS)aReturns current line number within a string, counting newlines as line separators. The first line is number 1. Note - the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`ParserElement.parseString` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. rrr)count)rrrrrr^s cCsF|dd|}|d|}|dkr2||d|S||ddSdS)zfReturns the line of text containing loc within a string, counting newlines as line separators. rrrN)rfind)rrZlastCRZnextCRrrrr[s  cCs8tdt|dt|dt||t||fdS)NzMatch z at loc z(%d,%d))printrr^rM)instringrexprrrr_defaultStartDebugActionsrcCs$tdt|dt|dS)NzMatched z -> )rrrr)rstartlocZendlocrtoksrrr_defaultSuccessDebugActionsrcCstdt|dS)NzException raised:)rr)rrrrrrr_defaultExceptionDebugActionsrcGsdS)zG'Do-nothing' debug action, to suppress debugging output during parsing.Nr)rrrrresrcstkrfddSdgdgtdddkrFddd}dd d n tj}tjd }|dd d }|d|d|ffdd}d}ztdtdj}Wntk rt}YnX||_|S)Ncs|Srrr)funcrrrrz_trim_arity..rFr)rcSs8tdkr dnd}tj| |dd|}|ddgS)N)rrrrlimitr)system_version traceback extract_stack)rrM frame_summaryrrrrsz"_trim_arity..extract_stackcSs$tj||d}|d}|ddgS)Nrrr)r extract_tb)tbrZframesrrrrrsz_trim_arity..extract_tbrrrcsz"|dd}dd<|WStk rdr>nNz.td}|dddddksjW5z~Wntk rYnXXdkrdd7<YqYqXqdS)NrTrrrr)r NameErrorrexc_info)rrrrZ foundArityrrmaxargsZpa_call_line_synthrrrs&  z_trim_arity..wrapperzr __class__)r)r) singleArgBuiltinsrrrrgetattrrrr)rrrZ LINE_DIFFZ this_liner func_namerrrrs,    rcseZdZdZdZdZeddZeddZddd Z d d Z d d Z dddZ dddZ dddZddZddZddZddZddZdd Zdd!d"Zd#d$Zdd%d&Zd'd(Zd)d*ZGd+d,d,eZed-k rGd.d/d/eZnGd0d/d/eZiZeZ d1d1gZ!dd2d3Z"eZ#ed4d5Z$dZ%edd7d8Z&dd9d:Z'e(dfd;d<Z)d=d>Z*e(fd?d@Z+e(dfdAdBZ,dCdDZ-dEdFZ.dGdHZ/dIdJZ0dKdLZ1dMdNZ2dOdPZ3dQdRZ4dSdTZ5dUdVZ6dWdXZ7dYdZZ8d[d\Z9d]d^Z:d_d`Z;ddadbZdgdhZ?didjZ@dkdlZAdmdnZBddodpZCdqdrZDdsdtZEdudvZFdwdxZGddydzZHdd{d|ZIfd}d~ZJddZKddZLddZMddZNdddZOdddZPZQS)r7z)Abstract base level parser element class.z FcCs |t_dS)a Overrides the default whitespace chars Example:: # default whitespace chars are space, and newline OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # change to just treat newline as significant ParserElement.setDefaultWhitespaceChars(" \t") OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def'] N)r7DEFAULT_WHITE_CHARScharsrrrsetDefaultWhitespaceCharsDsz'ParserElement.setDefaultWhitespaceCharscCs |t_dS)ah Set class to be used for inclusion of string literals into a parser. Example:: # default literal class used is Literal integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # change to Suppress ParserElement.inlineLiteralsUsing(Suppress) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '12', '31'] N)r7_literalStringClassrrrrinlineLiteralsUsingTsz!ParserElement.inlineLiteralsUsingcCst|_d|_d|_d|_||_d|_ttj |_ d|_ d|_ d|_ t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NTFr)NNN)r  parseAction failActionstrRepr resultsName saveAsListskipWhitespacerr7r whiteCharscopyDefaultWhiteCharsmayReturnEmptykeepTabs ignoreExprsdebug streamlined mayIndexErrorerrmsg modalResults debugActionsre callPreparse callDuringTry)rsavelistrrrrjs( zParserElement.__init__cCs<t|}|jdd|_|jdd|_|jr8tj|_|S)a/ Make a copy of this :class:`ParserElement`. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParseAction(lambda toks: toks[0] * 1024) + Suppress("K") integerM = integer.copy().addParseAction(lambda toks: toks[0] * 1024 * 1024) + Suppress("M") print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M")) prints:: [5120, 100, 655360, 268435456] Equivalent form of ``expr.copy()`` is just ``expr()``:: integerM = integer().addParseAction(lambda toks: toks[0] * 1024 * 1024) + Suppress("M") N)rIrrrr7rr)rZcpyrrrrIs  zParserElement.copycCs$||_d|j|_tjr ||S)a_ Define name for this expression, makes debugging and exception messages clearer. Example:: Word(nums).parseString("ABC") # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1) Word(nums).setName("integer").parseString("ABC") # -> Exception: Expected integer (at char 0), (line:1, col:1) Expected )rrr!enable_debug_on_named_expressionssetDebugrGrrrsetNames  zParserElement.setNamecCs |||S)aO Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original :class:`ParserElement` object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names. You can also set results names using the abbreviated syntax, ``expr("name")`` in place of ``expr.setResultsName("name")`` - see :class:`__call__`. Example:: date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: date_str = integer("year") + '/' + integer("month") + '/' + integer("day") )_setResultsNamerrlistAllMatchesrrrsetResultsNameszParserElement.setResultsNamecCs4|}|dr"|dd}d}||_| |_|S)N*rT)rIendswithrr)rrrZnewselfrrrrs  zParserElement._setResultsNameTcs@|r&|jdfdd }|_||_nt|jdr<|jj|_|S)zMethod to invoke the Python pdb debugger when this element is about to be parsed. Set ``breakFlag`` to True to enable, False to disable. Tcsddl}|||||Sr)pdbZ set_trace)rr doActions callPreParserZ _parseMethodrrbreakersz'ParserElement.setBreak..breaker_originalParseMethod)TT)_parserr1)rZ breakFlagrrrrsetBreaks  zParserElement.setBreakcOsVt|dgkrg|_n`` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. Example:: integer = Word(nums) date_str = integer + '/' + integer + '/' + integer date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # use parse action to convert to ints at parse time integer = Word(nums).setParseAction(lambda toks: int(toks[0])) date_str = integer + '/' + integer + '/' + integer # note that integer fields are now ints, not strings date_str.parseString("1999/12/31") # -> [1999, '/', 12, '/', 31] Ncss|]}t|VqdSr)callable)rrrrrr sz/ParserElement.setParseAction..zparse actions must be callablerF)r rallrmaprrrrfnsr=rrrrs(zParserElement.setParseActioncOs4|jtttt|7_|jp,|dd|_|S)z Add one or more parse actions to expression's list of parse actions. See :class:`setParseAction`. See examples in :class:`copy`. rF)rr rrrrrrrraddParseActionszParserElement.addParseActionc OsF|D](}|jt||d|dddq|jp>|dd|_|S)aAdd a boolean predicate function to expression's list of parse actions. See :class:`setParseAction` for function call signatures. Unlike ``setParseAction``, functions passed to ``addCondition`` need to return boolean success/fail of the condition. Optional keyword arguments: - message = define a custom message to be used in the raised exception - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) year_int = integer.copy() year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later") date_str = year_int + '/' + integer + '/' + integer result = date_str.parseString("1999/12/31") # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1) rrF)rrr)rrrrr)rrr=rrrr addConditions  zParserElement.addConditioncCs ||_|S)aDefine action to perform if parsing fails at this expression. Fail acton fn is a callable function that takes the arguments ``fn(s, loc, expr, err)`` where: - s = string being parsed - loc = location where expression match was attempted and failed - expr = the parse expression that failed - err = the exception thrown The function returns no value. It may throw :class:`ParseFatalException` if it is desired to stop parsing immediately.)rrrrrr setFailAction4s zParserElement.setFailActionc CsNd}|rJd}|jD]4}z|||\}}d}qWqtk rDYqXqq|SNTF)rrr2)rrrZ exprsFoundeZdummyrrr_skipIgnorablesAs   zParserElement._skipIgnorablescCsH|jr|||}|jrD|j}t|}||krD|||krD|d7}q&|SNr)rrrrr)rrrZwtinstrlenrrrpreParseNs  zParserElement.preParsecCs|gfSrrrrrrrrrrZszParserElement.parseImplcCs|Srrrrr tokenlistrrr postParse]szParserElement.postParsec Csd\}}}|j}|s|jr"|j|r8|j||||z|rR|jrR|||} n|} | } |jsl| t|krz||| |\}} Wqtk rt |t||j |YqXn||| |\}} Wn\t k r} z<|j|r|j||| || |jr ||| || W5d} ~ XYnXn|r>|jr>|||} n|} | } |js\| t|krz||| |\}} Wn*tk rt |t||j |YnXn||| |\}} | ||| } t | |j|j|jd} |jr`|s|jr`|rz|jD]}z||| | } Wn6tk rD}zt d}||_|W5d}~XYnX| dk r| | k rt | |j|jovt| t tf|jd} qWnFt k r} z&|j|r|j||| || W5d} ~ XYnXn|jD]}z||| | } Wn6tk r }zt d}||_|W5d}~XYnX| dk r| | k rt | |j|joRt| t tf|jd} q|r|j|r|j||| ||| || fS)N)rrr)rrz exception raised in parse action)rrrrrrrrrr2rrrr5rrrrr __cause__rr )rrrrrZTRYZMATCHZFAILZ debuggingprelocZ tokensStarttokenserrZ retTokensrZparse_action_excrrrrras          zParserElement._parseNoCachecCs@z|j||dddWStk r:t|||j|YnXdS)NFrr)rr4r2rrrrrrrtryParseszParserElement.tryParsec Cs4z|||Wnttfk r*YdSXdSdS)NFT)rr2rrrrr canParseNexts zParserElement.canParseNextc@seZdZddZdS)zParserElement._UnboundedCachecs~it|_fdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS) Ncs |Srrrr@cache not_in_cacherrrsz3ParserElement._UnboundedCache.__init__..getcs ||<dSrrrr@r$rrrrsz3ParserElement._UnboundedCache.__init__..setcs dSrrFrrrrrFsz5ParserElement._UnboundedCache.__init__..clearcstSrrrrrr cache_lensz9ParserElement._UnboundedCache.__init__..cache_len)rrtypes MethodTyperrrFr()rrrrFrrrrrs    z&ParserElement._UnboundedCache.__init__Nrrrrrrrr_UnboundedCachesrNc@seZdZddZdS)ParserElement._FifoCachecst|_tfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS) Ncs |Srrrrrrrs.ParserElement._FifoCache.__init__..getcs>||<tkr:zdWqtk r6YqXqdSr~)rpopitemrr)rsizerrrs  .ParserElement._FifoCache.__init__..setcs dSrrrrrrrFs0ParserElement._FifoCache.__init__..clearcstSrrrrrrrs4ParserElement._FifoCache.__init__..cache_len) rr _OrderedDictrrrrrFr(rrrrrFrr)rrrrrs   !ParserElement._FifoCache.__init__Nrrrrr _FifoCachesrc@seZdZddZdS)rcst|_itgfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_ dS) Ncs |Srrrrrrrsrcs4||<tkr&dq|dSr)rr?popleftrr)rkey_fiforrrrs rcsdSrrr)rr rrrF srcstSrrrrrrrsr) rr collectionsdequerrrrrFr(rr)rr rrrrs   rNrrrrrrsrc Csd\}}|||||f}tjtj}||} | |jkrtj|d7<z|||||} Wn8tk r} z||| j | j W5d} ~ XYn.X||| d| d f| W5QRSn@tj|d7<t | t r| | d| d fW5QRSW5QRXdS)NrNrr)r7packrat_cache_lock packrat_cacherrpackrat_cache_statsrr0rrrrIrr) rrrrrZHITZMISSlookuprr$rrrr _parseCaches$   zParserElement._parseCachecCs(tjdgttjtjdd<dSr)r7r rFrrrrrr resetCache6s zParserElement.resetCachecCs8tjs4dt_|dkr tt_n t|t_tjt_dS)aEnables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happens often in many complex grammars) can immediately return a cached value, instead of re-executing parsing/validating code. Memoizing is done of both valid results and parsing exceptions. Parameters: - cache_size_limit - (default= ``128``) - if an integer value is provided will limit the size of the packrat cache; if None is passed, then the cache size will be unbounded; if 0 is passed, the cache will be effectively disabled. This speedup may break existing programs that use parse actions that have side-effects. For this reason, packrat parsing is disabled when you first import pyparsing. To activate the packrat feature, your program must call the class method :class:`ParserElement.enablePackrat`. For best results, call ``enablePackrat()`` immediately after importing pyparsing. Example:: from pip._vendor import pyparsing pyparsing.ParserElement.enablePackrat() TN)r7_packratEnabledrr rrr)Zcache_size_limitrrr enablePackrat<s   zParserElement.enablePackratc Cst|js||jD] }|q|js8|}z<||d\}}|rr|||}t t }|||Wn0t k r}ztj rn|W5d}~XYnX|SdS)a Execute the parse expression with the given string. This is the main interface to the client code, once the complete expression has been built. Returns the parsed data as a :class:`ParseResults` object, which may be accessed as a list, or as a dict or object with attributes if the given parser includes results names. If you want the grammar to require that the entire input string be successfully parsed, then set ``parseAll`` to True (equivalent to ending the grammar with ``StringEnd()``). Note: ``parseString`` implicitly calls ``expandtabs()`` on the input string, in order to report proper column numbers in parse actions. If the input string contains tabs and the grammar uses parse actions that use the ``loc`` argument to index into the string being parsed, you can ensure you have a consistent view of the input string by: - calling ``parseWithTabs`` on your grammar before calling ``parseString`` (see :class:`parseWithTabs`) - define your parse action using the full ``(s, loc, toks)`` signature, and reference the input string using the parse action's ``s`` argument - explictly expand the tabs in your input string before calling ``parseString`` Example:: Word('a').parseString('aaaaabaaa') # -> ['aaaaa'] Word('a').parseString('aaaaabaaa', parseAll=True) # -> Exception: Expected end of text rN) r7rr streamlinerr expandtabsrrrr<r0verbose_stacktrace)rrparseAllrrrZserrrr parseString_s$!    zParserElement.parseStringc cs6|js||jD] }|q|js4t|}t|}d}|j}|j}t d} z||kr| |krz |||} ||| dd\} } Wnt k r| d}YqZX| |kr| d7} | | | fV|r|||} | |kr| }q|d7}q| }qZ| d}qZWn4t k r0}zt j rn|W5d}~XYnXdS)aq Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional ``maxMatches`` argument, to clip scanning after 'n' matches are found. If ``overlap`` is specified, then overlapping matches will be reported. Note that the start and end locations are reported relative to the string being parsed. See :class:`parseString` for more information on parsing strings with embedded tabs. Example:: source = "sldjf123lsdjjkf345sldkjf879lkjsfd987" print(source) for tokens, start, end in Word(alphas).scanString(source): print(' '*start + '^'*(end-start)) print(' '*start + tokens[0]) prints:: sldjf123lsdjjkf345sldkjf879lkjsfd987 ^^^^^ sldjf ^^^^^^^ lsdjjkf ^^^^^^ sldkjf ^^^^^^ lkjsfd rFrrN)rrrrrrrrrr7rr2r0r)rr maxMatchesZoverlaprrrZ preparseFnZparseFnmatchesrZnextLocrZnextlocrrrr scanStringsB       zParserElement.scanStringc Csg}d}d|_z||D]Z\}}}|||||rpt|trR||7}nt|trf||7}n |||}q|||ddd|D}dtt t |WSt k r}zt j rƂn|W5d}~XYnXdS)a[ Extension to :class:`scanString`, to modify matching text with modified tokens that may be returned from a parse action. To use ``transformString``, define a grammar and attach a parse action to it that modifies the returned token list. Invoking ``transformString()`` on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse action. ``transformString()`` returns the resulting transformed string. Example:: wd = Word(alphas) wd.setParseAction(lambda toks: toks[0].title()) print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york.")) prints:: Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York. rTNcSsg|] }|r|qSrrrorrrrsz1ParserElement.transformString..r)rrrrr5rr rrr_flattenr0r7r)rrr[ZlastErrrrrrrrs(    zParserElement.transformStringc CsRztdd|||DWStk rL}ztjr8n|W5d}~XYnXdS)a Another extension to :class:`scanString`, simplifying the access to the tokens found to match the given parse expression. May be called with optional ``maxMatches`` argument, to clip searching after 'n' matches are found. Example:: # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters cap_word = Word(alphas.upper(), alphas.lower()) print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")) # the sum() builtin can be used to merge results into a single ParseResults object print(sum(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))) prints:: [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']] ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity'] cSsg|]\}}}|qSrr)rrrrrrrr#sz.ParserElement.searchString..N)r5rr0r7r)rrrrrrr searchString s zParserElement.searchStringc csTd}d}|j||dD]*\}}}|||V|r<|dV|}q||dVdS)aR Generator method to split a string using the given expression as a separator. May be called with optional ``maxsplit`` argument, to limit the number of splits; and the optional ``includeSeparators`` argument (default= ``False``), if the separating matching text should be included in the split results. Example:: punc = oneOf(list(".,;:/-!?")) print(list(punc.split("This, this?, this sentence, is badly punctuated!"))) prints:: ['This', ' this', '', ' this sentence', ' is badly punctuated', ''] r)rN)r) rrmaxsplitZincludeSeparatorsZsplitsZlastrrrrrrr+s zParserElement.splitcCsV|tkrt|St|tr$||}t|tsJtjdt|t dddSt ||gS)a[ Implementation of + operator - returns :class:`And`. Adding strings to a ParserElement converts them to :class:`Literal`s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) prints:: Hello, World! -> ['Hello', ',', 'World', '!'] ``...`` may be used as a parse expression as a short form of :class:`SkipTo`. Literal('start') + ... + Literal('end') is equivalent to: Literal('start') + SkipTo('end')("_skipped*") + Literal('end') Note that the skipped text is returned with '_skipped' as a results name, and to support having multiple skips in the same parser, the value returned is a list of all skipped text. 4Cannot combine element of type %s with ParserElementr stacklevelN) Ellipsis _PendingSkiprrrr7warningswarnr SyntaxWarningrrSrrrrKDs   zParserElement.__add__cCsZ|tkrt|d|St|tr,||}t|tsRtjdt|t dddS||S)z` Implementation of + operator when left operand is not a :class:`ParserElement` _skipped*r#rr$N) r&r;rrrr7r(r)rr*rSrrrrTjs   zParserElement.__radd__cCsJt|tr||}t|ts:tjdt|tdddS|t |S)zT Implementation of - operator, returns :class:`And` with error stop r#rr$N) rrrr7r(r)rr*r _ErrorStoprSrrr__sub__ys   zParserElement.__sub__cCsBt|tr||}t|ts:tjdt|tdddS||S)z` Implementation of - operator when left operand is not a :class:`ParserElement` r#rr$Nrrrr7r(r)rr*rSrrr__rsub__s   zParserElement.__rsub__cs|tkrd}n8t|trF|ddtfkrFd|ddddd}t|tr\|d}}nt|trJtdd |D}|d dd}|ddkrd|df}t|dtr|ddkr|ddkrtS|ddkrtS|dtSnNt|dtr,t|dtr,|\}}||8}ntd t|dt|dntd t||dkrjtd |dkr|td||krdkrnntd|rfdd|r|dkr҈|}nt g||}n|}n|dkr}nt g|}|S)a Implementation of * operator, allows use of ``expr * 3`` in place of ``expr + expr + expr``. Expressions may also me multiplied by a 2-integer tuple, similar to ``{min, max}`` multipliers in regular expressions. Tuples may also include ``None`` as in: - ``expr*(n, None)`` or ``expr*(n, )`` is equivalent to ``expr*n + ZeroOrMore(expr)`` (read as "at least n instances of ``expr``") - ``expr*(None, n)`` is equivalent to ``expr*(0, n)`` (read as "0 to n instances of ``expr``") - ``expr*(None, None)`` is equivalent to ``ZeroOrMore(expr)`` - ``expr*(1, None)`` is equivalent to ``OneOrMore(expr)`` Note that ``expr*(None, n)`` does not raise an exception if more than n exprs exist in the input stream; that is, ``expr*(None, n)`` does not enforce a maximum number of expr occurrences. If this behavior is desired, then write ``expr*(None, n) + ~expr`` )rNNrrrrrcss|]}|tk r|ndVqdSr)r&rrrrrsz(ParserElement.__mul__..)NNz8cannot multiply 'ParserElement' and ('%s', '%s') objectsz0cannot multiply 'ParserElement' and '%s' objectsz/cannot multiply ParserElement by negative valuez@second tuple value must be greater or equal to first tuple valuez,cannot multiply ParserElement by 0 or (0, 0)cs(|dkrt|dStSdSr)r.nmakeOptionalListrrrr3sz/ParserElement.__mul__..makeOptionalList) r&rtuplerrEr,rr ValueErrorr)rrJZ minElementsZ optElementsrrr2r__mul__sN              zParserElement.__mul__cCs ||Sr)r6rSrrr__rmul__szParserElement.__rmul__cCsZ|tkrt|ddSt|tr(||}t|tsNtjdt|t dddSt ||gS)zL Implementation of | operator - returns :class:`MatchFirst` T) must_skipr#rr$N) r&r'rrrr7r(r)rr*r)rSrrr__or__s    zParserElement.__or__cCsBt|tr||}t|ts:tjdt|tdddS||BS)z` Implementation of | operator when left operand is not a :class:`ParserElement` r#rr$Nr.rSrrr__ror__s   zParserElement.__ror__cCsFt|tr||}t|ts:tjdt|tdddSt||gS)zD Implementation of ^ operator - returns :class:`Or` r#rr$N) rrrr7r(r)rr*r/rSrrr__xor__s   zParserElement.__xor__cCsBt|tr||}t|ts:tjdt|tdddS||AS)z` Implementation of ^ operator when left operand is not a :class:`ParserElement` r#rr$Nr.rSrrr__rxor__ s   zParserElement.__rxor__cCsFt|tr||}t|ts:tjdt|tdddSt||gS)zF Implementation of & operator - returns :class:`Each` r#rr$N) rrrr7r(r)rr*rrSrrr__and__ s   zParserElement.__and__cCsBt|tr||}t|ts:tjdt|tdddS||@S)z` Implementation of & operator when left operand is not a :class:`ParserElement` r#rr$Nr.rSrrr__rand__ s   zParserElement.__rand__cCst|S)zH Implementation of ~ operator - returns :class:`NotAny` )r+rrrr __invert__) szParserElement.__invert__cCstd|jjdS)Nz%r object is not iterable)rrrrrrrr-/ szParserElement.__iter__c Cszt|tr|f}t|Wntk r8||f}YnXt|dkrztd|ddt|dkrrdt|nd|t|dd}|S)a use ``[]`` indexing notation as a short form for expression repetition: - ``expr[n]`` is equivalent to ``expr*n`` - ``expr[m, n]`` is equivalent to ``expr*(m, n)`` - ``expr[n, ...]`` or ``expr[n,]`` is equivalent to ``expr*n + ZeroOrMore(expr)`` (read as "at least n instances of ``expr``") - ``expr[..., n]`` is equivalent to ``expr*(0, n)`` (read as "0 to n instances of ``expr``") - ``expr[...]`` and ``expr[0, ...]`` are equivalent to ``ZeroOrMore(expr)`` - ``expr[1, ...]`` is equivalent to ``OneOrMore(expr)`` ``None`` may be used in place of ``...``. Note that ``expr[..., n]`` and ``expr[m, n]``do not raise an exception if more than ``n`` ``expr``s exist in the input stream. If this behavior is desired, then write ``expr[..., n] + ~expr``. rz.only 1 or 2 index arguments supported ({0}{1})Nrz ... [{0}]r) rrr,rrr(r)rr4)rr@rrrrr4 s    zParserElement.__getitem__cCs|dk r||S|SdS)a Shortcut for :class:`setResultsName`, with ``listAllMatches=False``. If ``name`` is given with a trailing ``'*'`` character, then ``listAllMatches`` will be passed as ``True``. If ``name` is omitted, same as calling :class:`copy`. Example:: # these are equivalent userdata = Word(alphas).setResultsName("name") + Word(nums + "-").setResultsName("socsecno") userdata = Word(alphas)("name") + Word(nums + "-")("socsecno") N)rrIrGrrr__call__X s zParserElement.__call__cCst|S)z Suppresses the output of this :class:`ParserElement`; useful to keep punctuation from cluttering up returned output. )r>rrrrsuppressl szParserElement.suppresscCs d|_|S)a Disables the skipping of whitespace before matching the characters in the :class:`ParserElement`'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. FrrrrrleaveWhitespaces szParserElement.leaveWhitespacecCsd|_||_d|_|S)z8 Overrides the default whitespace chars TF)rrr)rrrrrsetWhitespaceChars| sz ParserElement.setWhitespaceCharscCs d|_|S)z Overrides default behavior to expand ````s to spaces before parsing the input string. Must be called before ``parseString`` when the input grammar contains elements that match ```` characters. T)rrrrr parseWithTabs szParserElement.parseWithTabscCsLt|trt|}t|tr4||jkrH|j|n|jt||S)a Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment or other ignorable patterns. Example:: patt = OneOrMore(Word(alphas)) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj'] patt.ignore(cStyleComment) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd'] )rrr>rrrIrSrrrignore s   zParserElement.ignorecCs"|pt|p t|ptf|_d|_|S)zT Enable display of debugging messages while doing pattern matching. T)rrrrr)rZ startActionZ successActionZexceptionActionrrrsetDebugActions s zParserElement.setDebugActionscCs|r|tttnd|_|S)a Enable display of debugging messages while doing pattern matching. Set ``flag`` to True to enable, False to disable. Example:: wd = Word(alphas).setName("alphaword") integer = Word(nums).setName("numword") term = wd | integer # turn on debugging for wd wd.setDebug() OneOrMore(term).parseString("abc 123 xyz 890") prints:: Match alphaword at loc 0(1,1) Matched alphaword -> ['abc'] Match alphaword at loc 3(1,4) Exception raised:Expected alphaword (at char 4), (line:1, col:5) Match alphaword at loc 7(1,8) Matched alphaword -> ['xyz'] Match alphaword at loc 11(1,12) Exception raised:Expected alphaword (at char 12), (line:1, col:13) Match alphaword at loc 15(1,16) Exception raised:Expected alphaword (at char 15), (line:1, col:16) The output shown is that produced by the default debug actions - custom debug actions can be specified using :class:`setDebugActions`. Prior to attempting to match the ``wd`` expression, the debugging message ``"Match at loc (,)"`` is shown. Then if the parse succeeds, a ``"Matched"`` message is shown, or an ``"Exception raised"`` message is shown. Also note the use of :class:`setName` to assign a human-readable name to the expression, which makes debugging and exception messages easier to understand - for instance, the default name created for the :class:`Word` expression without calling ``setName`` is ``"W:(ABCD...)"``. F)rGrrrr)rflagrrrr s%zParserElement.setDebugcCs|jSrrrrrrr szParserElement.__str__cCst|Srrrrrrr szParserElement.__repr__cCsd|_d|_|Sr)rrrrrrr szParserElement.streamlinecCsdSrrrrrrcheckRecursion szParserElement.checkRecursioncCs|gdS)zj Check defined expressions for valid structure, check for infinite recursive definitions. N)rI)r validateTracerrrvalidate szParserElement.validatec Csz |}Wn2tk r>t|d}|}W5QRXYnXz|||WStk r~}ztjrjn|W5d}~XYnXdS)z Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing. rN)readropenrr0r7r)rZfile_or_filenamerZ file_contentsfrrrr parseFile s  zParserElement.parseFilecsht|trBtr(||kp$tt||qd||kp>t|t|kSn"t|trV||Stt||kSdSr)rr7rbsuper__eq__varsrrrSrrrrR s   zParserElement.__eq__cCs ||k SrrrSrrr__ne__ szParserElement.__ne__cCst|Sr)idrrrr__hash__ szParserElement.__hash__cCs||kSrrrSrrr__req__ szParserElement.__req__cCs ||k SrrrSrrr__rne__ szParserElement.__rne__cCs4z|jt||dWdStk r.YdSXdS)a Method for quick testing of a parser against a test string. Good for simple inline microtests of sub expressions while building up larger parser. Parameters: - testString - to test against this expression for a match - parseAll - (default= ``True``) - flag to pass to :class:`parseString` when running tests Example:: expr = Word(nums) assert expr.matches("100") rTFN)rrr0)rZ testStringrrrrr s zParserElement.matches#c  Cst|tr"tttj|}t|tr4t|}|dkrBt j }|j } g} g} d} td t dt} d}|D]\}|dk r||ds| r|s| |qt|sqtd| |g}g} z"| ||}|j||d}Wntk r}zt|trdnd }d|krB|t|j||d t|j|d d |n|d |jd ||d t|| ot|} |}W5d}~XYntk r}z$|dt|| o|} |}W5d}~XYnX| o| } |dk rzR|||}|dk r(t|tr||n|t|n||WnRtk r}z2||j|d|d|jt |j|W5d}~XYnXn||j|d|r|r|d | d|| ||fqt| | fS)as Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and easy way to run a parse expression against a list of sample strings. Parameters: - tests - a list of separate test strings, or a multiline string of test strings - parseAll - (default= ``True``) - flag to pass to :class:`parseString` when running tests - comment - (default= ``'#'``) - expression for indicating embedded comments in the test string; pass None to disable comment filtering - fullDump - (default= ``True``) - dump results as list followed by results names in nested outline; if False, only dump nested list - printResults - (default= ``True``) prints test output to stdout - failureTests - (default= ``False``) indicates if these tests are expected to fail parsing - postParse - (default= ``None``) optional callback for successful parse results; called as `fn(test_string, parse_results)` and returns a string to be added to the test output - file - (default=``None``) optional file-like object to which test output will be written; if None, will default to ``sys.stdout`` Returns: a (success, results) tuple, where success indicates that all tests succeeded (or failed if ``failureTests`` is True), and the results contain a list of lines of each test's output Example:: number_expr = pyparsing_common.number.copy() result = number_expr.runTests(''' # unsigned integer 100 # negative integer -100 # float with scientific notation 6.02e23 # integer with scientific notation 1e-12 ''') print("Success" if result[0] else "Failed!") result = number_expr.runTests(''' # stray character 100Z # missing leading digit before '.' -.100 # too many '.' 3.14.159 ''', failureTests=True) print("Success" if result[0] else "Failed!") prints:: # unsigned integer 100 [100] # negative integer -100 [-100] # float with scientific notation 6.02e23 [6.02e+23] # integer with scientific notation 1e-12 [1e-12] Success # stray character 100Z ^ FAIL: Expected end of text (at char 3), (line:1, col:4) # missing leading digit before '.' -.100 ^ FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1) # too many '.' 3.14.159 ^ FAIL: Expected end of text (at char 4), (line:1, col:5) Success Each test string must be on a single line. If you want to test a string that spans multiple lines, create a test like this:: expr.runTest(r"this is a test\n of strings that spans \n 3 lines") (Note that this is a raw string literal, you must include the leading 'r'.) NT\nruFrZz(FATAL)rrrrzFAIL: zFAIL-EXCEPTION: )rpz{0} failed: {1}: {2})!rrr rrrrstrip splitlinesr'rstdoutwriterrprFrmrrrrlstriprr0r4r[rrMrr5rurrr)rZtestsrZcommentZfullDumpZ printResultsZ failureTestsrfileprint_Z allResultsZcommentssuccessrwBOMrr[resultrrrZpp_valuerrrrrunTests. sn`     $       0 zParserElement.runTests)F)F)F)T)T)TT)TT)r)F)N)T)N)F)T)Tr[TTFNN)RrrrrrrrrrrrIrrrrrrrrrrrrrrrrrrrr rr rrrrrrr_MAX_INTrrr!rrKrTr-r/r6r7r9r:r;r<r=r>r?r-rr@rArCrDrErFrGrrrrrIrKrPrRrUrWrXrYrrg __classcell__rrrTrr7?s     1     W   " 8H. &  J     $     +    cs6eZdZd fdd ZddZddZdd ZZS) r'Fcs>tt|t|tdd|_|j|_||_||_ dS)Nr...) rQr'rrrrrranchorr8)rrr8rTrrr s z_PendingSkip.__init__cs\t|dd}jrNdd}fdd}j||||B|Sj||S)Nrjr+cSs,|jr|jdgkr(|d=|dddS)Nrr_skipped)rlrr?rrrrr8 sz'_PendingSkip.__add__..must_skipcs<|jdddgkr8|d}dtjd|d<dS)Nrrrlz missing .show_skip)r;rr8rkr)rrJZskipperr8rmrrrrK s  z_PendingSkip.__add__cCs|jSr)rrrrrr sz_PendingSkip.__repr__cGs tddS)NzBuse of `...` expression without following SkipTo target expression)r)rrrrrr sz_PendingSkip.parseImpl)F)rrrrrKrrrirrrTrr' sr'cs eZdZdZfddZZS)r?zYAbstract :class:`ParserElement` subclass, for defining atomic matching patterns. cstt|jdddSNFr)rQr?rrrTrrr szToken.__init__rrrrrrirrrTrr? scs eZdZdZfddZZS)rz'An empty token, will always match. cs$tt|d|_d|_d|_dS)NrTF)rQrrrrrrrTrrr szEmpty.__init__rprrrTrr scs*eZdZdZfddZdddZZS)r*z#A token that will never match. cs*tt|d|_d|_d|_d|_dS)Nr*TFzUnmatchable token)rQr*rrrrrrrTrrr s zNoMatch.__init__TcCst|||j|dSr)r2rrrrrr szNoMatch.parseImpl)TrrrrrrrirrrTrr* s cs*eZdZdZfddZdddZZS)r'aToken to exactly match a specified string. Example:: Literal('blah').parseString('blah') # -> ['blah'] Literal('blah').parseString('blahfooblah') # -> ['blah'] Literal('blah').parseString('bla') # -> Exception: Expected "blah" For case-insensitive matching, use :class:`CaselessLiteral`. For keyword matching (force word break before and after the matched string), use :class:`Keyword` or :class:`CaselessKeyword`. cstt|||_t||_z|d|_Wn*tk rVtj dt ddt |_ YnXdt |j|_d|j|_d|_d|_|jdkrt|tkrt|_ dS) Nrz2null string passed to Literal; use Empty() insteadrr$"%s"rFr)rQr'rmatchrmatchLenfirstMatchCharrr(r)r*rrrrrrrr_SingleCharLiteralr matchStringrTrrr s"   zLiteral.__init__TcCs@|||jkr,||j|r,||j|jfSt|||j|dSr)ru startswithrsrtr2rrrrrr4 szLiteral.parseImpl)TrqrrrTrr' s c@seZdZdddZdS)rvTcCs0|||jkr|d|jfSt|||j|dSr)rursr2rrrrrr: sz_SingleCharLiteral.parseImplN)Trrrrrrrrrv9 srvcsLeZdZdZedZdfdd Zddd Zfd d Ze d d Z Z S)r$aToken to exactly match a specified string as a keyword, that is, it must be immediately followed by a non-keyword character. Compare with :class:`Literal`: - ``Literal("if")`` will match the leading ``'if'`` in ``'ifAndOnlyIf'``. - ``Keyword("if")`` will not; it will only match the leading ``'if'`` in ``'if x=1'``, or ``'if(y==2)'`` Accepts two optional constructor arguments in addition to the keyword string: - ``identChars`` is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$" - ``caseless`` allows case-insensitive matching, default is ``False``. Example:: Keyword("start").parseString("start") # -> ['start'] Keyword("start").parseString("starting") # -> Exception For case-insensitive matching, use :class:`CaselessKeyword`. _$NFcstt||dkrtj}||_t||_z|d|_Wn$tk r^t j dt ddYnXd|j|_ d|j |_ d|_d|_||_|r||_|}t||_dS)Nrz2null string passed to Keyword; use Empty() insteadrr$rrrF)rQr$rDEFAULT_KEYWORD_CHARSrsrrtrurr(r)r*rrrrcaselessupper caselessmatchr identChars)rrxrr}rTrrr] s*     zKeyword.__init__TcCs|jr|||||j|jkr|t||jksL|||j|jkr|dksj||d|jkr||j|jfSnv|||jkr|jdks||j|r|t||jks|||j|jkr|dks||d|jkr||j|jfSt |||j |dSr) r}rtr~rrrrsruryr2rrrrrrr s.zKeyword.parseImplcstt|}tj|_|Sr)rQr$rIr|r)rrrTrrrI sz Keyword.copycCs |t_dS)z,Overrides the default Keyword chars N)r$r|rrrrsetDefaultKeywordChars szKeyword.setDefaultKeywordChars)NF)T) rrrrrGr|rrrIrrrirrrTrr$B s  cs*eZdZdZfddZdddZZS)rafToken to match a specified string, ignoring case of letters. Note: the matched results will always be in the case of the given match string, NOT the case of the input text. Example:: OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD'] (Contrast with example for :class:`CaselessKeyword`.) cs6tt||||_d|j|_d|j|_dS)Nz'%s'r)rQrrr~ returnStringrrrwrTrrr s zCaselessLiteral.__init__TcCs@||||j|jkr,||j|jfSt|||j|dSr)rtr~rsrr2rrrrrr szCaselessLiteral.parseImpl)TrqrrrTrr s cs"eZdZdZdfdd ZZS)rz Caseless version of :class:`Keyword`. Example:: OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD'] (Contrast with example for :class:`CaselessLiteral`.) Ncstt|j||dddS)NTr})rQrr)rrxrrTrrr szCaselessKeyword.__init__)NrprrrTrr s cs,eZdZdZdfdd Zd ddZZS) raA variation on :class:`Literal` which matches "close" matches, that is, strings with at most 'n' mismatching characters. :class:`CloseMatch` takes parameters: - ``match_string`` - string to be matched - ``maxMismatches`` - (``default=1``) maximum number of mismatches allowed to count as a match The results from a successful parse will contain the matched text from the input string and the following named results: - ``mismatches`` - a list of the positions within the match_string where mismatches were found - ``original`` - the original match_string used to compare against the input string If ``mismatches`` is an empty list, then the match was an exact match. Example:: patt = CloseMatch("ATCATCGAATGGA") patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']}) patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1) # exact match patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']}) # close match allowing up to 2 mismatches patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2) patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']}) rcsBtt|||_||_||_d|j|jf|_d|_d|_dS)Nz&Expected %r (with up to %d mismatches)F) rQrrr match_string maxMismatchesrrr)rrrrTrrr szCloseMatch.__init__TcCs|}t|}|t|j}||kr|j}d}g} |j} tt||||D]2\}} | \} } | | krL| |t| | krLqqL|d}t|||g}||d<| |d<||fSt|||j|dS)Nrroriginal mismatches) rrrrrrr5r2r)rrrrstartrmaxlocrZmatch_stringlocrrZs_msrcmatresultsrrrr s(  zCloseMatch.parseImpl)r)TrqrrrTrr s  cs8eZdZdZd fdd Zdd d Zfd d ZZS)rBaX Token for matching words composed of allowed character sets. Defined with string containing all allowed initial characters, an optional string containing allowed body characters (if omitted, defaults to the initial character set), and an optional minimum, maximum, and/or exact length. The default value for ``min`` is 1 (a minimum value < 1 is not valid); the default values for ``max`` and ``exact`` are 0, meaning no maximum or exact length restriction. An optional ``excludeChars`` parameter can list characters that might be found in the input ``bodyChars`` string; useful to define a word of all printables except for one or two characters, for instance. :class:`srange` is useful for defining custom character set strings for defining ``Word`` expressions, using range notation from regular expression character sets. A common mistake is to use :class:`Word` to match a specific literal string, as in ``Word("Address")``. Remember that :class:`Word` uses the string argument to define *sets* of matchable characters. This expression would match "Add", "AAA", "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'. To match an exact literal string, use :class:`Literal` or :class:`Keyword`. pyparsing includes helper strings for building Words: - :class:`alphas` - :class:`nums` - :class:`alphanums` - :class:`hexnums` - :class:`alphas8bit` (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.) - :class:`punc8bit` (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.) - :class:`printables` (any non-whitespace character) Example:: # a word composed of digits integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9")) # a word with a leading capital, and zero or more lowercase capital_word = Word(alphas.upper(), alphas.lower()) # hostnames are alphanumeric, with leading alpha, and '-' hostname = Word(alphas, alphanums + '-') # roman numeral (not a strict parser, accepts invalid mix of characters) roman = Word("IVXLCDM") # any string of non-whitespace characters, except for ',' csv_value = Word(printables, excludeChars=",") NrrFcstt|rNtdfdd|D}|rNdfdd|D}||_t||_|rt||_t||_n||_t||_|dk|_ |dkrt d||_ |dkr||_ nt |_ |dkr||_ ||_ t||_d|j|_d |_||_d |j|jkr|dkr|dkr|dkr|j|jkr@d t|j|_nHt|jdkrnd t|jt|jf|_nd t|jt|jf|_|jrd|jd|_zt|j|_Wntk rd|_YnX|jj|_t|_dS)Nrc3s|]}|kr|VqdSrrr excludeCharsrrr2 sz Word.__init__..c3s|]}|kr|VqdSrrrrrrr4 srrzZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permittedrFrz[%s]+z%s[%s]*z [%s][%s]*z\b)rQrBrrr initCharsOrig initChars bodyCharsOrig bodyChars maxSpecifiedr5minLenmaxLenrhrrrr asKeyword_escapeRegexRangeCharsreStringrrescapecompilerrsre_match _WordRegexr)rrrminmaxexactrrrTrrr. sZ      0     z Word.__init__Tc Cs|||jkrt|||j||}|d7}t|}|j}||j}t||}||krj|||krj|d7}qLd}|||jkrd}nV|jr||kr|||krd}n6|j r|dkr||d|ks||kr|||krd}|rt|||j|||||fS)NrFTr) rr2rrrrrrrr) rrrrrrZ bodycharsrZthrowExceptionrrrrg s2    zWord.parseImplcsvztt|WStk r$YnX|jdkrpdd}|j|jkr`d||j||jf|_nd||j|_|jS)NcSs$t|dkr|dddS|SdS)Nrjrrrrr charsAsStr s z Word.__str__..charsAsStrz W:(%s, %s)zW:(%s))rQrBrrrrr)rrrTrrr s  z Word.__str__)NrrrFN)TrrrrrrrrirrrTrrB s49 c@seZdZdddZdS)rTcCs4|||}|s t|||j||}||fSr)rr2rendgroup)rrrrrfrrrr s  z_WordRegex.parseImplN)Trzrrrrr srcs"eZdZdZdfdd ZZS)rFzA short-cut class for defining ``Word(characters, exact=1)``, when defining a match of any single character in a string of characters. FNcsZtt|j|d||ddtd|j|_|r>d|j|_t|j|_|jj |_ dS)Nr)rrr[%s]rz\b%s\b) rQrFrrrrrrrrsr)rcharsetrrrTrrr s  z Char.__init__)FNrprrrTrrF scsbeZdZdZeedZdfdd Zddd Z dd d Z dd d Z fddZ ddZ ZS)r:aToken for matching strings that match a given regular expression. Defined with string specifying the regular expression in a form recognized by the stdlib Python `re module `_. If the given regex contains named groups (defined using ``(?P...)``), these will be preserved as named parse results. Example:: realnum = Regex(r"[+-]?\d+\.\d*") date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)') # ref: https://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression roman = Regex(r"M{0,4}(CM|CD|D?{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") z[A-Z]rFcstt|t|tr|s,tjdtdd||_||_ zt |j|j |_ |j|_ Wqt jk rtjd|tddYqXn2t|tjr||_ t||_|_ ||_ ntd|j j|_t||_d|j|_d|_d|_||_||_|jr|j|_|jr|j|_d S) aThe parameters ``pattern`` and ``flags`` are passed to the ``re.compile()`` function as-is. See the Python `re module `_ module for an explanation of the acceptable patterns and flags. z0null string passed to Regex; use Empty() insteadrr$$invalid pattern (%s) passed to RegexzCRegex may only be constructed with a string or a compiled RE objectrFTN)rQr:rrrr(r)r*patternflagsrrr sre_constantserrorcompiledREtyperr5rsrrrrrr asGroupListasMatchparseImplAsGroupListrparseImplAsMatch)rrrrrrTrrr sD        zRegex.__init__Tc Csb|||}|s t|||j||}t|}|}|rZ|D]\}}|||<qH||fSr)rr2rrr5r groupdictr!) rrrrrfrdrrrrrr s   zRegex.parseImplcCs8|||}|s t|||j||}|}||fSr)rr2rrgroupsrrrrrfrrrrr s  zRegex.parseImplAsGroupListcCs4|||}|s t|||j||}|}||fSr)rr2rrrrrrr s  zRegex.parseImplAsMatchcsFztt|WStk r$YnX|jdkr@dt|j|_|jS)NzRe:(%s))rQr:rrrrrrrTrrr s z Regex.__str__csljrtjdtddtjr@tr@tjdtddtjrTfdd}nfdd}|S)a Return Regex with an attached parse action to transform the parsed result as if called using `re.sub(expr, repl, string) `_. Example:: make_html = Regex(r"(\w+):(.*?):").sub(r"<\1>\2") print(make_html.transformString("h1:main title:")) # prints "

main title

" z-cannot use sub() with Regex(asGroupList=True)rr$z9cannot use sub() with a callable with Regex(asMatch=True)cs|dSr)expandr)replrrr, szRegex.sub..pacsj|dSr)rrrrrrrr/ s)rr(r)r* SyntaxErrorrrr)rrrrrrr s z Regex.sub)rFF)T)T)T)rrrrrrrrrrrrrrrirrrTrr: s - cs8eZdZdZd fdd Zd ddZfd d ZZS) r8a& Token for matching strings that are delimited by quoting characters. Defined with the following parameters: - quoteChar - string of one or more characters defining the quote delimiting string - escChar - character to escape quotes, typically backslash (default= ``None``) - escQuote - special quote sequence to escape an embedded quote string (such as SQL's ``""`` to escape an embedded ``"``) (default= ``None``) - multiline - boolean indicating whether quotes can span multiple lines (default= ``False``) - unquoteResults - boolean indicating whether the matched text should be unquoted (default= ``True``) - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default= ``None`` => same as quoteChar) - convertWhitespaceEscapes - convert escaped whitespace (``'\t'``, ``'\n'``, etc.) to actual whitespace (default= ``True``) Example:: qs = QuotedString('"') print(qs.searchString('lsjdf "This is the quote" sldjf')) complex_qs = QuotedString('{{', endQuoteChar='}}') print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf')) sql_qs = QuotedString('"', escQuote='""') print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf')) prints:: [['This is the quote']] [['This is the "quote"']] [['This is the quote with "embedded" quotes']] NFTc sXtt|}|s0tjdtddt|dkr>|}n"|}|s`tjdtddt|_t |_ |d_ |_ t |_ |_|_|_|_|rtjtjB_dtjtj d|dk rt|pdf_n.r)z|(?:%s)z|(?:%s.)z(.)z)*%srrFT)'rQr8rrr(r)r*r quoteCharr quoteCharLenfirstQuoteCharrendQuoteCharLenescCharescQuoteunquoteResultsconvertWhitespaceEscapesr MULTILINEDOTALLrrrrrrescCharReplacePatternrrrsrrrrrrrr)rrrrZ multilinerrrrTrrrZ sv           zQuotedString.__init__c Cs|||jkr|||pd}|s2t|||j||}|}|jr||j|j }t |t rd|kr|j rddddd}| D]\}}| ||}q|jrt|jd|}|jr| |j|j}||fS)Nr r  )\tr\z\fz\rz\g<1>)rrr2rrrrrrrrrr!rrrrrrr) rrrrrfrZws_mapZwslitZwscharrrrr s* zQuotedString.parseImplcsHztt|WStk r$YnX|jdkrBd|j|jf|_|jS)Nz.quoted string, starting with %s ending with %s)rQr8rrrrrrrTrrr s zQuotedString.__str__)NNFTNT)TrrrrTrr83 s&A #cs8eZdZdZd fdd Zd ddZfd d ZZS) raToken for matching words composed of characters *not* in a given set (will include whitespace in matched characters if not listed in the provided exclusion set - see example). Defined with string containing all disallowed characters, and an optional minimum, maximum, and/or exact length. The default value for ``min`` is 1 (a minimum value < 1 is not valid); the default values for ``max`` and ``exact`` are 0, meaning no maximum or exact length restriction. Example:: # define a comma-separated-value as anything that is not a ',' csv_value = CharsNotIn(',') print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213")) prints:: ['dkls', 'lsdkjf', 's12 34', '@!#', '213'] rrcstt|d|_||_|dkr*td||_|dkr@||_nt|_|dkrZ||_||_t ||_ d|j |_ |jdk|_ d|_ dS)NFrzfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedrr)rQrrrnotCharsr5rrrhrrrrr)rrrrrrTrrr s    zCharsNotIn.__init__TcCs|||jkrt|||j||}|d7}|j}t||jt|}||krb|||krb|d7}qD|||jkrt|||j|||||fSr)rr2rrrrr)rrrrrZnotcharsmaxlenrrrr s zCharsNotIn.parseImplcsfztt|WStk r$YnX|jdkr`t|jdkrTd|jdd|_n d|j|_|jS)Nrz !W:(%s...)z!W:(%s))rQrrrrrrrrTrrrs  zCharsNotIn.__str__)rrr)TrrrrTrr s cs`eZdZdZdddddddd d d d d ddddddddddddZd"fdd Zd#d d!ZZS)$rAaSpecial matching class for matching whitespace. Normally, whitespace is ignored by pyparsing grammars. This class is included when some whitespace structures are significant. Define with a string containing the whitespace characters to be matched; default is ``" \t\r\n"``. Also takes optional ``min``, ``max``, and ``exact`` arguments, as defined for the :class:`Word` class. zzzzzzzzz z z z zzzzzz z zzzz)rrrrrzuA0zu80zu80Euu€0uu€1uu€2uu€3uu€4uu€5uu€6uu€7uu€8uu€9uu€Auu€Buu‚Fuu…FuuÀ0 rrcstt|_dfddjDdddjD_d_dj_ |_ |dkrt|_ nt _ |dkr|_ |_ dS)Nrc3s|]}|jkr|VqdSr) matchWhiterrrrr:s z!White.__init__..css|]}tj|VqdSr)rA whiteStrsrrrrr<sTrr) rQrArrrDrrrrrrrrh)rZwsrrrrTrrr7s  zWhite.__init__TcCs|||jkrt|||j||}|d7}||j}t|t|}||krb|||jkrb|d7}qB|||jkrt|||j|||||fSr)rr2rrrrr)rrrrrrrrrrKs  zWhite.parseImpl)rrrr)T)rrrrrrrrirrrTrrAs6 cseZdZfddZZS)_PositionTokencs(tt||jj|_d|_d|_dSr)rQrrrrrrrrrTrrr\s z_PositionToken.__init__rrrrrirrrTrr[srcs2eZdZdZfddZddZd ddZZS) r"zaToken to advance to a specific column of input text; useful for tabular report scraping. cstt|||_dSr)rQr"rrM)rcolnorTrrrfszGoToColumn.__init__cCs\t|||jkrXt|}|jr*|||}||krX||rXt|||jkrX|d7}q*|Sr)rMrrrisspace)rrrrrrrrjs $ zGoToColumn.preParseTcCsDt||}||jkr"t||d|||j|}|||}||fS)NzText not in expected columnrMr2)rrrrZthiscolZnewlocrrrrrss    zGoToColumn.parseImpl)T)rrrrrrrrirrrTrr"bs  cs*eZdZdZfddZdddZZS)r&aMatches if current position is at the beginning of a line within the parse string Example:: test = '''\ AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (LineStart() + 'AAA' + restOfLine).searchString(test): print(t) prints:: ['AAA', ' this line'] ['AAA', ' and this line'] cstt|d|_dS)NzExpected start of line)rQr&rrrrTrrrszLineStart.__init__TcCs*t||dkr|gfSt|||j|dSr)rMr2rrrrrrszLineStart.parseImpl)TrqrrrTrr&|s cs*eZdZdZfddZdddZZS)r%zTMatches if current position is at the end of a line within the parse string cs,tt||tjddd|_dS)NrrzExpected end of line)rQr%rrDr7rrrrrTrrrszLineEnd.__init__TcCsb|t|kr6||dkr$|ddfSt|||j|n(|t|krN|dgfSt|||j|dS)Nrrrr2rrrrrrs     zLineEnd.parseImpl)TrqrrrTrr%s cs*eZdZdZfddZdddZZS)r=zLMatches if current position is at the beginning of the parse string cstt|d|_dS)NzExpected start of text)rQr=rrrrTrrrszStringStart.__init__TcCs0|dkr(|||dkr(t|||j||gfSr)rr2rrrrrrszStringStart.parseImpl)TrqrrrTrr=s cs*eZdZdZfddZdddZZS)r<zBMatches if current position is at the end of the parse string cstt|d|_dS)NzExpected end of text)rQr<rrrrTrrrszStringEnd.__init__TcCs^|t|krt|||j|n<|t|kr6|dgfS|t|krJ|gfSt|||j|dSrrrrrrrs    zStringEnd.parseImpl)TrqrrrTrr<s cs.eZdZdZeffdd ZdddZZS)rDayMatches if the current position is at the beginning of a Word, and is not preceded by any character in a given set of ``wordChars`` (default= ``printables``). To emulate the ```` behavior of regular expressions, use ``WordStart(alphanums)``. ``WordStart`` will also match at the beginning of the string being parsed, or at the beginning of a line. cs"tt|t||_d|_dS)NzNot at the start of a word)rQrDrr wordCharsrrrrTrrrs zWordStart.__init__TcCs@|dkr8||d|jks(|||jkr8t|||j||gfSr)rr2rrrrrrs  zWordStart.parseImpl)TrrrrrjrrrirrrTrrDscs.eZdZdZeffdd ZdddZZS)rCa_Matches if the current position is at the end of a Word, and is not followed by any character in a given set of ``wordChars`` (default= ``printables``). To emulate the ```` behavior of regular expressions, use ``WordEnd(alphanums)``. ``WordEnd`` will also match at the end of the string being parsed, or at the end of a line. cs(tt|t||_d|_d|_dS)NFzNot at the end of a word)rQrCrrrrrrrTrrrs zWordEnd.__init__TcCsPt|}|dkrH||krH|||jks8||d|jkrHt|||j||gfSr)rrr2r)rrrrrrrrrszWordEnd.parseImpl)TrrrrTrrCscszeZdZdZdfdd ZddZddZfd d Zfd d Zfd dZ dddZ fddZ dfdd Z Z S)r3z]Abstract subclass of ParserElement, for combining and post-processing parsed tokens. Fcstt|t|tr"t|}t|tr<|g_nt|t rP|g_nnt|t rt|}t dd|Drfdd|D}t|_n,zt|_Wnt k r|g_YnXd_ dS)Ncss|]}t|tVqdSr)rr)rrrrrr sz+ParseExpression.__init__..c3s&|]}t|tr|n|VqdSr)rrrrrrrrr sF)rQr3rrr r rrexprsr7r rvrrrrrrTrrrs"      zParseExpression.__init__cCs|j|d|_|Sr)rrrrSrrrrs zParseExpression.appendcCs0d|_dd|jD|_|jD] }|q|S)zExtends ``leaveWhitespace`` defined in base class, and also invokes ``leaveWhitespace`` on all contained expressions.FcSsg|] }|qSrrHrrrrrsz3ParseExpression.leaveWhitespace..)rrrC)rrrrrrCs   zParseExpression.leaveWhitespacecsrt|trB||jkrntt|||jD]}||jdq*n,tt|||jD]}||jdqX|Sr.)rr>rrQr3rFr)rrJrrTrrrF#s    zParseExpression.ignorecsNztt|WStk r$YnX|jdkrHd|jjt|jf|_|jSNz%s:(%s)) rQr3rrrrrrrrrTrrr/s zParseExpression.__str__cs*tt||jD] }|qt|jdkr|jd}t||jr|js|jdkr|j s|jdd|jdg|_d|_ |j |j O_ |j |j O_ |jd}t||jr|js|jdkr|j s|jdd|jdd|_d|_ |j |j O_ |j |j O_ dt ||_|S)Nrrrrr)rQr3rrrrrrrrrrrrr)rrrJrTrrr9s<     zParseExpression.streamlineNcCsB|dk r |ngdd|g}|jD]}||q$|gdSr)rrKrI)rrJtmprrrrrK[s  zParseExpression.validatecs$tt|}dd|jD|_|S)NcSsg|] }|qSrrHrrrrrcsz(ParseExpression.copy..)rQr3rIrrcrTrrrIaszParseExpression.copycsVtjrD|jD]6}t|tr |jr tjdd|t |j |jddq t t | ||S)N]{0}: setting results name {1!r} on {2} expression collides with {3!r} on contained expression)warn_ungrouped_named_tokens_in_collectionrr$)rrrrr7rr(r)rrrrQr3rrrrrrTrrrfs zParseExpression._setResultsName)F)N)F)rrrrrrrCrFrrrKrIrrirrrTrr3s "  cs`eZdZdZGdddeZdfdd ZfddZdd d Zd d Z d dZ ddZ Z S)ra Requires all given :class:`ParseExpression` s to be found in the given order. Expressions may be separated by whitespace. May be constructed using the ``'+'`` operator. May also be constructed using the ``'-'`` operator, which will suppress backtracking. Example:: integer = Word(nums) name_expr = OneOrMore(Word(alphas)) expr = And([integer("id"), name_expr("name"), integer("age")]) # more easily written as: expr = integer("id") + name_expr("name") + integer("age") cseZdZfddZZS)zAnd._ErrorStopcs&ttj|j||d|_|dS)N-)rQrr,rrrCryrTrrrszAnd._ErrorStop.__init__rrrrTrr,sr,Tcs|rt|krg}t|D]`\}}|tkrn|t|dkrdt||djd}|t|dqxtdq||q||dd<tt | ||t dd|jD|_ | |jdj|jdj|_d|_dS) Nrrr+z0cannot construct And with sequence ending in ...css|] }|jVqdSrrrrrrrszAnd.__init__..rT)r&rrrrrr;rrQrrrrrDrrr)rrrrrrZ skipto_argrTrrrs    z And.__init__cs|jrtdd|jddDrt|jddD]^\}}|dkrFq4t|tr4|jr4t|jdtr4|jd|j|d|jd<d|j|d<q4dd|jD|_tt|t dd|jD|_ |S)Ncss.|]&}t|to$|jo$t|jdtVqdSrN)rr3rr'rrrrrsz!And.streamline..rrcSsg|]}|dk r|qSrrrrrrrsz"And.streamline..css|] }|jVqdSrrrrrrrs) rrvrrr3r'rQrrrr)rrrrTrrrs$  zAnd.streamlinec Cs|jdj|||dd\}}d}|jddD]}t|tjrDd}q.|rz||||\}}Wqtk rtYqtk r}zd|_t|W5d}~XYqt k rt|t ||j |YqXn||||\}}|s| r.||7}q.||fS)NrFrrT) rrrrr,r6r0rrrrrr;) rrrr resultlistZ errorStoprZ exprtokensrrrrrs(   z And.parseImplcCst|tr||}||SrrrrrrSrrrrDs  z And.__iadd__cCs6|dd|g}|jD]}|||jsq2qdSr)rrIrrrsubRecCheckListrrrrrIs   zAnd.checkRecursioncCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nr{rcss|]}t|VqdSrrrrrrrszAnd.__str__..}r1rrrrrrrrrs    z And.__str__)T)T) rrrrrr,rrrrDrIrrirrrTrrts  cs^eZdZdZdfdd ZfddZddd Zd d Zd d ZddZ dfdd Z Z S)r/aRequires that at least one :class:`ParseExpression` is found. If two expressions match, the expression that matches the longest string will be used. May be constructed using the ``'^'`` operator. Example:: # construct Or using '^' operator number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) prints:: [['123'], ['3.1416'], ['789']] Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|] }|jVqdSrrrrrrrszOr.__init__..T)rQr/rrrvrrrTrrrsz Or.__init__cs.tt|tjr*tdd|jD|_|S)Ncss|] }|jVqdSrrrrrrrsz Or.streamline..)rQr/rrcollect_all_And_tokensrvrrrrTrrrsz Or.streamlineTc Csd}d}g}|jD]}z|||}Wnvtk rb} zd| _| j|krR| }| j}W5d} ~ XYqtk rt||krt|t||j|}t|}YqX|||fq|r|j t ddd|s|dd} | |||Sd} |D]\} } | | dkr | Sz| |||\}}Wn@tk r`} z d| _| j|krP| }| j}W5d} ~ XYqX|| krx||fS|| dkr||f} q| dkr| S|dk r|j|_ |nt||d|dS)NrrT)r@r rr no defined alternatives to match) rrr2rrrrrrsortrrr)rrrr maxExcLoc maxExceptionrrZloc2rZ best_exprZlongestZloc1Zexpr1rrrrrsT            z Or.parseImplcCst|tr||}||SrrrSrrr__ixor__;s  z Or.__ixor__cCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz ^ css|]}t|VqdSrrrrrrrEszOr.__str__..rrrrrrr@s    z Or.__str__cCs,|dd|g}|jD]}||qdSrrrIrrrrrIIs zOr.checkRecursioncsPtjs>tjr>tdd|jDr>tjdd|t |j ddt t | ||S)Ncss|]}t|tVqdSrrrrrrrrQsz%Or._setResultsName..{0}: setting results name {1!r} on {2} expression may only return a single token for an And alternative, in future will return the full list of tokens)warn_multiple_tokens_in_named_alternationrr$)rrrrrvrr(r)rrrrQr/rrrTrrrNszOr._setResultsName)F)T)F) rrrrrrrrrrIrrirrrTrr/s  = cs^eZdZdZdfdd ZfddZddd Zd d Zd d ZddZ dfdd Z Z S)r)aRequires that at least one :class:`ParseExpression` is found. If two expressions match, the first one listed is the one that will match. May be constructed using the ``'|'`` operator. Example:: # construct MatchFirst using '|' operator # watch the order of expressions to match number = Word(nums) | Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) # Fail! -> [['123'], ['3'], ['1416'], ['789']] # put more selective expression first number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums) print(number.searchString("123 3.1416 789")) # Better -> [['123'], ['3.1416'], ['789']] Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|] }|jVqdSrrrrrrrosz&MatchFirst.__init__..T)rQr)rrrvrrrTrrrlszMatchFirst.__init__cs.tt|tjr*tdd|jD|_|S)Ncss|] }|jVqdSrrrrrrrvsz(MatchFirst.streamline..)rQr)rrrrvrrrrTrrrsszMatchFirst.streamlineTc Csd}d}|jD]}z||||}|WStk r`}z|j|krP|}|j}W5d}~XYqtk rt||krt|t||j|}t|}YqXq|dk r|j|_|nt||d|dS)Nrr)rrr2rrrrr) rrrrrrrrrrrrrys$    zMatchFirst.parseImplcCst|tr||}||SrrrSrrr__ior__s  zMatchFirst.__ior__cCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrr | css|]}t|VqdSrrrrrrrsz%MatchFirst.__str__..rrrrrrrs    zMatchFirst.__str__cCs,|dd|g}|jD]}||qdSrrrrrrrIs zMatchFirst.checkRecursioncsPtjs>tjr>tdd|jDr>tjdd|t |j ddt t | ||S)Ncss|]}t|tVqdSrrrrrrrsz-MatchFirst._setResultsName..rrrr$)rrrrrvrr(r)rrrrQr)rrrTrrrszMatchFirst._setResultsName)F)T)F) rrrrrrrrrrIrrirrrTrr)[s   csHeZdZdZd fdd ZfddZdddZd d Zd d ZZ S)rasRequires all given :class:`ParseExpression` s to be found, but in any order. Expressions may be separated by whitespace. May be constructed using the ``'&'`` operator. Example:: color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN") shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON") integer = Word(nums) shape_attr = "shape:" + shape_type("shape") posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn") color_attr = "color:" + color("color") size_attr = "size:" + integer("size") # use Each (using operator '&') to accept attributes in any order # (shape and posn are required, color and size are optional) shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr) shape_spec.runTests(''' shape: SQUARE color: BLACK posn: 100, 120 shape: CIRCLE size: 50 color: BLUE posn: 50,80 color:GREEN size:20 shape:TRIANGLE posn:20,40 ''' ) prints:: shape: SQUARE color: BLACK posn: 100, 120 ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']] - color: BLACK - posn: ['100', ',', '120'] - x: 100 - y: 120 - shape: SQUARE shape: CIRCLE size: 50 color: BLUE posn: 50,80 ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']] - color: BLUE - posn: ['50', ',', '80'] - x: 50 - y: 80 - shape: CIRCLE - size: 50 color: GREEN size: 20 shape: TRIANGLE posn: 20,40 ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']] - color: GREEN - posn: ['20', ',', '40'] - x: 20 - y: 40 - shape: TRIANGLE - size: 20 Tcs>tt|||tdd|jD|_d|_d|_d|_dS)Ncss|] }|jVqdSrrrrrrrsz Each.__init__..T) rQrrrrrrinitExprGroupsrrrTrrrs z Each.__init__cs(tt|tdd|jD|_|S)Ncss|] }|jVqdSrrrrrrrsz"Each.streamline..)rQrrrrrrrTrrrszEach.streamlinec s|jrtdd|jD|_dd|jD}dd|jD}|||_dd|jD|_dd|jD|_dd|jD|_|j|j7_d |_|}|jdd}|jddg}d } | rj||j|j} g} | D]v} z| ||}Wn t k r| | YqX| |j t | | | |kr@| | q| kr܈ | qt| t| krd } q|rd d d|D} t ||d | |fdd|jD7}g}|D]"} | |||\}}| |qt|tg}||fS)Ncss&|]}t|trt|j|fVqdSr)rr.rVrrrrrrs z!Each.parseImpl..cSsg|]}t|tr|jqSrrr.rrrrrrs z"Each.parseImpl..cSs g|]}|jrt|ts|qSr)rrr.rrrrrs cSsg|]}t|tr|jqSr)rrErrrrrrs cSsg|]}t|tr|jqSr)rr,rrrrrrs cSs g|]}t|tttfs|qSr)rr.rEr,rrrrrsFTrVcss|]}t|VqdSrrrrrrrsz*Missing one or more required elements (%s)cs$g|]}t|tr|jkr|qSrrrZtmpOptrrrs )rrrZopt1mapZ optionalsZmultioptionalsZ multirequiredZrequiredrr2rrrVremoverrrsumr5)rrrrZopt1Zopt2ZtmpLocZtmpReqdZ matchOrderZ keepMatchingZtmpExprsZfailedrZmissingrrZ finalResultsrrrrsP    zEach.parseImplcCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz & css|]}t|VqdSrrrrrrr,szEach.__str__..rrrrrrr's    z Each.__str__cCs,|dd|g}|jD]}||qdSrrrrrrrI0s zEach.checkRecursion)T)T) rrrrrrrrrIrirrrTrrs 8  1 csjeZdZdZdfdd ZdddZdd Zfd d Zfd d ZddZ dddZ fddZ Z S)r1zfAbstract subclass of :class:`ParserElement`, for combining and post-processing parsed tokens. Fcstt||t|tr@t|jtr2||}n|t|}||_ d|_ |dk r|j |_ |j |_ | |j|j|_|j|_|j|_|j|jdSr)rQr1rrr issubclassrr?r'rrrrrDrrrrrrErrrrTrrr:s    zParseElementEnhance.__init__TcCs2|jdk r|jj|||ddStd||j|dS)NFrr)rrr2rrrrrrLs zParseElementEnhance.parseImplcCs*d|_|j|_|jdk r&|j|Sr~)rrrIrCrrrrrCRs    z#ParseElementEnhance.leaveWhitespacecsrt|trB||jkrntt|||jdk rn|j|jdn,tt|||jdk rn|j|jd|Sr.)rr>rrQr1rFrrSrTrrrFYs    zParseElementEnhance.ignorecs&tt||jdk r"|j|Sr)rQr1rrrrTrrres  zParseElementEnhance.streamlinecCsB||krt||g|dd|g}|jdk r>|j|dSr)r9rrI)rrrrrrrIks  z"ParseElementEnhance.checkRecursionNcCsB|dkr g}|dd|g}|jdk r4|j||gdSrrrKrIrrJrrrrrKrs   zParseElementEnhance.validatecsXztt|WStk r$YnX|jdkrR|jdk rRd|jjt|jf|_|jSr) rQr1rrrrrrrrrTrrrzszParseElementEnhance.__str__)F)T)N) rrrrrrrCrFrrIrKrrirrrTrr16s   cs*eZdZdZfddZdddZZS)r abLookahead matching of the given parse expression. ``FollowedBy`` does *not* advance the parsing position within the input string, it only verifies that the specified parse expression matches at the current position. ``FollowedBy`` always returns a null token list. If any results names are defined in the lookahead expression, those *will* be returned for access by name. Example:: # use FollowedBy to match a label only if it is followed by a ':' data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint() prints:: [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']] cstt||d|_dSr)rQr rrrrrTrrrszFollowedBy.__init__TcCs(|jj|||d\}}|dd=||fS)Nr)rr)rrrr_rrrrrs zFollowedBy.parseImpl)TrqrrrTrr s cs,eZdZdZd fdd Zd ddZZS) r(apLookbehind matching of the given parse expression. ``PrecededBy`` does not advance the parsing position within the input string, it only verifies that the specified parse expression matches prior to the current position. ``PrecededBy`` always returns a null token list, but if a results name is defined on the given expression, it is returned. Parameters: - expr - expression that must match prior to the current parse location - retreat - (default= ``None``) - (int) maximum number of characters to lookbehind prior to the current parse location If the lookbehind expression is a string, Literal, Keyword, or a Word or CharsNotIn with a specified exact or maximum length, then the retreat parameter is not required. Otherwise, retreat must be specified to give a maximum number of characters to look back from the current parse position for a lookbehind match. Example:: # VB-style variable names with type prefixes int_var = PrecededBy("#") + pyparsing_common.identifier str_var = PrecededBy("$") + pyparsing_common.identifier Ncstt||||_d|_d|_d|_t|t rJt |}d|_nVt|t t frf|j }d|_n:t|ttfr|jtkr|j}d|_nt|trd}d|_||_dt ||_d|_dS)NTFrznot preceded by )rQr(rrrCrrrrrrr'r$rtrBrrrhrretreatrr)rrrrTrrrs(  zPrecededBy.__init__rTc Cs|jr<||jkrt|||j||j}|j||\}}n|jt}|d|}t|||j} tdt||jdD]H} z|||| \}}Wn&t k r} z| } W5d} ~ XYqxXqqx| |dd=||fSr) rrr2rrrr<rrr0) rrrrrrrZ test_exprZinstring_sliceZ last_exprrMZpberrrrs"     zPrecededBy.parseImpl)N)rTrqrrrTrr(scs2eZdZdZfddZd ddZddZZS) r+aLookahead to disallow matching with the given parse expression. ``NotAny`` does *not* advance the parsing position within the input string, it only verifies that the specified parse expression does *not* match at the current position. Also, ``NotAny`` does *not* skip over leading whitespace. ``NotAny`` always returns a null token list. May be constructed using the '~' operator. Example:: AND, OR, NOT = map(CaselessKeyword, "AND OR NOT".split()) # take care not to mistake keywords for identifiers ident = ~(AND | OR | NOT) + Word(alphas) boolean_term = Optional(NOT) + ident # very crude boolean expression - to support parenthesis groups and # operation hierarchy, use infixNotation boolean_expr = boolean_term + ZeroOrMore((AND | OR) + boolean_term) # integers that are followed by "." are actually floats integer = Word(nums) + ~Char(".") cs0tt||d|_d|_dt|j|_dS)NFTzFound unwanted token, )rQr+rrrrrrrrTrrr szNotAny.__init__TcCs&|j||rt|||j||gfSr)rrr2rrrrrrszNotAny.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrz~{rr1rrrrrrrrrs   zNotAny.__str__)TrrrrTrr+s  cs>eZdZd fdd ZddZd ddZdfd d ZZS)_MultipleMatchNcs<tt||d|_|}t|tr.||}||dSr)rQrrrrrrstopOn)rrrenderrTrrr s   z_MultipleMatch.__init__cCs,t|tr||}|dk r"|nd|_|Sr)rrr not_ender)rrrrrr(s  z_MultipleMatch.stopOnTc Cs|jj}|j}|jdk }|r$|jj}|r2|||||||dd\}}zV|j } |r`|||| rp|||} n|} ||| |\}} | s| rR|| 7}qRWnttfk rYnX||fSNFr) rrrr rrr;r2r) rrrrZself_expr_parseZself_skip_ignorablesZ check_enderZ try_not_enderrZhasIgnoreExprsrZ tmptokensrrrr.s*      z_MultipleMatch.parseImplFcsftjrT|jgt|jdgD]6}t|tr|jrtjd d|t |j |jddqt t |||S)Nrrrrr$)rrrrrr7rr(r)rrrrQrrrrTrrrKsz_MultipleMatch._setResultsName)N)T)F)rrrrrrrrirrrTrrs rc@seZdZdZddZdS)r,ajRepetition of one or more of the given expression. Parameters: - expr - expression that must match one or more times - stopOn - (default= ``None``) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: BLACK" OneOrMore(attr_expr).parseString(text).pprint() # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']] # use stopOn attribute for OneOrMore to avoid reading label string as part of the data attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']] # could also be written as (attr_expr * (1,)).parseString(text).pprint() cCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrz}...rrrrrrss   zOneOrMore.__str__N)rrrrrrrrrr,Yscs8eZdZdZd fdd Zd fdd Zdd ZZS) rEakOptional repetition of zero or more of the given expression. Parameters: - expr - expression that must match zero or more times - stopOn - (default= ``None``) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example: similar to :class:`OneOrMore` Ncstt|j||dd|_dS)N)rT)rQrErr)rrrrTrrrszZeroOrMore.__init__Tc s<ztt||||WSttfk r6|gfYSXdSr)rQrErr2rrrTrrrszZeroOrMore.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)NrrU]...rrrrrrs   zZeroOrMore.__str__)N)TrrrrTrrE|s c@s eZdZddZeZddZdS) _NullTokencCsdSr~rrrrrr*sz_NullToken.__bool__cCsdSrrrrrrrsz_NullToken.__str__N)rrrr*rrrrrrr sr cs<eZdZdZeZeffdd Zd ddZddZZ S) r.aGOptional matching of the given expression. Parameters: - expr - expression that must match zero or more times - default (optional) - value to be returned if the optional expression is not found. Example:: # US postal code can be a 5-digit zip, plus optional 4-digit qualifier zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4))) zip.runTests(''' # traditional ZIP code 12345 # ZIP+4 form 12101-0001 # invalid ZIP 98765- ''') prints:: # traditional ZIP code 12345 ['12345'] # ZIP+4 form 12101-0001 ['12101-0001'] # invalid ZIP 98765- ^ FAIL: Expected end of text (at char 5), (line:1, col:6) cs.tt|j|dd|jj|_||_d|_dS)NFroT)rQr.rrrrAr)rrr<rTrrrs zOptional.__init__Tc Cs|z|jj|||dd\}}WnVttfk rr|j|jk rj|jjr`t|jg}|j||jj<qn|jg}ng}YnX||fSr )rrr2rrA_Optional__optionalNotMatchedrr5)rrrrrrrrrs    zOptional.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)NrrUrXrrrrrrs   zOptional.__str__)T) rrrrr r rrrrirrrTrr.s $ cs,eZdZdZd fdd Zd ddZZS) r;a Token for skipping over all undefined text until the matched expression is found. Parameters: - expr - target expression marking the end of the data to be skipped - include - (default= ``False``) if True, the target expression is also parsed (the skipped text and target expression are returned as a 2-element list). - ignore - (default= ``None``) used to define grammars (typically quoted strings and comments) that might contain false matches to the target expression - failOn - (default= ``None``) define expressions that are not allowed to be included in the skipped test; if found before the target expression is found, the SkipTo is not a match Example:: report = ''' Outstanding Issues Report - 1 Jan 2000 # | Severity | Description | Days Open -----+----------+-------------------------------------------+----------- 101 | Critical | Intermittent system crash | 6 94 | Cosmetic | Spelling error on Login ('log|n') | 14 79 | Minor | System slow when running too many reports | 47 ''' integer = Word(nums) SEP = Suppress('|') # use SkipTo to simply match everything up until the next SEP # - ignore quoted strings, so that a '|' character inside a quoted string does not match # - parse action will call token.strip() for each matched token, i.e., the description body string_data = SkipTo(SEP, ignore=quotedString) string_data.setParseAction(tokenMap(str.strip)) ticket_expr = (integer("issue_num") + SEP + string_data("sev") + SEP + string_data("desc") + SEP + integer("days_open")) for tkt in ticket_expr.searchString(report): print tkt.dump() prints:: ['101', 'Critical', 'Intermittent system crash', '6'] - days_open: 6 - desc: Intermittent system crash - issue_num: 101 - sev: Critical ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14'] - days_open: 14 - desc: Spelling error on Login ('log|n') - issue_num: 94 - sev: Cosmetic ['79', 'Minor', 'System slow when running too many reports', '47'] - days_open: 47 - desc: System slow when running too many reports - issue_num: 79 - sev: Minor FNcs`tt||||_d|_d|_||_d|_t|t rF| ||_ n||_ dt |j |_dS)NTFzNo match found for )rQr;r ignoreExprrr includeMatchrrrrfailOnrrr)rrJZincluderFrrTrrr s zSkipTo.__init__Tc Cs&|}t|}|j}|jj}|jdk r,|jjnd}|jdk rB|jjnd} |} | |kr|dk rf||| rfq| dk rz| || } Wqntk rYqYqnXqnz||| dddWqtt fk r| d7} YqJXqqJt|||j || }|||} t | } |j r||||dd\}} | | 7} || fS)NF)rrrr) rrrrrrrr0r2rrr5r)rrrrrrrZ expr_parseZself_failOn_canParseNextZself_ignoreExpr_tryParseZtmplocZskiptextZ skipresultrrrrr-s:   zSkipTo.parseImpl)FNN)TrqrrrTrr;s9 csneZdZdZdfdd ZddZddZd d Zd d Zdd dZ ddZ fddZ dfdd Z Z S)r!a_Forward declaration of an expression to be defined later - used for recursive grammars, such as algebraic infix notation. When the expression is known, it is assigned to the ``Forward`` variable using the '<<' operator. Note: take care when assigning to ``Forward`` not to overlook precedence of operators. Specifically, '|' has a lower precedence than '<<', so that:: fwdExpr << a | b | c will actually be evaluated as:: (fwdExpr << a) | b | c thereby leaving b and c out as parseable alternatives. It is recommended that you explicitly group the values inserted into the ``Forward``:: fwdExpr << (a | b | c) Converting to use the '<<=' operator instead will avoid this problem. See :class:`ParseResults.pprint` for an example of a recursive parser created using ``Forward``. Ncstt|j|dddSrn)rQr!rrSrTrrrwszForward.__init__cCsjt|tr||}||_d|_|jj|_|jj|_||jj|jj |_ |jj |_ |j |jj |Sr) rrrrrrrrDrrrrrErSrrr __lshift__zs      zForward.__lshift__cCs||>SrrrSrrr __ilshift__szForward.__ilshift__cCs d|_|Sr~rBrrrrrCszForward.leaveWhitespacecCs$|js d|_|jdk r |j|Sr)rrrrrrrrs   zForward.streamlinecCsJ|dkr g}||kr<|dd|g}|jdk r<|j||gdSrrrrrrrKs  zForward.validatecCslt|dr|jS|jdk r |jSd|_d}z&|jdk rJt|jdd}nd}W5|jjd||_X|jS)Nrz: ...rjz: iNone)r1rrrrrr)rZ retStringrrrrs   zForward.__str__cs.|jdk rtt|St}||K}|SdSr)rrQr!rIrcrTrrrIs  z Forward.copyFcs@tjr.|jdkr.tjdd|t|jddtt | ||S)NzR{0}: setting results name {0!r} on {1} expression that has no contained expressionwarn_name_set_on_empty_Forwardrr$) rrrr(r)rrrrQr!rrrTrrrs zForward._setResultsName)N)N)F)rrrrrrrrCrrKrrIrrirrrTrr!\s   cs"eZdZdZdfdd ZZS)r@zW Abstract subclass of :class:`ParseExpression`, for converting parsed results. Fcstt||d|_dSr~)rQr@rrrrTrrrszTokenConverter.__init__)FrprrrTrr@scs6eZdZdZd fdd ZfddZdd ZZS) raConverter to concatenate all matching tokens to a single string. By default, the matching patterns must also be contiguous in the input string; this can be disabled by specifying ``'adjacent=False'`` in the constructor. Example:: real = Word(nums) + '.' + Word(nums) print(real.parseString('3.1416')) # -> ['3', '.', '1416'] # will also erroneously match the following print(real.parseString('3. 1416')) # -> ['3', '.', '1416'] real = Combine(Word(nums) + '.' + Word(nums)) print(real.parseString('3.1416')) # -> ['3.1416'] # no match when there are internal spaces print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...) rTcs8tt|||r|||_d|_||_d|_dSr)rQrrrCadjacentr joinStringr)rrrrrTrrrszCombine.__init__cs(|jrt||ntt|||Sr)rr7rFrQrrSrTrrrFszCombine.ignorecCsP|}|dd=|td||jg|jd7}|jrH|rH|gS|SdS)Nr)r)rIr5rrYrrrr;)rrrrZretToksrrrrs  "zCombine.postParse)rT)rrrrrrFrrirrrTrrs cs(eZdZdZfddZddZZS)r#aConverter to return the matched tokens as a list - useful for returning tokens of :class:`ZeroOrMore` and :class:`OneOrMore` expressions. Example:: ident = Word(alphas) num = Word(nums) term = ident | num func = ident + Optional(delimitedList(term)) print(func.parseString("fn a, b, 100")) # -> ['fn', 'a', 'b', '100'] func = ident + Group(Optional(delimitedList(term))) print(func.parseString("fn a, b, 100")) # -> ['fn', ['a', 'b', '100']] cstt||d|_dSr)rQr#rrrrTrrr szGroup.__init__cCs|gSrrrrrrrszGroup.postParserrrrrrrirrrTrr#s cs(eZdZdZfddZddZZS)ra?Converter to return a repetitive expression as a list, but also as a dictionary. Each element can also be referenced using the first token in the expression as its key. Useful for tabular report scraping when the first column can be used as a item key. Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) # print attributes as plain groups print(OneOrMore(attr_expr).parseString(text).dump()) # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names result = Dict(OneOrMore(Group(attr_expr))).parseString(text) print(result.dump()) # access named fields as dict entries, or output as dict print(result['shape']) print(result.asDict()) prints:: ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'} See more examples at :class:`ParseResults` of accessing fields by results name. cstt||d|_dSr)rQrrrrrTrrr8sz Dict.__init__cCst|D]\}}t|dkrq|d}t|tr@t|d}t|dkr\td|||<qt|dkrt|dtst|d|||<q|}|d=t|dkst|tr| rt||||<qt|d|||<q|j r|gS|SdS)Nrrrr) rrrrrrrr5rIr;r)rrrrrtokZikeyZ dictvaluerrrr<s$   zDict.postParserrrrTrrs& c@s eZdZdZddZddZdS)r>a[Converter for ignoring the results of a parsed expression. Example:: source = "a, b, c,d" wd = Word(alphas) wd_list1 = wd + ZeroOrMore(',' + wd) print(wd_list1.parseString(source)) # often, delimiters that are useful during parsing are just in the # way afterward - use Suppress to keep them out of the parsed output wd_list2 = wd + ZeroOrMore(Suppress(',') + wd) print(wd_list2.parseString(source)) prints:: ['a', ',', 'b', ',', 'c', ',', 'd'] ['a', 'b', 'c', 'd'] (See also :class:`delimitedList`.) cCsgSrrrrrrrkszSuppress.postParsecCs|SrrrrrrrAnszSuppress.suppressN)rrrrrrArrrrr>Usc@s(eZdZdZddZddZddZdS) r-zDWrapper for parse actions, to ensure they are only called once. cCst||_d|_dSr~)rrcalled)rZ methodCallrrrrus zOnlyOnce.__init__cCs.|js||||}d|_|St||ddS)NTr)rrr2)rrrrrrrrr@xs zOnlyOnce.__call__cCs d|_dSr~)rrrrrreset~szOnlyOnce.resetN)rrrrrr@rrrrrr-rscs:tfdd}z j|_Wntk r4YnX|S)aqDecorator for debugging parse actions. When the parse action is called, this decorator will print ``">> entering method-name(line:, , )"``. When the parse action completes, the decorator will print ``"<<"`` followed by the returned value, or any exception that the parse action raised. Example:: wd = Word(alphas) @traceParseAction def remove_duplicate_chars(tokens): return ''.join(sorted(set(''.join(tokens)))) wds = OneOrMore(wd).setParseAction(remove_duplicate_chars) print(wds.parseString("slkdjs sld sldd sdlf sdljf")) prints:: >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {})) <>entering %s(line: '%s', %d, %r) z<.z)rrr)rOrrrrrvs  ,cCs`t|dt|dt|d}|rBt|t|||S|tt|||SdS)aHelper to define a delimited list of expressions - the delimiter defaults to ','. By default, the list elements and delimiters can have intervening whitespace, and comments, but this can be overridden by passing ``combine=True`` in the constructor. If ``combine`` is set to ``True``, the matching tokens are returned as a single token string, with the delimiters included; otherwise, the matching tokens are returned as a list of tokens, with the delimiters suppressed. Example:: delimitedList(Word(alphas)).parseString("aa,bb,cc") # -> ['aa', 'bb', 'cc'] delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE'] z [rr N)rrrErr>)rZdelimcombineZdlNamerrrrTs$csjtfdd}|dkr0ttdd}n|}|d|j|dd|d td S) a>Helper to define a counted list of expressions. This helper defines a pattern of the form:: integer expr expr expr... where the leading integer tells how many expr expressions follow. The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed. If ``intExpr`` is specified, it should be a pyparsing expression that produces an integer value. Example:: countedArray(Word(alphas)).parseString('2 ab cd ef') # -> ['ab', 'cd'] # in this parser, the leading integer value is given in binary, # '10' indicating that 2 values are in the array binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2)) countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef') # -> ['ab', 'cd'] cs.|d}|r ttg|p&tt>gSr)r#rrW)rrrr1Z arrayExprrrrcountFieldParseActions"z+countedArray..countFieldParseActionNcSs t|dSr)rrrrrrrzcountedArray..ZarrayLenTrz(len) rj)r!rBrfrrIrrr)rZintExprr"rr!rrPs cCs6g}|D](}t|tr&|t|q||q|Sr)rr rEr r)Lrrrrrr s   r cs6tfdd}|j|dddt|S)a4Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousLiteral(first) matchExpr = first + ":" + second will match ``"1:1"``, but not ``"1:2"``. Because this matches a previous literal, will also match the leading ``"1:1"`` in ``"1:10"``. If this is not desired, use :class:`matchPreviousExpr`. Do *not* use with packrat parsing enabled. csP|rBt|dkr|d>qLt|}tdd|D>n t>dS)Nrrcss|]}t|VqdSr)r'rZttrrrr szDmatchPreviousLiteral..copyTokenToRepeater..)rr rrr)rrrZtflatZreprrcopyTokenToRepeaters   z1matchPreviousLiteral..copyTokenToRepeaterTr#(prev) )r!rrr)rr'rr&rrcs  csFt|}|Kfdd}|j|dddt|S)aTHelper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousExpr(first) matchExpr = first + ":" + second will match ``"1:1"``, but not ``"1:2"``. Because this matches by expressions, will *not* match the leading ``"1:1"`` in ``"1:10"``; the expressions are evaluated first, and then compared, so ``"1"`` is compared with ``"10"``. Do *not* use with packrat parsing enabled. cs*t|fdd}j|dddS)Ncs$t|}|kr tddddS)Nrr)r rr2)rrrZ theseTokensZ matchTokensrrmustMatchTheseTokens%s zLmatchPreviousExpr..copyTokenToRepeater..mustMatchTheseTokensTr#)r rr)rrrr*r&r)rr'#s  z.matchPreviousExpr..copyTokenToRepeaterTr#r()r!rIrrr)rZe2r'rr&rrbs cCs:dD]}||t|}q|dd}|dd}t|S)Nz\^-]rr\rr)r_bslashr)rrrrrr.s   rc st|trtjddd|r:dd}dd}|r4tntndd}dd}|rRtntg}t|trn|}n$t|t rt |}ntjd t dd|st S|s.d }|t |d kr.||}t||d d D]N\} } || |r||| d =qq||| r||| d =||| qq|d 7}q|s|s|rzlt |t d |krtdd dd|Dd|WStddd|Dd|WSWn&tk rtjdt ddYnXtfdd|Dd|S)aHelper to quickly define a set of alternative Literals, and makes sure to do longest-first testing when there is a conflict, regardless of the input order, but returns a :class:`MatchFirst` for best performance. Parameters: - strs - a string of space-delimited literals, or a collection of string literals - caseless - (default= ``False``) - treat all literals as caseless - useRegex - (default= ``True``) - as an optimization, will generate a Regex object; otherwise, will generate a :class:`MatchFirst` object (if ``caseless=True`` or ``asKeyword=True``, or if creating a :class:`Regex` raises an exception) - asKeyword - (default=``False``) - enforce Keyword-style matching on the generated expressions Example:: comp_oper = oneOf("< = > <= >= !=") var = Word(alphas) number = Word(nums) term = var | number comparison_expr = term + comp_oper + term print(comparison_expr.searchString("B = 12 AA=23 B<=AA AA>12")) prints:: [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']] z_More than one string argument passed to oneOf, pass choices as a list or space-delimited stringrr$cSs||kSr)r~rLbrrrr[rzoneOf..cSs||Sr)r~ryr,rrrr\rcSs||kSrrr,rrrr_rcSs ||Sr)ryr,rrrr`rz6Invalid argument to oneOf, expected string or iterablerrNrrcss|]}t|VqdSr)rrZsymrrrrszoneOf..r|css|]}t|VqdSr)rrr.rrrrsz7Exception creating Regex for oneOf, building MatchFirstc3s|]}|VqdSrrr.ZparseElementClassrrrs)rrr(r)rrr$r'rr r r*r*rrrBrr:rrr)) Zstrsr}ZuseRegexrZisequalZmasksZsymbolsrZcurr#rJrr0rrg6s\          ** cCsttt||S)aHelper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the :class:`Dict`, :class:`ZeroOrMore`, and :class:`Group` tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are suppressed, thereby leaving the significant key text. The value pattern can include named results, so that the :class:`Dict` results can include named token fields. Example:: text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) print(OneOrMore(attr_expr).parseString(text).dump()) attr_label = label attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join) # similar to Dict, but simpler call format result = dictOf(attr_label, attr_value).parseString(text) print(result.dump()) print(result['shape']) print(result.shape) # object attribute access works too print(result.asDict()) prints:: [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE SQUARE {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'} )rr,r#)r@r$rrrrUs%cCs^tdd}|}d|_|d||d}|r@dd}ndd}|||j|_|S) aHelper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. By default, returns astring containing the original parsed text. If the optional ``asString`` argument is passed as ``False``, then the return value is a :class:`ParseResults` containing any results names that were originally matched, and a single token containing the original matched text from the input string. So if the expression passed to :class:`originalTextFor` contains expressions with defined results names, you must set ``asString`` to ``False`` if you want to preserve those results name values. Example:: src = "this is test bold text normal text " for tag in ("b", "i"): opener, closer = makeHTMLTags(tag) patt = originalTextFor(opener + SkipTo(closer) + closer) print(patt.searchString(src)[0]) prints:: [' bold text '] ['text'] cSs|Srr)rrrrrrrrz!originalTextFor..F_original_start _original_endcSs||j|jSr)r1r2rrrrrrcSs&||d|dg|dd<dS)Nr1r2)r?rrrr extractTextsz$originalTextFor..extractText)rrrIrr)rZasStringZ locMarkerZ endlocMarker matchExprr3rrrr{s  cCst|ddS)zkHelper to undo pyparsing's default grouping of And expressions, even if all but one are non-empty. cSs|dSrrrrrrrrzungroup..)r@r)rrrrr|scCs4tdd}t|d|d|dS)aHelper to decorate a returned token with its starting and ending locations in the input string. This helper adds the following results names: - locn_start = location where matched expression begins - locn_end = location where matched expression ends - value = the actual parsed results Be careful if the input text contains ```` characters, you may want to call :class:`ParserElement.parseWithTabs` Example:: wd = Word(alphas) for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [[0, 'ljsdf', 5]] [[8, 'lksdjjf', 15]] [[18, 'lkkjj', 23]] cSs|SrrrrrrrrzlocatedExpr..Z locn_startr$Zlocn_end)rrr#rIrC)rZlocatorrrrr~sz\[]-*.$+^?()~ rcCs |ddSrrrrrrrrrz\\0?[xX][0-9a-fA-F]+cCstt|dddS)Nrz\0xr)unichrrrarrrrr rz \\0[0-7]+cCstt|ddddS)Nrr)r6rrrrrr rz\]rrUrnegatebodyrXcsFddz"dfddt|jDWStk r@YdSXdS)aHelper to easily define string ranges for use in Word construction. Borrows syntax from regexp '[]' string range definitions:: srange("[0-9]") -> "0123456789" srange("[a-z]") -> "abcdefghijklmnopqrstuvwxyz" srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_" The input string must be enclosed in []'s, and the returned string is the expanded character set joined into a single string. The values enclosed in the []'s may be: - a single character - an escaped character with a leading backslash (such as ``\-`` or ``\]``) - an escaped hex character with a leading ``'\x'`` (``\x21``, which is a ``'!'`` character) (``\0x##`` is also supported for backwards compatibility) - an escaped octal character with a leading ``'\0'`` (``\041``, which is a ``'!'`` character) - a range of any of the above, separated by a dash (``'a-z'``, etc.) - any combination of the above (``'aeiouy'``, ``'a-zA-Z0-9_$'``, etc.) cSs<t|ts|Sdddtt|dt|ddDS)Nrcss|]}t|VqdSrr6rrrrr)sz+srange....rr)rr5rrord)prrrr)rzsrange..rc3s|]}|VqdSrr)rpartZ _expandedrrr+szsrange..N)r_reBracketExprrr9rrrr>rrss "csfdd}|S)zoHelper method for defining parse actions that require matching at a specific column in the input text. cs"t||krt||ddS)Nzmatched token not at column %dr)rZlocnrr0rr verifyCol3sz!matchOnlyAtCol..verifyColr)r1r@rr0rra/s cs fddS)aHelper method for common parse actions that simply return a literal value. Especially useful when used with :class:`transformString` (). Example:: num = Word(nums).setParseAction(lambda toks: int(toks[0])) na = oneOf("N/A NA").setParseAction(replaceWith(math.nan)) term = na | num OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234] csgSrrrZreplStrrrrErzreplaceWith..rrArrArrp8s cCs|dddS)aHelper parse action for removing quotation marks from parsed quoted strings. Example:: # by default, quotation marks are included in parsed results quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"] # use removeQuotes to strip quotation marks from parsed results quotedString.setParseAction(removeQuotes) quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"] rrrrrrrrrnGs csNfdd}ztdtdj}Wntk rBt}YnX||_|S)aLHelper to define a parse action by mapping a function to all elements of a ParseResults list. If any additional args are passed, they are forwarded to the given function as additional arguments after the token, as in ``hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))``, which will convert the parsed data to an integer using base 16. Example (compare the last to example in :class:`ParserElement.transformString`:: hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16)) hex_ints.runTests(''' 00 11 22 aa FF 0a 0d 1a ''') upperword = Word(alphas).setParseAction(tokenMap(str.upper)) OneOrMore(upperword).runTests(''' my kingdom for a horse ''') wd = Word(alphas).setParseAction(tokenMap(str.title)) OneOrMore(wd).setParseAction(' '.join).runTests(''' now is the winter of our discontent made glorious summer by this sun of york ''') prints:: 00 11 22 aa FF 0a 0d 1a [0, 17, 34, 170, 255, 10, 13, 26] my kingdom for a horse ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE'] now is the winter of our discontent made glorious summer by this sun of york ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York'] csfdd|DS)Ncsg|]}|fqSrr)rZtoknrrrrr{sz(tokenMap..pa..rrrBrrrzsztokenMap..parr)rrrr)rrrrrrBrrVs$ cCs t|Srrr~rrrrrrcCs t|Srrlowerrrrrrrrfrgcs~t|tr|t|| d}n|jtttd}|rt t }||dt t t |td|tddgdd d d |}nlt t ttd d B}||dt t t | tttd|tddgdd d d |}ttd|d dd}|d|fdd |ddddd}|_|_t||_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag namerz_-:tag=/Fr<rWcSs |ddkSNrrHrrrrrrrz_makeTags..rgrcSs |ddkSrJrrrrrrrrh)rz<%s>c s*|dddd|S)Nrr:r)rrrtitlerrIrZresnamerrrrrrrKrz)rrr$rrBrHrGrRrIrrnrrEr#r>r.rmrjrVr_LrrrrrLrrFr;Ztag_body)tagStrZxmlZ suppress_LTZ suppress_GTZ tagAttrNameZ tagAttrValueZopenTagZcloseTagrrMr _makeTagssH , rPcCs t|dS)aKHelper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = 'More info at the pyparsing wiki page' # makeHTMLTags returns pyparsing expressions for the opening and # closing tags as a 2-tuple a, a_end = makeHTMLTags("A") link_expr = a + SkipTo(a_end)("link_text") + a_end for link in link_expr.searchString(text): # attributes in the tag (like "href" shown here) are # also accessible as named results print(link.link_text, '->', link.href) prints:: pyparsing -> https://github.com/pyparsing/pyparsing/wiki FrPrOrrrr_scCs t|dS)zHelper to construct opening and closing tag expressions for XML, given a tag name. Matches tags only in the given upper/lower case. Example: similar to :class:`makeHTMLTags` TrQrRrrrr`scs8|r|ddn|ddDfdd}|S)a7Helper to create a validating parse action to be used with start tags created with :class:`makeXMLTags` or :class:`makeHTMLTags`. Use ``withAttribute`` to qualify a starting tag with a required attribute value, to avoid false matches on common tags such as ```` or ``
``. Call ``withAttribute`` with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in ``(align="right")``, or - as an explicit dict with ``**`` operator, when an attribute name is also a Python reserved word, as in ``**{"class":"Customer", "align":"right"}`` - a list of name-value tuples, as in ``(("ns1:class", "Customer"), ("ns2:align", "right"))`` For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for ``class`` (with or without a namespace), use :class:`withClass`. To verify that the attribute exists, but without specifying a value, pass ``withAttribute.ANY_VALUE`` as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 NcSsg|]\}}||fqSrrrarrrrsz!withAttribute..csZD]P\}}||kr$t||d||tjkr|||krt||d||||fqdS)Nzno matching attribute z+attribute '%s' has value '%s', must be '%s')r2ry ANY_VALUE)rrrZattrNameZ attrValueZattrsrrrs  zwithAttribute..pa)r!)rZattrDictrrrTrrys 8 cCs|r d|nd}tf||iS)aSimplified version of :class:`withAttribute` when matching on a div class - made difficult because ``class`` is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 z%s:classclass)ry)Z classname namespaceZ classattrrrrrs#(rcCsGdddt}t}||||B}t|D]n\}}|ddd\} } } } | dkr`d| nd| } | dkr| dkst| d krtd | \}}t| }| tjkrp| d kr||| t|t | }n| d kr*| dk r ||| |t|t | |}n|||t|t |}nD| dkrf||||||t|||||}ntd n| tj krT| d krt | t st | } || j |t| |}n| d kr| dk r||| |t|t | |}n|||t|t |}nD| dkrJ||||||t|||||}ntd ntd | rt | ttfr~|j| n || ||| |BK}|}q.||K}|S)al Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See :class:`ParserElement.enablePackrat` for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form ``(opExpr, numTerms, rightLeftAssoc, parseAction)``, where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants ``opAssoc.RIGHT`` and ``opAssoc.LEFT``. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted); if the parse action is passed a tuple or list of functions, this is equivalent to calling ``setParseAction(*fn)`` (:class:`ParserElement.setParseAction`) - lpar - expression for matching left-parentheses (default= ``Suppress('(')``) - rpar - expression for matching right-parentheses (default= ``Suppress(')')``) Example:: # simple example of four-function arithmetic with ints and # variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] c@seZdZdddZdS)zinfixNotation.._FBTcSs|j|||gfSr)rrrrrrrsz$infixNotation.._FB.parseImplN)Trzrrrr_FBsrXrNrrz%s termz %s%s termrz@if numterms=3, opExpr must be a tuple or list of two expressionsrz6operator must be unary (1), binary (2), or ternary (3)z2operator must indicate right or left associativity)r r!rrr5rrhLEFTr#r,RIGHTrr.rr4r r)ZbaseExprZopListZlparZrparrXrZlastExprrZoperDefZopExprZarityZrightLeftAssocrZtermNameZopExpr1ZopExpr2ZthisExprr4rrrr}Ds`H    &       &    z4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*"z string enclosed in double quotesz4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*'z string enclosed in single quotesz*quotedString using single or double quotesuzunicode string literalcCs||krtd|dkr*t|tr"t|tr"t|dkrt|dkr|dk rtt|t||tjdd dd}n$t t||tj dd}nx|dk rtt|t |t |ttjdd dd}n4ttt |t |ttjdd d d}ntd t }|dk rd|tt|t||B|Bt|K}n$|tt|t||Bt|K}|d ||f|S) a Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default= ``"("``); can also be a pyparsing expression - closer - closing character for a nested list (default= ``")"``); can also be a pyparsing expression - content - expression for items within the nested lists (default= ``None``) - ignoreExpr - expression for ignoring opening and closing delimiters (default= :class:`quotedString`) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the ``ignoreExpr`` argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an :class:`Or` or :class:`MatchFirst`. The default is :class:`quotedString`, but if no expressions are to be ignored, then pass ``None`` for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR, RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] z.opening and closing strings cannot be the sameNrr5cSs |dSrrrrrrrrznestedExpr..cSs |dSrr^rrrrr rcSs |dSrr^rrrrr'rcSs |dSrr^rrrrr,rzOopening and closing arguments must be strings if no content expression is givenznested %s%s expression)r5rrrrr,rr7rrrWrIr'r!r#r>rEr)ZopenerZcloserZcontentrrrrrrds`A      *$c sddfddfdd}fdd}fdd }ttd }tt|d }t|d }t|d } |rtt||t|t|t|| } n(tt|t|t|t|| } | fdd| t t| dS)aHelper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the current level; set to False for block of left-most statements (default= ``True``) A valid block must contain at least one ``blockStatement``. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group("(" + Optional(delimitedList(identifier)) + ")") + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group(funcDecl + func_body) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << (funcDef | assignment | identifier) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] Ncsdd<dSrrr) backup_stack indentStackrr reset_stacksz"indentedBlock..reset_stackcsN|t|krdSt||}|dkrJ|dkr>t||dt||ddS)Nrzillegal nestingznot a peer entry)rrMr2rrrZcurColr`rrcheckPeerIndents     z&indentedBlock..checkPeerIndentcs2t||}|dkr"|n t||ddS)Nrznot a subentry)rMrr2rbrcrrcheckSubIndents   z%indentedBlock..checkSubIndentcsJ|t|krdSt||}r&|ks2t||d|dkrFdS)Nznot an unindentr)rrMr2r?rbrcrr checkUnindents     z$indentedBlock..checkUnindentz INDENTrZUNINDENTcsSrr)rLr-rr)rarrrrzindentedBlock..zindented block) r,r%rDrArrrr#r.rrFr+) ZblockStatementExprr`rjrdrerfrwrgZPEERZUNDENTZsmExprr)r_r`rarrz7s2Q    z#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]z[\0xa1-\0xbf\0xd7\0xf7]z_:zany tagzgt lt amp nbsp quot aposz><& "'z &(?Pr/z);zcommon HTML entitycCs t|jS)zRHelper parser action to replace common HTML entities with their special characters)_htmlEntityMaprZentityrrrrrosz/\*(?:[^*]|\*(?!/))*z*/zC style commentzz HTML commentz.*z rest of linez//(?:\\\n|[^\n])*z // commentzC++ style commentz#.*zPython style commentr commaItemrIc@seZdZdZeeZeeZe e  d eZ e e d eedZed d eZe ede e dZed d eeeed eB d Zeeed  d eZed d eZeeBeBZed d eZe eded dZed dZ ed dZ!e!de!d dZ"ee!de!ddee!de!d dZ#e#$dd d e  d!Z%e&e"e%Be#B d" d"Z'ed# d$Z(e)d=d&d'Z*e)d>d)d*Z+ed+ d,Z,ed- d.Z-ed/ d0Z.e/e0BZ1e)d1d2Z2e&e3e4d3e5e e6d3d4ee7d5 d6Z8e9ee:;e8Bd7d8 d9Zd`, :class:`reals`, :class:`scientific notation`) - common :class:`programming identifiers` - network addresses (:class:`MAC`, :class:`IPv4`, :class:`IPv6`) - ISO8601 :class:`dates` and :class:`datetime` - :class:`UUID` - :class:`comma-separated list` Parse actions: - :class:`convertToInteger` - :class:`convertToFloat` - :class:`convertToDate` - :class:`convertToDatetime` - :class:`stripHTMLTags` - :class:`upcaseTokens` - :class:`downcaseTokens` Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] integerz hex integerrz[+-]?\d+zsigned integerrHfractioncCs|d|dS)Nrrrrrrrrrzpyparsing_common.rz"fraction or mixed integer-fractionz[+-]?(:?\d+\.\d*|\.\d+)z real numberz@[+-]?(:?\d+(:?[eE][+-]?\d+)|(:?\d+\.\d*|\.\d+)(:?[eE][+-]?\d+)?)z$real number with scientific notationz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumberr identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}z IPv4 addressz[0-9a-fA-F]{1,4} hex_integerrKzfull IPv6 address)rrz::zshort IPv6 addresscCstdd|DdkS)Ncss|]}tj|rdVqdSrd)r _ipv6_partrr%rrrrs z,pyparsing_common...r7)rrrrrrrz::ffff:zmixed IPv6 addressz IPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}z MAC address%Y-%m-%dcsfdd}|S)a Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%d"``) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] c sNzt|dWStk rH}zt||t|W5d}~XYnXdSr)rstrptimedater5r2rrrrZvefmtrrcvt_fnsz.pyparsing_common.convertToDate..cvt_fnrrwrxrrvr convertToDates zpyparsing_common.convertToDate%Y-%m-%dT%H:%M:%S.%fcsfdd}|S)aHelper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%dT%H:%M:%S.%f"``) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] c sJzt|dWStk rD}zt||t|W5d}~XYnXdSr)rrsr5r2rrurvrrrxsz2pyparsing_common.convertToDatetime..cvt_fnrryrrvrconvertToDatetimes z"pyparsing_common.convertToDatetimez7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?z ISO8601 datez(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}UUIDcCstj|dS)aParse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td, td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) Prints:: More info at the pyparsing wiki page r)r_html_stripperr)rrrrrr stripHTMLTagsszpyparsing_common.stripHTMLTagsrrrirjrrIzcomma separated listcCs t|SrrCrrrrrrcCs t|SrrDrrrrrrN)rr)r{)?rrrrrrZconvertToIntegerfloatZconvertToFloatrBrfrrrkrXror:Zsigned_integerrlrr.rAZ mixed_integerrrealZsci_realrnumberrmrHrGrnZ ipv4_addressrqZ_full_ipv6_addressZ_short_ipv6_addressrZ_mixed_ipv6_addressrZ ipv6_addressZ mac_addressrrzr|Z iso8601_dateZiso8601_datetimeuuidrKrJr~rr,r'r%rjrA _commasepitemrTrmrIZcomma_separated_listrxrVrrrrrsv""        c@seZdZddZddZdS)_lazyclasspropertycCs||_|j|_|j|_dSr)rrrrrrrr sz_lazyclassproperty.__init__csldkrt|tdr:tfddjddDr@i_|jj}|jkrb|j|<j|S)N_internc3s |]}jt|dgkVqdS)rN)rr)rZ superclassrrrrsz-_lazyclassproperty.__get__..r)rr1rv__mro__rrr)rrrattrnamerrr__get__s  z_lazyclassproperty.__get__N)rrrrrrrrrr src@sPeZdZdZgZeddZeddZeddZ edd Z ed d Z d S) ra A set of Unicode characters, for language-specific strings for ``alphas``, ``nums``, ``alphanums``, and ``printables``. A unicode_set is defined by a list of ranges in the Unicode character set, in a class attribute ``_ranges``, such as:: _ranges = [(0x0020, 0x007e), (0x00a0, 0x00ff),] A unicode set can also be defined using multiple inheritance of other unicode sets:: class CJK(Chinese, Japanese, Korean): pass cCsZg}|jD]8}|tkrqD|jD] }|t|d|ddq q ddtt|DS)NrrrcSsg|] }t|qSrr:rrrrr4sz5unicode_set._get_chars_for_ranges..)rr_rangesrErrtr)rrZccZrrrrr_get_chars_for_ranges,s   z!unicode_set._get_chars_for_rangescCsdttj|S)z+all non-whitespace characters in this ranger)rrrrrrrrrrj6szunicode_set.printablescCsdttj|S)z'all alphabetic characters in this ranger)rfilterrisalpharrrrrrH;szunicode_set.alphascCsdttj|S)z*all numeric digit characters in this ranger)rrrisdigitrrrrrrf@szunicode_set.numscCs |j|jS)z)all alphanumeric characters in this range)rHrfrrrrrGEszunicode_set.alphanumsN) rrrrrrrrrjrHrfrGrrrrrs     c@seZdZdZdejfgZGdddeZGdddeZ GdddeZ Gd d d eZ Gd d d eZ Gd ddeZ GdddeZGdddeZGddde eeZGdddeZGdddeZGdddeZGdddeZdS)rzF A namespace class for defining common language unicode_sets. c@seZdZdZddgZdS)zpyparsing_unicode.Latin1z/Unicode set for Latin-1 Unicode Character Range)r~)NrrrrrrrrrLatin1Qsrc@seZdZdZdgZdS)zpyparsing_unicode.LatinAz/Unicode set for Latin-A Unicode Character Range)iNrrrrrLatinAUsrc@seZdZdZdgZdS)zpyparsing_unicode.LatinBz/Unicode set for Latin-B Unicode Character Range)iiONrrrrrLatinBYsrc@s6eZdZdZdddddddd d d d d dddddgZdS)zpyparsing_unicode.Greekz.Unicode set for Greek Unicode Character Ranges)ipi)ii)ii)i iE)iHiM)iPiW)iY)i[)i])i_i})ii)ii)ii)ii)ii)ii)iiNrrrrrGreek]s&rc@seZdZdZdgZdS)zpyparsing_unicode.Cyrillicz0Unicode set for Cyrillic Unicode Character Range)iiNrrrrrCyrillicesrc@seZdZdZddgZdS)zpyparsing_unicode.Chinesez/Unicode set for Chinese Unicode Character Range)Nii0i?0NrrrrrChineseisrc@sDeZdZdZgZGdddeZGdddeZGdddeZdS) zpyparsing_unicode.Japanesez`Unicode set for Japanese Unicode Character Range, combining Kanji, Hiragana, and Katakana rangesc@seZdZdZddgZdS)z pyparsing_unicode.Japanese.Kanjiz-Unicode set for Kanji Unicode Character Range)rirNrrrrrKanjiqsrc@seZdZdZdgZdS)z#pyparsing_unicode.Japanese.Hiraganaz0Unicode set for Hiragana Unicode Character Range)i@0i0NrrrrrHiraganausrc@seZdZdZdgZdS)z#pyparsing_unicode.Japanese.Katakanaz1Unicode set for Katakana Unicode Character Range)i0i0NrrrrrKatakanaysrN) rrrrrrrrrrrrrJapanesems rc@s eZdZdZddddddgZdS) zpyparsing_unicode.Koreanz.Unicode set for Korean Unicode Character Range)ii)ii)i01i1)i`i)iirNrrrrrKorean}src@seZdZdZdS)zpyparsing_unicode.CJKzTUnicode set for combined Chinese, Japanese, and Korean (CJK) Unicode Character RangeNrrrrrCJKsrc@seZdZdZddgZdS)zpyparsing_unicode.Thaiz,Unicode set for Thai Unicode Character Range)ii:)i?i[NrrrrrThaisrc@seZdZdZdddgZdS)zpyparsing_unicode.Arabicz.Unicode set for Arabic Unicode Character Range)ii)ii)iiNrrrrrArabicsrc@seZdZdZdgZdS)zpyparsing_unicode.Hebrewz.Unicode set for Hebrew Unicode Character Range)iiNrrrrrHebrewsrc@seZdZdZddgZdS)zpyparsing_unicode.Devanagariz2Unicode set for Devanagari Unicode Character Range)i i )iiNrrrrr DevanagarisrN)rrrrr maxunicoderrrrrrrrrrrrrrrrrrrrKs uالعربيةu中文uкириллицаuΕλληνικάuעִברִיתu 日本語u漢字u カタカナu ひらがなu 한국어u ไทยuदेवनागरी__main__Zselectfromr{r)r columnsrZtablesZcommandaK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual z] 100 -100 +100 3.14159 6.02e23 1e-12 z 100 FF z6 12345678-1234-5678-1234-567812345678 )NF)r)rF)N)FTF)T)r)T( rrrrrweakrefrrrIrr(rrr rxrrroperatorr itertools functoolsrr ImportErrorr_threadrZ threadingZcollections.abcr r r r rZ ordereddictr rrrrrrZ%warn_on_multiple_string_args_to_oneofr__all__r4 version_inforrbmaxsizerhrrchrr6rrrrrtreversedr rrvrrrrZmaxintZxrangerZ __builtin__rZfnamerrrrr rZascii_uppercaseZascii_lowercaserHrfrXrGr+rZ printablerjrrr0r2r4r6r9rrr5registerrMr^r[rrrrerr7r'r?rr*r'rvrNrr$rrrrBrrFr:r8rrArr"r&r%r=r<rDrCr3rr/r)rr1r r(r+rr,rEr r.r;r!r@rr#rr>r-rvrTrPr rcrbrrgrUr{r|r~rrWr]r\rurtrZ _escapedPuncZ_escapedHexCharZ_escapedOctCharZ _singleCharZ _charRangerr?rsrarprnrrxrVrPr_r`ryrSrrhrYrZr}rirRrrrmrwrdrzrIrkrKrJrrrhr7rOrorLrYrCrqrSrQrZrlrrrNrrrrrrrrrsetattrrrrrrrrrrZ selectTokenZ fromTokenZidentZ columnNameZcolumnNameListZ columnSpecZ tableNameZ tableNameListZ simpleSQLrgrrmrorr}rrrrsH            ?]  H    D! 'N E  KFyl{VO#K,:#Dvj-D0  $  W' *     4   0%   E&h~   (     ./J    &   PKd]ڜ>*OO"__pycache__/appdirs.cpython-38.pycnu[U .e_ @s`dZdZdeeeZddlZddlZejddkZ e r>eZ ej drddl Z e ddZe drrdZqe d rd Zqd Znej Zd4d dZd5ddZd6ddZd7ddZd8ddZd9ddZd:ddZGdddeZddZd d!Zd"d#Zd$d%Zedkrfzdd&lmZeZWnBe k rdzddl!Z"eZWne k r^eZYnXYnXe#d'kr\d(Z$d)Z%d*Z&e'd+ee'd,ee$e%d-d.Z(e&D]Z)e'd/e)e*e(e)fqe'd0ee$e%Z(e&D]Z)e'd/e)e*e(e)fqe'd1ee$Z(e&D]Z)e'd/e)e*e(e)fqe'd2ee$d d3Z(e&D]Z)e'd/e)e*e(e)fq>dS);zyUtilities for determining application-specific dirs. See for details and usage. ).NrjavaZWindowswin32ZMacdarwinZlinux2FcCstdkr^|dkr|}|rdpd}tjt|}|r|dk rNtj|||}qtj||}nNtdkrtjd}|rtj||}n&tdtjd }|rtj||}|r|rtj||}|S) aJReturn full path to the user-specific data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user data directories are: Mac OS X: ~/Library/Application Support/ Unix: ~/.local/share/ # or in $XDG_DATA_HOME, if defined Win XP (not roaming): C:\Documents and Settings\\Application Data\\ Win XP (roaming): C:\Documents and Settings\\Local Settings\Application Data\\ Win 7 (not roaming): C:\Users\\AppData\Local\\ Win 7 (roaming): C:\Users\\AppData\Roaming\\ For Unix, we follow the XDG spec and support $XDG_DATA_HOME. That means, by default "~/.local/share/". rN CSIDL_APPDATACSIDL_LOCAL_APPDATAFrz~/Library/Application Support/Z XDG_DATA_HOMEz~/.local/sharesystemospathnormpath_get_win_folderjoin expandusergetenv)appname appauthorversionroamingconstrr7/usr/lib/python3.8/site-packages/pip/_vendor/appdirs.py user_data_dir-s&   rcs tdkrR|dkr}tjtd}r|dk rBtj||}qtj|}ntdkrztjd}rtj|}nttdtjdd g}d d | tjD}r|rtj|fd d |D}|rtj|}n|d }|Sr|rtj||}|S)aiReturn full path to the user-shared data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "multipath" is an optional parameter only applicable to *nix which indicates that the entire list of data dirs should be returned. By default, the first item from XDG_DATA_DIRS is returned, or '/usr/local/share/', if XDG_DATA_DIRS is not set Typical site data directories are: Mac OS X: /Library/Application Support/ Unix: /usr/local/share/ or /usr/share/ Win XP: C:\Documents and Settings\All Users\Application Data\\ Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) Win 7: C:\ProgramData\\ # Hidden, but writeable on Win 7. For Unix, this is using the $XDG_DATA_DIRS[0] default. WARNING: Do not use this on Windows. See the Vista-Fail note above for why. rNCSIDL_COMMON_APPDATAFrz/Library/Application SupportZ XDG_DATA_DIRSz/usr/local/sharez /usr/sharecSs g|]}tj|tjqSrr rrrstripsep.0xrrr sz!site_data_dir..csg|]}tj|gqSrr rrr rrrr#sr) r r rrrrrrpathsepsplitrrr multipathrZpathlistrr%r site_data_dirds6  r*cCsXtdkrt||d|}n&tdtjd}|r>tj||}|rT|rTtj||}|S)aReturn full path to the user-specific config dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user config directories are: Mac OS X: same as user_data_dir Unix: ~/.config/ # or in $XDG_CONFIG_HOME, if defined Win *: same as user_data_dir For Unix, we follow the XDG spec and support $XDG_CONFIG_HOME. That means, by default "~/.config/". rrNZXDG_CONFIG_HOMEz ~/.configr rr rrrrrrrrrrrruser_config_dirsr.cstdkr*t|}r|rtj||}ndtdd}dd|tjD}rt|rbtj|fdd|D}|rtj|}n|d}|S)aReturn full path to the user-shared data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "multipath" is an optional parameter only applicable to *nix which indicates that the entire list of config dirs should be returned. By default, the first item from XDG_CONFIG_DIRS is returned, or '/etc/xdg/', if XDG_CONFIG_DIRS is not set Typical site config directories are: Mac OS X: same as site_data_dir Unix: /etc/xdg/ or $XDG_CONFIG_DIRS[i]/ for each value in $XDG_CONFIG_DIRS Win *: same as site_data_dir Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) For Unix, this is using the $XDG_CONFIG_DIRS[0] default, if multipath=False WARNING: Do not use this on Windows. See the Vista-Fail note above for why. r+ZXDG_CONFIG_DIRSz/etc/xdgcSs g|]}tj|tjqSrrr rrrr#sz#site_config_dir..csg|]}tj|gqSrr$r r%rrr#sr)r r*r rrrr'r&r(rr%rsite_config_dirs  r/TcCstdkrd|dkr|}tjtd}|r|dk rBtj|||}ntj||}|rtj|d}nNtdkrtjd}|rtj||}n&tdtjd }|rtj||}|r|rtj||}|S) aReturn full path to the user-specific cache dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "opinion" (boolean) can be False to disable the appending of "Cache" to the base app data dir for Windows. See discussion below. Typical user cache directories are: Mac OS X: ~/Library/Caches/ Unix: ~/.cache/ (XDG default) Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Cache Vista: C:\Users\\AppData\Local\\\Cache On Windows the only suggestion in the MSDN docs is that local settings go in the `CSIDL_LOCAL_APPDATA` directory. This is identical to the non-roaming app data dir (the default returned by `user_data_dir` above). Apps typically put cache data somewhere *under* the given dir here. Some examples: ...\Mozilla\Firefox\Profiles\\Cache ...\Acme\SuperApp\Cache\1.0 OPINION: This function appends "Cache" to the `CSIDL_LOCAL_APPDATA` value. This can be disabled with the `opinion=False` option. rNr FZCacherz~/Library/CachesZXDG_CACHE_HOMEz~/.cacher rrrZopinionrrrruser_cache_dirs(! r1cCsXtdkrt||d|}n&tdtjd}|r>tj||}|rT|rTtj||}|S)aReturn full path to the user-specific state dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user state directories are: Mac OS X: same as user_data_dir Unix: ~/.local/state/ # or in $XDG_STATE_HOME, if defined Win *: same as user_data_dir For Unix, we follow this Debian proposal to extend the XDG spec and support $XDG_STATE_HOME. That means, by default "~/.local/state/". r+NZXDG_STATE_HOMEz~/.local/stater,r-rrruser_state_dir:sr2cCstdkr tjtjd|}nNtdkrLt|||}d}|rntj|d}n"t|||}d}|rntj|d}|r|rtj||}|S)aReturn full path to the user-specific log dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "opinion" (boolean) can be False to disable the appending of "Logs" to the base app data dir for Windows, and "log" to the base cache dir for Unix. See discussion below. Typical user log directories are: Mac OS X: ~/Library/Logs/ Unix: ~/.cache//log # or under $XDG_CACHE_HOME if defined Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Logs Vista: C:\Users\\AppData\Local\\\Logs On Windows the only suggestion in the MSDN docs is that local settings go in the `CSIDL_LOCAL_APPDATA` directory. (Note: I'm interested in examples of what some windows apps use for a logs dir.) OPINION: This function appends "Logs" to the `CSIDL_LOCAL_APPDATA` value for Windows and appends "log" to the user cache dir for Unix. This can be disabled with the `opinion=False` option. rz~/Library/LogsrFZLogslog)r r rrrrr1r0rrr user_log_dirds"    r4c@sneZdZdZdddZeddZedd Zed d Zed d Z eddZ eddZ eddZ dS)AppDirsz1Convenience wrapper for getting application dirs.NFcCs"||_||_||_||_||_dS)N)rrrrr))selfrrrrr)rrr__init__s zAppDirs.__init__cCst|j|j|j|jdSN)rr)rrrrrr6rrrrs zAppDirs.user_data_dircCst|j|j|j|jdSN)rr))r*rrrr)r9rrrr*s zAppDirs.site_data_dircCst|j|j|j|jdSr8)r.rrrrr9rrrr.s zAppDirs.user_config_dircCst|j|j|j|jdSr:)r/rrrr)r9rrrr/s zAppDirs.site_config_dircCst|j|j|jdSNr)r1rrrr9rrrr1s zAppDirs.user_cache_dircCst|j|j|jdSr;)r2rrrr9rrrr2s zAppDirs.user_state_dircCst|j|j|jdSr;)r4rrrr9rrrr4s zAppDirs.user_log_dir)NNNFF) __name__ __module__ __qualname____doc__r7propertyrr*r.r/r1r2r4rrrrr5s&       r5cCsHtrddl}nddl}dddd|}||jd}|||\}}|S)zThis is a fallback technique at best. I'm not sure if using the registry for this guarantees us the correct answer for all CSIDL_* names. rNZAppDatazCommon AppDataz Local AppDatar rr z@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)PY3winreg_winregOpenKeyHKEY_CURRENT_USERZ QueryValueEx) csidl_namerEZshell_folder_namekeydirtyperrr_get_win_folder_from_registrys rLcCsddlm}m}|dt||dd}z^t|}d}|D]}t|dkr8d}qRq8|rzddl}||}Wnt k rYnXWnt k rYnX|S)Nr)shellconshellFT) Zwin32com.shellrMrNSHGetFolderPathgetattrunicodeordwin32apiGetShortPathName ImportError UnicodeError)rHrMrNrJ has_high_charcrTrrr_get_win_folder_with_pywin32s$  rZcCsddl}dddd|}|d}|jjd|dd|d}|D]}t|dkr@d }qZq@|r|d}|jj|j|dr|}|jS) Nr#rBiFrOT) ctypesZcreate_unicode_bufferwindllZshell32ZSHGetFolderPathWrSZkernel32ZGetShortPathNameWvalue)rHr^Z csidl_constbufrXrYZbuf2rrr_get_win_folder_with_ctypess&   rbc Csddl}ddlm}ddlm}|jjd}|d|}|jj }| dt |j |d|j j ||j|d}d}|D]} t| dkr|d }qq||r|d|}|jj } | |||r|j|d}|S) Nr)jna)rrYFrOT)arrayZcom.sunrcZcom.sun.jna.platformrZWinDefZMAX_PATHZzerosZShell32ZINSTANCErPrQZShlObjZSHGFP_TYPE_CURRENTZNativeZtoStringZtostringrrSZKernel32rU) rHrfrcrZbuf_sizerarNrJrXrYZkernelrrr_get_win_folder_with_jnas&      rg)r___main__ZMyAppZ MyCompany)rr.r1r2r4r*r/z-- app dirs %s --z%-- app dirs (with optional 'version')z1.0r<z%s: %sz) -- app dirs (without optional 'version')z+ -- app dirs (without optional 'appauthor')z( -- app dirs (with disabled 'appauthor'))r)NNNF)NNNF)NNNF)NNNF)NNNT)NNNF)NNNT)+r@Z__version_info__rmapstr __version__sysr version_inforCrRplatform startswithZjava_verZos_namer rr*r.r/r1r2r4objectr5rLrZrbrgr^r_rrVZ com.sun.jnaZcomr=rrZpropsprintdirsZproprQrrrrsv     7 B ( 3 9 * 30      PKd]օkk__pycache__/six.cpython-38.pycnu[U ʗReE@sXdZddlmZddlZddlZddlZddlZddlZdZdZ ej ddkZ ej ddkZ ej dddkZ e refZefZefZeZeZejZn~efZeefZeejfZeZeZejd red ZnHGd d d eZ ze!e Wne"k red ZYn Xed Z[ e r&ddl#m$Z$ndZ$ddZ%ddZ&GdddeZ'Gddde'Z(Gdddej)Z*Gddde'Z+GdddeZ,e,e-Z.Gddde*Z/e+ddd d!e+d"d#d$d%d"e+d&d#d#d'd&e+d(d)d$d*d(e+d+d)d,e+d-d#d$d.d-e+d/d0d0d1d/e+d2d0d0d/d2e+d3d4d5e+d6d)d$d7d6e+d8d)e r6d9nd:d;e+dd?d@dAe+d!d!d e+dBdBdCe+dDdDdCe+dEdEdCe+d7d)d$d7d6e+dFd#d$dGdFe+dHd#d#dIdHe(d$d)e(dJdKe(dLdCej dMkrdNndCe(dOdPe(dQdRdSe(dTdUdVe(dWdXej dYkrdWndZe(d[d\d]e(d^d_d`e(dadbdce(dddedfe(dgdhdie(djdkdle(dmdndoe(dpdqdre(dsdtdue(dvdwdxe(dydydze(d{d{dze(d|d|dze(d}d}d~e(dde(dde(dde(dZddZe(dde(ddde(ddde(ddde(ddde(ddde(ddde(ddde(ddde(ddde(ddde(ddde(ddde(ddde(ddde(de-dde(de-dde(de-de-de(ddde(ddde(dddgBZ0ejdkre0e(ddÃg7Z0e0D]2Z1e2e/e1j3e1e4e1e(re.5e1de1j3q[1e0e/_0e/e-dZ6e.5e6dơGddȄde*Z7e+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+dAdde+ddde+ddde+ddde+dddddփe+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+dddgZ8e8D]Z1e2e7e1j3e1q [1e8e7_0e.5e7e-dddGddde*Z9e+ddde+ddde+dddgZ:e:D]Z1e2e9e1j3e1q[1e:e9_0e.5e9e-dddGddde*Z;e+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+ddde+d dde+d dde+d dde+d dde+d dde+ddde+ddde+ddde+dddg#Ze>D]Z1e2e=e1j3e1q[1e>e=_0e.5e=e-dddGdd d e*Z?e+d!ddgZ@e@D]Z1e2e?e1j3e1 qL[1e@e?_0e.5e?e-d"d#d$Gd%d&d&ej)ZAe.5eAe-dd'd(d)ZBd*d+ZCe rd,ZDd-ZEd.ZFd/ZGd0ZHd1ZIn$d2ZDd3ZEd4ZFd5ZGd6ZHd7ZIzeJZKWn"eLk rFd8d9ZKYnXeKZJzeMZMWn"eLk rvd:d;ZMYnXe rd<d=ZNejOZPd>d?ZQeZRn>d@d=ZNdAdBZPdCd?ZQGdDdEdEeZReMZMe%eNdFeSeDZTeSeEZUeSeFZVeSeGZWeSeHZXeSeIZYe rdGdHZZdIdJZ[dKdLZ\dMdNZ]e^dOZ_e^dPZ`e^dQZanTdRdHZZdSdJZ[dTdLZ\dUdNZ]e^dVZ_e^dWZ`e^dXZae%eZdYe%e[dZe%e\d[e%e]d\e rd]d^Zbd_d`ZcedZeddlfZfefgdajhZi[fejdZkejlZmenZoddlpZpepjqZqepjrZr[pdbZsej dcdck rddZtdeZudfZvndgZtdhZudiZvnpdjd^Zbdkd`ZceeZeedZidldmZkdndoZmewejxeyZoddlqZqeqjqZqZrdpZsddZtdeZudfZve%ebdqe%ecdrdsdbZzdtdgZ{dudhZ|dvdiZ}e re~e6jdwZddxdyZnddzd{Zed|ej ddd}k red~n ddZe~e6jddZedk rddZej dddMkreZddZe%edej dddkrejejfddZejje_ejejfddZejje_nejZddZddZdddZdddZdddZddZgZe-Zeddk rge_ejrHeejD]4\ZZeej-dkrej3e-kreje=qDq[[eje.dS(z6Utilities for writing code that runs on Python 2 and 3)absolute_importNz'Benjamin Peterson z1.16.0)rjavaic@seZdZddZdS)XcCsdS)Nlselfrr~/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/six.py__len__>sz X.__len__N)__name__ __module__ __qualname__r rrrr r<srl)spec_from_loadercCs ||_dS)z Add documentation to a function.N)__doc__)funcdocrrr _add_docPsrcCst|tj|S)z7Import module, returning the module after the last dot.) __import__sysmodulesnamerrr _import_moduleUsrc@seZdZddZddZdS) _LazyDescrcCs ||_dSNrr rrrr __init__]sz_LazyDescr.__init__cCsB|}t||j|zt|j|jWntk r<YnX|Sr)_resolvesetattrrdelattr __class__AttributeError)r objtpresultrrr __get__`sz_LazyDescr.__get__N)r rrrr'rrrr rrcs.eZdZdfdd ZddZddZZS) MovedModuleNcs2tt||tr(|dkr |}||_n||_dSr)superr(rPY3mod)r roldnewr"rr rns zMovedModule.__init__cCs t|jSr)rr+r rrr rwszMovedModule._resolvecCs"|}t||}t||||Sr)rgetattrr )r attr_modulevaluerrr __getattr__zs  zMovedModule.__getattr__)N)r rrrrr3 __classcell__rrr.r r(ls r(cs(eZdZfddZddZgZZS) _LazyModulecstt|||jj|_dSr)r)r5rr"rrr.rr rsz_LazyModule.__init__cCs ddg}|dd|jD7}|S)Nrr cSsg|] }|jqSrr).0r0rrr sz'_LazyModule.__dir__..)_moved_attributes)r attrsrrr __dir__sz_LazyModule.__dir__)r rrrr:r8r4rrr.r r5s r5cs&eZdZdfdd ZddZZS)MovedAttributeNcsdtt||trH|dkr |}||_|dkr@|dkr<|}n|}||_n||_|dkrZ|}||_dSr)r)r;rr*r+r0)r rold_modnew_modold_attrnew_attrr.rr rszMovedAttribute.__init__cCst|j}t||jSr)rr+r/r0r modulerrr rs zMovedAttribute._resolve)NN)r rrrrr4rrr.r r;sr;c@speZdZdZddZddZddZdd d Zdd d Zd dZ ddZ ddZ ddZ e Z ddZddZdS)_SixMetaPathImporterz A meta path importer to import six.moves and its submodules. This class implements a PEP302 finder and loader. It should be compatible with Python 2.5 and all existing versions of Python3 cCs||_i|_dSr)r known_modules)r six_module_namerrr rsz_SixMetaPathImporter.__init__cGs"|D]}||j|jd|<qdSN.rCr)r r+ fullnamesfullnamerrr _add_modulesz _SixMetaPathImporter._add_modulecCs|j|jd|SrErGr rIrrr _get_modulesz _SixMetaPathImporter._get_moduleNcCs||jkr|SdSr)rC)r rIpathrrr find_modules z _SixMetaPathImporter.find_modulecCs||jkrt||SdSr)rCr)r rIrMtargetrrr find_specs  z_SixMetaPathImporter.find_speccCs2z |j|WStk r,td|YnXdS)Nz!This loader does not know module )rCKeyError ImportErrorrKrrr __get_modules z!_SixMetaPathImporter.__get_modulecCsTz tj|WStk r YnX||}t|tr@|}n||_|tj|<|Sr)rrrQ _SixMetaPathImporter__get_module isinstancer(r __loader__)r rIr+rrr load_modules     z _SixMetaPathImporter.load_modulecCst||dS)z Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451) __path__)hasattrrTrKrrr is_packagesz_SixMetaPathImporter.is_packagecCs||dS)z;Return None Required, if is_package is implementedN)rTrKrrr get_codes z_SixMetaPathImporter.get_codecCs ||jSr)rWr)r specrrr create_modulesz"_SixMetaPathImporter.create_modulecCsdSrrr@rrr exec_modulesz _SixMetaPathImporter.exec_module)N)N)r rrrrrJrLrNrPrTrWrZr[ get_sourcer]r^rrrr rBs   rBc@seZdZdZgZdS) _MovedItemszLazy loading of moved objectsN)r rrrrXrrrr r`sr` cStringIOioStringIOfilter itertoolsbuiltinsifilter filterfalse ifilterfalseinput __builtin__ raw_inputinternrmapimapgetcwdosZgetcwdugetcwdb getoutputcommands subprocessrangexrange reload_module importlibimpreloadreduce functools shlex_quoteZpipesshlexquoteUserDict collectionsUserList UserStringzipizip zip_longest izip_longest configparser ConfigParsercollections_abc)rrzcollections.abccopyregcopy_regdbm_gnugdbmzdbm.gnudbm_ndbmdbmzdbm.ndbm _dummy_thread dummy_thread)r _threadhttp_cookiejar cookielibzhttp.cookiejar http_cookiesCookiez http.cookies html_entitieshtmlentitydefsz html.entities html_parser HTMLParserz html.parser http_clienthttplibz http.clientemail_mime_basezemail.MIMEBasezemail.mime.baseemail_mime_imagezemail.MIMEImagezemail.mime.imageemail_mime_multipartzemail.MIMEMultipartzemail.mime.multipartemail_mime_nonmultipartzemail.MIMENonMultipartzemail.mime.nonmultipartemail_mime_textzemail.MIMETextzemail.mime.textBaseHTTPServerz http.server CGIHTTPServerSimpleHTTPServercPicklepicklequeueQueuereprlibrepr socketserver SocketServerthreadtkinterTkintertkinter_dialogDialogztkinter.dialogtkinter_filedialog FileDialogztkinter.filedialogtkinter_scrolledtext ScrolledTextztkinter.scrolledtexttkinter_simpledialog SimpleDialogztkinter.simpledialog tkinter_tixTixz tkinter.tix tkinter_ttkttkz tkinter.ttktkinter_constants Tkconstantsztkinter.constants tkinter_dndTkdndz tkinter.dndtkinter_colorchoosertkColorChooserztkinter.colorchoosertkinter_commondialogtkCommonDialogztkinter.commondialogtkinter_tkfiledialog tkFileDialog tkinter_fonttkFontz tkinter.fonttkinter_messagebox tkMessageBoxztkinter.messageboxtkinter_tksimpledialogtkSimpleDialog urllib_parsez.moves.urllib_parsez urllib.parse urllib_errorz.moves.urllib_errorz urllib.errorurllibz .moves.urlliburllib_robotparser robotparserzurllib.robotparser xmlrpc_client xmlrpclibz xmlrpc.client xmlrpc_serverSimpleXMLRPCServerz xmlrpc.serverwin32winreg_winregzmoves.z.movesmovesc@seZdZdZdS)Module_six_moves_urllib_parsez7Lazy loading of moved objects in six.moves.urllib_parseNr rrrrrrr rTsr ParseResulturlparse SplitResultparse_qs parse_qsl urldefragurljoinurlsplit urlunparse urlunsplit quote_plusunquote unquote_plusunquote_to_bytes urlencode splitquerysplittag splituser splitvalue uses_fragment uses_netloc uses_params uses_query uses_relativemoves.urllib_parsezmoves.urllib.parsec@seZdZdZdS)Module_six_moves_urllib_errorz7Lazy loading of moved objects in six.moves.urllib_errorNrrrrr r~srURLErrorurllib2 HTTPErrorContentTooShortErrorz.moves.urllib.errormoves.urllib_errorzmoves.urllib.errorc@seZdZdZdS)Module_six_moves_urllib_requestz9Lazy loading of moved objects in six.moves.urllib_requestNrrrrr rsrurlopenzurllib.requestinstall_opener build_opener pathname2url url2pathname getproxiesRequestOpenerDirectorHTTPDefaultErrorHandlerHTTPRedirectHandlerHTTPCookieProcessor ProxyHandler BaseHandlerHTTPPasswordMgrHTTPPasswordMgrWithDefaultRealmAbstractBasicAuthHandlerHTTPBasicAuthHandlerProxyBasicAuthHandlerAbstractDigestAuthHandlerHTTPDigestAuthHandlerProxyDigestAuthHandler HTTPHandler HTTPSHandler FileHandler FTPHandlerCacheFTPHandlerUnknownHandlerHTTPErrorProcessor urlretrieve urlcleanup URLopenerFancyURLopener proxy_bypassparse_http_listparse_keqv_listz.moves.urllib.requestmoves.urllib_requestzmoves.urllib.requestc@seZdZdZdS) Module_six_moves_urllib_responsez:Lazy loading of moved objects in six.moves.urllib_responseNrrrrr r"sr"addbasezurllib.response addclosehookaddinfo addinfourlz.moves.urllib.responsemoves.urllib_responsezmoves.urllib.responsec@seZdZdZdS)#Module_six_moves_urllib_robotparserz=Lazy loading of moved objects in six.moves.urllib_robotparserNrrrrr r(sr(RobotFileParserz.moves.urllib.robotparsermoves.urllib_robotparserzmoves.urllib.robotparserc@sNeZdZdZgZedZedZedZ edZ edZ ddZ d S) Module_six_moves_urllibzICreate a six.moves.urllib namespace that resembles the Python 3 namespacerrr!r'r*cCsdddddgS)Nparseerrorrequestresponserrr rrr r:szModule_six_moves_urllib.__dir__N) r rrrrX _importerrLr,r-r.r/rr:rrrr r+s     r+z moves.urllibcCstt|j|dS)zAdd an item to six.moves.N)r r`r)moverrr add_movesr2c CsXztt|WnDtk rRz tj|=Wn"tk rLtd|fYnXYnXdS)zRemove item from six.moves.zno such move, %rN)r!r`r#r__dict__rQrrrr remove_moves r4__func____self__ __closure____code__ __defaults__ __globals__im_funcZim_selfZ func_closure func_codeZ func_defaultsZ func_globalscCs|Sr)next)itrrr advance_iterator#sr?cCstddt|jDS)Ncss|]}d|jkVqdS)__call__N)r3)r6klassrrr ,szcallable..)anytype__mro__)r$rrr callable+srFcCs|Srrunboundrrr get_unbound_function0srIcCs|Srrrclsrrr create_unbound_method5srLcCs|jSr)r;rGrrr rI:scCst|||jSr)types MethodTyper")rr$rrr create_bound_method=srOcCst|d|Sr)rMrNrJrrr rL@sc@seZdZddZdS)IteratorcCst||Sr)rD__next__r rrr r=Esz Iterator.nextN)r rrr=rrrr rPCsrPz3Get the function out of a possibly unbound functioncKst|jf|Sr)iterkeysdkwrrr iterkeysVsrWcKst|jf|Sr)rRvaluesrTrrr itervaluesYsrYcKst|jf|Sr)rRitemsrTrrr iteritems\sr[cKst|jf|Sr)rRlistsrTrrr iterlists_sr]rSrXrZcKs |jf|Sr)rWrTrrr rWhscKs |jf|Sr)rYrTrrr rYkscKs |jf|Sr)r[rTrrr r[nscKs |jf|Sr)r]rTrrr r]qsviewkeys viewvalues viewitemsz1Return an iterator over the keys of a dictionary.z3Return an iterator over the values of a dictionary.z?Return an iterator over the (key, value) pairs of a dictionary.zBReturn an iterator over the (key, [values]) pairs of a dictionary.cCs |dS)Nzlatin-1)encodesrrr bsrdcCs|Srrrbrrr usrez>BassertCountEqualZassertRaisesRegexpZassertRegexpMatchesZassertNotRegexpMatchesassertRaisesRegex assertRegexassertNotRegexcCs|Srrrbrrr rdscCst|dddS)Nz\\z\\\\Zunicode_escape)unicodereplacerbrrr rescCs t|dS)Nrord)bsrrr byte2intsrpcCs t||Srrm)bufirrr indexbytessrsZassertItemsEqualz Byte literalz Text literalcOst|t||Sr)r/_assertCountEqualr argskwargsrrr rfscOst|t||Sr)r/_assertRaisesRegexrurrr rhscOst|t||Sr)r/ _assertRegexrurrr riscOst|t||Sr)r/_assertNotRegexrurrr rjsexeccCs:z*|dkr|}|j|k r$|||W5d}d}XdSr) __traceback__with_traceback)r%r2tbrrr reraises  rcCsB|dkr*td}|j}|dkr&|j}~n |dkr6|}tddS)zExecute code in a namespace.Nrgzexec _code_ in _globs_, _locs_)r _getframe f_globalsf_localsr{)Z_code_Z_globs_Z_locs_framerrr exec_s rzedef reraise(tp, value, tb=None): try: raise tp, value, tb finally: tb = None )rzrdef raise_from(value, from_value): try: raise value from from_value finally: value = None cCs|dSrr)r2 from_valuerrr raise_fromsrprintc s.|dtjdkrdSfdd}d}|dd}|dk r`t|trNd}nt|ts`td|d d}|dk rt|trd}nt|tstd |rtd |s|D]}t|trd}qq|rtd }td }nd }d }|dkr|}|dkr|}t|D] \} }| r||||q||dS)z4The new-style print function for Python 2.4 and 2.5.fileNcsdt|tst|}ttrVt|trVjdk rVtdd}|dkrHd}|j|}|dS)Nerrorsstrict) rU basestringstrrrkencodingr/rawrite)datarfprr rs   zprint_..writeFsepTzsep must be None or a stringendzend must be None or a stringz$invalid keyword arguments to print()  )poprstdoutrUrkr TypeError enumerate) rvrwrZ want_unicoderrargnewlinespacerrrrr print_sL          rcOs<|dtj}|dd}t|||r8|dk r8|dS)NrflushF)getrrr_printr)rvrwrrrrr r/s    zReraise an exception.c Csj|D]8}zt||}Wntk r.YqYqXt|||q|D]}t||t||iqB||_|Sr)r/r#r update __wrapped__)wrapperwrappedassignedupdatedr0r2rrr _update_wrapper>s rcCstjt|||dS)Nrrr)r}partialrrrrr wrapsNsrcs&Gfdddt}t|ddiS)z%Create a base class with a metaclass.cs,eZdZfddZefddZdS)z!with_metaclass..metaclasscs>tjdddkr.t}|k r2|d<n}|||S)Nr)r__orig_bases__)r version_inforM resolve_bases)rKr this_basesrUresolved_basesbasesmetarr __new___s   z)with_metaclass..metaclass.__new__cs |Sr) __prepare__)rKrrrrr rjsz-with_metaclass..metaclass.__prepare__N)r rrr classmethodrrrrr metaclass]s rtemporary_classr)rDr)rrrrrr with_metaclassXsrcsfdd}|S)z6Class decorator for creating a class with a metaclass.cs||j}|d}|dk r@t|tr,|g}|D]}||q0|dd|ddt|drl|j|d<|j|j |S)N __slots__r3 __weakref__r) r3copyrrUrrrYrr __bases__)rK orig_varsslots slots_varrrr rrs        zadd_metaclass..wrapperr)rrrrr add_metaclassps rutf-8rcCs8t|tr|St|tr$|||Stdt|dS)zCoerce **s** to six.binary_type. For Python 2: - `unicode` -> encoded to `str` - `str` -> `str` For Python 3: - `str` -> encoded to `bytes` - `bytes` -> `bytes` not expecting type '%s'N)rU binary_type text_typerarrDrcrrrrr ensure_binarys   rcCsft|tkr|Str*t|tr*|||StrDt|trD|||St|ttfsbt dt||S)zCoerce *s* to `str`. For Python 2: - `unicode` -> encoded to `str` - `str` -> `str` For Python 3: - `str` -> `str` - `bytes` -> decoded to `str` r) rDrPY2rUrrar*rdecoderrrrr ensure_strs   rcCs8t|tr|||St|tr$|Stdt|dS)zCoerce *s* to six.text_type. For Python 2: - `unicode` -> `unicode` - `str` -> `unicode` For Python 3: - `str` -> `str` - `bytes` -> decoded to `str` rN)rUrrrrrDrrrr ensure_texts   rcCs2tr.d|jkrtd|j|j|_dd|_|S)a A class decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class. __str__zY@python_2_unicode_compatible cannot be applied to %s because it doesn't define __str__().cSs|dS)Nr) __unicode__rar rrr z-python_2_unicode_compatible..)rr3 ValueErrorr rr)rArrr python_2_unicode_compatibles  r__spec__)N)NN)rr)rr)rr)r __future__rr}reoperatorrrM __author__ __version__rrr*PY34r string_typesint integer_typesrD class_typesrbytesrmaxsizeMAXSIZErlongZ ClassTyperkplatform startswithobjectrlen OverflowErrorimportlib.utilrrrrr( ModuleTyper5r;rBr r0r`r8r0r rrUrJrr_urllib_parse_moved_attributesr_urllib_error_moved_attributesr _urllib_request_moved_attributesr"!_urllib_response_moved_attributesr($_urllib_robotparser_moved_attributesr+r2r4 _meth_func _meth_self _func_closure _func_code_func_defaults _func_globalsr=r? NameErrorrFrIrNrOrLrP attrgetterget_method_functionget_method_selfget_function_closureget_function_codeget_function_defaultsget_function_globalsrWrYr[r] methodcallerr^r_r`rdrechrunichrstructStructpackint2byte itemgetterrpgetitemrsrR iterbytesrbrcBytesIOrtrxryrzrrornrfrhrirjr/rfrrrrrWRAPPER_ASSIGNMENTSWRAPPER_UPDATESrupdate_wrapperrrrrrrrrX __package__globalsrrsubmodule_search_locations meta_pathrrrimporterappendrrrr s$    I                                        H                                                                  %                                                  5        PKd]O7 )__pycache__/__init__.cpython-38.opt-1.pycnu[U .e1@sdZddlmZddlZddlZddlZdZej ej e Z ddZ ereeje dejejdd<e de d e d e d e d e d e de de de de de de de de de de de de de de de de de de d e d!e d"e d#e d$e d%e d&e d'e d(e d)e d*e d+e d,e d-e d.e d/e d0e d1e d2e d3e d4e d5e d6e d7dS)8z pip._vendor is for vendoring dependencies of pip to prevent needing pip to depend on something external. Files inside of pip._vendor should be considered immutable and should only be updated to versions from upstream. )absolute_importNFcCsvdt|}zt|ttddWntk r8Yn:Xtj|tj|<|dd\}}t tj||tj|dS)Nz{0}.{1}r)level.) format__name__ __import__globalslocals ImportErrorsysmodulesrsplitsetattr)Z modulenameZ vendored_namebaseheadr8/usr/lib/python3.8/site-packages/pip/_vendor/__init__.pyvendoreds  rz*.whlZ cachecontrolZcoloramaZ contextlib2ZdistlibZdistroZhtml5libZsixz six.moveszsix.moves.urllibzsix.moves.urllib.parseZ packagingzpackaging.versionzpackaging.specifiersZpep517Z pkg_resourcesZprogressZpytomlZretryingZrequestszrequests.exceptionszrequests.packageszrequests.packages.urllib3z&requests.packages.urllib3._collectionsz$requests.packages.urllib3.connectionz(requests.packages.urllib3.connectionpoolz!requests.packages.urllib3.contribz*requests.packages.urllib3.contrib.ntlmpoolz+requests.packages.urllib3.contrib.pyopensslz$requests.packages.urllib3.exceptionsz requests.packages.urllib3.fieldsz"requests.packages.urllib3.filepostz"requests.packages.urllib3.packagesz/requests.packages.urllib3.packages.ordered_dictz&requests.packages.urllib3.packages.sixz5requests.packages.urllib3.packages.ssl_match_hostnamezErequests.packages.urllib3.packages.ssl_match_hostname._implementationz%requests.packages.urllib3.poolmanagerz!requests.packages.urllib3.requestz"requests.packages.urllib3.responsezrequests.packages.urllib3.utilz)requests.packages.urllib3.util.connectionz&requests.packages.urllib3.util.requestz'requests.packages.urllib3.util.responsez$requests.packages.urllib3.util.retryz#requests.packages.urllib3.util.ssl_z&requests.packages.urllib3.util.timeoutz"requests.packages.urllib3.util.urlZurllib3)__doc__Z __future__rZglobZos.pathosr Z DEBUNDLEDpathabspathdirname__file__Z WHEEL_DIRrjoinrrrrsr $PKd]gg$__pycache__/six.cpython-38.opt-1.pycnu[U .e~C@sdZddlmZddlZddlZddlZddlZddlZdZdZ ej ddkZ ej ddkZ ej dddkZ e refZefZefZeZeZejZn~efZeefZeejfZeZeZejd red ZnHGd d d eZ ze!e Wne"k red ZYn Xed Z[ ddZ#ddZ$GdddeZ%Gddde%Z&Gdddej'Z(Gddde%Z)GdddeZ*e*e+Z,Gddde(Z-e)dddd e)d!d"d#d$d!e)d%d"d"d&d%e)d'd(d#d)d'e)d*d(d+e)d,d"d#d-d,e)d.d/d/d0d.e)d1d/d/d.d1e)d2d3d4e)d5d(d#d6d5e)d7d(e rd8nd9d:e)d;d(d<e)d=d>d?d@e)d d de)dAdAdBe)dCdCdBe)dDdDdBe)d6d(d#d6d5e)dEd"d#dFdEe)dGd"d"dHdGe&d#d(e&dIdJe&dKdLe&dMdNdOe&dPdQdPe&dRdSdTe&dUdVdWe&dXdYdZe&d[d\d]e&d^d_d`e&dadbdce&dddedfe&dgdhdie&djdkdle&dmdndoe&dpdpdqe&drdrdqe&dsdsdqe&dtdtdue&dvdwe&dxdye&dzd{e&d|d}d|e&d~de&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&de+dde&de+dde&de+de+de&ddde&ddde&dddg@Z.ejdkrfe.e&ddg7Z.e.D]2Z/e0e-e/j1e/e2e/e&rje,3e/de/j1qj[/e.e-_.e-e+dZ4e,3e4dGddde(Z5e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)d@dde)ddde)ddde)ddde)ddddd΃e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddgZ6e6D]Z/e0e5e/j1e/q[/e6e5_.e,3e5e+dddڡGdd܄de(Z7e)ddde)ddde)dddgZ8e8D]Z/e0e7e/j1e/q>[/e8e7_.e,3e7e+dddGddde(Z9e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)d ddg#Z:e:D]Z/e0e9e/j1e/q[/e:e9_.e,3e9e+d d d Gd dde(Z;e)ddde)ddde)ddde)dddgZe>D]Z/e0e=e/j1e/q[/e>e=_.e,3e=e+dddGdddej'Z?e,3e?e+ddd d!Z@d"d#ZAe rd$ZBd%ZCd&ZDd'ZEd(ZFd)ZGn$d*ZBd+ZCd,ZDd-ZEd.ZFd/ZGzeHZIWn"eJk rd0d1ZIYnXeIZHzeKZKWn"eJk rd2d3ZKYnXe rFd4d5ZLejMZNd6d7ZOeZPn>d8d5ZLd9d:ZNd;d7ZOGd<d=d=eZPeKZKe#eLd>eQeBZReQeCZSeQeDZTeQeEZUeQeFZVeQeGZWe r(d?d@ZXdAdBZYdCdDZZdEdFZ[e\dGZ]e\dHZ^e\dIZ_nTdJd@ZXdKdBZYdLdDZZdMdFZ[e\dNZ]e\dOZ^e\dPZ_e#eXdQe#eYdRe#eZdSe#e[dTe rDdUdVZ`dWdXZaebZcddldZdededYjfZg[dehdZiejjZkelZmddlnZnenjoZoenjpZpdZZqej d[d[k r6d\Zrd]Zsn d^Zrd_Zsnjd`dVZ`dadXZaecZcebZgdbdcZidddeZketejuevZmddloZoeojoZoZpdfZqd\Zrd]Zse#e`dge#eadhdidZZwdjd^Zxdkd_Zye reze4j{dlZ|ddmdnZ}nddodpZ|e|dqej dddrk rLe|dsn.ej dddrk rne|dtn dudvZ~eze4j{dwdZedk rdxdyZej dddzk reZd{dyZe#e}d|ej dddk rejejfd}d~ZnejZddZddZdddZdddZdddZddZgZe+Zeddk rzge_ejreejD]4\ZZeej+dkrej1e+kreje=qq[[eje,dS(z6Utilities for writing code that runs on Python 2 and 3)absolute_importNz'Benjamin Peterson z1.12.0)rjavaic@seZdZddZdS)XcCsdS)Nlselfrr3/usr/lib/python3.8/site-packages/pip/_vendor/six.py__len__>sz X.__len__N)__name__ __module__ __qualname__r rrrr r<srlcCs ||_dS)z Add documentation to a function.N)__doc__)funcdocrrr _add_docKsrcCst|tj|S)z7Import module, returning the module after the last dot.) __import__sysmodulesnamerrr _import_modulePsrc@seZdZddZddZdS) _LazyDescrcCs ||_dSNrr rrrr __init__Xsz_LazyDescr.__init__cCsB|}t||j|zt|j|jWntk r<YnX|Sr)_resolvesetattrrdelattr __class__AttributeError)r objtpresultrrr __get__[sz_LazyDescr.__get__N)r rrrr&rrrr rVsrcs.eZdZdfdd ZddZddZZS) MovedModuleNcs2tt||tr(|dkr |}||_n||_dSr)superr'rPY3mod)r roldnewr!rr ris zMovedModule.__init__cCs t|jSr)rr*r rrr rrszMovedModule._resolvecCs"|}t||}t||||Sr)rgetattrr)r attr_modulevaluerrr __getattr__us  zMovedModule.__getattr__)N)r rrrrr2 __classcell__rrr-r r'gs r'cs(eZdZfddZddZgZZS) _LazyModulecstt|||jj|_dSr)r(r4rr!rrr-rr r~sz_LazyModule.__init__cCs ddg}|dd|jD7}|S)Nrr cSsg|] }|jqSrr).0r/rrr sz'_LazyModule.__dir__..)_moved_attributes)r Zattrsrrr __dir__sz_LazyModule.__dir__)r rrrr8r7r3rrr-r r4|s r4cs&eZdZdfdd ZddZZS)MovedAttributeNcsdtt||trH|dkr |}||_|dkr@|dkr<|}n|}||_n||_|dkrZ|}||_dSr)r(r9rr)r*r/)r rZold_modZnew_modZold_attrZnew_attrr-rr rszMovedAttribute.__init__cCst|j}t||jSr)rr*r.r/)r modulerrr rs zMovedAttribute._resolve)NN)r rrrrr3rrr-r r9sr9c@sVeZdZdZddZddZddZdd d Zd d Zd dZ ddZ ddZ e Z dS)_SixMetaPathImporterz A meta path importer to import six.moves and its submodules. This class implements a PEP302 finder and loader. It should be compatible with Python 2.5 and all existing versions of Python3 cCs||_i|_dSr)r known_modules)r Zsix_module_namerrr rsz_SixMetaPathImporter.__init__cGs"|D]}||j|jd|<qdSN.r<r)r r*Z fullnamesfullnamerrr _add_modulesz _SixMetaPathImporter._add_modulecCs|j|jd|Sr=r?r r@rrr _get_modulesz _SixMetaPathImporter._get_moduleNcCs||jkr|SdSr)r<)r r@pathrrr find_modules z _SixMetaPathImporter.find_modulecCs2z |j|WStk r,td|YnXdS)Nz!This loader does not know module )r<KeyError ImportErrorrBrrr Z __get_modules z!_SixMetaPathImporter.__get_modulecCsTz tj|WStk r YnX||}t|tr@|}n||_|tj|<|Sr)rrrF _SixMetaPathImporter__get_module isinstancer'r __loader__)r r@r*rrr load_modules     z _SixMetaPathImporter.load_modulecCst||dS)z Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451) __path__)hasattrrHrBrrr is_packagesz_SixMetaPathImporter.is_packagecCs||dS)z;Return None Required, if is_package is implementedN)rHrBrrr get_codes z_SixMetaPathImporter.get_code)N) r rrrrrArCrErHrKrNrO get_sourcerrrr r;s  r;c@seZdZdZgZdS) _MovedItemszLazy loading of moved objectsN)r rrrrLrrrr rQsrQZ cStringIOioStringIOfilter itertoolsbuiltinsZifilter filterfalseZ ifilterfalseinputZ __builtin__Z raw_inputinternrmapimapgetcwdosZgetcwdugetcwdbZ getoutputZcommands subprocessrangeZxrangeZ reload_module importlibZimpreloadreduce functoolsZ shlex_quoteZpipesZshlexZquoteUserDict collectionsUserList UserStringzipZizip zip_longestZ izip_longestZ configparserZ ConfigParsercopyregZcopy_regZdbm_gnuZgdbmzdbm.gnuZ _dummy_threadZ dummy_threadZhttp_cookiejarZ cookielibzhttp.cookiejarZ http_cookiesZCookiez http.cookiesZ html_entitiesZhtmlentitydefsz html.entitiesZ html_parserZ HTMLParserz html.parserZ http_clientZhttplibz http.clientZemail_mime_basezemail.MIMEBasezemail.mime.baseZemail_mime_imagezemail.MIMEImagezemail.mime.imageZemail_mime_multipartzemail.MIMEMultipartzemail.mime.multipartZemail_mime_nonmultipartzemail.MIMENonMultipartzemail.mime.nonmultipartZemail_mime_textzemail.MIMETextzemail.mime.textZBaseHTTPServerz http.serverZ CGIHTTPServerZSimpleHTTPServerZcPicklepickleZqueueZQueuereprlibreprZ socketserverZ SocketServer_threadthreadZtkinterZTkinterZtkinter_dialogZDialogztkinter.dialogZtkinter_filedialogZ FileDialogztkinter.filedialogZtkinter_scrolledtextZ ScrolledTextztkinter.scrolledtextZtkinter_simpledialogZ SimpleDialogztkinter.simpledialogZ tkinter_tixZTixz tkinter.tixZ tkinter_ttkZttkz tkinter.ttkZtkinter_constantsZ Tkconstantsztkinter.constantsZ tkinter_dndZTkdndz tkinter.dndZtkinter_colorchooserZtkColorChooserztkinter.colorchooserZtkinter_commondialogZtkCommonDialogztkinter.commondialogZtkinter_tkfiledialogZ tkFileDialogZ tkinter_fontZtkFontz tkinter.fontZtkinter_messageboxZ tkMessageBoxztkinter.messageboxZtkinter_tksimpledialogZtkSimpleDialogZ urllib_parsez.moves.urllib_parsez urllib.parseZ urllib_errorz.moves.urllib_errorz urllib.errorZurllibz .moves.urllibZurllib_robotparser robotparserzurllib.robotparserZ xmlrpc_clientZ xmlrpclibz xmlrpc.clientZ xmlrpc_serverZSimpleXMLRPCServerz xmlrpc.serverZwin32winreg_winregzmoves.z.movesmovesc@seZdZdZdS)Module_six_moves_urllib_parsez7Lazy loading of moved objects in six.moves.urllib_parseNr rrrrrrr ruBsruZ ParseResultZurlparseZ SplitResultZparse_qsZ parse_qslZ urldefragZurljoinZurlsplitZ urlunparseZ urlunsplitZ quote_plusZunquoteZ unquote_plusZunquote_to_bytesZ urlencodeZ splitqueryZsplittagZ splituserZ splitvalueZ uses_fragmentZ uses_netlocZ uses_paramsZ uses_queryZ uses_relativemoves.urllib_parsezmoves.urllib.parsec@seZdZdZdS)Module_six_moves_urllib_errorz7Lazy loading of moved objects in six.moves.urllib_errorNrvrrrr rxlsrxZURLErrorZurllib2Z HTTPErrorZContentTooShortErrorz.moves.urllib.errormoves.urllib_errorzmoves.urllib.errorc@seZdZdZdS)Module_six_moves_urllib_requestz9Lazy loading of moved objects in six.moves.urllib_requestNrvrrrr rzsrzZurlopenzurllib.requestZinstall_openerZ build_openerZ pathname2urlZ url2pathnameZ getproxiesZRequestZOpenerDirectorZHTTPDefaultErrorHandlerZHTTPRedirectHandlerZHTTPCookieProcessorZ ProxyHandlerZ BaseHandlerZHTTPPasswordMgrZHTTPPasswordMgrWithDefaultRealmZAbstractBasicAuthHandlerZHTTPBasicAuthHandlerZProxyBasicAuthHandlerZAbstractDigestAuthHandlerZHTTPDigestAuthHandlerZProxyDigestAuthHandlerZ HTTPHandlerZ HTTPSHandlerZ FileHandlerZ FTPHandlerZCacheFTPHandlerZUnknownHandlerZHTTPErrorProcessorZ urlretrieveZ urlcleanupZ URLopenerZFancyURLopenerZ proxy_bypassZparse_http_listZparse_keqv_listz.moves.urllib.requestmoves.urllib_requestzmoves.urllib.requestc@seZdZdZdS) Module_six_moves_urllib_responsez:Lazy loading of moved objects in six.moves.urllib_responseNrvrrrr r|sr|Zaddbasezurllib.responseZ addclosehookZaddinfoZ addinfourlz.moves.urllib.responsemoves.urllib_responsezmoves.urllib.responsec@seZdZdZdS)#Module_six_moves_urllib_robotparserz=Lazy loading of moved objects in six.moves.urllib_robotparserNrvrrrr r~sr~ZRobotFileParserz.moves.urllib.robotparsermoves.urllib_robotparserzmoves.urllib.robotparserc@sNeZdZdZgZedZedZedZ edZ edZ ddZ d S) Module_six_moves_urllibzICreate a six.moves.urllib namespace that resembles the Python 3 namespacerwryr{r}rcCsdddddgS)Nparseerrorrequestresponserqrr rrr r8szModule_six_moves_urllib.__dir__N) r rrrrL _importerrCrrrrrqr8rrrr rs     rz moves.urllibcCstt|j|dS)zAdd an item to six.moves.N)rrQr)Zmoverrr add_movesrc CsXztt|WnDtk rRz tj|=Wn"tk rLtd|fYnXYnXdS)zRemove item from six.moves.zno such move, %rN)r rQr"rt__dict__rFrrrr remove_moves r__func____self__ __closure____code__ __defaults__ __globals__im_funcZim_selfZ func_closureZ func_codeZ func_defaultsZ func_globalscCs|Sr)next)itrrr advance_iteratorsrcCstddt|jDS)Ncss|]}d|jkVqdS)__call__N)r)r5klassrrr szcallable..)anytype__mro__)r#rrr callablesrcCs|SrrZunboundrrr get_unbound_functionsrcCs|Srrrclsrrr create_unbound_method#srcCs|jSr)rrrrr r(scCst|||jSr)types MethodTyper!)rr#rrr create_bound_method+srcCst|d|Sr)rrrrrr r.sc@seZdZddZdS)IteratorcCst||Sr)r__next__r rrr r3sz Iterator.nextN)r rrrrrrr r1srz3Get the function out of a possibly unbound functioncKst|jf|Sr)iterkeysdkwrrr iterkeysDsrcKst|jf|Sr)rvaluesrrrr itervaluesGsrcKst|jf|Sr)ritemsrrrr iteritemsJsrcKst|jf|Sr)rZlistsrrrr iterlistsMsrrrrcKs |jf|Sr)rrrrr rVscKs |jf|Sr)rrrrr rYscKs |jf|Sr)rrrrr r\scKs |jf|Sr)rrrrr r_sviewkeys viewvalues viewitemsz1Return an iterator over the keys of a dictionary.z3Return an iterator over the values of a dictionary.z?Return an iterator over the (key, value) pairs of a dictionary.zBReturn an iterator over the (key, [values]) pairs of a dictionary.cCs |dS)Nzlatin-1)encodesrrr bqsrcCs|Srrrrrr utsrz>BassertCountEqualZassertRaisesRegexpZassertRegexpMatchesassertRaisesRegex assertRegexcCs|Srrrrrr rscCst|dddS)Nz\\z\\\\Zunicode_escape)unicodereplacerrrr rscCs t|dS)Nrord)Zbsrrr byte2intsrcCs t||Srr)Zbufirrr indexbytessrZassertItemsEqualz Byte literalz Text literalcOst|t||Sr)r._assertCountEqualr argskwargsrrr rscOst|t||Sr)r._assertRaisesRegexrrrr rscOst|t||Sr)r. _assertRegexrrrr rsexeccCs:z*|dkr|}|j|k r$|||W5d}d}XdSr) __traceback__with_traceback)r$r1tbrrr reraises  rcCsB|dkr*td}|j}|dkr&|j}~n |dkr6|}tddS)zExecute code in a namespace.Nrzexec _code_ in _globs_, _locs_)r _getframe f_globalsf_localsr)Z_code_Z_globs_Z_locs_framerrr exec_s rzedef reraise(tp, value, tb=None): try: raise tp, value, tb finally: tb = None )rrzdef raise_from(value, from_value): try: if from_value is None: raise value raise value from from_value finally: value = None zrdef raise_from(value, from_value): try: raise value from from_value finally: value = None cCs|dSrr)r1Z from_valuerrr raise_fromsrprintc s.|dtjdkrdSfdd}d}|dd}|dk r`t|trNd}nt|ts`td|d d}|dk rt|trd}nt|tstd |rtd |s|D]}t|trd}qq|rtd }td }nd }d }|dkr|}|dkr|}t|D] \} }| r||||q||dS)z4The new-style print function for Python 2.4 and 2.5.fileNcsdt|tst|}ttrVt|trVjdk rVtdd}|dkrHd}|j|}|dS)Nerrorsstrict) rI basestringstrrrencodingr.rwrite)datarfprr rs   zprint_..writeFsepTzsep must be None or a stringendzend must be None or a stringz$invalid keyword arguments to print()  )poprstdoutrIrr TypeError enumerate) rrrZ want_unicoderrargnewlineZspacerrrr print_sL          r)rrcOs<|dtj}|dd}t|||r8|dk r8|dS)NrflushF)getrrr_printr)rrrrrrr rs    zReraise an exception.csfdd}|S)Ncst|}|_|Sr)rdwraps __wrapped__)fassignedupdatedwrappedrr wrapper*szwraps..wrapperr)rrrrrrr r(srcs&Gfdddt}t|ddiS)z%Create a base class with a metaclass.cs,eZdZfddZefddZdS)z!with_metaclass..metaclasscs ||Srr)rr this_basesrbasesmetarr __new__:sz)with_metaclass..metaclass.__new__cs |Sr) __prepare__)rrrrrr r=sz-with_metaclass..metaclass.__prepare__N)r rrr classmethodrrrrr metaclass8srZtemporary_classr)rr)rrrrrr with_metaclass3srcsfdd}|S)z6Class decorator for creating a class with a metaclass.cs||j}|d}|dk r@t|tr,|g}|D]}||q0|dd|ddt|drl|j|d<|j|j |S)N __slots__r __weakref__r) rcopyrrIrrrMrr __bases__)rZ orig_varsslotsZ slots_varrrr rEs        zadd_metaclass..wrapperr)rrrrr add_metaclassCs rutf-8rcCs8t|tr|||St|tr$|Stdt|dS)zCoerce **s** to six.binary_type. For Python 2: - `unicode` -> encoded to `str` - `str` -> `str` For Python 3: - `str` -> encoded to `bytes` - `bytes` -> `bytes` not expecting type '%s'N)rI text_typer binary_typerrrrrrrr ensure_binaryUs   r cCsXt|ttfstdt|tr:t|tr:|||}ntrTt|trT|||}|S)zCoerce *s* to `str`. For Python 2: - `unicode` -> encoded to `str` - `str` -> `str` For Python 3: - `str` -> `str` - `bytes` -> decoded to `str` r) rIrrrrPY2rr)decoderrrr ensure_strhs  r cCs8t|tr|||St|tr$|Stdt|dS)zCoerce *s* to six.text_type. For Python 2: - `unicode` -> `unicode` - `str` -> `unicode` For Python 3: - `str` -> `str` - `bytes` -> decoded to `str` rN)rIrr rrrrrrr ensure_text|s   r cCs2tr.d|jkrtd|j|j|_dd|_|S)a A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class. __str__zY@python_2_unicode_compatible cannot be applied to %s because it doesn't define __str__().cSs|dS)Nr) __unicode__rr rrr z-python_2_unicode_compatible..)r r ValueErrorr rr)rrrr python_2_unicode_compatibles  r__spec__)N)NN)rr)rr)rr)rZ __future__rrdrUoperatorrr __author__ __version__ version_infor r)ZPY34rZ string_typesintZ integer_typesrZ class_typesrbytesrmaxsizeZMAXSIZErZlongZ ClassTyperplatform startswithobjectrlen OverflowErrorrrrr' ModuleTyper4r9r;r rrQr7r/rrrIrArtruZ_urllib_parse_moved_attributesrxZ_urllib_error_moved_attributesrzZ _urllib_request_moved_attributesr|Z!_urllib_response_moved_attributesr~Z$_urllib_robotparser_moved_attributesrrrZ _meth_funcZ _meth_selfZ _func_closureZ _func_codeZ_func_defaultsZ _func_globalsrr NameErrorrrrrrr attrgetterZget_method_functionZget_method_selfZget_function_closureZget_function_codeZget_function_defaultsZget_function_globalsrrrr methodcallerrrrrrchrZunichrstructStructpackZint2byte itemgetterrgetitemrrZ iterbytesrRrSBytesIOrrrpartialr[rrrrr.rVrrrrrWRAPPER_ASSIGNMENTSWRAPPER_UPDATESrrrr r r rrL __package__globalsrrsubmodule_search_locations meta_pathrrZimporterappendrrrr s     >                                        F                                                                  %                                                  5      PKd]uchardet/sbcharsetprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # Shy Shalom - original C code # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .charsetprober import CharSetProber from .enums import CharacterCategory, ProbingState, SequenceLikelihood class SingleByteCharSetProber(CharSetProber): SAMPLE_SIZE = 64 SB_ENOUGH_REL_THRESHOLD = 1024 # 0.25 * SAMPLE_SIZE^2 POSITIVE_SHORTCUT_THRESHOLD = 0.95 NEGATIVE_SHORTCUT_THRESHOLD = 0.05 def __init__(self, model, reversed=False, name_prober=None): super(SingleByteCharSetProber, self).__init__() self._model = model # TRUE if we need to reverse every pair in the model lookup self._reversed = reversed # Optional auxiliary prober for name decision self._name_prober = name_prober self._last_order = None self._seq_counters = None self._total_seqs = None self._total_char = None self._freq_char = None self.reset() def reset(self): super(SingleByteCharSetProber, self).reset() # char order of last character self._last_order = 255 self._seq_counters = [0] * SequenceLikelihood.get_num_categories() self._total_seqs = 0 self._total_char = 0 # characters that fall in our sampling range self._freq_char = 0 @property def charset_name(self): if self._name_prober: return self._name_prober.charset_name else: return self._model['charset_name'] @property def language(self): if self._name_prober: return self._name_prober.language else: return self._model.get('language') def feed(self, byte_str): if not self._model['keep_english_letter']: byte_str = self.filter_international_words(byte_str) if not byte_str: return self.state char_to_order_map = self._model['char_to_order_map'] for i, c in enumerate(byte_str): # XXX: Order is in range 1-64, so one would think we want 0-63 here, # but that leads to 27 more test failures than before. order = char_to_order_map[c] # XXX: This was SYMBOL_CAT_ORDER before, with a value of 250, but # CharacterCategory.SYMBOL is actually 253, so we use CONTROL # to make it closer to the original intent. The only difference # is whether or not we count digits and control characters for # _total_char purposes. if order < CharacterCategory.CONTROL: self._total_char += 1 if order < self.SAMPLE_SIZE: self._freq_char += 1 if self._last_order < self.SAMPLE_SIZE: self._total_seqs += 1 if not self._reversed: i = (self._last_order * self.SAMPLE_SIZE) + order model = self._model['precedence_matrix'][i] else: # reverse the order of the letters in the lookup i = (order * self.SAMPLE_SIZE) + self._last_order model = self._model['precedence_matrix'][i] self._seq_counters[model] += 1 self._last_order = order charset_name = self._model['charset_name'] if self.state == ProbingState.DETECTING: if self._total_seqs > self.SB_ENOUGH_REL_THRESHOLD: confidence = self.get_confidence() if confidence > self.POSITIVE_SHORTCUT_THRESHOLD: self.logger.debug('%s confidence = %s, we have a winner', charset_name, confidence) self._state = ProbingState.FOUND_IT elif confidence < self.NEGATIVE_SHORTCUT_THRESHOLD: self.logger.debug('%s confidence = %s, below negative ' 'shortcut threshhold %s', charset_name, confidence, self.NEGATIVE_SHORTCUT_THRESHOLD) self._state = ProbingState.NOT_ME return self.state def get_confidence(self): r = 0.01 if self._total_seqs > 0: r = ((1.0 * self._seq_counters[SequenceLikelihood.POSITIVE]) / self._total_seqs / self._model['typical_positive_ratio']) r = r * self._freq_char / self._total_char if r >= 1.0: r = 0.99 return r PKd]uG=00chardet/universaldetector.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # Shy Shalom - original C code # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### """ Module containing the UniversalDetector detector class, which is the primary class a user of ``chardet`` should use. :author: Mark Pilgrim (initial port to Python) :author: Shy Shalom (original C code) :author: Dan Blanchard (major refactoring for 3.0) :author: Ian Cordasco """ import codecs import logging import re from .charsetgroupprober import CharSetGroupProber from .enums import InputState, LanguageFilter, ProbingState from .escprober import EscCharSetProber from .latin1prober import Latin1Prober from .mbcsgroupprober import MBCSGroupProber from .sbcsgroupprober import SBCSGroupProber class UniversalDetector(object): """ The ``UniversalDetector`` class underlies the ``chardet.detect`` function and coordinates all of the different charset probers. To get a ``dict`` containing an encoding and its confidence, you can simply run: .. code:: u = UniversalDetector() u.feed(some_bytes) u.close() detected = u.result """ MINIMUM_THRESHOLD = 0.20 HIGH_BYTE_DETECTOR = re.compile(b'[\x80-\xFF]') ESC_DETECTOR = re.compile(b'(\033|~{)') WIN_BYTE_DETECTOR = re.compile(b'[\x80-\x9F]') ISO_WIN_MAP = {'iso-8859-1': 'Windows-1252', 'iso-8859-2': 'Windows-1250', 'iso-8859-5': 'Windows-1251', 'iso-8859-6': 'Windows-1256', 'iso-8859-7': 'Windows-1253', 'iso-8859-8': 'Windows-1255', 'iso-8859-9': 'Windows-1254', 'iso-8859-13': 'Windows-1257'} def __init__(self, lang_filter=LanguageFilter.ALL): self._esc_charset_prober = None self._charset_probers = [] self.result = None self.done = None self._got_data = None self._input_state = None self._last_char = None self.lang_filter = lang_filter self.logger = logging.getLogger(__name__) self._has_win_bytes = None self.reset() def reset(self): """ Reset the UniversalDetector and all of its probers back to their initial states. This is called by ``__init__``, so you only need to call this directly in between analyses of different documents. """ self.result = {'encoding': None, 'confidence': 0.0, 'language': None} self.done = False self._got_data = False self._has_win_bytes = False self._input_state = InputState.PURE_ASCII self._last_char = b'' if self._esc_charset_prober: self._esc_charset_prober.reset() for prober in self._charset_probers: prober.reset() def feed(self, byte_str): """ Takes a chunk of a document and feeds it through all of the relevant charset probers. After calling ``feed``, you can check the value of the ``done`` attribute to see if you need to continue feeding the ``UniversalDetector`` more data, or if it has made a prediction (in the ``result`` attribute). .. note:: You should always call ``close`` when you're done feeding in your document if ``done`` is not already ``True``. """ if self.done: return if not len(byte_str): return if not isinstance(byte_str, bytearray): byte_str = bytearray(byte_str) # First check for known BOMs, since these are guaranteed to be correct if not self._got_data: # If the data starts with BOM, we know it is UTF if byte_str.startswith(codecs.BOM_UTF8): # EF BB BF UTF-8 with BOM self.result = {'encoding': "UTF-8-SIG", 'confidence': 1.0, 'language': ''} elif byte_str.startswith((codecs.BOM_UTF32_LE, codecs.BOM_UTF32_BE)): # FF FE 00 00 UTF-32, little-endian BOM # 00 00 FE FF UTF-32, big-endian BOM self.result = {'encoding': "UTF-32", 'confidence': 1.0, 'language': ''} elif byte_str.startswith(b'\xFE\xFF\x00\x00'): # FE FF 00 00 UCS-4, unusual octet order BOM (3412) self.result = {'encoding': "X-ISO-10646-UCS-4-3412", 'confidence': 1.0, 'language': ''} elif byte_str.startswith(b'\x00\x00\xFF\xFE'): # 00 00 FF FE UCS-4, unusual octet order BOM (2143) self.result = {'encoding': "X-ISO-10646-UCS-4-2143", 'confidence': 1.0, 'language': ''} elif byte_str.startswith((codecs.BOM_LE, codecs.BOM_BE)): # FF FE UTF-16, little endian BOM # FE FF UTF-16, big endian BOM self.result = {'encoding': "UTF-16", 'confidence': 1.0, 'language': ''} self._got_data = True if self.result['encoding'] is not None: self.done = True return # If none of those matched and we've only see ASCII so far, check # for high bytes and escape sequences if self._input_state == InputState.PURE_ASCII: if self.HIGH_BYTE_DETECTOR.search(byte_str): self._input_state = InputState.HIGH_BYTE elif self._input_state == InputState.PURE_ASCII and \ self.ESC_DETECTOR.search(self._last_char + byte_str): self._input_state = InputState.ESC_ASCII self._last_char = byte_str[-1:] # If we've seen escape sequences, use the EscCharSetProber, which # uses a simple state machine to check for known escape sequences in # HZ and ISO-2022 encodings, since those are the only encodings that # use such sequences. if self._input_state == InputState.ESC_ASCII: if not self._esc_charset_prober: self._esc_charset_prober = EscCharSetProber(self.lang_filter) if self._esc_charset_prober.feed(byte_str) == ProbingState.FOUND_IT: self.result = {'encoding': self._esc_charset_prober.charset_name, 'confidence': self._esc_charset_prober.get_confidence(), 'language': self._esc_charset_prober.language} self.done = True # If we've seen high bytes (i.e., those with values greater than 127), # we need to do more complicated checks using all our multi-byte and # single-byte probers that are left. The single-byte probers # use character bigram distributions to determine the encoding, whereas # the multi-byte probers use a combination of character unigram and # bigram distributions. elif self._input_state == InputState.HIGH_BYTE: if not self._charset_probers: self._charset_probers = [MBCSGroupProber(self.lang_filter)] # If we're checking non-CJK encodings, use single-byte prober if self.lang_filter & LanguageFilter.NON_CJK: self._charset_probers.append(SBCSGroupProber()) self._charset_probers.append(Latin1Prober()) for prober in self._charset_probers: if prober.feed(byte_str) == ProbingState.FOUND_IT: self.result = {'encoding': prober.charset_name, 'confidence': prober.get_confidence(), 'language': prober.language} self.done = True break if self.WIN_BYTE_DETECTOR.search(byte_str): self._has_win_bytes = True def close(self): """ Stop analyzing the current document and come up with a final prediction. :returns: The ``result`` attribute, a ``dict`` with the keys `encoding`, `confidence`, and `language`. """ # Don't bother with checks if we're already done if self.done: return self.result self.done = True if not self._got_data: self.logger.debug('no data received!') # Default to ASCII if it is all we've seen so far elif self._input_state == InputState.PURE_ASCII: self.result = {'encoding': 'ascii', 'confidence': 1.0, 'language': ''} # If we have seen non-ASCII, return the best that met MINIMUM_THRESHOLD elif self._input_state == InputState.HIGH_BYTE: prober_confidence = None max_prober_confidence = 0.0 max_prober = None for prober in self._charset_probers: if not prober: continue prober_confidence = prober.get_confidence() if prober_confidence > max_prober_confidence: max_prober_confidence = prober_confidence max_prober = prober if max_prober and (max_prober_confidence > self.MINIMUM_THRESHOLD): charset_name = max_prober.charset_name lower_charset_name = max_prober.charset_name.lower() confidence = max_prober.get_confidence() # Use Windows encoding name instead of ISO-8859 if we saw any # extra Windows-specific bytes if lower_charset_name.startswith('iso-8859'): if self._has_win_bytes: charset_name = self.ISO_WIN_MAP.get(lower_charset_name, charset_name) self.result = {'encoding': charset_name, 'confidence': confidence, 'language': max_prober.language} # Log all prober confidences if none met MINIMUM_THRESHOLD if self.logger.getEffectiveLevel() == logging.DEBUG: if self.result['encoding'] is None: self.logger.debug('no probers hit minimum threshold') for group_prober in self._charset_probers: if not group_prober: continue if isinstance(group_prober, CharSetGroupProber): for prober in group_prober.probers: self.logger.debug('%s %s confidence = %s', prober.charset_name, prober.language, prober.get_confidence()) else: self.logger.debug('%s %s confidence = %s', prober.charset_name, prober.language, prober.get_confidence()) return self.result PKd]vi8"Q"Q0chardet/__pycache__/langthaimodel.cpython-38.pycnu[U ʗRev@s2"ddlmZdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?d?Zddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d dddddddd d d d ddddddddddddddddddd d!d"d#ddddddd$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvddwdxdydzd{d|d}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd ddZeddeeddddZdS))SingleByteCharSetModel)?4"3/:9157+,0r'>6- r= *.? r$ ( # )!2%&8;<jkde^lmnoY_pq@HIrJstfQuZgNR`[OThiab\XvcUSrrrKr r r r r wrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)Lr*Br+r,r-r.r/r0r1r2r3r4Vr5r6r7r8r9r:r;r<r=CMr>]Dr?r@AErAFPGW(rrrrr*rr<r=r r!r-r5r%r0rr$r"rr(rrr)r,r/rrr r2r6r8rrr3r9r r4r.r;r>rr1r7r&rrr r'rrrr:r r rrrr?rrr@rAr#rr+r`rrrrrrrrarbrdrrrrmrrrrhrnrrsrrrrrXrkrqrxrrNrYrorvrwrrIrMrgrlrtrurGrHrQrRrSrTrZr[rcrerfrjrrxyz{|}~rFrJrKrLrOrPrUrVrWr\r]r^r_rirpryrzr{r|r}r~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrErDrCrBzTIS-620Thaig@?Fuกขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛) charset_namelanguagechar_to_order_maplanguage_modeltypical_positive_ratiokeep_ascii_lettersalphabetN)#pip._vendor.chardet.sbcharsetproberrTHAI_LANG_MODELTIS_620_THAI_CHAR_TO_ORDERTIS_620_THAI_MODELrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/langthaimodel.pys" BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*PKd]VPP4chardet/__pycache__/cp949prober.cpython-38.opt-1.pycnu[U .e?@sDddlmZddlmZddlmZddlmZGdddeZdS))EUCKRDistributionAnalysis)CodingStateMachine)MultiByteCharSetProber)CP949_SM_MODELcs4eZdZfddZeddZeddZZS) CP949Probercs,tt|tt|_t|_|dS)N) superr__init__rrZ coding_smrZdistribution_analyzerresetself __class__C/usr/lib/python3.8/site-packages/pip/_vendor/chardet/cp949prober.pyr#s zCP949Prober.__init__cCsdS)NZCP949rr rrr charset_name+szCP949Prober.charset_namecCsdS)NZKoreanrr rrrlanguage/szCP949Prober.language)__name__ __module__ __qualname__rpropertyrr __classcell__rrr rr"s   rN) ZchardistributionrZcodingstatemachinerZmbcharsetproberrZmbcssmrrrrrrs    PKd]VTTFF8chardet/__pycache__/mbcsgroupprober.cpython-38.opt-1.pycnu[U .e@sddlmZddlmZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZGd d d eZd S) )CharSetGroupProber) UTF8Prober) SJISProber) EUCJPProber) GB2312Prober) EUCKRProber) CP949Prober) Big5Prober) EUCTWProbercseZdZdfdd ZZS)MBCSGroupProberNcsDtt|j|dttttttt t g|_ | dS)N) lang_filter) superr __init__rrrrrrr r Zprobersreset)selfr  __class__G/usr/lib/python3.8/site-packages/pip/_vendor/chardet/mbcsgroupprober.pyr*s zMBCSGroupProber.__init__)N)__name__ __module__ __qualname__r __classcell__rrrrr )sr N)ZcharsetgroupproberrZ utf8proberrZ sjisproberrZ eucjpproberrZ gb2312proberrZ euckrproberrZ cp949proberrZ big5proberr Z euctwproberr r rrrrs         PKd]#S\MAMA/chardet/__pycache__/mbcssm.cpython-38.opt-1.pycnu[U .ec@sl ddlmZdZejejejdejejejejejejejejejejejejejejejejejejejejfZdZedeeddZdZ ejejdejejejd dejd ejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejfFZ d Z e d e e d dZ dZ dd ddejejejejejejejejejejejejejejejejejejejejejejejejejejdejdejejejejejejejf(ZdZe d eeddZdZejejdejejejejejejejejejejejejejfZdZed eeddZdZejejejdddd ejejejejejejejejejejejejejejejejejejejejejejejejejdejejejejejejejejejejejejejejejf0ZdZedeeddZdZejejejejejejdejejejejejejejejejejejejejejejejejd ejejejejejejejejejdejejejejejejejejejejejejejf0ZdZedeeddZdZejejejdejejejejejejejejejejejejejejejejejejejejfZdZed eeddZ dZ!dddejd dejejejejejejejejejejejejd d d d ejejd d d d d ejd d d d d d dddejddd d ejd d d d d d d ejejejejf8Z"d Z#e!d e"e#d!dZ$dZ%d d dd d dejejejejejejejejejejejejdddejejejdddejdejd d dd dddddejdddejejejdddddejdejejejf8Z&d"Z'e%d e&e'd#dZ(d$Z)ejejejejejejd%d d&d'ddd dd dejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejddddejejejejejejejejejejejejejdddejejejejejejejejejejejejddddejejejejejejejejejejejejejejddejejejejejejejejejejejejd&d&d&d&ejejejejejejejejejejejejejejejd&ejejejejejejejejejejejejd%d%d%d%ejejejejejejejejejejejejejejejd%ejejejejejejejejejejejejd%d%d%ejejejejejejejejejejejejejejejejejejejejejejejejejejejfZ*d(Z+e)d)e*e+d*dZ,d+S),) MachineState(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrZBig5)Z class_tableZ class_factorZ state_tableZchar_len_tablename(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr ) rrrrrrrrrr ZCP949(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrzEUC-JP(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrzEUC-KR(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrrr zx-euc-tw(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r)rrrrrrrZGB2312(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrZ Shift_JIS(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr )rrrrrrzUTF-16BE)rrrrrrzUTF-16LE(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r rrrrrr rrrrrr r)rrrrrrrrrrrrrrr r zUTF-8N)-ZenumsrZBIG5_CLSZERRORZSTARTZITS_MEZBIG5_STZBIG5_CHAR_LEN_TABLEZ BIG5_SM_MODELZ CP949_CLSZCP949_STZCP949_CHAR_LEN_TABLEZCP949_SM_MODELZ EUCJP_CLSZEUCJP_STZEUCJP_CHAR_LEN_TABLEZEUCJP_SM_MODELZ EUCKR_CLSZEUCKR_STZEUCKR_CHAR_LEN_TABLEZEUCKR_SM_MODELZ EUCTW_CLSZEUCTW_STZEUCTW_CHAR_LEN_TABLEZEUCTW_SM_MODELZ GB2312_CLSZ GB2312_STZGB2312_CHAR_LEN_TABLEZGB2312_SM_MODELZSJIS_CLSZSJIS_STZSJIS_CHAR_LEN_TABLEZ SJIS_SM_MODELZ UCS2BE_CLSZ UCS2BE_STZUCS2BE_CHAR_LEN_TABLEZUCS2BE_SM_MODELZ UCS2LE_CLSZ UCS2LE_STZUCS2LE_CHAR_LEN_TABLEZUCS2LE_SM_MODELZUTF8_CLSZUTF8_STZUTF8_CHAR_LEN_TABLEZ UTF8_SM_MODELrr>/usr/lib/python3.8/site-packages/pip/_vendor/chardet/mbcssm.pysP $ $$$ $&$ $ $PKd]1X`/chardet/__pycache__/gb2312prober.cpython-38.pycnu[U ʗRe@sDddlmZddlmZddlmZddlmZGdddeZdS))GB2312DistributionAnalysis)CodingStateMachine)MultiByteCharSetProber)GB2312_SM_MODELcs4eZdZfddZeddZeddZZS) GB2312Probercs(ttt|_t|_|dS)N)super__init__rr coding_smrdistribution_analyzerresetself __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/gb2312prober.pyr#s  zGB2312Prober.__init__cCsdS)NGB2312rr rrr charset_name)szGB2312Prober.charset_namecCsdS)NChineserr rrrlanguage-szGB2312Prober.language)__name__ __module__ __qualname__rpropertyrr __classcell__rrrrr"s   rN) chardistributionrcodingstatemachinermbcharsetproberrmbcssmrrrrrrs    PKd]b)?-chardet/__pycache__/big5prober.cpython-38.pycnu[U ʗRe@sDddlmZddlmZddlmZddlmZGdddeZdS))Big5DistributionAnalysis)CodingStateMachine)MultiByteCharSetProber) BIG5_SM_MODELcs4eZdZfddZeddZeddZZS) Big5Probercs(ttt|_t|_|dS)N)super__init__rr coding_smrdistribution_analyzerresetself __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/big5prober.pyr#s  zBig5Prober.__init__cCsdS)NBig5rr rrr charset_name)szBig5Prober.charset_namecCsdS)NChineserr rrrlanguage-szBig5Prober.language)__name__ __module__ __qualname__rpropertyrr __classcell__rrrrr"s   rN) chardistributionrcodingstatemachinermbcharsetproberrmbcssmrrrrrrs    PKd]a2chardet/__pycache__/mbcsgroupprober.cpython-38.pycnu[U ʗRe@sddlmZddlmZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZdd lmZGd d d eZd S)) Big5Prober)CharSetGroupProber) CP949Prober) EUCJPProber) EUCKRProber) EUCTWProber) GB2312Prober) JOHABProber) SJISProber) UTF8ProbercseZdZdfdd ZZS)MBCSGroupProberNc sDtj|dtttttttt t g |_ | dS)N) lang_filter) super__init__r r rrrrrrr probersreset)selfr  __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/mbcsgroupprober.pyr+s zMBCSGroupProber.__init__)N)__name__ __module__ __qualname__r __classcell__rrrrr *sr N) big5proberrcharsetgroupproberr cp949proberr eucjpproberr euckrproberr euctwproberr gb2312proberr johabproberr sjisproberr utf8proberr r rrrrs          PKd]{D$$ $ 2chardet/__pycache__/escprober.cpython-38.opt-1.pycnu[U .en@sXddlmZddlmZddlmZmZmZddlm Z m Z m Z m Z GdddeZ dS)) CharSetProber)CodingStateMachine)LanguageFilter ProbingState MachineState) HZ_SM_MODELISO2022CN_SM_MODELISO2022JP_SM_MODELISO2022KR_SM_MODELcsVeZdZdZdfdd ZfddZeddZed d Zd d Z d dZ Z S)EscCharSetProberz This CharSetProber uses a "code scheme" approach for detecting encodings, whereby easily recognizable escape or shift sequences are relied on to identify these encodings. Ncstt|j|dg|_|jtj@rD|jtt |jtt |jtj @r`|jtt |jtj @r||jttd|_d|_d|_d|_|dS)N) lang_filter)superr __init__ coding_smr rZCHINESE_SIMPLIFIEDappendrrrZJAPANESEr ZKOREANr active_sm_count_detected_charset_detected_language_statereset)selfr  __class__A/usr/lib/python3.8/site-packages/pip/_vendor/chardet/escprober.pyr*s   zEscCharSetProber.__init__csJtt||jD]}|sqd|_|qt|j|_d|_d|_dS)NT) r r rractivelenrrr)rrrrrr:s   zEscCharSetProber.resetcCs|jSNrrrrr charset_nameEszEscCharSetProber.charset_namecCs|jSr)rrrrrlanguageIszEscCharSetProber.languagecCs|jr dSdSdS)NgGz?grrrrrget_confidenceMszEscCharSetProber.get_confidencecCs|D]}|jD]}|r|jsq||}|tjkrhd|_|jd8_|jdkrtj|_|j Sq|tj krtj |_| |_ |j|_|j Sqq|j S)NFr)rrZ next_staterZERRORrrZNOT_MErstateZITS_MEZFOUND_ITZget_coding_state_machinerr!r)rZbyte_strcrZ coding_staterrrfeedSs"       zEscCharSetProber.feed)N) __name__ __module__ __qualname____doc__rrpropertyr r!r"r& __classcell__rrrrr #s   r N)Z charsetproberrZcodingstatemachinerZenumsrrrZescsmrrr r r rrrrs  PKd]Mv v 5chardet/__pycache__/codingstatemachine.cpython-38.pycnu[U ʗRe @s&ddlZddlmZGdddZdS)N) MachineStatec@sDeZdZdZddZddZddZdd Zd d Ze d d Z dS)CodingStateMachinea A state machine to verify a byte sequence for a particular encoding. For each byte the detector receives, it will feed that byte to every active state machine available, one byte at a time. The state machine changes its state based on its previous state and the byte it receives. There are 3 states in a state machine that are of interest to an auto-detector: START state: This is the state to start with, or a legal byte sequence (i.e. a valid code point) for character has been identified. ME state: This indicates that the state machine identified a byte sequence that is specific to the charset it is designed for and that there is no other possible encoding which can contain this byte sequence. This will to lead to an immediate positive answer for the detector. ERROR state: This indicates the state machine identified an illegal byte sequence for that encoding. This will lead to an immediate negative answer for this encoding. Detector will exclude this encoding from consideration from here on. cCs0||_d|_d|_d|_tt|_|dS)Nr) _model_curr_byte_pos_curr_char_len _curr_statelogging getLogger__name__loggerreset)selfsmr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/codingstatemachine.py__init__8s  zCodingStateMachine.__init__cCs tj|_dSN)rSTARTrrrrrr @szCodingStateMachine.resetcCsh|jd|}|jtjkr0d|_|jd||_|j|jd|}|jd||_|jd7_|jS)N class_tablerchar_len_table class_factor state_tabler)rrrrrr)rc byte_class curr_staterrr next_stateCs zCodingStateMachine.next_statecCs|jSr)rrrrrget_current_charlenPsz&CodingStateMachine.get_current_charlencCs |jdS)Nnamerrrrrget_coding_state_machineSsz+CodingStateMachine.get_coding_state_machinecCs |jdS)Nlanguager rrrrr"VszCodingStateMachine.languageN) r __module__ __qualname____doc__rr rrr!propertyr"rrrrr!s r)r enumsrrrrrrs PKd]gYjv v 6chardet/__pycache__/charsetprober.cpython-38.opt-1.pycnu[U .e@s0ddlZddlZddlmZGdddeZdS)N) ProbingStatec@sneZdZdZdddZddZeddZd d Zed d Z d dZ e ddZ e ddZ e ddZdS) CharSetProbergffffff?NcCsd|_||_tt|_dSN)_state lang_filterloggingZ getLogger__name__Zlogger)selfrr E/usr/lib/python3.8/site-packages/pip/_vendor/chardet/charsetprober.py__init__'szCharSetProber.__init__cCs tj|_dSr)rZ DETECTINGrr r r r reset,szCharSetProber.resetcCsdSrr rr r r charset_name/szCharSetProber.charset_namecCsdSrr )r bufr r r feed3szCharSetProber.feedcCs|jSr)rrr r r state6szCharSetProber.statecCsdS)Ngr rr r r get_confidence:szCharSetProber.get_confidencecCstdd|}|S)Ns([-])+ )resub)rr r r filter_high_byte_only=sz#CharSetProber.filter_high_byte_onlycCs\t}td|}|D]@}||dd|dd}|sL|dkrLd}||q|S)u9 We define three types of bytes: alphabet: english alphabets [a-zA-Z] international: international characters [€-ÿ] marker: everything else [^a-zA-Z€-ÿ] The input buffer can be thought to contain a series of words delimited by markers. This function works to filter all words that contain at least one international character. All contiguous sequences of markers are replaced by a single space ascii character. This filter applies to all scripts which do not use English characters. s%[a-zA-Z]*[-]+[a-zA-Z]*[^a-zA-Z-]?Nr) bytearrayrfindallextendisalpha)rfilteredZwordsZwordZ last_charr r r filter_international_wordsBs  z(CharSetProber.filter_international_wordscCst}d}d}tt|D]n}|||d}|dkr characters. Also retains English alphabet and high byte characters immediately before occurrences of >. This filter can be applied to all scripts which contain both English characters and extended ASCII characters, but is currently only used by ``Latin1Prober``. Frr>s PKd]U3chardet/__pycache__/utf8prober.cpython-38.opt-1.pycnu[U .e @sHddlmZddlmZmZddlmZddlmZGdddeZ dS)) CharSetProber) ProbingState MachineState)CodingStateMachine) UTF8_SM_MODELcsTeZdZdZfddZfddZeddZedd Zd d Z d d Z Z S) UTF8Proberg?cs*tt|tt|_d|_|dS)N)superr__init__rr coding_sm _num_mb_charsresetself __class__B/usr/lib/python3.8/site-packages/pip/_vendor/chardet/utf8prober.pyr &s zUTF8Prober.__init__cs"tt||jd|_dS)N)rrr r r r rrrr ,s zUTF8Prober.resetcCsdS)Nzutf-8rr rrr charset_name1szUTF8Prober.charset_namecCsdS)Nrr rrrlanguage5szUTF8Prober.languagecCs|D]f}|j|}|tjkr,tj|_qlq|tjkrDtj|_qlq|tj kr|j dkr|j d7_ q|j tj kr||jkrtj|_|j S)Nr)r Z next_staterZERRORrZNOT_MEZ_stateZITS_MEZFOUND_ITZSTARTZget_current_charlenr stateZ DETECTINGget_confidenceZSHORTCUT_THRESHOLD)rZbyte_strcZ coding_staterrrfeed9s     zUTF8Prober.feedcCs.d}|jdkr&||j|j9}d|S|SdS)NgGz?g?)r ONE_CHAR_PROB)rZunlikerrrrLs  zUTF8Prober.get_confidence) __name__ __module__ __qualname__rr r propertyrrrr __classcell__rrrrr#s    rN) Z charsetproberrZenumsrrZcodingstatemachinerZmbcssmrrrrrrs   PKd].5chardet/__pycache__/charsetgroupprober.cpython-38.pycnu[U ʗRe@s,ddlmZddlmZGdddeZdS)) CharSetProber) ProbingStatecsReZdZdfdd ZfddZeddZedd Zd d Zd d Z Z S)CharSetGroupProberNcs$tj|dd|_g|_d|_dS)N) lang_filter)super__init__ _active_numprobers_best_guess_prober)selfr __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/charsetgroupprober.pyr!szCharSetGroupProber.__init__csFtd|_|jD]$}|r|d|_|jd7_qd|_dS)NrTr)rresetr r activer )r proberr rrr's  zCharSetGroupProber.resetcCs |js||jsdS|jjSN)r get_confidence charset_namer rrrr1s zCharSetGroupProber.charset_namecCs |js||jsdS|jjSr)r rlanguagerrrrr9s zCharSetGroupProber.languagecCs|jD]~}|sq|jsq||}|s(q|tjkrJ||_tj|_|jS|tjkrd|_|j d8_ |j dkrtj|_|jSq|jS)NFrr) r rfeedrFOUND_ITr _statestateNOT_MEr )r byte_strrrrrrrAs&       zCharSetGroupProber.feedcCs|j}|tjkrdS|tjkr"dSd}d|_|jD]R}|ss  PKd]{`~J~J3chardet/__pycache__/gb2312freq.cpython-38.opt-1.pycnu[U .eP@sdZdZdZdS)g?i(iiii< iTii iQii i iii<iw ii9 i iiiiZ iiiqi i i iW iyiiieioiiv ii i iiii iLiBi iQ iiiQiiiEiifiiiiiiiidi( iyiii,i i i iE iei iWiRiii| iR ii i i iX i ijiEii i+iPiiiii;iim iiliiii iieiHiiiii^ iki6ii" Fi i i i i^ i i iii?i`iui$i1i ii i iUi i1 iiigiliii iiGii2iiq i i iPiiL iiiiiy ii i iMiikii4 iiiiii i i@ i`ii5iiN ii7i3iiniiuiGi&ibihi0i iM iNii i iY i ii ii &i iQi i7i^ihiiiJ iiPiiiiriiiiiiiT i-iGi,iui i ii$iii<iBii$i>iiix iLiWiiini iiTiiZii i i{ iii i ii i?i 0ibi;DiiiiCiSiiUi> i|igi ii i iKi iiii% i5 iiiiil iihi iii?i iUiii ii*i< i i ii i iii ii i! iX iii iiQ igiiii iiri ii iqii iiz ii i3i iii i i]iciziii7 ii_ii iCii&iaiHi| ili ii=iiiIiPi ii~ i8i`i iw i i iTii i iiii iiiii[iq ii igi|iCi ii iN iIiii5 i i(ii/iHiK i iiii9iiIiii|iii i iWii iii^~iiii i i= iXii3i iIiii iiii3iriioi ii i{iiiiC!iHi iifi= ii1[i i| iDii%iitii i ii ii.iiyiiTiii9 i i i#iiJiniiii ii>iBi"iiiai iiMiKi iW i i i i! ir iFi+ i i i iix HiJiiii2KiiR i$ii9i it ii ii iiiiiiiii%i~i i` iiii'iviii ii|i'i iin i*ii iiFii%i)i~ii iiiJi&ii i!iD iiwii[i ii i i i' i ikiii i i iiiiiih Bi_i i?iigihii'iiiiiiiiiiii5i] ii iiiiiii1 ii)ia iiiii; iii_iiQi/iu i i iji[ii}ii iii iiiiQi^ i iGiizi iiiViOii ii ii imiui i6ii i-i$i iiRii} i ipir i] i iDi iiiiiiiiiiii1iniiiitiYiG i i i/ i|ti0i iiiii\i i iivii iiciiii i~iAi"ii" i!i8Ci8 ii iji i1iili>i ii] i i i~iLi(iiiKidviDiiii%i iii i, i2ii iiij -i.i imiKi iioi i;i ii idi@iai iM i1 iLi@i2 iiwiitiQi i/ii ii~iiiii i/ii i_ i#i OiiOiGiiki[iOioii- i ii i!i i iIiiii{iri i.ihi i iT iii'iL aii i@ii iii iT i/ iiiii iiMiii il iii i{i8i#i iii9iiSiRi wiiZii0 iEigig ii iLiiipiiiSi iiiii i@iiI iLi; iOiqiii) i i:iFii5iJidiA ii i) iEiLYiiii im i ii i iiic iiRii!iiii i(iii]Iii i iieiiii iii`ii iii ii[iiC i(iPi,i i}iO i' iLi\ i i i iiiiZiiisi'i iUiiiiiN iii i iiMiiiiii iiiiigi'iii ii Pi0 is iiiip i iniiii i\i iii i!ihimi(i& i iCiiBi)i5 iiiiii ii>iii i i{iNiiiiEi3Ji#iicii ii$ i5iixi i]iiiki iiiiP ii iiiriiL i izidiii#i iii[ iSiihiiGiiiii iU+i iyiwi"iiVi2 i&izi i iiJ iP i iiii% iZi$ io iT iKi1 i ii`iVi ii id i iii+i iiAii iiii$ii i_i3i\ iiiibi ifiiii iAiniixiFi iOi[ii(i ii i#i7i2 ixiif i i i!i6i{ iiYiii+iiiii iiii i iKiei i i iTi$iiiih ii iRiii"i iZi i_ ii@iiai iii3 i iki)ijiii ieii iA i^ii iW iiihi: iz i) ii| iii ii i8 iji iii3i i iziipiyi i i2 ioiD i=i.ii9 iaifii*i_ii i*ii i i ii i- ii i}ii i ii* i ititi6 qiiiiiii iSi iii!i)iiyi ii ij ii iiViIiiig iiiLii iipiDii i ii%ii iM iiii$i i iiE i"iU iie i i|i iQiii ii ii i1 iiii$i i]i4i&iiiziii`iiwi iiii i)i% i&iiii*iii8i2i> iSi iii1i#i ii ii#i i iiii iF iii, i> i+i i iiZ 3iqi i$ii iVi i;iiiNimiKiWiii5i i Ri4i iIiiDiiii i i i iiii%iKi|iii iii9iin iii i-i3 i2 ipii? ii~iiiiiiCii[ii iii i3 i> iili i`ix iiii i# iiii0iii iL i iiQiiRii?i(imii` ii3iiii& i ii isiDii0 ib ifi@ i iii ii=i i i<iii ii6iiis iii iSiii i8iZ iii ii iii i ii iiiiNi i i iLi iJ iii ibiig iii[ iiiiii~ ii i iiifiiiii i i` i4i= iiiili? iici ii iiii iiiiiiiiwiii i%ii id i^i+iii iZiF iI iit i /i iiiyi* isi&i+iii) iii iii i i ie iiiQi] ii i_i7 ii0ciuiiiLiki iiii#iiiiiii?iii ini i iii iii iHiiYiiu ii i iiJii_ i_i&iiii iiiZi%i isiiSii i iViiiiii1i'iiFi\i i|i iWiii|iSWi i* i iRiliPi#i i i-iq ii i ii4iiiiiia iiiii@ i iXiii%iii8 i3i,ii} iiidixi ii# ii6i i i.iiiAi iir i i iR idiii+ iiii i{i{iHi i iiiiiici i i iii,iiI iici ii iii=i iJi. i,i>iiiiLiei]ii iC iiii*i; i ii iipi iiiRii9 i i ii iii?i:i i i iQi'isiiwi[i ii-i i)iiMiiiii]}i6i@i iiUiiii/iiis i iiik i? ii, i= i1iMi iii/iS id iio i6 ikiui iiiW{iixiWii iiiix i^ ii[ i+ 7i:iiU iii!iii i.iHiTiiYiii ii@i"iCisi i i iG bii7i~i. iUi iqi iiii{iiiYi/i iiiAi ii*i:i8i'i i ii iiA i_i0iiiiiiiiKi i iit i* iii iiii i i iiDiiii>iiivii i i'iViii iiikii i\iiii!i i*iU iiiiiizii\if iii i iii iiii i iiB iii iii{i=i i&i iiV i i"i! i i iii i( i=ii i ii9i ii4iaii-iQ i ii imiiiiiCiii7i}iqiDi4iuii iiiv iiiF iiu ia iiH ioi i iliKiA iii izi4 i i! iH ii i5 iijii`ii iB i:iOiai i#iiidii(i i& ii^imig iE iio ii(iG i$i@i iIiiiAi i`Xii7ii/ii$ii iihiiii iUi"iTiiiimii!iiiiii iiMi iii 2iqii9iii iiii/iii pi@iX iijii i^ ibi i iniiviiioioiiviii0ii9ii$ iifiS izi iiDi{iiXii iVi3 iYi ii iAiiiiiqiU i i: ii2iji ii i{ ii iFi i i ii iiiciiiR i;ik hii i iiY iOixiziZi<iv ii i i iiIiii4 iMiiiiib iiii ii iiCii iiiO ii8iii i.i]i iVic i iii iH iiTiii ii> i ii i3ii,iiifiiiiliTiWiHi.i'i>ipiiii"ii iJii i ivi2iii ixi i2iigi i4iii i iii{ iz i i i iii iiiiii?iii iJiiii i i8iE ij \ii8i8 ii iii`ii>ibiSiii i iii0i iiiEi iidiiii1iiin@ii iiTii iiQiCii iK i;ikiiiiii_i\ ieiiwiiiiiMii. iriaiii i ii iiiigii i' i iii i Tiii4ioii iXiyiixii i i iU ^i: iiii ii"i#iii ii iiiiNiUiiip i" i-i i ii:ii ii iiii iiW i iG iLii iGiw oiii iMir ii iiQ iiI iN%i iXiii i7 i iaii ii i' iiihi i}iNiyi?itii iD iiii liiii iie iJisi2i*iyiiiiii iiqi ii5i}is i$iiii5 iBiii# idisi} ii~iiib iiO i/ ]iii i]i2iifi7iiiOi iRii# i i[iEii if iS i idiFiiiC iV i>ii iiBii i i1i6imii iiiip i ii i i<izi i| iXiiisie i]iii i iiOi i+i iiiiii:i iAii ii ii( i imi4iP i inii ioioiiimiiyii8i i<iii<ic iC iii&iwi i i$i i9i&ii i)i`iiiiiiGibiEii:iQio iF i iii i iFi|i;i iii3i4 i%i:i iciipi6 i\iCii0i9 ii iiii~ iii"ih iiii i)ii i iii* ii i i i%ii iiii i.iii9i iii iii ii"i! ii, i ig iJ igiF iiii ii;ii iZiEi^iA iiili5ii ii4i' iiiki ii i2ii ii iXi7ii i{iiBixi=ei(i iii'iiiiiiiiii iD iiikii iii-i, i iei7 i ii iiini} ip i7ijii ii9ii iii0iPi iiiiiO i i i iUi iii< iii iJiitiNii)i i.ii*i iAir i] i)iiiiiGii_ ipik iii i% i ii ii>ibi_i^?ii:iYiDi%ii iiiiiYii i iiiiil Aii i i iDiBi i ii i@ i(iv iiigi i i}iviiii iiiii iiiiiiii i-i~iiy i%i i _i iiiiijiMi iiGi+i iii iiii3 i;i Gi)ii iii i ii ii i ii,iIi iii iXiAi\iiiP ivii iVii=i i i6 i<iiX i i i ii8 i- iY iiiii iiciiii9i i- iuii ii iR i i ii6ii iih i}i i? iw i ii ia i( i i1ii ii>iii i ii]i iXiriPi0 i,ii+ ijii`iiiii. iii ii& iWiB iii|i7 Uii iWiiYii iiw i iii iiiiiuiibiiq iiibiii =i$ iiNiJiiiUiiii iiiiKi,iii4iri{i iiHiipi5iii=i i iEi9ii;i <ii5i iii ii\iiipiiiiriNiii^iiiiiK ii i*ii{ i+ i ii*i8iiii iiii ij ii@il 6ii2i8ii iiii'iiiiB iiii\iiiS iV ii~iiiii i iiVi iz i i^i i iii_ i} iG iqiI i ii8itihiS ii}iRi i9Sin iPiiB iiisiiXi}ifiiii iiiiiin iIi^iTiixiiriii_ibiiOiPiQiRiSN)Z!GB2312_TYPICAL_DISTRIBUTION_RATIOZGB2312_TABLE_SIZEZGB2312_CHAR_TO_FREQ_ORDERrrB/usr/lib/python3.8/site-packages/pip/_vendor/chardet/gb2312freq.py*sPKd]3 3 .chardet/__pycache__/enums.cpython-38.opt-1.pycnu[U .e}@shdZGdddeZGdddeZGdddeZGdddeZGd d d eZGd d d eZd S)zr All of the Enums that are used throughout the chardet package. :author: Dan Blanchard (dan.blanchard@gmail.com) c@seZdZdZdZdZdZdS) InputStatezS This enum represents the different states a universal detector can be in. N)__name__ __module__ __qualname____doc__Z PURE_ASCIIZ ESC_ASCIIZ HIGH_BYTEr r =/usr/lib/python3.8/site-packages/pip/_vendor/chardet/enums.pyrsrc@s<eZdZdZdZdZdZdZdZdZ eeBZ e eBeBZ dS) LanguageFilterzj This enum represents the different language filters we can apply to a ``UniversalDetector``. rrN) rrrrZCHINESE_SIMPLIFIEDZCHINESE_TRADITIONALZJAPANESEZKOREANZNON_CJKZALLZCHINESEZCJKr r r r r sr c@seZdZdZdZdZdZdS) ProbingStatezG This enum represents the different states a prober can be in. rrrN)rrrrZ DETECTINGZFOUND_ITZNOT_MEr r r r r src@seZdZdZdZdZdZdS) MachineStatezN This enum represents the different states a state machine can be in. rrrN)rrrrZSTARTZERRORZITS_MEr r r r r)src@s,eZdZdZdZdZdZdZeddZ dS) SequenceLikelihoodzX This enum represents the likelihood of a character following the previous one. rrrcCsdS)z::returns: The number of likelihood categories in the enum.r r )clsr r r get_num_categories;sz%SequenceLikelihood.get_num_categoriesN) rrrrZNEGATIVEZUNLIKELYZLIKELYZPOSITIVE classmethodrr r r r r2src@s$eZdZdZdZdZdZdZdZdS)CharacterCategoryz This enum represents the different categories language models for ``SingleByteCharsetProber`` put characters into. Anything less than CONTROL is considered a letter. N) rrrrZ UNDEFINEDZ LINE_BREAKZSYMBOLZDIGITZCONTROLr r r r rAs rN)robjectrr rrrrr r r r s    PKd]RbYY5chardet/__pycache__/gb2312prober.cpython-38.opt-1.pycnu[U .e@sDddlmZddlmZddlmZddlmZGdddeZdS))MultiByteCharSetProber)CodingStateMachine)GB2312DistributionAnalysis)GB2312_SM_MODELcs4eZdZfddZeddZeddZZS) GB2312Probercs,tt|tt|_t|_|dS)N) superr__init__rrZ coding_smrZdistribution_analyzerresetself __class__D/usr/lib/python3.8/site-packages/pip/_vendor/chardet/gb2312prober.pyr"s zGB2312Prober.__init__cCsdS)NZGB2312rr rrr charset_name(szGB2312Prober.charset_namecCsdS)NZChineserr rrrlanguage,szGB2312Prober.language)__name__ __module__ __qualname__rpropertyrr __classcell__rrr rr!s   rN) ZmbcharsetproberrZcodingstatemachinerZchardistributionrZmbcssmrrrrrrs    PKd]Z,qq:chardet/__pycache__/langcyrillicmodel.cpython-38.opt-1.pycnu[U .eF@sdZdZdZdZdZdZdZeeddd d d Zeeddd d d Zeeddd d d Z eedddd d Z eedddd d Z eedddd d Z dS)(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrJKrrrrrrGBAL@MHECNIOrrrrrDrr '    6;%,:)05.7*<$1&"#+- (48!=>39/?2F(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrr9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqr\rrrsrtrurvrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxryrr~r{r|rrrrrrrrrrrrrrr}rrzrrrrrrrrwr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrr9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r]r^r_r`rarbrcrdrerfrgrhrirrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxryrr~r{r|rrrrrrrrrrrrrrr}rrzrrrrrrrrwrrjr\rkrlrmrnrorprqrrrsrtrurvrr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrr\rrxryrr~r{r|rrrrrrrrrrrrrrr}rrzrrrrrrrrwr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrr9r:r;r<r\r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrwrrrrxrryrrzrr{rr|rr}rr~rrTrUrVrWrXrYrZrrrrr[r]r^r_rrr`rarbrcrdrerfrrrgrhrirjrkrlrmrnrrrrrrrrrrorprqrrrrrsrrrrrrrrrrrrrrrrtrurrrrrrrrrrrrrvrr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxryrr~r{r|rrrrrrrrrrr9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r]r^r_r`rarbrcrdrerfrgrhrirrrrr}rrzrrrrrrrrwrrjr\rkrlrmrnrorprqrrrsrtrurvrr(rxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrrrxrxrxrxrrxrxrxr|rxr|rxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrrxr|r|r|r|r|rrr|rxrxrxr|rxrxrxrxrxrxrxrxrxrxr|rxrxrrrxrxrxrxrxrxrxrxrxr|rxr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxr|r|rxrxrxrxrxrxrxrxrxr|rxrxrrrxrxrxrxrxrxrxrxr|rxrxrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxr|rxr|rxrxrxrxrxrxrxrxrxrxrxrxrxrrrxrxrxrxrxrxrxrxrxrxrxr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxrxrxrxrxrxrxrxrxr|rxrxrrrxrxrxrxrxrxrxrxrxrxrxr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxrxrxr|r|r|rxrrxrxrrxrxrxrxr|r|rxrr|r|r|rxrxr|rrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxr|rxrxrxrxrxr|r|rxr|rxrxrxr|rr|r|rrr|r|r|r|r|r|rrrrrrrrr|rrrrrrrrrrrrrrr|rrrrrrrrrrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxr|r|r|rxrr|r|rxrxr|rr|rrrrrrrrr|rrrrrrrrrrrrrrr|rrrrrrrrrrxrxrxrxrxrxr|rxrxrr|rxr|r|rxr|rxrxrxrxr|r|rxrrxr|r|rxrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxrxrxr|r|rxrxrxrxrxr|rxrxrxrxr|r|r|rrxrxrxr|r|r|r|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxrxrxrxrxr|rxr|rxrxrxrxrxrxr|rxr|r|rrrxr|rr|r|rrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrxrxrxrxrxrxrxrxrxrxrxr|rrrxrrrrrr|rrrr|r|r|rr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxr|rxrxr|r|r|r|rrxr|rxr|rxr|rr|r|rrrr|rr|rr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxrxrxrxrxrxrxr|r|rxr|rxrxrxr|r|r|r|rr|r|r|r|rxrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrxr|rxr|r|rxrxrxrxrxrxrxrxrxrrxr|rrrxrxrxrxr|rxrxrxrxr|rxr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrr|rxrxrxrxrxr|r|rxrxrr|rrrxr|rxr|rxrrrr|rrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrrxrr|rxrxrxrxr|rxrxrxrxrr|r|rrr|rxr|r|r|rxr|rxr|r|rxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxr|rxrr|rxr|rxrrr|rxrxr|rr|rxrrr|rxr|r|rrrxrrxr|r|rrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrrxrr|rxrxrxrxrxrxrxrxr|rrxr|rrr|r|rxrxrxr|rxrxrr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxr|r|rxrxr|r|r|rxrxrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxr|r|rxrxrxrxrxrxrxrrxr|rxrxr|rxr|rr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrxrxrxrxrxrxr|rxrxrxr|r|r|r|rxrrxr|rxrrr|rrr|r|r|r|rrxrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrr|r|rxrxrxrxrxrr|r|rrxrrrxrrrxrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxr|r|rrrxrxrxr|r|rr|r|rxrrr|rrr|r|rrxrrr|rrr|rrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxr|rxrxrxrxrr|r|r|rr|rrxrxrrr|rr|rr|r|rr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rxrxrxrxrxr|rrxr|r|rxr|rrxr|rrxrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxr|rxrxrxr|r|r|rxrxrr|rr|rrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrrr|rr|rxrxr|r|rr|r|rxrr|rrrr|r|rxr|rr|r|r|r|r|rxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrrrrrr|r|rrrxrrrrxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrxrxrxr|rrrr|rrrrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrr|rxr|r|r|rr|r|r|rr|rrrrrrrr|rrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrr|rxrxrxrxrrrrrrrrrrxrrr|rrrrrrrrrrrrrrrrrrrr|rrrrr|rrrrrrrrrrrrrrrrrrrrrr|r|rxr|r|r|rxrr|r|r|r|r|r|r|r|rrrrrrrrrrrrrrr|rrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrxrxrxr|r|r|r|rxr|r|rrr|r|r|r|rrrxrr|rr|rrrrrrrr|rrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrxr|r|r|r|rr|rr|rr|rrrr|rr|r|rrr|r|rrrrr|rrrrrrrrrr|rrrr|rrrr|rrrrrrrrrrrrrrrrxr|r|r|rrrr|rxrrrrr|rr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrr|rxr|rxr|rr|r|r|r|rrrrr|rrrrrrrrrrrrrrrr|rrrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrxrrrrr|r|r|rxr|r|r|r|r|r|r|rrrr|rr|rrrr|r|rrrrr|rrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrr|rxr|rxrxr|rrrrrrrrr|rrrrxrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rxrxrxrxrr|r|r|r|rrrrr|rrrr|rrrrrrrrrrrr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrr|rxrxrxr|rrrrr|r|rrrr|rrrrxrrrrrrrrrrrr|rrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxr|rxr|rrrr|r|r|rrrr|rrrrrrrrrrxrrrrrr|rrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrxrr|rrr|r|r|r|r|r|rr|r|rrrrrr|r|r|rrrrr|rrrrrr|rrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrxrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrxr|r|rrrr|r|rrrrr|rrrr|rrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rxr|rxr|rrrrrrrrrr|rr|rr|rrrrrrrrrrrrrrrr|rrr|rrrrr|rrrrrr|rrrrrrrrrrrrrrrrrxr|r|r|rrrr|r|rrrr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rxrr|r|r|r|r|r|rrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rr|rrrrrxr|rr|rr|r|rrrrrr|rrrr|rrrrrr|rr|r|rrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrr|r|r|r|rrrrrrrrrr|rrrrrrrrrrrrr|rrr|rrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrr|rr|r|r|rrxrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|rxr|r|rrrrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|rrr|rr|r|r|r|r|rr|r|rrrrrrr|r|r|rr|rrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|r|rrrr|r|rrrrr|rrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|r|rrrr|r|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|r|rrrrrrrrrr|rrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|rrr|rr|rrrrrr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrglP@?FzKOI8-RZRussian)Zchar_to_order_mapZprecedence_matrixZtypical_positive_ratioZkeep_english_letterZ charset_nameZlanguagez windows-1251z ISO-8859-5Z MacCyrillicZIBM866ZIBM855N) ZKOI8R_char_to_order_mapZwin1251_char_to_order_mapZlatin5_char_to_order_mapZmacCyrillic_char_to_order_mapZIBM855_char_to_order_mapZIBM866_char_to_order_mapZRussianLangModelZ Koi8rModelZWin1251CyrillicModelZLatin5CyrillicModelZMacCyrillicModelZ Ibm866ModelZ Ibm855ModelrrI/usr/lib/python3.8/site-packages/pip/_vendor/chardet/langcyrillicmodel.pysb     PKd]TVV*chardet/__pycache__/jisfreq.cpython-38.pycnu[U ʗRed@sdZdZdZdS)g@i((i'iOii}i ii ii] i i ii iiiiii iiiXi}iiikig i i ikiiiiiiii%i&01,-iiiiiii iii<iiipiiiiiiigiiiiWiXii ih i"iiiii i ii\iii i/ ii iiiii0 ii ihi iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiiiii ii!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7iiViji4iiiiBiii8i9i:i;i<i=i>iviiiiSiieiifi iid i+iiiaiw iiiiIii~ii ii?i@iAiBiCiDi ii- i iiiii iiEi^ i. i i3iii iFi/ iYi i iiiji iiGiHiIiJiqi1 iYik/i2#i *[\5i!i! %@il'iA 4 <ii-ii7Si~iKi=E;7i7i8m& OiK=i~idiLiMiNiOiPiQiRiSiTiUiVY>J"ip piTi_i.XiLijei9P ilyii Di )ihi F?+iiigciB]iN8j:i5iii7Ri4Gdinihit63$WCi i: ix ii*iV i iWiXiYiZi[i\i]i^i_i`iiaibicidieifigihiiijikiliminioipiqirisiti iuiviwixiyizi{i|iiiiili}i i~iii i i iiii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiikii i> i i i i i ij iiiZi[i\i]ii ii ii i i i i iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i iiiiiii2 iii{iTiia i i^iii|i i=iimik i i ii iViy i ii iq iiii i iiii!ii ii ii iCiOi3iiiiiir iiinii+iiii ipiqi i; Ai iiiCi0 iini iiiTiCioi ii i# iii~iiPiiiiii ii i i$ iz ii i&iiiii iiiii_iiUii is i ii iIiiiiiiii3 iii$iWi1 i5iPi iiiiiiiX iiiil iiiHii iiiiii i iWii~ipii$iiii@iLi i iiiiuii iJiI iW iii_ii i<iiii]iDiiiiihiiiiifi-i}it ii iiii,i ibiiiXiiiFii{ i`iii+i3iqiimii4 iiiiiiBiliX i ii% iii% i2 iuii i iiJii|irii@i iii iii ii iL iiiiiiib iJ i icii iiiii4 iRiim iTiii iiiiiie iii? i iiiii-i ii*iEi ii+i ii& i iii/iii.isi[ii+ii ii iBic iiiiii i) ii,i iu ii ii9i& iiiiiiv iiY i i3 ii iiiiDiiiiidiii| i(iyiiiii<i8i iiii i id i5 iBiini iiiii|i i!ii)i@ in imi i i0iaiii zi'ii iWii[iviii iii io i i ii iii' ii i"iii9iii iiJiiihiiie ii\iiip i@iiQi9iii iiiw iiiEiiJiIi iiiiiifii ii i i1i ii iii' iri iiii iiici iqiixiii i2iiiii i*iiibiFiiviidi iii!iRiiiQiiiiPiiiiiiii( iii_ ii` iiif ii6 iiAiiia iiiuiTi i2iiiiii i^iCii ii[ii ivi%iiiini!iFiiZi^iiiidiiiix iii]i iBiici i iiiPiqi i iHiY iii( ii iigi}iKi iii4 iiWii iiCig i-idiikii4i} iiq i~ i+i iiihi@ i i i@iA iDi:iiiei iiqiwiiiiiiiidiiZii* iM i[iiisiZ i i ii>ii'i-i i ii ii) iiiiitiFi7 iiti#iiiiiiYiiifikib i1ii ii6ioic iiqi iiii iuii:iiiN iiUi=i iviilNiiii]ii;iii iiiliLi i}iiiiiB i8 iQii#i`iTii ixiiri iiiiii ii3iniiiiiii{iii@i iiii9 ii5 ih id iZ iiiiiiiiisi-ir iiiii[ ii0iiiii.iSi iRiO iii ii;i i4iy i i;iiz iipii i i ii: i(i|i ii"iiiiii iOiieiii iC iti) ii6Kiii8iiP iihii ii ii3i$iii* i=bie ii i4iii i.i7ii\ iiiiji iiiiiii/iii i=ii^ii5 i ii i\iiiii9i#i+ i is i,ii7iiiYiii iMii+ ii iQii6 iiiiiiyi iisi#i{ i iUifi<iiiviii)i iiiiiimi<iii iiigii lii iD ibiui i iDiBiii i[ i ii8iii>i iii iiii i] iiDiii6iZii i5ii i i<imi i, i iiui^ i iiigiiIiiigi ii\i:i iMti iiEioiiiiEiRii iiEij igiWiiiKi iCii=ii]i$i!ii iii`iKiviii0ii^i i3ii"iiiiaik ii; iwiiiiiii iyiiiiiPiii iwiiit i iii iiiJiaiii]iiii iiiiLihiiii iu ijiii#iCiii iai!si| ii iYii iiiihiOi5iiiziii iSiiLii.ii&ii i< i7iisiA iiiMi iisii*i, i%i i iikii&ifiOiji"ii(i-ii[iii ii- i=ii} iiMiSiii iiiii ii i i ii ii~ iiJitikivieiyiii< i if iiMki iiioiiiwiv ilii]iii.i iiii/if iqi$ig iiGinii>i6 i= ii iii iNi ixiiei* iih iiii$iiiioibi,ii iiitiii i ii iVii iiiiiiiw iiipiHi Viiii<iZi i8riwii&i ii/iiiii>ii> iE ixii&ieiiwi iii5iii ii\iiiSii iiii2iiii+i'ii%iiix iOii iQ iiiiiii_Hiiii igiiiy ii i0i&i+ i iiii il i'ii'izii i ii_ iiii i ii? i ii iz iim i|i ii ig i0iii ii*ii i i`iwiii i#ici)iiiR i iiTiiriiViiii_iiiiiriii i` ixiii iiifiiin i= i*iAii i(ixiS i{iT ii9iiiMi irii;ii(ii%ii[ia ib iiiDiiii- i\ iii iio iEimi)ii!iiic ii, i1ii] iii>iIii iTiiii iiiyiikizixiiNi iiii i5i i i"iiHi<id ii iiih i ii ip iii:iLi1iii iii> iiq i?iZiMiIi iiB iK iDii#i i iYi>iiii`iiiiiiiiiiiii iiiciiiiiiTiiaii2iyi/ii"iU ibii ii/ii ii i i{i iij i i5i*iiiiiaixiii iiFiiii7 iii i?iwiiiiii+ii8 ii iNi iii,iinii i i ioisi_i?ii iii i iii?i0i i iiyi3ifi i=iiilii iivi]ii i iiizi iiyijiiui iipiijii iiiziiir iiiiiiiiiFii'i i{ ini ixui$iiiiMiiik iipi i^ iqi i`i|ii ii i| i i i ii i iiii iGi ii-iiZi1iYii- i ieiii[iC iiie i i.i-iiii iii i i7 ibil i iii{ii.i i iizii i ii? iii9 ii iiii}ii iaii i Qi idi;iV ii/i^iD ii?im i i i9iIi iii iii i{i}i iiiii&ii~iiXii i} i ii9i ii:ii"i\iii i_ i8iWi~ i^i%iPisi iwii ii8 i iLiii. iii iiiNiiPiiSiiii:iRi'i0ibiii iiiiizii iiiiiKii i iriiqi iiin iL iiiiiiiiiiXi@ iigiii4ii: iiiiri iiQi ii i;i'i i>iibimiiwiiis iiiiA iit i9 iiiii io i^iii2iiciii i iriii i!iitii1i{i iiiiisiiiii ixiviaip iii iiLiOiiiUi i.ii)i. iiEi i"iiyii iiii(i iiiq iE i6i i i2iui6i iiii. iii iiiViiisi iiiGiGijitiiWii iii`iiiiui ii ii{iQii iOiCi ii iiJi i i i$iiii/ iii_iiiij iRii7iii/ ii3iDiu i6iXi4iii iiii>iiii0 i`i` i iiiiUii i irii i)ii5iiHii iii~ir ii iiiii ii]iiiiiii i@ iii iaiiviiii/i!i6iiii7iwi i i3ici8ixii iiB iiiM iiF iigiiii(ii i: iiiHii if ii"i i~iii i iyii i ii i!iNi i4iA iidieiziiii iiii0 ii iiiiiii{iii i iifi(iliiGi ii^iB imiF i|iiUiii2iRiii#ii iiiFi Uiiii1i icikiiN iSi i iii$iO ii iYiiii iiGi iiiW i iC i?i ii~iiiUiFiiiiiiii iC i iiiiei iiiii/ iQi_iv i; i i iPi)iGimi iiiG i,iIiz_i i i9inii iAi i iX ii#iVi)i< i%ii}iiiHiw i5iipi.iiiimiiii i#ihi|ibii ii@i(i^izi iiAi i i i"i ig ii|iiiii6iiXiii,iii iii$i#iIik iiiii:i iiQi ioih iVi$i iitiiiiY i,iii i iD ii i~i i iii%iii iii ii i i7i/i ii iEiVii iE iuii&iiii i iioiiiZiiiii i iiii!iini8ii'iiiiiii iiGi iRi2iii:ii,iiZ ilii(iXiP i?ii i ioiiiii iiWi*ii;i8ii&i)ii i ioiiiiiHi_iii0iix ii0 ii; ii iiiXii ii1iZi*i%i i|idi`iiiSiji}i\iiiiG i ii ifqi%iBii1 ipii"iiiii i|iiii iil i2 i i iii@ihii;iii ii iii&iiii}ii%i iii i?ii iia iy ii iii ii= i1 ii<ii{i#iiii iAii iitiii ii> i iKi3 iii=ii\i i i'iAi+igiib iKiiiii ii ii4 ii*iim i ii ioiNii0i(ii ii$i4i i{i iiiQ iiiUiiii,i`ii iii ij i)i ii-i6i iF i2i)ii i*i iYN)JIS_TYPICAL_DISTRIBUTION_RATIOJIS_TABLE_SIZEJIS_CHAR_TO_FREQ_ORDERrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/jisfreq.py,sPKd]Oи..2chardet/__pycache__/euckrfreq.cpython-38.opt-1.pycnu[U .e4@sdZdZdZdS)g@0 (0 xitiiiiHiaiiii+iWiuihii]iiiiiiiiiiiviwiiiimiFi!ipii iiiiiixi/iiiiiiii9iiitii-iyiKiiiiiiOiiniiiiiii0i<i4{iiiiiiiiiriiiiiiiiiiiiXiXiiiiYiii&iiPiiiiiiii^iiiiiii9iiiiiiiQii"itiiii]i{i7iii{ii;iiuiizi/ii|iiii7iii.iiiiiiiiiiiiii{iiii#i|i}ii~iiti8ii_i i i i i i!iiii_iiiiiii*iiuii`i"iii|iiiiiiiaiiiiiii?iiRi!i i/iii!i"i=iii#ii$i%i&i'i(i)i,ii'ibi$i*ii+ii-ii,iiiiii&iUiii#iii-i.'iiifi/isii0iiiiii ii9ie[i1iiiiZiii:iiii2i3iiGiiiyi4iiii5i6i7i,wiiisi8ii9i:iii~i;ii<i;i}i=i>i?ioi)iii@iiAiBiii2iYiCiDii<iEiFiGiHiIi%iJiKiLiMiNiOi`i>iPii=iQiiRiiSiTi;iiiii iUiiViWiXi4iYiiZi[ii\i]ii^iii_"iPiii`i;ii~iHiaivizi?iiiibiii<iciddieific0iidiigiyiiihiisi0iji=ikiiliiii<ibiiUi iiiiIiminioiipiqirisitiuiiii6iviwii*i]ixiyiiiziZi-:ibi i{i|i&i'iii5iiii>i}i~iwiigiiii6ii%ii(iviiiwiiiEiiiiiiiiiifiVii7iiiiiBiNii[ii'iiiiiiiSiiiiiieiiixiiiiiiiiiiiiiiiiiiiii?iiiiiqiifii(i)iii~ii\iiiiii)iiiiiiiiiii$iiiiiliiii~iiiCiiii@iiiii2iiKiiziViiiQirifiiii ihi+i3ii1i iiigi(iiiiziiiiiiiiiiiiiiiiiAi<ijiiiMigii2iiiiiiiiiiVihiiiJiii0ibiiiiiiiYiiiai!*iiiiKiDi8iiRiiBi@iiiiiiiiyiiiiiiXi:iii#iiiiiiGiiikiii=iii!iiiJi=iii}iiijiiiiiiiiiiiiiEiiiiijiO4iiiiiiiii ivi]iiCiiiiiiiioiiii iiiliciAiiiiiiiiiTiiikiiii3i*iqii>iiiiiii+iiiii;ipiixiiii iiiii ii i ii i iiiliiiiii)iimi8iiiDiiiii iiiiiii7iLBiiiDiiiiiitiiii i!i i"i#i$i%iRi&i'i(i)i*i+i,i,i-i.mii i^i/iciiEiiiiaimi0iEi1i2i3iiii4iTiiii5iiiii6i7iiniiioi8i9iFiiii:iGi;i<i=i>i?i@iAiBiCiDiEi$iFiGiii%iiipiHiIiJiKiLiiiiiiiiMiNiOiPiQiRiiSi/iTiiUiiiiViIiHiiiiiWiiXiqiYiZi[i\iiriisi]i^i_i` iviLiai.iibiFi>iijicZiiiBi6ii`idieii|iifiii5igiihiiiHijiiikiilii1iminioipiqiriCisitiuiviwiixiyizi{iii|i}i~iiiiiiiiOiiiiiiiiiiiiiEiiiqiiiIii\ii-iiiSiii iieiiiliiMQiPiii^ii i-iFiiiiiiiiiiiiiiiiiii i.iitiiiiiJiiiiiiiigiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiuiiii9i iiii ii$iiiii5i%ikLiiiiiiiiiiAiiiiiiiiiRiuiiiiii)iii:iiiiii"i$iviiciZiiiii*iWiiKiiLi+iiiiiii iBii?iiiiiiiiMi[i5iiiiniiiiCii'iiiiiiiii iiii iiiiiiiFiTi/iiii8iuiiiiKii(iMiiiiiiiiiiiiTi?iiiiiiei i(iiiiii%i0iOii i8i i i i i iii i i i#i iVi iiPi  MiWii ii ii|i i Siiiiiii i iii i i i i i ii i 9Diiii 3iii i i i{i iii i i ii iiiii! ikiiiiNiYii" i# i$ i% i& i' i( i]i) i* i+ i, i- i. ii/ ii>iri1 iiii\ii2 ii3 iii4 i5 i6 iwi7 ii8 ii3iiii9 i: iL i; i< iiiiiii iiii= iiJi> i? i@ iiA iB iC iD iiE iiiF iG iH iI iiiiiiiJ iK iiiL iM iN iiIiO iP iiQ iR iS iiT iiU iV iW iX iiY iZ i[ i\ i] iii^ i_ i` ia iiib ic id ie iiif ig iUiixi ih iiii ij iii4i&iii!iiiSiyi iii"i ii#ik iil im in iiipiQii.io iUiOiip iiq ir is ixit iiu iv iw iii$ix iiy ii`iz i{ i| i} i~ i i i i i i i iCiiii%iyiiioi ii i i i i i ii i i i iii iii i i@iii iGi iiii2iiii i i i iNi i iiiii i i i i ri iiziniiiPi i#i i&iQi iimi iciii i'i iwi i i(ili@iiii)ii*i i i i ii i i i iii iii i i iHii i ii iii i i ii i iri iiAi iiii }i,iii:iiii iiIi iNii1i iWiiiiii i+i i 1iibii iqi i,i iieii_iidi i i i i i ii2iiii i i i i ii ii i ii-i iii i i i i i ii i i i i i ii ii i i7i ii ii i i i i i i iiiiii,iGiiii ii^i i i.i igii ii i i iii iiii_ii i i iihihii{i i|iii3i i i iii i i \iiiii i i i i i i i i i i iiii iji iiii4ii i i i i i ii i i i i6idi/i i iiioi iiRii &i kniziii ii iXiidiiSii}i i}iii~iiiii i! iNi" iiiiii# iisi$ i% i& fiDii1i' iii( i@i) ^ii* ii+ i, i- i. i/ iJi+i0 i1 i2 iiTii3 i4 i5 i6 i7 iAi.iiii8 i9 ii"i: i; ii< i= i> iii0i? ii@ iiA iB iiC iD iE iF iG iii_i[iH iI iii`iaiJ iiiiiK iL iM iN iO iiiiiiiP iQ iR N)Z EUCKR_TYPICAL_DISTRIBUTION_RATIOZEUCKR_TABLE_SIZEZEUCKR_CHAR_TO_FREQ_ORDERrrA/usr/lib/python3.8/site-packages/pip/_vendor/chardet/euckrfreq.py)sPKd]PP3chardet/__pycache__/langturkishmodel.cpython-38.pycnu[U ʗRet@s2"ddlmZdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?d?Zdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddddddddddddddddddd dddddddd!d"d#dd$d%d&dd'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7dddddd8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddZeddeeddddZdS))SingleByteCharSetModel)?%/'4$-5<1.*0,#3&>+8r rr    9: ?627;!=")(rrrr r r r r rrrrrrrrErrrrrrArrrrr r!r"r#r$r%r&r'r(r)r*@r+r,r-r.r/r0r1r2r3ejd^P]ir4~}|hIcOU{r5zb\yx[gwDvuatsr6Zrqpor7r>r@VYFr8NGRXr9MBTSnKr:`r=CmJWfr;_QlLHr<r?rAk(rrrrr(r&r?r+r,r-r%r2r r'r.r)rr<r!rArrr3rr$r#r*r"rr r=rr/r9r;rr rrr r@r>rrrr rrrrr6rr rr5r7rr0r1r8rr:rr4rErDrrrrCrrrrrrrrrrrwrrrrrrrrrrrrrxrvrrrrrrmr\rrrrzrerrrrrrrrrrrrrrrrrrrrrrrrr~r}r|r{ryrurtrsrrrqrprornrlrkrjrirhrgrfrdrcrbrar`r_r^r]r[rZrYrXrWrVrUrTrSrRrQrPrOrNrMrLrKrJrIrHrGrFrBz ISO-8859-9TurkishgX4 ?TuRABCDEFGHIJKLMNOPRSTUVYZabcdefghijklmnoprstuvyzÂÇÎÖÛÜâçîöûüĞğİıŞş) charset_namelanguagechar_to_order_maplanguage_modeltypical_positive_ratiokeep_ascii_lettersalphabetN)#pip._vendor.chardet.sbcharsetproberrTURKISH_LANG_MODEL ISO_8859_9_TURKISH_CHAR_TO_ORDERISO_8859_9_TURKISH_MODELrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/langturkishmodel.pys" BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*PKd]V:chardet/__pycache__/universaldetector.cpython-38.opt-1.pycnu[U .e0@sdZddlZddlZddlZddlmZddlmZmZm Z ddl m Z ddl m Z ddlmZdd lmZGd d d eZdS) a Module containing the UniversalDetector detector class, which is the primary class a user of ``chardet`` should use. :author: Mark Pilgrim (initial port to Python) :author: Shy Shalom (original C code) :author: Dan Blanchard (major refactoring for 3.0) :author: Ian Cordasco N)CharSetGroupProber) InputStateLanguageFilter ProbingState)EscCharSetProber) Latin1Prober)MBCSGroupProber)SBCSGroupProberc @sneZdZdZdZedZedZedZ dddd d d d d dZ e j fddZ ddZddZddZdS)UniversalDetectoraq The ``UniversalDetector`` class underlies the ``chardet.detect`` function and coordinates all of the different charset probers. To get a ``dict`` containing an encoding and its confidence, you can simply run: .. code:: u = UniversalDetector() u.feed(some_bytes) u.close() detected = u.result g?s[-]s(|~{)s[-]z Windows-1252z Windows-1250z Windows-1251z Windows-1256z Windows-1253z Windows-1255z Windows-1254z Windows-1257)z iso-8859-1z iso-8859-2z iso-8859-5z iso-8859-6z iso-8859-7z iso-8859-8z iso-8859-9z iso-8859-13cCsNd|_g|_d|_d|_d|_d|_d|_||_t t |_ d|_ | dS)N)_esc_charset_prober_charset_probersresultdone _got_data _input_state _last_char lang_filterloggingZ getLogger__name__logger_has_win_bytesreset)selfrrI/usr/lib/python3.8/site-packages/pip/_vendor/chardet/universaldetector.py__init__Qs zUniversalDetector.__init__cCsVdddd|_d|_d|_d|_tj|_d|_|jr>|j |j D] }| qDdS)z Reset the UniversalDetector and all of its probers back to their initial states. This is called by ``__init__``, so you only need to call this directly in between analyses of different documents. Nencoding confidencelanguageF) rrrrr PURE_ASCIIrrr rr )rproberrrrr^s  zUniversalDetector.resetcCs>|jr dSt|sdSt|ts(t|}|js|tjrJdddd|_nv|tj tj frldddd|_nT|drdddd|_n:|d rd ddd|_n |tj tj frd ddd|_d |_|jd dk rd |_dS|j tjkr.|j|rtj|_ n*|j tjkr.|j|j|r.tj|_ |dd|_|j tjkr|js^t|j|_|j|tjkr:|jj|j|jjd|_d |_n|j tjkr:|jst |jg|_|jt!j"@r|j#t$|j#t%|jD]:}||tjkr|j||jd|_d |_q&q|j&|r:d |_'dS)a Takes a chunk of a document and feeds it through all of the relevant charset probers. After calling ``feed``, you can check the value of the ``done`` attribute to see if you need to continue feeding the ``UniversalDetector`` more data, or if it has made a prediction (in the ``result`` attribute). .. note:: You should always call ``close`` when you're done feeding in your document if ``done`` is not already ``True``. Nz UTF-8-SIG?rzUTF-32szX-ISO-10646-UCS-4-3412szX-ISO-10646-UCS-4-2143zUTF-16Tr)(rlen isinstance bytearrayr startswithcodecsBOM_UTF8r BOM_UTF32_LE BOM_UTF32_BEBOM_LEBOM_BErrr#HIGH_BYTE_DETECTORsearch HIGH_BYTE ESC_DETECTORrZ ESC_ASCIIr rrfeedrZFOUND_IT charset_nameget_confidencer!r r rZNON_CJKappendr rWIN_BYTE_DETECTORr)rZbyte_strr$rrrr6os            zUniversalDetector.feedc Cst|jr |jSd|_|js&|jdn|jtjkrBdddd|_n|jtjkrd}d}d}|j D]"}|sjq`| }||kr`|}|}q`|r||j kr|j }|j }| }|d r|jr|j||}|||jd|_|jtjkrn|jd dkrn|jd |j D]`}|sq t|trP|jD] }|jd |j |j| q,n|jd |j |j| q |jS) z Stop analyzing the current document and come up with a final prediction. :returns: The ``result`` attribute, a ``dict`` with the keys `encoding`, `confidence`, and `language`. Tzno data received!asciir%r&rNrziso-8859rz no probers hit minimum thresholdz%s %s confidence = %s)rrrrdebugrrr#r4r r8MINIMUM_THRESHOLDr7lowerr+r ISO_WIN_MAPgetr!ZgetEffectiveLevelrDEBUGr)rZprobers) rZprober_confidenceZmax_prober_confidenceZ max_proberr$r7Zlower_charset_namer Z group_proberrrrclosesj            zUniversalDetector.closeN)r __module__ __qualname____doc__r=recompiler2r5r:r?rZALLrrr6rBrrrrr 3s$     mr )rEr,rrFZcharsetgroupproberrZenumsrrrZ escproberrZ latin1proberrZmbcsgroupproberr Zsbcsgroupproberr objectr rrrrs      PKd]HR" 2chardet/__pycache__/sbcharsetprober.cpython-38.pycnu[U ʗRe7 @sXddlmZddlmZddlmZmZmZeddddd d d d gZGd ddeZ dS)) namedtuple) CharSetProber)CharacterCategory ProbingStateSequenceLikelihoodSingleByteCharSetModel charset_namelanguagechar_to_order_maplanguage_modeltypical_positive_ratiokeep_ascii_lettersalphabetcsbeZdZdZdZdZdZdfdd Zfd d Ze d d Z e d dZ ddZ ddZ ZS)SingleByteCharSetProber@igffffff?g?FNcsLt||_||_||_d|_d|_d|_d|_d|_ d|_ | dSN) super__init___model _reversed _name_prober _last_order _seq_counters _total_seqs _total_char _control_char _freq_charreset)selfmodel is_reversed name_prober __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/sbcharsetprober.pyr6s z SingleByteCharSetProber.__init__cs<td|_dgt|_d|_d|_d|_d|_ dS)Nr) rrrrget_num_categoriesrrrrrrr#r%r&rEs zSingleByteCharSetProber.resetcCs|jr|jjS|jjSr)rr rr)r%r%r&r Psz$SingleByteCharSetProber.charset_namecCs|jr|jjS|jjSr)rr rr)r%r%r&r Vsz SingleByteCharSetProber.languagec CsV|jjs||}n ||}|s(|jS|jj}|jj}|D]}||tj }|tj krf|j d7_ ||j kr|j d7_ |j|j kr|jd7_|js||j|}n|||j}|j|d7<||_q<|jj}|jtjkrP|j|jkrP|}||jkr(|jd||tj|_n(||jkrP|jd|||jtj|_|jS)Nrz$%s confidence = %s, we have a winnerz8%s confidence = %s, below negative shortcut threshold %s)rrfilter_international_wordsremove_xml_tagsstater r getr UNDEFINEDCONTROLr SAMPLE_SIZErrrrrr r DETECTINGSB_ENOUGH_REL_THRESHOLDget_confidencePOSITIVE_SHORTCUT_THRESHOLDloggerdebugFOUND_IT_stateNEGATIVE_SHORTCUT_THRESHOLDNOT_ME) rbyte_strr r charorderlm_catr confidencer%r%r&feed\sP        zSingleByteCharSetProber.feedcCsnd}|jdkrj|jtjd|jtj|j|jj}||j|j|j}||j |j}|dkrjd}|S)Ng{Gz?rg?g?gGz?) rrrPOSITIVELIKELYrr rrr)rrr%r%r&r3s   z&SingleByteCharSetProber.get_confidence)FN)__name__ __module__ __qualname__r0r2r4r9rrpropertyr r r@r3 __classcell__r%r%r#r&r0s   2rN) collectionsr charsetproberrenumsrrrrrr%r%r%r&s  PKd]MJ.chardet/__pycache__/cp949prober.cpython-38.pycnu[U ʗRe.@sDddlmZddlmZddlmZddlmZGdddeZdS))EUCKRDistributionAnalysis)CodingStateMachine)MultiByteCharSetProber)CP949_SM_MODELcs4eZdZfddZeddZeddZZS) CP949Probercs(ttt|_t|_|dS)N)super__init__rr coding_smrdistribution_analyzerresetself __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/cp949prober.pyr#s  zCP949Prober.__init__cCsdS)NCP949rr rrr charset_name+szCP949Prober.charset_namecCsdS)NKoreanrr rrrlanguage/szCP949Prober.language)__name__ __module__ __qualname__rpropertyrr __classcell__rrrrr"s   rN) chardistributionrcodingstatemachinermbcharsetproberrmbcssmrrrrrrs    PKd]˺m4chardet/__pycache__/universaldetector.cpython-38.pycnu[U ʗRe3@sdZddlZddlZddlZddlmZddlmZmZm Z ddl m Z ddl m Z ddlmZdd lmZdd lmZGd d d ZdS) a Module containing the UniversalDetector detector class, which is the primary class a user of ``chardet`` should use. :author: Mark Pilgrim (initial port to Python) :author: Shy Shalom (original C code) :author: Dan Blanchard (major refactoring for 3.0) :author: Ian Cordasco N)CharSetGroupProber) InputStateLanguageFilter ProbingState)EscCharSetProber) Latin1Prober)MBCSGroupProber)SBCSGroupProber) UTF1632Proberc @seZdZdZdZedZedZedZ dddd d d d d dZ e j fddZ eddZeddZeddZddZddZddZdS)UniversalDetectoraq The ``UniversalDetector`` class underlies the ``chardet.detect`` function and coordinates all of the different charset probers. To get a ``dict`` containing an encoding and its confidence, you can simply run: .. code:: u = UniversalDetector() u.feed(some_bytes) u.close() detected = u.result g?s[-]s(|~{)s[-]z Windows-1252z Windows-1250z Windows-1251z Windows-1256z Windows-1253z Windows-1255z Windows-1254z Windows-1257)z iso-8859-1z iso-8859-2z iso-8859-5z iso-8859-6z iso-8859-7z iso-8859-8z iso-8859-9z iso-8859-13cCsTd|_d|_g|_d|_d|_d|_d|_d|_||_t t |_ d|_ |dSN)_esc_charset_prober_utf1632_prober_charset_probersresultdone _got_data _input_state _last_char lang_filterlogging getLogger__name__logger_has_win_bytesreset)selfrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/universaldetector.py__init__Ts zUniversalDetector.__init__cCs|jSr )rrrrr input_statebszUniversalDetector.input_statecCs|jSr )rr!rrr has_win_bytesfszUniversalDetector.has_win_bytescCs|jSr )rr!rrrcharset_probersjsz!UniversalDetector.charset_proberscCsfdddd|_d|_d|_d|_tj|_d|_|jr>|j |j rN|j |j D] }| qTdS)z Reset the UniversalDetector and all of its probers back to their initial states. This is called by ``__init__``, so you only need to call this directly in between analyses of different documents. Nencoding confidencelanguageF) rrrrr PURE_ASCIIrrrrrr)rproberrrrrns   zUniversalDetector.resetcCs|jr dS|sdSt|ts$t|}|js|tjrFdddd|_nv|tjtj frhdddd|_nT|drdddd|_n:|d rd ddd|_n |tj tj frd ddd|_d |_|jd dk rd |_dS|j t jkr(|j|rt j|_ n*|j t jkr(|j|j|r(t j|_ |dd|_|jsFt|_|jjtjkr|j|tjkr|jj|jdd|_d |_dS|j t jkr|jst|j |_|j|tjkr|jj|j|jj!d|_d |_n|j t jkr|j"s4t#|j g|_"|j t$j%@r&|j"&t'|j"&t(|j"D]:}||tjkr:|j||j!d|_d |_qvq:|j)|rd |_*dS)a Takes a chunk of a document and feeds it through all of the relevant charset probers. After calling ``feed``, you can check the value of the ``done`` attribute to see if you need to continue feeding the ``UniversalDetector`` more data, or if it has made a prediction (in the ``result`` attribute). .. note:: You should always call ``close`` when you're done feeding in your document if ``done`` is not already ``True``. Nz UTF-8-SIG?r&zUTF-32szX-ISO-10646-UCS-4-3412szX-ISO-10646-UCS-4-2143zUTF-16Tr')+r isinstance bytearrayr startswithcodecsBOM_UTF8r BOM_UTF32_LE BOM_UTF32_BEBOM_LEBOM_BErrr+HIGH_BYTE_DETECTORsearch HIGH_BYTE ESC_DETECTORr ESC_ASCIIrr stater DETECTINGfeedFOUND_IT charset_nameget_confidencerrrr)rr rNON_CJKappendr rWIN_BYTE_DETECTORr)rbyte_strr,rrrr@s             zUniversalDetector.feedc Cst|jr |jSd|_|js&|jdn|jtjkrBdddd|_n|jtjkrd}d}d}|j D]"}|sjq`| }||kr`|}|}q`|r||j kr|j }|j }| }|d r|jr|j||}|||jd|_|jtjkrn|jd dkrn|jd |j D]`}|sq t|trP|jD] }|jd |j |j| q,n|jd |j |j| q |jS) z Stop analyzing the current document and come up with a final prediction. :returns: The ``result`` attribute, a ``dict`` with the keys `encoding`, `confidence`, and `language`. Tzno data received!asciir-r.r&Nr%ziso-8859r'z no probers hit minimum thresholdz%s %s confidence = %s)rrrrdebugrrr+r;rrCMINIMUM_THRESHOLDrBlowerr2r ISO_WIN_MAPgetr)getEffectiveLevelrDEBUGr0rprobers) rprober_confidencemax_prober_confidence max_proberr,rBlower_charset_namer( group_proberrrrclosesj           zUniversalDetector.closeN)r __module__ __qualname____doc__rJrecompiler9r<rFrLrALLr propertyr"r#r$rr@rVrrrrr 4s2       r )rYr3rrZcharsetgroupproberrenumsrrr escproberr latin1proberrmbcsgroupproberr sbcsgroupproberr utf1632proberr r rrrrs       PKd]jmjj1chardet/__pycache__/big5freq.cpython-38.opt-1.pycnu[U .ez@sdZdZdZdS)g?(i ii Riiaii ni!i iL,iBi iiiii{ i] iii ijiii.iNiii:iii?iii=iNKikiq iii i i ib iii ioi2 iiii ici8iiiiiii{|i "i i @i\ii iiiiiiFii| iQHiiPivi iiiiDi^ iiiFi} iEi iOi0isii4<2i i&iMiii~ iiGii[ iii?ii iaiiK i*iigi Zi i:i iiKi i iiiii`iliii i i qii~ii i ii iiiciuii*iii i i~imiiieiGi^iini UiCiiCiiiiiii jioi/iiiPi7 i[ii i? iiiioSi(ii ip]ii6iji i@ iiiiii8+i3 i[ii\iiiii] iA ii i1iiHi i idii+i i2iiii iOiL iiifi1iiiiiii3i9li,i iiiiiii ieiz iQiMi&i Xiiiii iikipiMii %i iiii'i ii\ i i7Jii!iiiiiNiiB iPi_ iqi iii i i ii i iIii8 ii ii{ i i iimiiifiiixii iii ii iigii iiiiii&ii'iiiii.i iiiM iiii$#iiDihiAi iiriiiUiGiiii i iQiSiiiidi 0FiiiC iiiii iiJii iUiiN i iii<ii i:iA i ii i i9ii}ii iiiWiPi ii)iDiiii4 i i i)iiir iisiiitii9 iiiis i*iiiiiii] iiiii iD iji( i iii iiui5iYiji iliiuiii iii` i i=i iiiiiii5ii!iiiTiE ixiiiei iiO iPii| i6iAi i/iki i iili!i iiBii`ii i iAii iiii ivi i iiwiiiMi iiiiiia iii i} iixi,}ii iB iiiiiiiiiF ikimi ii ii ii iibii) i^ iP i i,ii ii7i5 i~ iyi|i iziiii iC i{iiiiiiiiii1bii i iiit ii ii_ iiiii i i ib iii5Diilii|i[i* ii ii%iG i^ iiliii ii` iii ipiincigimiii'i2iii{ii ii iiiD iifi ii|i: iiii i i i i ii inii ii;iiIiYi}ii iXi"ii iiiiiii-iiliiiiiiiiiEii~ii>i]ii,iiiiviLiBii&iii iiiiGiiiiBii i+ iii iiiii i iaiiii ia ii}iE iiDii=ii0i ii i6 iiiivi!iiiiii9iHiiiii iFiiiiii"iiH iii i ioiiiRi*ii.iiiiiiI 3ii, ii*iSiiiXiii/iibipii iiiiiiRii ii7 ii2ii iiiiiii_ iib ii iiii iiiiiii` Oii i i`i7i i iiiiiiia iiiiiiigiii ii i_ii~iiiii iaii ib iiiii ii i;i i-i iiQ iiiqiiii`ii#i#iiiiiri isiiiiditi iic ii ikiwi ii iiiiiiigi iQiiUi i iiiCiSiic iii5iiiBii_i iciNiiYiiii iLidi i i iKi i8 iaiGiii i iiisi6i iti; Niii i i4ii:ii\iqiiii.iii iui iiii i i iriii i iic iiii@iii ii ii ii/i9 ii iiiiiii i< id iiii8iviiCiii iimii iiiiiiZiiiwi {iiii$iiiMid i0irii iigiiViiiii: iZiii{i$ie i0iii$i i i ii5ii[iviiiciiViR i$i; iiif iii idiiiWie iii iii i iiJ iiiiiuii ii ii i iK ii2iiL i i.iii2ii iiiii%i iii i iiiiiii i ixi iM ii}iiiTiiiid i iiiii`iiiii i3iii;i iiiiyiYiLiii i iiiiU\iiiiiiViN iii iii ii"ixi%ii;i= i iii2iEii!iii^ii"iwi i#iiii ii$i<iQiiiri%ii]ii&ii< i'i i3i6iBii i(iii ii i iig i i i)i i i*i+i! iii:ii7ii^ii iii(i i,i+i i ixi-ii/ihi= i.iiiiVi ii hii i/iiii<iii;i0iiii i i1izi i ii5i6i i_)i2i3ii4iyi" ii ii^i5i i i?i%i+if i i6i_iWiii i7i> ii ig i# iu i8i ii9ih iF iiVi{i iO iiIwi~i i^iii:iiiiiiii i;iei1iiiiiiiii i i iiP i<i=ii>i i(i`iRi? iYiiIi ii i7i i i?iii i@iioiqiYiniiiliiii ii ii iEiPiVii! i iiiiiniiAii|i ii iBiiiiii- i iOi i iCiiDiWiTiTiiii i}iEii&i i iiiiii iii~iG i iii$ iWiiiioii iFiiGiii" iii# iiiDi-iQ iiHiei i iiIi iiiJizi iiKiiiLii$ i iiiiiH iiiiiiMi:i iiiNiiI i iiiHiiiiiOiii iPiQiiikiRiR i ii i i ii iiiiiiSiTiii i% iiiiii& iS iUi iiS iiCiiiiVi~ii!iXiiiiii,iiiiiOii|iiiiPiie iiii i i iiiiiiiiT iiiiWiiiiXiiYiiRi iviii ii i=i iiZiiU iii[i iiiV i% i\iii]iii^i8iT i. i' i_iiviiiiiwitii`iaibi> iii"i{i i iiciidi9iiiii[i9iiidih i ieiii iJ i!iiifiii iiiTigiii i%iWiMihiiiiiiiiiiiii( ij iiyi7imiijiki i? iW i"iii Biili|i i) izii iii iiiiiminiuiv iwii i* iiioipiiqi7i.irii i iii iifii i isi& iyi ii i iiiii i i>iiii iYi iitiiui/ i+ i ivi ii i@ iwii i ii3iiii, ixi i6i9i i ii6i ii! iiiyiiQi:ici iii- oiiiFiX i i iifi iizi iii iii{i/ii' i ibiii`iiiiui iviiiii i i iiii i0iEiSii8i[i|i}iGii ii!i~iiiFiU ii ii iieisiii iw iiii" i iai iZi&iiiii i iiiiAiii iiii iiiiiiiii ioii ii i i ii iiA i iJi0i ix i ii iiY iiiiii i i iiZ i8ioiiiQiiiii iaQiiipi;iiPiibiiiii i ii iiii iii iiiiiiiii]iiiii iiiii'iii. i i iiiii iLiiiiii ii/ iiiiiB i0 i[ ii8iiiii iii/i3iiiii iiii0i iniiiiiiii i iiiiiiiii4iiii<i ii iiiYi iiiC iiii iiiii}i1ii iiiiKi i0 iFiiii ii#ii\iiifi >i iii iiiiii i iiiiijiiiiii-ipi9i@ i6iyiiii i i1 iiiiiiiViiiii4iii iKi1 ii iD i iiiiii#iiii i2 iiii iZiHipiiigiii i iqri iiiii i iK iV i i\ i,i ii iiii]iiiui iiiiiiiiiZiii iiiiijiii0ihihiii ii iE iii iii iiiiiiiiiii iiii2 iiiiiiMiiwiii iy i?iiii itimi( i ii+iiiiiiiii i ii i iii iiL iii) i ii iiif ii iiiiiiiRi"iA i3 i ii-i1ii$i i(ii] i i# ii$ i iiii i* iiii i ii i i=ik ii!ii iiii i ii _iiiii^ i2ii iiii9iii iiii4 i iii ibiiii ii ii5ii iii"i i iiiii4iIi ii#ii iiiiiij iiii$ik i ii ii\i igiiEi5 iiiiiiiii iii6 iiii ii%iii ii i[i iiiiii i&eiii iiioi iil i i}iiiizii+ iii iiiini-ii i'iiii iiii(iii iiiiiiii ii iiiBiiiqiiii<ii*iji)i"i*ii>i)i7 ii+iiiiiiizii,iiiiiM i)iriii-i i iiiiiTipiii#i#iiiiiiii iiii i ii iiSii.i8 iiiiiz i9 i=iiiim iiSiiiiiixiii/iiiqiii3ii5ii: i i ii iiiiii i; i i0i1iiiiiin ii_ ii]i i iniiiii i% iiiii i` iiiiiziTisi2i3 ii i{ i5ii ig iiikiiiii iii3i4ii iici iii i iiiai:i1i iii!Aihi io i i6i"ii il -ii ia i5ii ii i ii#i! ii$ii ii4 ifii i%i& i iN ri iiWiiiiii i' ii$iii< i iNiiiW ikiiO iiiiiiiX i, ii6i&itiiP ii i7i i i i- ijii i iiC[ip ii i'i8i ib iim i i ii{i(i i ii i9i i i i:i i i^iiiiB i;iiiiii ii ii ii)i<i=i ii ii>iiiii =iiiiiiiiiiin iiHiDi i?iiUiWi i= ii:ii iNi iKiEi@i4ic i ii> iiQ i iAiiihiii i i( i]iiiiBi*iiiliiCiDiiEih iiiiiiXiiiii+iiii+iJiiiUii iimi iEiiiiFiiGi ki inii id iiiiiiiF i!i iiri@iiHi"iCiGiii ii^i ii 8iti) i;i i? i!iioiIi i"i#i#i$iiJi i%i i&iriKi'i5 i(i)iio i@ i}iA ii,ii*i41i+ii i i ii" ii,ii iC iiuiriD i-i i-i iLivi{ii| iMi.i.iNiY i6 iii i/i0i/i ii1i$ii2i%iGiRiB i i_iiiC ii iD ii3iiiii ii i. ii i4i@iwii5ii6i7iii ii&i0ii8i i&i i* i+ iG iOiui# i i1iPiRiiQii ii)iii=i9iili iiiiE iSiiki i\i iii iyi:i i;i<iF i%i=iiRiii>idi'i, i?iei$ ii2i3i- ii i4ii(iSi@iAiBii.iTiiOi i iiiii i&i iii i<i iiiiCiiDi iiUiip iG ie i i i ii iEi;iViFi'iGi)i ii} iHi*iiWiiiIiiTii i iiiiii iiJi. igi~iUiij i iiiXiii8ii*i iiiKi~ iii iLiiH i iii% i+if iii iitiiMiNiii ii ii iiik iYiiYiii*i/ iiOiR iZiH ii#iI i i iii5iS i]iE i[i\i isiI i+iPiQi,i i iRiiSiTii,iiUi]iVi iiLi-i!i iT i\4iWi iiXiYiZii[i>iwiiiii+i^iiJ ii_i$ii\iiiili.i]i`ii^i_iq i%ii`iaiiii i6ig iU ibicidiai iq ixi iei ibiyi ifihigihiii'iii iii ijir ii i0 i i=iibi|iiiii i iih iki iliii iaiicimiii ini iiui iidieiis iK i/ioi7ii& i iJ i8ipiqii ij ifii igi iii(ii`irisi i iii<iFik ifiiii]iiiIiti>iiuiivii iii i0ii-iiwiL ii iiiiiGiaii it i ii iSiKixiiyiziiiV iiOii1 i i{i i iiF iyii9iZ i|i}i~iFi iii i i:iiiii2 iiiipii;iG iii ihiiiii7 iiiiiqiiiM iiiiiii iii iii i(i8 iiN i ii3 i iiO i<iiiiTiiW i iiiii(iiii1iiiiiiiiu iZii i iciijiP ipiii iiii iv iiijii iiii iQ iK i ii i' iiiiii9 iii i izii i iiikiiiii ii2i iiliii>i=iCi'iii>i iiZiiii imini iibiii i iqi?ii ii ii i"ii i?i i}iiioi@i>iiAi i1ii)iiii?i i iiiixi ii ii i3i i ihii il iiii)ii ipii'iiii4ii i i iiiiAi_i iBiiL ii iPiqii iiriiiiiX iicisi! iiiiHii iw iiiiCiDitiiiiiiix i ii i/ iiii5i i4 iuiir iii_ii/i i<ii~i7iy im iii^i5 in ibi itiiil iiii6ii i7iiiiiiiviiii i8i: ii ii0 i i1 iiwiIiiiii i( iiiBi ii4isi iiiii i iii?iCiixi iEiHi iiFiyiziGiiiii{iiii|ii; i}i9imiH i~iiz iiis i iiM iiii iiim iiiIiiiio iiiiiiii_iiii i2 i3 iHii*iii iiii< iiii:ii ii iiAii iiR iiiii i ii" ii iiiiii ii iii iiiQi i iY iiiiiiii{iKii i[i iJiiiN iiS iiiiiI iiiT i@ii iii i i@iiRiii it iiiiJiIii iiii iU iimiiii{ i ii i i;iV iii iii<iii idiiiiXiii9iii6 iiiUiiii iiLi!i= ii) ii i i iii i ii ii=i$i(iviii&iicii iii i ii>iiii{i"iiiii#iiiiiW ii iiii ii$i i%iiiiii&i^iii[ i ii'iiiiiiii(i iii2i\ iJi ip ipin iiu iq i)ii iO i> ii i*iX iii i+ii i,i iii iiiiiKii i iIi-iii!iiiiii.iDiiiJisi# iii ii7 iiii/iwii|iiiiii"i4 i| i,iiiii iiiiiiiii?iY iP i0ii1iZ iZ i ii i ii i#i@i2ii|iiziiiiiAi'ii? ii ii8 ii yiiLiVi i3i i i i$iiiiMii%ii i i i i i.ii4iNiii ii i i iiii i5i9 i%iiiiKiQ iixi6i7iiBi i iOiv i[ iii&ii ii iiiXii* ii\ iPi i iNi+ iw iiiiiWiCi ii iQiDi i?i] iiii^ io iR i i iEii iiFi i'iiXiiGiiS i iiT iRii8ixi ikiSiiTiii ii iiDii9i!iiiii(iiLi"i#i$i%i_ ii&iJi:iUii}i i)ii i;i<i iEi+i'i iiHi=iVi*iHiyi, i+iWi3i>i ii?i(iIi,i-i` iqiia i iii ii)i*iXi i+iiOiYi,i-ii.ii/i ii0i.iiii1i iJir i2i3i$ i i4ii5i6i7i iib i iii} i ifiiKii i i i i8iZi9ii: ii ic ii:ii i;is iJ i@ii it i; i i/i<id ii iiiU ii0iie i=iif iu iMiiiii i>i i[iiAiLiiii?i i i i i@iAiv iBiCi\iijii[ i ig iDiEiiiFi iBiiGi iiHii(iiMiCih iiIiNiJi iKiLiiiMii1i2iNiidiOidiV iDi`ii#i5 iPi]iQiEini i iii^iRi_iFiSip ii iiTiUii i iVii i iiGiiiieiHiOi iiPi`iWiw ij iXi ii3i iaiiIiYiJix i7iiii- i i4ik iibiZi-iii. icii[i iri;i iKi5iLiXii i iii\i]iii6i% i^i_iii~i`il iy iaizi~ iiibi?iici7idi iiieiiz iiiMifigi/ ihi|ii@idiiiiiNiiii8ifiiijikiiOiPiiilimi@ini9i ioi i iii< isii\ iQi.iRiNi@i iipiiSi{ iqiiAii iiiiTi iiii:iiiri isi@ iW i;itiui iviwixiyi| iiiiizi i i3iQiiimiiAi{i|ii ii}iOiRi iigiii~iZi iiiiii i\im ii} ii<iX ii ii i iiii iiY iiii0 iiii i=i iiiiLiiiiihiiiiii>i>ii/i?iUiiiiiiei)ix tiifiSii iy i in i i iiTi i@ii i iiiiiii ii iziUigiiViio iii6 ip itiiiiii iAiiJiVihiZ i iiWiiiiN)ZBIG5_TYPICAL_DISTRIBUTION_RATIOZBIG5_TABLE_SIZEZBIG5_CHAR_TO_FREQ_ORDERrr@/usr/lib/python3.8/site-packages/pip/_vendor/chardet/big5freq.py+sPKd] QQ4chardet/__pycache__/euctwprober.cpython-38.opt-1.pycnu[U .e@sDddlmZddlmZddlmZddlmZGdddeZdS))MultiByteCharSetProber)CodingStateMachine)EUCTWDistributionAnalysis)EUCTW_SM_MODELcs4eZdZfddZeddZeddZZS) EUCTWProbercs,tt|tt|_t|_|dS)N) superr__init__rrZ coding_smrZdistribution_analyzerresetself __class__C/usr/lib/python3.8/site-packages/pip/_vendor/chardet/euctwprober.pyr"s zEUCTWProber.__init__cCsdS)NzEUC-TWrr rrr charset_name(szEUCTWProber.charset_namecCsdS)NZTaiwanrr rrrlanguage,szEUCTWProber.language)__name__ __module__ __qualname__rpropertyrr __classcell__rrr rr!s   rN) ZmbcharsetproberrZcodingstatemachinerZchardistributionrZmbcssmrrrrrrs    PKd]]QQ4chardet/__pycache__/euckrprober.cpython-38.opt-1.pycnu[U .e@sDddlmZddlmZddlmZddlmZGdddeZdS))MultiByteCharSetProber)CodingStateMachine)EUCKRDistributionAnalysis)EUCKR_SM_MODELcs4eZdZfddZeddZeddZZS) EUCKRProbercs,tt|tt|_t|_|dS)N) superr__init__rrZ coding_smrZdistribution_analyzerresetself __class__C/usr/lib/python3.8/site-packages/pip/_vendor/chardet/euckrprober.pyr#s zEUCKRProber.__init__cCsdS)NzEUC-KRrr rrr charset_name)szEUCKRProber.charset_namecCsdS)NZKoreanrr rrrlanguage-szEUCKRProber.language)__name__ __module__ __qualname__rpropertyrr __classcell__rrr rr"s   rN) ZmbcharsetproberrZcodingstatemachinerZchardistributionrZmbcssmrrrrrrs    PKd]bA- 5chardet/__pycache__/hebrewprober.cpython-38.opt-1.pycnu[U .e6@s,ddlmZddlmZGdddeZdS)) CharSetProber) ProbingStatecseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZfddZddZddZddZddZddZeddZeddZedd ZZS)! HebrewProberg{Gz?z ISO-8859-8z windows-1255cs>tt|d|_d|_d|_d|_d|_d|_| dSN) superr__init___final_char_logical_score_final_char_visual_score_prev _before_prev_logical_prober_visual_proberresetself __class__D/usr/lib/python3.8/site-packages/pip/_vendor/chardet/hebrewprober.pyrszHebrewProber.__init__cCsd|_d|_d|_d|_dS)N )rrrrrrrrrszHebrewProber.resetcCs||_||_dSr)rr)rZ logicalProberZ visualProberrrrset_model_probersszHebrewProber.set_model_proberscCs||j|j|j|j|jfkSr) FINAL_KAF FINAL_MEM FINAL_NUNFINAL_PE FINAL_TSADIrcrrris_finalszHebrewProber.is_finalcCs||j|j|j|jfkSr) NORMAL_KAF NORMAL_MEM NORMAL_NUN NORMAL_PEr(rrr is_non_finals zHebrewProber.is_non_finalcCs|jtjkrtjS||}|D]}|dkrn|jdkr||jrR|jd7_q||jr|j d7_ n,|jdkr||jr|dkr|j d7_ |j|_||_q tj S)Nr!r) staterNOT_MEZfilter_high_byte_onlyrr*rrr/r DETECTING)rZbyte_strZcurrrrfeeds&       zHebrewProber.feedcCsx|j|j}||jkr|jS||j kr.|jS|j|j}||jkrR|jS||j krd|jS|dkrr|jS|jS)Ng) rrMIN_FINAL_CHAR_DISTANCELOGICAL_HEBREW_NAMEVISUAL_HEBREW_NAMErZget_confidencerMIN_MODEL_DISTANCE)rZfinalsubZmodelsubrrr charset_names     zHebrewProber.charset_namecCsdS)NZHebrewrrrrrlanguageszHebrewProber.languagecCs(|jjtjkr"|jjtjkr"tjStjSr)rr0rr1rr2rrrrr0s  zHebrewProber.state)__name__ __module__ __qualname__r#r+r$r,r%r-r&r.r'Z NORMAL_TSADIr4r7r6r5rrr"r*r/r3propertyr8r9r0 __classcell__rrrrrs4  ;  rN)Z charsetproberrZenumsrrrrrrs  cPKd]_ -chardet/__pycache__/utf8prober.cpython-38.pycnu[U ʗRe @sHddlmZddlmZddlmZmZddlmZGdddeZ dS)) CharSetProber)CodingStateMachine) MachineState ProbingState) UTF8_SM_MODELcsTeZdZdZfddZfddZeddZedd Zd d Z d d Z Z S) UTF8Proberg?cs&ttt|_d|_|dS)N)super__init__rr coding_sm _num_mb_charsresetself __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/utf8prober.pyr %s  zUTF8Prober.__init__cst|jd|_dS)N)rr r r r rrrr +s  zUTF8Prober.resetcCsdS)Nzutf-8rr rrr charset_name0szUTF8Prober.charset_namecCsdS)Nrr rrrlanguage4szUTF8Prober.languagecCs|D]b}|j|}|tjkr*tj|_qh|tjkr@tj|_qh|tj kr|j dkr|j d7_ q|j tj kr||jkrtj|_|j S)Nr)r next_staterERRORrNOT_ME_stateITS_MEFOUND_ITSTARTget_current_charlenr state DETECTINGget_confidenceSHORTCUT_THRESHOLD)rbyte_strc coding_staterrrfeed8s     zUTF8Prober.feedcCs*d}|jdkr&||j|j9}d|S|S)NgGz?g?)r ONE_CHAR_PROB)runlikerrrr"Ks  zUTF8Prober.get_confidence) __name__ __module__ __qualname__r)r r propertyrrr'r" __classcell__rrrrr"s    rN) charsetproberrcodingstatemachinerenumsrrmbcssmrrrrrrs   PKd]II3chardet/__pycache__/big5prober.cpython-38.opt-1.pycnu[U .e@sDddlmZddlmZddlmZddlmZGdddeZdS))MultiByteCharSetProber)CodingStateMachine)Big5DistributionAnalysis) BIG5_SM_MODELcs4eZdZfddZeddZeddZZS) Big5Probercs,tt|tt|_t|_|dS)N) superr__init__rrZ coding_smrZdistribution_analyzerresetself __class__B/usr/lib/python3.8/site-packages/pip/_vendor/chardet/big5prober.pyr#s zBig5Prober.__init__cCsdS)NZBig5rr rrr charset_name)szBig5Prober.charset_namecCsdS)NZChineserr rrrlanguage-szBig5Prober.language)__name__ __module__ __qualname__rpropertyrr __classcell__rrr rr"s   rN) ZmbcharsetproberrZcodingstatemachinerZchardistributionrZmbcssmrrrrrrs    PKd]&Xn n +chardet/__pycache__/__init__.cpython-38.pycnu[U ʗRey@sLddlmZddlmZddlmZmZdddddgZd dZd d dZ d S)) InputState)UniversalDetector)VERSION __version__rdetect detect_allrrcCsFt|ts.t|ts&tdt|t|}t}|||S)z Detect the encoding of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` 1Expected object of type bytes or bytearray, got: ) isinstance bytearraybytes TypeErrortyperfeedclose)byte_strdetectorr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/__init__.pyrs    FcCst|ts.t|ts&tdt|t|}t}||||jt j krg}g}|j D]0}t |dr| dd|jDqb||qb|D]^}|s||jkr|jpd}|}|dr|jr|j||}||||jdqt|dkrt|d d d S|jgS) a Detect all the possible encodings of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` :param ignore_threshold: Include encodings that are below ``UniversalDetector.MINIMUM_THRESHOLD`` in results. :type ignore_threshold: ``bool`` rproberscss|] }|VqdS)Nr).0prrr Fszdetect_all..ziso-8859)encoding confidencelanguagecSs |d S)Nrr)resultrrr[zdetect_all..)key)r r r r r rrr input_stater HIGH_BYTEcharset_probershasattrextendrappendget_confidenceMINIMUM_THRESHOLD charset_namelower startswith has_win_bytes ISO_WIN_MAPgetrlensortedr)rignore_thresholdrresultsrproberr)lower_charset_namerrrr+sD        N)F) enumsruniversaldetectorrversionrr__all__rrrrrrs  PKd]0chardet/__pycache__/version.cpython-38.opt-1.pycnu[U .e@sdZdZedZdS)z This module exists only to simplify retrieving the version number of chardet from within setup.py and from chardet subpackages. :author: Dan Blanchard (dan.blanchard@gmail.com) z3.0.4.N)__doc__ __version__splitZVERSIONrr?/usr/lib/python3.8/site-packages/pip/_vendor/chardet/version.pysPKd]3 /chardet/__pycache__/hebrewprober.cpython-38.pycnu[U ʗRe_6@s,ddlmZddlmZGdddeZdS)) CharSetProber) ProbingStatecseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZfddZddZddZddZddZddZeddZeddZedd ZZS)! HebrewProberg{Gz?z ISO-8859-8z windows-1255cs:td|_d|_d|_d|_d|_d|_|dSN) super__init___final_char_logical_score_final_char_visual_score_prev _before_prev_logical_prober_visual_proberresetself __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/hebrewprober.pyrs zHebrewProber.__init__cCsd|_d|_d|_d|_dS)N )rrrrrrrrrszHebrewProber.resetcCs||_||_dSr)rr)rlogical_prober visual_proberrrrset_model_probersszHebrewProber.set_model_proberscCs||j|j|j|j|jfkSr) FINAL_KAF FINAL_MEM FINAL_NUNFINAL_PE FINAL_TSADIrcrrris_finalszHebrewProber.is_finalcCs||j|j|j|jfkSr) NORMAL_KAF NORMAL_MEM NORMAL_NUN NORMAL_PEr*rrr is_non_finals zHebrewProber.is_non_finalcCs|jtjkrtjS||}|D]}|dkrn|jdkr||jrR|jd7_q||jr|j d7_ n,|jdkr||jr|dkr|j d7_ |j|_||_q tj S)Nr!r) staterNOT_MEfilter_high_byte_onlyrr,rrr1r DETECTING)rbyte_strcurrrrfeeds(      zHebrewProber.feedcCsx|j|j}||jkr|jS||j kr.|jS|j|j}||jkrR|jS||j krd|jS|dkrr|jS|jS)Ng) rrMIN_FINAL_CHAR_DISTANCELOGICAL_HEBREW_NAMEVISUAL_HEBREW_NAMErget_confidencerMIN_MODEL_DISTANCE)rfinalsubmodelsubrrr charset_names     zHebrewProber.charset_namecCsdS)NHebrewrrrrrlanguage#szHebrewProber.languagecCs(|jjtjkr"|jjtjkr"tjStjSr)rr2rr3rr5rrrrr2's  zHebrewProber.state)__name__ __module__ __qualname__r%r-r&r.r'r/r(r0r) NORMAL_TSADIr9r=r;r:rrr$r,r1r8propertyr@rBr2 __classcell__rrrrrs4    >  rN) charsetproberrenumsrrrrrrs  dPKd]\9 9 ;chardet/__pycache__/codingstatemachine.cpython-38.opt-1.pycnu[U .e@s(ddlZddlmZGdddeZdS)N) MachineStatec@sDeZdZdZddZddZddZdd Zd d Ze d d Z dS)CodingStateMachinea A state machine to verify a byte sequence for a particular encoding. For each byte the detector receives, it will feed that byte to every active state machine available, one byte at a time. The state machine changes its state based on its previous state and the byte it receives. There are 3 states in a state machine that are of interest to an auto-detector: START state: This is the state to start with, or a legal byte sequence (i.e. a valid code point) for character has been identified. ME state: This indicates that the state machine identified a byte sequence that is specific to the charset it is designed for and that there is no other possible encoding which can contain this byte sequence. This will to lead to an immediate positive answer for the detector. ERROR state: This indicates the state machine identified an illegal byte sequence for that encoding. This will lead to an immediate negative answer for this encoding. Detector will exclude this encoding from consideration from here on. cCs0||_d|_d|_d|_tt|_|dS)Nr) _model_curr_byte_pos_curr_char_len _curr_stateloggingZ getLogger__name__Zloggerreset)selfZsmr J/usr/lib/python3.8/site-packages/pip/_vendor/chardet/codingstatemachine.py__init__7s  zCodingStateMachine.__init__cCs tj|_dSN)rSTARTrr r r rr ?szCodingStateMachine.resetcCsh|jd|}|jtjkr0d|_|jd||_|j|jd|}|jd||_|jd7_|jS)NZ class_tablerZchar_len_tableZ class_factorZ state_tabler)rrrrrr)r cZ byte_classZ curr_stater r r next_stateBs zCodingStateMachine.next_statecCs|jSr)rrr r rget_current_charlenPsz&CodingStateMachine.get_current_charlencCs |jdS)Nnamerrr r rget_coding_state_machineSsz+CodingStateMachine.get_coding_state_machinecCs |jdS)Nlanguagerrr r rrVszCodingStateMachine.languageN) r __module__ __qualname____doc__rr rrrpropertyrr r r rr!sr)r Zenumsrobjectrr r r rs PKd]78chardet/__pycache__/mbcharsetprober.cpython-38.opt-1.pycnu[U .eU @s0ddlmZddlmZmZGdddeZdS)) CharSetProber) ProbingState MachineStatecsVeZdZdZdfdd ZfddZeddZed d Zd d Z d dZ Z S)MultiByteCharSetProberz MultiByteCharSetProber Ncs,tt|j|dd|_d|_ddg|_dS)N) lang_filter)superr__init__distribution_analyzer coding_sm _last_char)selfr __class__G/usr/lib/python3.8/site-packages/pip/_vendor/chardet/mbcharsetprober.pyr 'szMultiByteCharSetProber.__init__cs<tt||jr|j|jr.|jddg|_dS)Nr)rrresetr r r r rrrr-s   zMultiByteCharSetProber.resetcCstdSNNotImplementedErrorrrrr charset_name5sz#MultiByteCharSetProber.charset_namecCstdSrrrrrrlanguage9szMultiByteCharSetProber.languagecCstt|D]}|j||}|tjkrN|jd|j|j |t j |_ qq |tj krft j|_ qq |tjkr |j}|dkr|d|jd<|j|j|q |j||d|d|q |d|jd<|jt jkr|jr||jkrt j|_ |jS)Nz!%s %s prober hit error at byte %srr)rangelenr Z next_staterZERRORZloggerdebugrrrZNOT_MEZ_stateZITS_MEZFOUND_ITZSTARTZget_current_charlenr r feedstateZ DETECTINGZgot_enough_dataget_confidenceZSHORTCUT_THRESHOLD)r Zbyte_striZ coding_stateZchar_lenrrrr=s8       zMultiByteCharSetProber.feedcCs |jSr)r rrrrrrZsz%MultiByteCharSetProber.get_confidence)N) __name__ __module__ __qualname____doc__r rpropertyrrrr __classcell__rrrrr"s   rN)Z charsetproberrZenumsrrrrrrrs PKd]i' -''9chardet/__pycache__/chardistribution.cpython-38.opt-1.pycnu[U .e$@sddlmZmZmZddlmZmZmZddlm Z m Z m Z ddl m Z mZmZddlmZmZmZGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZGdddeZdS))EUCTW_CHAR_TO_FREQ_ORDEREUCTW_TABLE_SIZE EUCTW_TYPICAL_DISTRIBUTION_RATIO)EUCKR_CHAR_TO_FREQ_ORDEREUCKR_TABLE_SIZE EUCKR_TYPICAL_DISTRIBUTION_RATIO)GB2312_CHAR_TO_FREQ_ORDERGB2312_TABLE_SIZE!GB2312_TYPICAL_DISTRIBUTION_RATIO)BIG5_CHAR_TO_FREQ_ORDERBIG5_TABLE_SIZEBIG5_TYPICAL_DISTRIBUTION_RATIO)JIS_CHAR_TO_FREQ_ORDERJIS_TABLE_SIZEJIS_TYPICAL_DISTRIBUTION_RATIOc@sLeZdZdZdZdZdZddZddZd d Z d d Z d dZ ddZ dS)CharDistributionAnalysisigGz?g{Gz?cCs0d|_d|_d|_d|_d|_d|_|dSN)_char_to_freq_order _table_sizetypical_distribution_ratio_done _total_chars _freq_charsresetselfrH/usr/lib/python3.8/site-packages/pip/_vendor/chardet/chardistribution.py__init__.sz!CharDistributionAnalysis.__init__cCsd|_d|_d|_dS)zreset analyser, clear any stateFN)rrrrrrrr=szCharDistributionAnalysis.resetcCsX|dkr||}nd}|dkrT|jd7_||jkrTd|j|krT|jd7_dS)z"feed a character with known lengthr riN) get_orderrrrr)rcharZchar_lenorderrrrfeedFs  zCharDistributionAnalysis.feedcCsT|jdks|j|jkr|jS|j|jkrN|j|j|j|j}||jkrN|S|jS)z(return confidence based on existing datar )rrMINIMUM_DATA_THRESHOLDSURE_NOrSURE_YES)rrrrrget_confidenceTs  z'CharDistributionAnalysis.get_confidencecCs |j|jkSr)rENOUGH_DATA_THRESHOLDrrrrgot_enough_datadsz(CharDistributionAnalysis.got_enough_datacCsdS)Nr"r)rbyte_strrrrr#isz"CharDistributionAnalysis.get_orderN) __name__ __module__ __qualname__r,r)r(r'rrr&r+r-r#rrrrr(s rcs$eZdZfddZddZZS)EUCTWDistributionAnalysiscs$tt|t|_t|_t|_dSr) superr2rrrrrrrr __class__rrrrsz"EUCTWDistributionAnalysis.__init__cCs0|d}|dkr(d|d|ddSdSdS)Nr ^rr"rrr. first_charrrrr#xsz#EUCTWDistributionAnalysis.get_orderr/r0r1rr# __classcell__rrr4rr2qs r2cs$eZdZfddZddZZS)EUCKRDistributionAnalysiscs$tt|t|_t|_t|_dSr) r3r=rrrrrrrrr4rrrsz"EUCKRDistributionAnalysis.__init__cCs0|d}|dkr(d|d|ddSdSdS)Nr r7rr8r"rr9rrrr#sz#EUCKRDistributionAnalysis.get_orderr;rrr4rr=s r=cs$eZdZfddZddZZS)GB2312DistributionAnalysiscs$tt|t|_t|_t|_dSr) r3r?rrrr rr rrr4rrrsz#GB2312DistributionAnalysis.__init__cCs>|d|d}}|dkr6|dkr6d|d|dSdSdS)Nr rr>r8r7r"rrr.r: second_charrrrr#sz$GB2312DistributionAnalysis.get_orderr;rrr4rr?s r?cs$eZdZfddZddZZS)Big5DistributionAnalysiscs$tt|t|_t|_t|_dSr) r3rBrr rr rr rrr4rrrsz!Big5DistributionAnalysis.__init__cCsX|d|d}}|dkrP|dkr:d|d|ddSd|d|dSndSdS) Nr rr8?@r"rr@rrrr#s z"Big5DistributionAnalysis.get_orderr;rrr4rrBs rBcs$eZdZfddZddZZS)SJISDistributionAnalysiscs$tt|t|_t|_t|_dSr) r3rGrrrrrrrrr4rrrsz!SJISDistributionAnalysis.__init__cCsr|d|d}}|dkr0|dkr0d|d}n&|dkrR|dkrRd|dd}nd S||d }|d krnd }|S) Nr rr"rFr)rr.r:rAr%rrrr#s z"SJISDistributionAnalysis.get_orderr;rrr4rrGs rGcs$eZdZfddZddZZS)EUCJPDistributionAnalysiscs$tt|t|_t|_t|_dSr) r3rOrrrrrrrrr4rrrsz"EUCJPDistributionAnalysis.__init__cCs0|d}|dkr(d|d|ddSdSdS)Nr r7r8rr"r)rr.r$rrrr#sz#EUCJPDistributionAnalysis.get_orderr;rrr4rrOs rON)Z euctwfreqrrrZ euckrfreqrrrZ gb2312freqrr r Zbig5freqr r r Zjisfreqrrrobjectrr2r=r?rBrGrOrrrrsIPKd]!+E/E/,chardet/__pycache__/euckrfreq.cpython-38.pycnu[U ʗRe4@sdZdZdZdS)g@0 (0 xitiiiiHiaiiii+iWiuihii]iiiiiiiiiiiviwiiiimiFi!ipii iiiiiixi/iiiiiiii9iiitii-iyiKiiiiiiOiiniiiiiii0i<i4{iiiiiiiiiriiiiiiiiiiiiXiXiiiiYiii&iiPiiiiiiii^iiiiiii9iiiiiiiQii"itiiii]i{i7iii{ii;iiuiizi/ii|iiii7iii.iiiiiiiiiiiiii{iiii#i|i}ii~iiti8ii_i i i i i i!iiii_iiiiiii*iiuii`i"iii|iiiiiiiaiiiiiii?iiRi!i i/iii!i"i=iii#ii$i%i&i'i(i)i,ii'ibi$i*ii+ii-ii,iiiiii&iUiii#iii-i.'iiifi/isii0iiiiii ii9ie[i1iiiiZiii:iiii2i3iiGiiiyi4iiii5i6i7i,wiiisi8ii9i:iii~i;ii<i;i}i=i>i?ioi)iii@iiAiBiii2iYiCiDii<iEiFiGiHiIi%iJiKiLiMiNiOi`i>iPii=iQiiRiiSiTi;iiiii iUiiViWiXi4iYiiZi[ii\i]ii^iii_"iPiii`i;ii~iHiaivizi?iiiibiii<iciddieific0iidiigiyiiihiisi0iji=ikiiliiii<ibiiUi iiiiIiminioiipiqirisitiuiiii6iviwii*i]ixiyiiiziZi-:ibi i{i|i&i'iii5iiii>i}i~iwiigiiii6ii%ii(iviiiwiiiEiiiiiiiiiifiVii7iiiiiBiNii[ii'iiiiiiiSiiiiiieiiixiiiiiiiiiiiiiiiiiiiii?iiiiiqiifii(i)iii~ii\iiiiii)iiiiiiiiiii$iiiiiliiii~iiiCiiii@iiiii2iiKiiziViiiQirifiiii ihi+i3ii1i iiigi(iiiiziiiiiiiiiiiiiiiiiAi<ijiiiMigii2iiiiiiiiiiVihiiiJiii0ibiiiiiiiYiiiai!*iiiiKiDi8iiRiiBi@iiiiiiiiyiiiiiiXi:iii#iiiiiiGiiikiii=iii!iiiJi=iii}iiijiiiiiiiiiiiiiEiiiiijiO4iiiiiiiii ivi]iiCiiiiiiiioiiii iiiliciAiiiiiiiiiTiiikiiii3i*iqii>iiiiiii+iiiii;ipiixiiii iiiii ii i ii i iiiliiiiii)iimi8iiiDiiiii iiiiiii7iLBiiiDiiiiiitiiii i!i i"i#i$i%iRi&i'i(i)i*i+i,i,i-i.mii i^i/iciiEiiiiaimi0iEi1i2i3iiii4iTiiii5iiiii6i7iiniiioi8i9iFiiii:iGi;i<i=i>i?i@iAiBiCiDiEi$iFiGiii%iiipiHiIiJiKiLiiiiiiiiMiNiOiPiQiRiiSi/iTiiUiiiiViIiHiiiiiWiiXiqiYiZi[i\iiriisi]i^i_i` iviLiai.iibiFi>iijicZiiiBi6ii`idieii|iifiii5igiihiiiHijiiikiilii1iminioipiqiriCisitiuiviwiixiyizi{iii|i}i~iiiiiiiiOiiiiiiiiiiiiiEiiiqiiiIii\ii-iiiSiii iieiiiliiMQiPiii^ii i-iFiiiiiiiiiiiiiiiiiii i.iitiiiiiJiiiiiiiigiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiuiiii9i iiii ii$iiiii5i%ikLiiiiiiiiiiAiiiiiiiiiRiuiiiiii)iii:iiiiii"i$iviiciZiiiii*iWiiKiiLi+iiiiiii iBii?iiiiiiiiMi[i5iiiiniiiiCii'iiiiiiiii iiii iiiiiiiFiTi/iiii8iuiiiiKii(iMiiiiiiiiiiiiTi?iiiiiiei i(iiiiii%i0iOii i8i i i i i iii i i i#i iVi iiPi  MiWii ii ii|i i Siiiiiii i iii i i i i i ii i 9Diiii 3iii i i i{i iii i i ii iiiii! ikiiiiNiYii" i# i$ i% i& i' i( i]i) i* i+ i, i- i. ii/ ii>iri1 iiii\ii2 ii3 iii4 i5 i6 iwi7 ii8 ii3iiii9 i: iL i; i< iiiiiii iiii= iiJi> i? i@ iiA iB iC iD iiE iiiF iG iH iI iiiiiiiJ iK iiiL iM iN iiIiO iP iiQ iR iS iiT iiU iV iW iX iiY iZ i[ i\ i] iii^ i_ i` ia iiib ic id ie iiif ig iUiixi ih iiii ij iii4i&iii!iiiSiyi iii"i ii#ik iil im in iiipiQii.io iUiOiip iiq ir is ixit iiu iv iw iii$ix iiy ii`iz i{ i| i} i~ i i i i i i i iCiiii%iyiiioi ii i i i i i ii i i i iii iii i i@iii iGi iiii2iiii i i i iNi i iiiii i i i i ri iiziniiiPi i#i i&iQi iimi iciii i'i iwi i i(ili@iiii)ii*i i i i ii i i i iii iii i i iHii i ii iii i i ii i iri iiAi iiii }i,iii:iiii iiIi iNii1i iWiiiiii i+i i 1iibii iqi i,i iieii_iidi i i i i i ii2iiii i i i i ii ii i ii-i iii i i i i i ii i i i i i ii ii i i7i ii ii i i i i i i iiiiii,iGiiii ii^i i i.i igii ii i i iii iiii_ii i i iihihii{i i|iii3i i i iii i i \iiiii i i i i i i i i i i iiii iji iiii4ii i i i i i ii i i i i6idi/i i iiioi iiRii &i kniziii ii iXiidiiSii}i i}iii~iiiii i! iNi" iiiiii# iisi$ i% i& fiDii1i' iii( i@i) ^ii* ii+ i, i- i. i/ iJi+i0 i1 i2 iiTii3 i4 i5 i6 i7 iAi.iiii8 i9 ii"i: i; ii< i= i> iii0i? ii@ iiA iB iiC iD iE iF iG iii_i[iH iI iii`iaiJ iiiiiK iL iM iN iO iiiiiiiP iQ iR N) EUCKR_TYPICAL_DISTRIBUTION_RATIOEUCKR_TABLE_SIZEEUCKR_CHAR_TO_FREQ_ORDERrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/euckrfreq.py)sPKd]7Y@2chardet/__pycache__/sbcsgroupprober.cpython-38.pycnu[U ʗRe!@sddlmZddlmZddlmZmZddlmZm Z ddl m Z ddl m Z mZmZmZmZmZddlmZddlmZdd lmZGd d d eZd S) )CharSetGroupProber) HebrewProber)ISO_8859_5_BULGARIAN_MODELWINDOWS_1251_BULGARIAN_MODEL)ISO_8859_7_GREEK_MODELWINDOWS_1253_GREEK_MODEL)WINDOWS_1255_HEBREW_MODEL)IBM855_RUSSIAN_MODELIBM866_RUSSIAN_MODELISO_8859_5_RUSSIAN_MODELKOI8_R_RUSSIAN_MODELMACCYRILLIC_RUSSIAN_MODELWINDOWS_1251_RUSSIAN_MODEL)TIS_620_THAI_MODEL)ISO_8859_9_TURKISH_MODEL)SingleByteCharSetProbercseZdZfddZZS)SBCSGroupProbercstt}ttd|d}ttd|d}|||tttttttt tt tt tt tt tttttttt|||g|_|dS)NF) is_reversed name_proberT)super__init__rrrset_model_probersrr r r r r rrrrrrprobersreset)self hebrew_proberlogical_hebrew_probervisual_hebrew_prober __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/sbcsgroupprober.pyr3s<  zSBCSGroupProber.__init__)__name__ __module__ __qualname__r __classcell__r r rr!r2srN)charsetgroupproberr hebrewproberrlangbulgarianmodelrrlanggreekmodelrrlanghebrewmodelrlangrussianmodelr r r r r r langthaimodelrlangturkishmodelrsbcharsetproberrrr r r r!s       PKd]s_q q 0chardet/__pycache__/charsetprober.cpython-38.pycnu[U ʗRe@s8ddlZddlZddlmZedZGdddZdS)N) ProbingStates%[a-zA-Z]*[-]+[a-zA-Z]*[^a-zA-Z-]?c@sneZdZdZdddZddZeddZd d Zed d Z d dZ e ddZ e ddZ e ddZdS) CharSetProbergffffff?NcCsd|_||_tt|_dSN)_state lang_filterlogging getLogger__name__logger)selfrr /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/charsetprober.py__init__+szCharSetProber.__init__cCs tj|_dSr)r DETECTINGrr r r rreset0szCharSetProber.resetcCsdSrr rr r r charset_name3szCharSetProber.charset_namecCstdSr)NotImplementedError)r byte_strr r rfeed7szCharSetProber.feedcCs|jSr)rrr r rstate:szCharSetProber.statecCsdS)Ngr rr r rget_confidence>szCharSetProber.get_confidencecCstdd|}|S)Ns([-])+ )resub)bufr r rfilter_high_byte_onlyAsz#CharSetProber.filter_high_byte_onlycCsZt}t|}|D]@}||dd|dd}|sJ|dkrJd}||q|S)u7 We define three types of bytes: alphabet: english alphabets [a-zA-Z] international: international characters [€-ÿ] marker: everything else [^a-zA-Z€-ÿ] The input buffer can be thought to contain a series of words delimited by markers. This function works to filter all words that contain at least one international character. All contiguous sequences of markers are replaced by a single space ascii character. This filter applies to all scripts which do not use English characters. Nr) bytearrayINTERNATIONAL_WORDS_PATTERNfindallextendisalpha)rfilteredwordsword last_charr r rfilter_international_wordsFs    z(CharSetProber.filter_international_wordscCst}d}d}t|d}t|D]R\}}|dkrB|d}d}q$|dkr$||krr|sr|||||dd}q$|s|||d |S) a[ Returns a copy of ``buf`` that retains only the sequences of English alphabet and high byte characters that are not between <> characters. This filter can be applied to all scripts which contain both English characters and extended ASCII characters, but is currently only used by ``Latin1Prober``. Frc>rs  PKd]l⤓888chardet/__pycache__/sbcsgroupprober.cpython-38.opt-1.pycnu[U .e @sddlmZddlmZddlmZmZmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZddlmZddlmZdd lmZGd d d eZd S) )CharSetGroupProber)SingleByteCharSetProber)Win1251CyrillicModel Koi8rModelLatin5CyrillicModelMacCyrillicModel Ibm866Model Ibm855Model)Latin7GreekModelWin1253GreekModel)Latin5BulgarianModelWin1251BulgarianModel)TIS620ThaiModel)Win1255HebrewModel) HebrewProber)Latin5TurkishModelcseZdZfddZZS)SBCSGroupProberc stt|tttttttttttt tt tt tt tt ttttg |_t}ttd|}ttd|}||||j|||g|dS)NFT)superr__init__rrrrrrr r r r r rrZprobersrrZset_model_probersextendreset)selfZ hebrew_proberZlogical_hebrew_proberZvisual_hebrew_prober __class__G/usr/lib/python3.8/site-packages/pip/_vendor/chardet/sbcsgroupprober.pyr,s6  zSBCSGroupProber.__init__)__name__ __module__ __qualname__r __classcell__rrrrr+srN)ZcharsetgroupproberrZsbcharsetproberrZlangcyrillicmodelrrrrrr Zlanggreekmodelr r Zlangbulgarianmodelr r Z langthaimodelrZlanghebrewmodelrZ hebrewproberrZlangturkishmodelrrrrrrs       PKd]"|& & 5chardet/__pycache__/latin1prober.cpython-38.opt-1.pycnu[U .e@s^ddlmZddlmZdZdZdZdZdZdZ dZ dZ d Z d Z eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeee ee ee eeeeeeeeeeee ee ee e eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee e e e e e e e e e e e e e e e e e e e e e e ee e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e ee e e e e e e e fZd ZGd d d eZdS)) CharSetProber) ProbingState)@rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrcsLeZdZfddZddZeddZeddZd d Zd d Z Z S) Latin1Probercs&tt|d|_d|_|dS)N)superr __init___last_char_class _freq_counterresetself __class__D/usr/lib/python3.8/site-packages/pip/_vendor/chardet/latin1prober.pyraszLatin1Prober.__init__cCs t|_dgt|_t|dS)Nr)OTHr FREQ_CAT_NUMrrrrrrrrgs zLatin1Prober.resetcCsdS)Nz ISO-8859-1rrrrr charset_namelszLatin1Prober.charset_namecCsdS)NrrrrrlanguagepszLatin1Prober.languagecCs`||}|D]J}t|}t|jt|}|dkr@tj|_qZ|j|d7<||_q|j S)Nrr) Zfilter_with_english_lettersLatin1_CharToClassLatin1ClassModelr CLASS_NUMrNOT_MEZ_staterstate)rZbyte_strcZ char_classZfreqrrrfeedts  zLatin1Prober.feedcCs\|jtjkrdSt|j}|dkr(d}n|jd|jdd|}|dkrPd}|d}|S)Ng{Gz?grrg4@g\(\?)r!rr sumr)rZtotalZ confidencerrrget_confidences  zLatin1Prober.get_confidence) __name__ __module__ __qualname__rrpropertyrrr#r% __classcell__rrrrr `s   r N)Z charsetproberrZenumsrrZUDFrZASCZASSZACVZACOZASVZASOrrrr rrrrs  ' PKd]gHgH)chardet/__pycache__/mbcssm.cpython-38.pycnu[U ʗRetu@sJ ddlmZdZejejejdejejejejejejejejejejejejejejejejejejejejfZdZedeeddZdZ ejejdejejejd dejd ejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejfFZ d Z e d e e d dZ dZ dd ddejejejejejejejejejejejejejejejejejejejejejejejejejejdejdejejejejejejejf(ZdZe d eeddZdZejejdejejejejejejejejejejejejejfZdZed eeddZdZejejejejejejejddd ejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejf2ZdZed eeddZdZejejejdddd ejejejejejejejejejejejejejejejejejejejejejejejejejdejejejejejejejejejejejejejejejf0ZdZedeeddZdZejejejejejejdejejejejejejejejejejejejejejejejejd ejejejejejejejejejdejejejejejejejejejejejejejf0ZdZedeeddZ dZ!ejejejdejejejejejejejejejejejejejejejejejejejejfZ"dZ#e!d e"e#d dZ$d!Z%dddejd dejejejejejejejejejejejejd d d d ejejd d d d d ejd d d d d d dddejdd"d d ejd d d d d d d ejejejejf8Z&d#Z'e%d e&e'd$dZ(d!Z)d d dd d dejejejejejejejejejejejejdddejejejdddejdejd d dd d"d"dddejdddejejejdddddejdejejejf8Z*d%Z+e)d e*e+d&dZ,d'Z-ejejejejejejd(d d)d*d"dd dd dejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejddddejejejejejejejejejejejejejdddejejejejejejejejejejejejddddejejejejejejejejejejejejejejddejejejejejejejejejejejejd)d)d)d)ejejejejejejejejejejejejejejejd)ejejejejejejejejejejejejd(d(d(d(ejejejejejejejejejejejejejejejd(ejejejejejejejejejejejejd(d(d(ejejejejejejejejejejejejejejejejejejejejejejejejejejejfZ.d+Z/e-d,e.e/d-dZ0d.S)/) MachineState(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrBig5) class_table class_factor state_tablechar_len_tablename(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) rrrrrrrrrr CP949(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrzEUC-JP(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrzEUC-KR(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) rrrrrrrrrrJohab(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrrrzx-euc-tw(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrrGB2312(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrr Shift_JIS(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrzUTF-16BE)rrrrrrzUTF-16LE(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrr rrrrrrr)rrrrrrrrrrrrrrrrzUTF-8N)1enumsrBIG5_CLSERRORSTARTITS_MEBIG5_STBIG5_CHAR_LEN_TABLE BIG5_SM_MODEL CP949_CLSCP949_STCP949_CHAR_LEN_TABLECP949_SM_MODEL EUCJP_CLSEUCJP_STEUCJP_CHAR_LEN_TABLEEUCJP_SM_MODEL EUCKR_CLSEUCKR_STEUCKR_CHAR_LEN_TABLEEUCKR_SM_MODEL JOHAB_CLSJOHAB_STJOHAB_CHAR_LEN_TABLEJOHAB_SM_MODEL EUCTW_CLSEUCTW_STEUCTW_CHAR_LEN_TABLEEUCTW_SM_MODEL GB2312_CLS GB2312_STGB2312_CHAR_LEN_TABLEGB2312_SM_MODELSJIS_CLSSJIS_STSJIS_CHAR_LEN_TABLE SJIS_SM_MODEL UCS2BE_CLS UCS2BE_STUCS2BE_CHAR_LEN_TABLEUCS2BE_SM_MODEL UCS2LE_CLS UCS2LE_STUCS2LE_CHAR_LEN_TABLEUCS2LE_SM_MODELUTF8_CLSUTF8_STUTF8_CHAR_LEN_TABLE UTF8_SM_MODELrMrM/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/mbcssm.pys $   $  $ %  $  $ & $  $  $PKd]℄>>/chardet/__pycache__/compat.cpython-38.opt-1.pycnu[U .en@s@ddlZejdkr(dZdZeefZeZndZdZeefZeZdS)N)rTF) sys version_infoZPY2ZPY3strZunicodeZbase_strZ text_typebytesrr>/usr/lib/python3.8/site-packages/pip/_vendor/chardet/compat.pys PKd]Z,qq4chardet/__pycache__/langcyrillicmodel.cpython-38.pycnu[U .eF@sdZdZdZdZdZdZdZeeddd d d Zeeddd d d Zeeddd d d Z eedddd d Z eedddd d Z eedddd d Z dS)(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrJKrrrrrrGBAL@MHECNIOrrrrrDrr '    6;%,:)05.7*<$1&"#+- (48!=>39/?2F(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrr9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqr\rrrsrtrurvrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxryrr~r{r|rrrrrrrrrrrrrrr}rrzrrrrrrrrwr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrr9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r]r^r_r`rarbrcrdrerfrgrhrirrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxryrr~r{r|rrrrrrrrrrrrrrr}rrzrrrrrrrrwrrjr\rkrlrmrnrorprqrrrsrtrurvrr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrr\rrxryrr~r{r|rrrrrrrrrrrrrrr}rrzrrrrrrrrwr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrr9r:r;r<r\r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrwrrrrxrryrrzrr{rr|rr}rr~rrTrUrVrWrXrYrZrrrrr[r]r^r_rrr`rarbrcrdrerfrrrgrhrirjrkrlrmrnrrrrrrrrrrorprqrrrrrsrrrrrrrrrrrrrrrrtrurrrrrrrrrrrrrvrr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxryrr~r{r|rrrrrrrrrrr9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r]r^r_r`rarbrcrdrerfrgrhrirrrrr}rrzrrrrrrrrwrrjr\rkrlrmrnrorprqrrrsrtrurvrr(rxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrrrxrxrxrxrrxrxrxr|rxr|rxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrrxr|r|r|r|r|rrr|rxrxrxr|rxrxrxrxrxrxrxrxrxrxr|rxrxrrrxrxrxrxrxrxrxrxrxr|rxr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxr|r|rxrxrxrxrxrxrxrxrxr|rxrxrrrxrxrxrxrxrxrxrxr|rxrxrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxr|rxr|rxrxrxrxrxrxrxrxrxrxrxrxrxrrrxrxrxrxrxrxrxrxrxrxrxr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxrxrxrxrxrxrxrxrxr|rxrxrrrxrxrxrxrxrxrxrxrxrxrxr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxrxrxr|r|r|rxrrxrxrrxrxrxrxr|r|rxrr|r|r|rxrxr|rrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxr|rxrxrxrxrxr|r|rxr|rxrxrxr|rr|r|rrr|r|r|r|r|r|rrrrrrrrr|rrrrrrrrrrrrrrr|rrrrrrrrrrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxr|r|r|rxrr|r|rxrxr|rr|rrrrrrrrr|rrrrrrrrrrrrrrr|rrrrrrrrrrxrxrxrxrxrxr|rxrxrr|rxr|r|rxr|rxrxrxrxr|r|rxrrxr|r|rxrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxrxrxr|r|rxrxrxrxrxr|rxrxrxrxr|r|r|rrxrxrxr|r|r|r|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxrxrxrxrxr|rxr|rxrxrxrxrxrxr|rxr|r|rrrxr|rr|r|rrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrxrxrxrxrxrxrxrxrxrxrxr|rrrxrrrrrr|rrrr|r|r|rr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxr|rxrxr|r|r|r|rrxr|rxr|rxr|rr|r|rrrr|rr|rr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxrxrxrxrxrxrxr|r|rxr|rxrxrxr|r|r|r|rr|r|r|r|rxrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrxr|rxr|r|rxrxrxrxrxrxrxrxrxrrxr|rrrxrxrxrxr|rxrxrxrxr|rxr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrr|rxrxrxrxrxr|r|rxrxrr|rrrxr|rxr|rxrrrr|rrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrrxrr|rxrxrxrxr|rxrxrxrxrr|r|rrr|rxr|r|r|rxr|rxr|r|rxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxr|rxrr|rxr|rxrrr|rxrxr|rr|rxrrr|rxr|r|rrrxrrxr|r|rrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrrxrr|rxrxrxrxrxrxrxrxr|rrxr|rrr|r|rxrxrxr|rxrxrr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxr|r|rxrxr|r|r|rxrxrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrxr|r|rxrxrxrxrxrxrxrrxr|rxrxr|rxr|rr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrxrxrxrxrxrxr|rxrxrxr|r|r|r|rxrrxr|rxrrr|rrr|r|r|r|rrxrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrr|r|rxrxrxrxrxrr|r|rrxrrrxrrrxrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxr|r|rrrxrxrxr|r|rr|r|rxrrr|rrr|r|rrxrrr|rrr|rrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxr|rxrxrxrxrr|r|r|rr|rrxrxrrr|rr|rr|r|rr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rxrxrxrxrxr|rrxr|r|rxr|rrxr|rrxrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrxrxr|rxrxrxr|r|r|rxrxrr|rr|rrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrrr|rr|rxrxr|r|rr|r|rxrr|rrrr|r|rxr|rr|r|r|r|r|rxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrxrxrxrxrrrrrr|r|rrrxrrrrxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrxrxrxr|rrrr|rrrrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrr|rxr|r|r|rr|r|r|rr|rrrrrrrr|rrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrr|rxrxrxrxrrrrrrrrrrxrrr|rrrrrrrrrrrrrrrrrrrr|rrrrr|rrrrrrrrrrrrrrrrrrrrrr|r|rxr|r|r|rxrr|r|r|r|r|r|r|r|rrrrrrrrrrrrrrr|rrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrxrxrxr|r|r|r|rxr|r|rrr|r|r|r|rrrxrr|rr|rrrrrrrr|rrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrxr|r|r|r|rr|rr|rr|rrrr|rr|r|rrr|r|rrrrr|rrrrrrrrrr|rrrr|rrrr|rrrrrrrrrrrrrrrrxr|r|r|rrrr|rxrrrrr|rr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrr|rxr|rxr|rr|r|r|r|rrrrr|rrrrrrrrrrrrrrrr|rrrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrxrrrrr|r|r|rxr|r|r|r|r|r|r|rrrr|rr|rrrr|r|rrrrr|rrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrr|rxr|rxrxr|rrrrrrrrr|rrrrxrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rxrxrxrxrr|r|r|r|rrrrr|rrrr|rrrrrrrrrrrr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrr|rxrxrxr|rrrrr|r|rrrr|rrrrxrrrrrrrrrrrr|rrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxr|rxr|rrrr|r|r|rrrr|rrrrrrrrrrxrrrrrr|rrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrxrr|rrr|r|r|r|r|r|rr|r|rrrrrr|r|r|rrrrr|rrrrrr|rrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrxrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxrxr|r|rrrr|r|rrrrr|rrrr|rrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rxr|rxr|rrrrrrrrrr|rr|rr|rrrrrrrrrrrrrrrr|rrr|rrrrr|rrrrrr|rrrrrrrrrrrrrrrrrxr|r|r|rrrr|r|rrrr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rxrr|r|r|r|r|r|rrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rr|rrrrrxr|rr|rr|r|rrrrrr|rrrr|rrrrrr|rr|r|rrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrr|r|r|r|rrrrrrrrrr|rrrrrrrrrrrrr|rrr|rrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrr|rr|r|r|rrxrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|rxr|r|rrrrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|rrr|rr|r|r|r|r|rr|r|rrrrrrr|r|r|rr|rrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|r|rrrr|r|rrrrr|rrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|r|rrrr|r|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|r|rrrrrrrrrr|rrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|rrr|rr|rrrrrr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrglP@?FzKOI8-RZRussian)Zchar_to_order_mapZprecedence_matrixZtypical_positive_ratioZkeep_english_letterZ charset_nameZlanguagez windows-1251z ISO-8859-5Z MacCyrillicZIBM866ZIBM855N) ZKOI8R_char_to_order_mapZwin1251_char_to_order_mapZlatin5_char_to_order_mapZmacCyrillic_char_to_order_mapZIBM855_char_to_order_mapZIBM866_char_to_order_mapZRussianLangModelZ Koi8rModelZWin1251CyrillicModelZLatin5CyrillicModelZMacCyrillicModelZ Ibm866ModelZ Ibm855ModelrrI/usr/lib/python3.8/site-packages/pip/_vendor/chardet/langcyrillicmodel.pysb     PKd]WUjUj,chardet/__pycache__/euctwfreq.cpython-38.pycnu[U ʗRe1@sdZdZdZdS)g?i(iii Riiii ni!i iL,iAis iiiiiL iS iii iiii.iNiii:iii?iii=iNKiil iii i i i  iii ioi$ iiii ici8iiiiiiiz|it "i ie @i\ii iiiiiiFiiM iQHiiPivif iiiiDiT iiiFiN iEi iOi/isii3<2i i&iLiiiO iiGiiM iii?ii i`iiF i*iigi Zi i:i iiKi i iiiii`iiiig i i qii~iiP i ii iii!iuii*iii i i~iiiieiGi^iii UiCiiBiiiiiii jioi/iiiOi2 i[ii i& iiiiSi(ii ip]ii6iii i' iiiiii8+i% i[ii\iiiiiX i( ii i0i iHi i i"i!i+i i1i"iii iOiG iiifi1iiiiiii2i9li,i iiiiii}ih i#iq iQiMi&i Xiii#ii iijiiMii %i ii$ii'i iiN ii i7Jii!iiiiiMii) iPiU ii ii%i i i ii i iIii3 ii iir i i iimiii$iiixii iii ii ii%i&i iiiiii&ii'iii'ii.i iiiH iiii$#iiDi&iAi iiiiiUiGiiii iQ iPiSi'iidi 0Fiii* iiiiiiiJii iUiiI iR iii<iiS i:i7 i ii i i9ii}ii iiiViPiT ii)iCiiii& i i i)iiim iiiiiii4 iiiin i*iiiiiiiO iiiii i+ i(i i iiiU i(ii5iYiji iliiuii)i i*i+iV i i=i iiiiiii4ii!iiiTi, ixiiiei iiJ iPiis i5iAiV i/iki i iili!i iiAii`ii i iAii iiii ii i iiiiiMi iiiiiiW iii it iii+}iij i8 iiiiiiiii- i)imi iiW ii ii iiaii iP iK i i,ii ii7i' iu ii{ik iiiii i9 iiiiiiiiiii1bii i iiio iiX i,iQ iiiii i i iX iii5Diiliii[i iiY ii%i. iY ii*iii iiR iii ipiincigi+iii'i2iii{iil iim iii: iifi ii|i5 iiiiZ i i i i ii i,ii ii;iiIiYiii[ iXi"ii iiii~iii,iikiii-iiiiiiDiiii>i]ii,iiiiviLiBii&iii iiiiGiiiiBii i! iiiu iiiii i iaiiiiv iS ii}i; iiDii=ii0i ii\ i( iiiivi iiii.ii9iHiiiii] iEiiiiii!ii/ iii i i-iiiQi*ii.i/iiiii0 3ii" ii*iRiiiWiii/iibi.ii iiiiiiRii ii) ii2ii iiiiiiiZ iiT iiw iiii iiiiiii[ Oii i i`i7ix i^ iiiiiii\ iiiiiiigiiin ii i_ii~iii0ii iaiiy i] iiiii ii i;i i-i iiL iii/iiii`ii#i"iiiii0i isiiiidisi iiY ii ikiwio ii iiii1ii2igip iQiiUi iv iiiCiSii^ iii5iiiBii_i ibiNiiXiiii iLici i i iKiw i* iaiGi3ii i iii1i6i i2i6 Niii i i3ii:ii\iqiiii-iii i3i iiiix i i irii4i i_ iiU iiii@ii5i ii ii ii/i+ i6i iiiiiii i7 iZ iiii8i4iiCiii iilii` iiiiiiYiii5i {iiii$i7iiMiV i0irii iigiiVii8ii9i, iZiii{i#iW i0iii$i i i ii4ii[iviiiciiViM i$i- iiiX iii idiiiWi[ iii iiiq i ii1 iiiiitiiii ii i i2 ii2i:i3 i i.iii2ii iiiii%i iii i i iiiiii i i6i i4 ii|iiiSiiii_ i iiiii`iiiii i3iii;ir iiii7iYiLi;ii i iiiiT\iiii<iiVi5 iii iii ii"ixi%ii;i8 i iii2iEi=i!iii^iiwi i"iiiis ii#i<iQiiiri$ii]ii%ii. i&i i3i5iBiiy i'iii ii i i>iY ia ib i(i i i)i*i iii:ii6ii^ii iii(i i+i+i i ixi,i i.ihi/ i-iii iVi ii hiiz i.iiii<iii;i/i?iii i i0i8i i ii5i6i i_)i1i2i i3iyi ii i i^i4i i i?i$i+i\ i i5i_iWii iz i6i0 ii i] i ip i7i ii8i^ i< iiVi9i i6 iiIwi}ic i^ii i9i@ii iAi iii i:iei1iiiBiiiiii i i ii7 i;i<ii=i{ i(i`iRi1 iYiiIi i i i6i id i>iiie i?iioiqiYiniiiliiCiDi{ ii i_ iEiPiUii i iiiiEimii@ii:i ii iAiiiiii# i iNi i iBiiCiWiTiTii iif i;iDii&i i| iiiiii iii<i= i iii iVii iioii iEi iFiii iii iiiDi-i8 iiGidi i i iHit iiiIizi iiJi i iKii i| iiiii> iiiiiiLi:i i=iiMii? i iiiHiiiiiNiii iOiPiiFikiQi9 i ii i iu iiv iiiiiiRiSiii} i i>iiiii i: iTi iiN iiCiiiiUi~ii iWiiGiiii,iiiiiOii|iiiiOi?iVi` ii ii~ i iw iiii@i!iii; iiiiWii"i iXiiYiiRig iuii ih i ix i=i iiZii< iii[i i#ii= i i\i$ii]iHiIi^i7iO i$ i i_i%iviJii i!iwitii`iaibi9 i&ii"i{i i i'iciidi8iiiii[i9iiidiZ i ieiii i@ i!i(i"ifiii i#i$iTigiKii i%iWiMihiiiiiiii%iiiii i` iiyi7imiLijiki i: i> i!iii Bi)ili|i i iziii iiMi ii iiiminiuiq ivii i i*iNioipiiqi7i.iriiy i iii iifii i isi! iyi iOi i iii+iPij i i>iiii iYi iAitiiui% i i ivi iiz i2 iwi,i i ii3iQiii ixi i6i9ik iii&6i i-i iiRiyiiQi9ici i'i.i oi(iBiFi? il i i)iei i izi iSiTi iii{i/ii" i ibi/ii`iii0iuiiviii1ii i iiUii*i i/iEiSii8iZi|i}iFi+i ii!i~i2i,iFiP iim ii iieisiiCi ir iiii iiai3iZi%i-iiii i4iiiiAiii i iii iiiiDi.iiii inii iii iii ii3 i5iJi0i is i ii ii@ iiiVii/i i i6iWiA i7ioi iiPi0ii1iin iaQi2iipi:iiPiibiiiii i{ i3i7iEiii iii| iFiGiXiiiiii]i i4iii} ii i5ii&ii8i i i iiiii iLiiiii i iYi iiiii4 i iB i9i8iiiii iHi i/i3iZi[ii io iii:i0i ini\ii]ii^iii i iiiIiiii;ii4ii<i=i;i ii iiiXi iii5 i_ii i iiiii}i0i>ip iJiiiKi i& iFiiii i i#ii[iiifi >iq ii?ir ii6iiii i iiiiijiiiii@i-ipi9i; i6iyiAiii i i' iiiiiiiViii`ii4iii iKi iai i6 i iiiiii"iiiKi i iiii iYiGioiibifici7i is ipri i8iiii i iA iQ i iC i,i ii iiii\iLiiui~ i iii9iiiBiiZiii iCiiiijidii0ihigiiei iMi} i7 i ii iiDi iiiiifi:iiiNi;i iEiFii( ii<iiiGiMi=iwigii~ it i?iiii itimi# i ii+iiihiiiii[ i iOi i iii iiB iii$ it ii iiia ii iiHiiiiiQi"i< i i ii-i1ii#iu i'iiD i i ii i iIii>iJi% iiiPi i iii i i=ia iiKiiv iiii i ii _iijii?iE i1i i iikii8iQii iliii i imi@i ibiiii iRi ii5ii iiiLi iw iiniii4iHi iiMii iiiiii\ iioiiNi] i ii ii\ix igiiEi iiiiiiipii iiqi iiiiiiOiii iri iZi isitiiii iPeiii iiioi ii^ ii}iiiiziAi& iii i iiini-ii iQiiii iiiiRiiui iiiiBiii iy ii iviwiBihiqiiii<ii*iiiSi"iTiCi>i)i ixiUiiii~iiiziiViiiiiC i)iqiiiWi i iiiDiiETiFpiii#i#iyii iiiGiiz iiiii ii iiSiiXi iiiiiu i i=iHiii_ iiRiiiiiiwiiiYizi{iqiii3ii5ii i i{ ii i|i}iSi~ii i i iZi[iiiiii` iiF ii]i i iniiiIii i iiiii iG iTiJiiKiziSiri\i) ii iv i5ii ib iiijiiiii iii]i^ii iiciiii i ii iai:i1i iiiAihi ia i i6iii ib -ii iH i_ii ii i iii iiii| ii* ifii ii i iD ii iLiWiiiiUii i ii$ii i i iNiiiR ikiiE iiiiiMiiS i' ii`iisiiF ii iai} i i i( ijii i~ iViB[ib iWi iibi iI iic i i ii{ii i ii ici i i idi i i]iiii= ieiiiiii ii iNi iiifigi i i iihiiiii =iiXiiiiiiiiid iiHiCi iiiiTiWi i ii9ii iNi iKiEiji4iJ i iYi iiG i ikiiihiOii i i i]iPiZiiliiQi[ikiiminiRioic iiiiiSiXiiii\i+iiiiiIiTiUiUii iili iDiiiipiiqi ki imii iK iiiiiiVi8 i i iiri@iWiri iCiGiii ii^i ii 8iti i:i i i!iinisi i"i i#i$i]iti i%i i&iriui'i+ i(i)iie i i}i iiii*i41i+ii i i ii ii,ii i> iXitiri? ii i-i iviui{iiw iwii.ixiT i, iii i/i0ii ii1i ii2i iGiRi i i^iiYi iZi i i[i3i^iiii ii i) i\i i4i@ivii5ii6i7iid i]i ii^i8ii&i i i i9 iyiui i iiziRii{ii ii(i_ii<i9iili iii_i iSi`iki i[i iii ixi:i i;i<i! i$i=ii|iii>idi i i?iei iiii ii iii i}i@iAiBii.i~iaiOi i ii`ibii i%i iii i;i iiiiCiiDi iiiif i" iL i i i ii iEi;iiFi&iGi i iix iHi)iiiciiIidiTii i ieiiiii iiJi igi~iUiie i iiiifiai8igi i ibihiKiy iii iLii: i iii i*iM iiii icitiiMiNiii ii ii iiif iiiYidiei*i iiOiH ii# ii#i; i i iiiiI i\i@ iii isi$ i iPiQi i i iRijiSiTii+iiUiiVi iiLi i!i iJ i\4iWi iiXiYiZii[i>iwikifiii+iii% iii$ii\iiiili i]iili^i_ig i%ii`iaigiiii iiN iK ibicidii ic iwi iei ibiyi ifihigihihii'iii imiiz ijid iii i i i<iii|iiiii iiiO iki iliii iaiiimiii ini iiui iniiiie i& i ioiii i i< iipiqiP iQ iiji ii iii(ii_irisi i iii<iEiR ifiiii]iiiIiti=iiuiivii iioi i iki,iliwi' ii imiiiiFi`ii if i ii iSiJixiiyiziniiL ipiOii i i{i i iiA iyiiiU i|i}i~iFi iqii i iiiiii iiiipiiiB iioi iiiipii- iiriiiqiqii( iiriiiisi iii iii i(i. isi) iiti i ii* iiuiiiTiviM i{ iiitii'iiii iiiiiiiig iZiwi i iciiji+ ipiiiixiii ih iiii iiii i, i= i ii i iuiiiii/ iyii i iyivi i iiwiiiiii ii iziiiii>iiCi'iiii{iiZiiii iii iiaiii iiqi?ii ii|ii i"ii ii i}iiiii=iiAi i1ii)iiii?i i iiiixi ii ii i i iihiiS iiii(ii iii'ixiyii ii i i iiiii_i iii> ii}iPiii iiii~ii iN iicii iiiiHii ii iiiiiiiiiiiiij iii i* iiii i i iiih iii_ii/i i<ii~i7ik iT iii]i iU ibi itiiig iizii ii| iiiiiiiii{iii ii0 ii ii+ i i, iiiIiiiii i iiiBi ii4isi iiiii i iii?iCiii iiGi iiiiiiiiiiiiiii|i1 iiimiC iiil iiii i} ii? iiii iiih iiiIiiiiV iiiiiiii^iiii i- i. iii)iii iiii2 iiiiii ii iiAii ii- iiiii i ii ii iiiiii ii iii iiiQi i iO iiiiiiiiziKii i[i iJiii@ ii. iiiiiD ii}i/ i@ii iii i i@iiRiii ij i~iiiJiii iiii i0 iimiiiim i~ ii i ii1 iii iiiiii idiiiiXiii9iii iiiUiiiiiiLii3 ii ii i i iii i ii iii$i(iviii&iibii iii i iiiiii{iiiiiiiiiii2 ii iiii iii iiiiiiii^iiiV i iiiiiiiiiiiiii2iW ii iW ioii iik iX iii iA i4 ii ii3 iii iii ii iii iiiiiii i iHiiiiiiiiiiiDiiiIisi iii ii iiiiiwii{iiiiiii/ in i,iiiii i iii ii ii i ii4 iB iiiiP i5 i ii i ii ii iii|iiziiiii i'ii5 iiii! ii yiiiViii i i iiiiiiiiii i iii-iiiiii ii i i iiii ii" i%iiiiJiC iixiiii i i iil i6 iiiii ii iiiXii ii7 ii i iNi im iiii iWi i i!i ii i i>i8 ii"i#i9 ij iD i i ii$i i%ii iiiXi&ii'iE i i(iF ii)iixi ikiiiii*i+ii iiDiii,iiiiiiiKi-i.i/i: ii0iJiii1i|i iii iii iEi*i2i iiiiiiHixi iii3ii iii3iiii; ipii< i iii ii4i5i i i6iiOi i7i8ii9ii:i ii;iiiii<i iiY i=i>i i i?ii@iAiBi i ii= i iiio i ifiiii i i i iCi iDii# ii i> iiEii iFiZ iE iii i[ i$ i iiGi? ii iiiG iiii@ iHiiA i\ iLiiiii iIi i iiiiiiiJi i i i iKiLi] iMiNi iijiiQ i iB iOiPiiiQi iiiRi iSiTii(iiiiC iiUiiVi iWiXiiiYiiiiZiidi[iciH ii_ii#i0 i\ii]iini i iiii^iii_ik iD ii`iaii ibii i iciiiiidiii iiiidi^ iE ieiiii iiiifii_ i7iiii i iiF iiigi-iii! iiihi iqi;i iiiiXii i iiiiijiiii ikiliii~imiG i` iniyip iiioi>iipiiqi iiiriia iiiisiti" iui|ii?iiiiviiiiiieiiiwixiyiiiiizi{i@i|ii i}i i iii% isiiR ii.iiMi?i ii~iiib iii@ii iiiii iiiiiiii ii6 iI iiii iiiiic iiiiii i i2iiiimii@iiii iiiNii iifiiiiZi iiiiii i\iH iid iiiJ ii ii i iiii iiK iiii# iiii ii iiiiKiiiiigiiiihii>ii.iiiiiiiii)in tiiiii io i iI i i iiiq iiir i iiiiip ii ii iziiiiUiiJ iii1 iK itiiiiii iiiJiiiL i iiiiiiN) EUCTW_TYPICAL_DISTRIBUTION_RATIOEUCTW_TABLE_SIZEEUCTW_CHAR_TO_FREQ_ORDERrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/euctwfreq.py,sPKd]#SmXX(chardet/__pycache__/escsm.cpython-38.pycnu[U ʗRe.H@sddlmZdZejejdejejejejejejejejejejejejejejejejejejejdejdejdejdddejdejdddejdejdejejejejejejejf0ZdZedeedd d Zd Z ejdejejejejejejejejejejejejejejejejejejejejejejejejejejejejdejejejejejejejejejddejejejejejejejejejejejejejejejejejejejejejejf@Z d Z e d e e dd d Z dZ ejdejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejdejejejdejejejejejdejejejejejejejejejejejejejejejejejejejejejejejejejejejejfHZdZe deeddd ZdZejdejejejejejejejejejejejejejejejejejejejdejejejejejejdejejejejejejejejejejejf(ZdZedeeddd ZdS)) MachineState(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrz HZ-GB-2312Chinese) class_table class_factor state_tablechar_len_tablenamelanguage(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) rrrrrrrrr z ISO-2022-CN(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) rrrrrrrrrr z ISO-2022-JPJapanese(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrz ISO-2022-KRKoreanN)enumsrHZ_CLSSTARTERRORITS_MEHZ_STHZ_CHAR_LEN_TABLE HZ_SM_MODEL ISO2022CN_CLS ISO2022CN_STISO2022CN_CHAR_LEN_TABLEISO2022CN_SM_MODEL ISO2022JP_CLS ISO2022JP_STISO2022JP_CHAR_LEN_TABLEISO2022JP_SM_MODEL ISO2022KR_CLS ISO2022KR_STISO2022KR_CHAR_LEN_TABLEISO2022KR_SM_MODELr*r*/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/escsm.pys $  $  $  $ PKd]:OU U ,chardet/__pycache__/escprober.cpython-38.pycnu[U ʗRe@sXddlmZddlmZddlmZmZmZddlm Z m Z m Z m Z GdddeZ dS)) CharSetProber)CodingStateMachine)LanguageFilter MachineState ProbingState) HZ_SM_MODELISO2022CN_SM_MODELISO2022JP_SM_MODELISO2022KR_SM_MODELcsVeZdZdZdfdd ZfddZeddZed d Zd d Z d dZ Z S)EscCharSetProberz This CharSetProber uses a "code scheme" approach for detecting encodings, whereby easily recognizable escape or shift sequences are relied on to identify these encodings. Ncstj|dg|_|jtj@r@|jtt|jtt |jtj @r\|jtt |jtj @rx|jtt d|_d|_d|_d|_|dS)N) lang_filter)super__init__ coding_smr rCHINESE_SIMPLIFIEDappendrrrJAPANESEr KOREANr active_sm_count_detected_charset_detected_language_statereset)selfr  __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/escprober.pyr.s   zEscCharSetProber.__init__csFt|jD]}|sqd|_|qt|j|_d|_d|_dS)NT)r rractivelenrrr)rrrrrr>s    zEscCharSetProber.resetcCs|jSNrrrrr charset_nameIszEscCharSetProber.charset_namecCs|jSr )rr"rrrlanguageMszEscCharSetProber.languagecCs|jr dSdS)NgGz?gr!r"rrrget_confidenceQszEscCharSetProber.get_confidencecCs|D]}|jD]}|r|jsq||}|tjkrhd|_|jd8_|jdkrtj|_|j Sq|tj krtj |_| |_ |j|_|j Sqq|j S)NFr)rr next_staterERRORrrNOT_MErstateITS_MEFOUND_ITget_coding_state_machinerr$r)rbyte_strcr coding_staterrrfeedTs"       zEscCharSetProber.feed)N) __name__ __module__ __qualname____doc__rrpropertyr#r$r%r1 __classcell__rrrrr 's   r N) charsetproberrcodingstatemachinerenumsrrrescsmrrr r r rrrrs  PKd]tt3chardet/__pycache__/chardistribution.cpython-38.pycnu[U ʗRe%@sddlmZmZmZddlmZmZmZddlm Z m Z m Z ddl m Z mZmZddlmZmZmZddlmZGdddZGd d d eZGd d d eZGd ddeZGdddeZGdddeZGdddeZGdddeZdS))BIG5_CHAR_TO_FREQ_ORDERBIG5_TABLE_SIZEBIG5_TYPICAL_DISTRIBUTION_RATIO)EUCKR_CHAR_TO_FREQ_ORDEREUCKR_TABLE_SIZE EUCKR_TYPICAL_DISTRIBUTION_RATIO)EUCTW_CHAR_TO_FREQ_ORDEREUCTW_TABLE_SIZE EUCTW_TYPICAL_DISTRIBUTION_RATIO)GB2312_CHAR_TO_FREQ_ORDERGB2312_TABLE_SIZE!GB2312_TYPICAL_DISTRIBUTION_RATIO)JIS_CHAR_TO_FREQ_ORDERJIS_TABLE_SIZEJIS_TYPICAL_DISTRIBUTION_RATIO)JOHAB_TO_EUCKR_ORDER_TABLEc@sLeZdZdZdZdZdZddZddZd d Z d d Z d dZ ddZ dS)CharDistributionAnalysisigGz?g{Gz?cCs2t|_d|_d|_d|_d|_d|_|dSN)tuple_char_to_freq_order _table_sizetypical_distribution_ratio_done _total_chars _freq_charsresetselfr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/chardistribution.py__init__>sz!CharDistributionAnalysis.__init__cCsd|_d|_d|_dS)zreset analyser, clear any stateFN)rrrrrrr rMszCharDistributionAnalysis.resetcCsX|dkr||}nd}|dkrT|jd7_||jkrTd|j|krT|jd7_dS)z"feed a character with known lengthr"riN) get_orderrrrr)rcharchar_lenorderrrr feedVs  zCharDistributionAnalysis.feedcCsT|jdks|j|jkr|jS|j|jkrN|j|j|j|j}||jkrN|S|jS)z(return confidence based on existing datar")rrMINIMUM_DATA_THRESHOLDSURE_NOrSURE_YES)rrrrr get_confidenceds  z'CharDistributionAnalysis.get_confidencecCs |j|jkSr)rENOUGH_DATA_THRESHOLDrrrr got_enough_datausz(CharDistributionAnalysis.got_enough_datacCsdS)Nr$r)r_rrr r%zsz"CharDistributionAnalysis.get_orderN) __name__ __module__ __qualname__r/r,r+r*r!rr)r.r0r%rrrr r8s rcs$eZdZfddZddZZS)EUCTWDistributionAnalysiscs tt|_t|_t|_dSr)superr!rrr rr rr __class__rr r!s z"EUCTWDistributionAnalysis.__init__cCs,|d}|dkr(d|d|ddSdS)Nr"^rr$rrbyte_str first_charrrr r%sz#EUCTWDistributionAnalysis.get_orderr2r3r4r!r% __classcell__rrr7r r5s r5cs$eZdZfddZddZZS)EUCKRDistributionAnalysiscs tt|_t|_t|_dSrr6r!rrrrrrrr7rr r!s z"EUCKRDistributionAnalysis.__init__cCs,|d}|dkr(d|d|ddSdS)Nr"r:rr;r$rr<rrr r%sz#EUCKRDistributionAnalysis.get_orderr?rrr7r rAs rAcs$eZdZfddZddZZS)JOHABDistributionAnalysiscs tt|_t|_t|_dSrrBrr7rr r!s z"JOHABDistributionAnalysis.__init__cCs@|d}d|krdkrcoderrr r%s  z#JOHABDistributionAnalysis.get_orderr?rrr7r rDs rDcs$eZdZfddZddZZS)GB2312DistributionAnalysiscs tt|_t|_t|_dSr)r6r!r rr rr rrr7rr r!s z#GB2312DistributionAnalysis.__init__cCs:|d|d}}|dkr6|dkr6d|d|dSdS)Nr"rrCr;r:r$rrr=r> second_charrrr r%sz$GB2312DistributionAnalysis.get_orderr?rrr7r rJs rJcs$eZdZfddZddZZS)Big5DistributionAnalysiscs tt|_t|_t|_dSr)r6r!rrrrrrrr7rr r!s z!Big5DistributionAnalysis.__init__cCsR|d|d}}|dkrN|dkr:d|d|ddSd|d|dSdS) Nr"rr;?@r$rrKrrr r%s z"Big5DistributionAnalysis.get_orderr?rrr7r rMs rMcs$eZdZfddZddZZS)SJISDistributionAnalysiscs tt|_t|_t|_dSrr6r!rrrrrrrr7rr r!s z!SJISDistributionAnalysis.__init__cCs|d|d}}d|kr&dkr8nnd|d}n.d|krLdkrbnnd|dd}nd S||d }|d kr~d }|S) Nr"rr$rQr)rr=r>rLr(rrr r%s z"SJISDistributionAnalysis.get_orderr?rrr7r rRs rRcs$eZdZfddZddZZS)EUCJPDistributionAnalysiscs tt|_t|_t|_dSrrSrr7rr r!s z"EUCJPDistributionAnalysis.__init__cCs,|d}|dkr(d|d|ddSdS)Nr"r:r;rr$r)rr=r&rrr r%sz#EUCJPDistributionAnalysis.get_orderr?rrr7r r[s r[N)big5freqrrr euckrfreqrrr euctwfreqrr r gb2312freqr r r jisfreqrrr johabfreqrrr5rArDrJrMrRr[rrrr s JPKd]): 3chardet/__pycache__/sjisprober.cpython-38.opt-1.pycnu[U .e@s`ddlmZddlmZddlmZddlmZddlm Z ddl m Z m Z GdddeZ d S) )MultiByteCharSetProber)CodingStateMachine)SJISDistributionAnalysis)SJISContextAnalysis) SJIS_SM_MODEL) ProbingState MachineStatecsPeZdZfddZfddZeddZeddZd d Zd d Z Z S) SJISProbercs4tt|tt|_t|_t|_ | dSN) superr __init__rr coding_smrdistribution_analyzerrcontext_analyzerresetself __class__B/usr/lib/python3.8/site-packages/pip/_vendor/chardet/sjisprober.pyr %s  zSJISProber.__init__cstt||jdSr )r r rrrrrrr,szSJISProber.resetcCs|jjSr )r charset_namerrrrr0szSJISProber.charset_namecCsdS)NZJapaneserrrrrlanguage4szSJISProber.languagecCsNtt|D]}|j||}|tjkrP|jd|j|j |t j |_ qq |tj krjt j|_ qq |tjkr |j}|dkr|d|jd<|j|jd|d||j|j|q |j||d||d|||j||d|d|q |d|jd<|jt jkrH|jrH||jkrHt j|_ |jS)Nz!%s %s prober hit error at byte %sr)rangelenr Z next_staterZERRORZloggerdebugrrrZNOT_MEZ_stateZITS_MEZFOUND_ITZSTARTZget_current_charlenZ _last_charrfeedrstateZ DETECTINGZgot_enough_dataget_confidenceZSHORTCUT_THRESHOLD)rZbyte_striZ coding_stateZchar_lenrrrr 8sH      zSJISProber.feedcCs|j}|j}t||Sr )rr"rmax)rZ context_confZ distrib_confrrrr"Ys  zSJISProber.get_confidence) __name__ __module__ __qualname__r rpropertyrrr r" __classcell__rrrrr $s    !r N)ZmbcharsetproberrZcodingstatemachinerZchardistributionrZjpcntxrZmbcssmrZenumsrrr rrrrs     PKd]Z *chardet/__pycache__/version.cpython-38.pycnu[U ʗRe@sdZdZedZdS)z This module exists only to simplify retrieving the version number of chardet from within setup.py and from chardet subpackages. :author: Dan Blanchard (dan.blanchard@gmail.com) z5.0.0.N)__doc__ __version__splitVERSIONrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/version.pysPKd];chardet/__pycache__/charsetgroupprober.cpython-38.opt-1.pycnu[U .e@s,ddlmZddlmZGdddeZdS)) ProbingState) CharSetProbercsReZdZdfdd ZfddZeddZedd Zd d Zd d Z Z S)CharSetGroupProberNcs(tt|j|dd|_g|_d|_dS)N) lang_filter)superr__init__ _active_numprobers_best_guess_prober)selfr __class__J/usr/lib/python3.8/site-packages/pip/_vendor/chardet/charsetgroupprober.pyr!szCharSetGroupProber.__init__csJtt|d|_|jD]$}|r|d|_|jd7_qd|_dS)NrTr)rrresetr r activer )r proberr rrr's zCharSetGroupProber.resetcCs |js||jsdS|jjSN)r get_confidence charset_namer rrrr1s zCharSetGroupProber.charset_namecCs |js||jsdS|jjSr)r rlanguagerrrrr9s zCharSetGroupProber.languagecCs|jD]v}|sq|jsq||}|s(q|tjkrB||_|jS|tjkrd|_|jd8_|jdkrtj|_ |jSq|jS)NFrr) r rfeedrFOUND_ITr stateNOT_MEr Z_state)r Zbyte_strrrrrrrAs$       zCharSetGroupProber.feedcCs|j}|tjkrdS|tjkr"dSd}d|_|jD]R}|ss  PKd]Jm%U%U5chardet/__pycache__/langhungarianmodel.cpython-38.pycnu[U ʗRe@sP$ddlmZdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?d?Zddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d dddddddd d d d ddddddddddddddddddd d!d"d#dddddddd$d%d&dd'd(d)d*d+d,d-d.d/d0d1d2d3d4dd5d6d7d8d9d:dddddd;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd ddZeddeeddddZddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d dddddddd d d d ddddddddddddddddddd d!d"d#dddddddd$d%d&dd'd(d)d*d+d,d-d.d/d0d1d2d3d4dd5d6d7d8d9d:dddddddd;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdPdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`daddcdddedfdgdhdidjddldmdndodpdqdrdsdtdudvdwdxdydzd{d|dkd~dOdddddddddddddddddddddddQddddddddddddddd}ddddbdddddddddddddddd ddZeddeeddddZdS))SingleByteCharSetModel)?(6- 21&'5$)"#/.+!%9074rr    r> 3,=:;<?*8rrrr r r r r rrrrrrrrHrrrrr@Drrrrrr r!r"r#r$r%r&r'r(r)r*Cr+r,r-r.Ar/r0r1NELQr2SPr3r4r5Br6r7Fr8Tr9KGRIr:UOVr;MWr<Jr@r=r>rAr?(rrrrr(r,r&r%r)r#r+r1r!r'r9r:r0rrr.r"r-r$r*r=r<rr rr?r;r>r rrrrrr rrrr@rr3r rrrr r r2rrrrrArr5r6r7r4r/r8rGrJrrIrHrarrrFrrrrrrr_rrr{rrrrrrXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~rKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r`rbrcrdrerfrgrhrirjrkrlrmrnrorprqrsrtrurvrwrxryrzr|r}r~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrErDrCrBz windows-1250Z Hungariang(P?TuPABCDEFGHIJKLMNOPRSTUVZabcdefghijklmnoprstuvzÁÉÍÓÖÚÜáéíóöúüŐőŰű) charset_namelanguagechar_to_order_maplanguage_modeltypical_positive_ratiokeep_ascii_lettersalphabetrrz ISO-8859-2N)#pip._vendor.chardet.sbcharsetproberrZHUNGARIAN_LANG_MODELZ$WINDOWS_1250_HUNGARIAN_CHAR_TO_ORDERZWINDOWS_1250_HUNGARIAN_MODELZ"ISO_8859_2_HUNGARIAN_CHAR_TO_ORDERZISO_8859_2_HUNGARIAN_MODELr r /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/langhungarianmodel.pys8$ BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB* PKd]$[z j j2chardet/__pycache__/euctwfreq.cpython-38.opt-1.pycnu[U .e{@sdZdZdZdS)g?i(iii Riiii ni!i iL,iAis iiiiiL iS iii iiii.iNiii:iii?iii=iNKiil iii i i i  iii ioi$ iiii ici8iiiiiiiz|it "i ie @i\ii iiiiiiFiiM iQHiiPivif iiiiDiT iiiFiN iEi iOi/isii3<2i i&iLiiiO iiGiiM iii?ii i`iiF i*iigi Zi i:i iiKi i iiiii`iiiig i i qii~iiP i ii iii!iuii*iii i i~iiiieiGi^iii UiCiiBiiiiiii jioi/iiiOi2 i[ii i& iiiiSi(ii ip]ii6iii i' iiiiii8+i% i[ii\iiiiiX i( ii i0i iHi i i"i!i+i i1i"iii iOiG iiifi1iiiiiii2i9li,i iiiiii}ih i#iq iQiMi&i Xiii#ii iijiiMii %i ii$ii'i iiN ii i7Jii!iiiiiMii) iPiU ii ii%i i i ii i iIii3 ii iir i i iimiii$iiixii iii ii ii%i&i iiiiii&ii'iii'ii.i iiiH iiii$#iiDi&iAi iiiiiUiGiiii iQ iPiSi'iidi 0Fiii* iiiiiiiJii iUiiI iR iii<iiS i:i7 i ii i i9ii}ii iiiViPiT ii)iCiiii& i i i)iiim iiiiiii4 iiiin i*iiiiiiiO iiiii i+ i(i i iiiU i(ii5iYiji iliiuii)i i*i+iV i i=i iiiiiii4ii!iiiTi, ixiiiei iiJ iPiis i5iAiV i/iki i iili!i iiAii`ii i iAii iiii ii i iiiiiMi iiiiiiW iii it iii+}iij i8 iiiiiiiii- i)imi iiW ii ii iiaii iP iK i i,ii ii7i' iu ii{ik iiiii i9 iiiiiiiiiii1bii i iiio iiX i,iQ iiiii i i iX iii5Diiliii[i iiY ii%i. iY ii*iii iiR iii ipiincigi+iii'i2iii{iil iim iii: iifi ii|i5 iiiiZ i i i i ii i,ii ii;iiIiYiii[ iXi"ii iiii~iii,iikiii-iiiiiiDiiii>i]ii,iiiiviLiBii&iii iiiiGiiiiBii i! iiiu iiiii i iaiiiiv iS ii}i; iiDii=ii0i ii\ i( iiiivi iiii.ii9iHiiiii] iEiiiiii!ii/ iii i i-iiiQi*ii.i/iiiii0 3ii" ii*iRiiiWiii/iibi.ii iiiiiiRii ii) ii2ii iiiiiiiZ iiT iiw iiii iiiiiii[ Oii i i`i7ix i^ iiiiiii\ iiiiiiigiiin ii i_ii~iii0ii iaiiy i] iiiii ii i;i i-i iiL iii/iiii`ii#i"iiiii0i isiiiidisi iiY ii ikiwio ii iiii1ii2igip iQiiUi iv iiiCiSii^ iii5iiiBii_i ibiNiiXiiii iLici i i iKiw i* iaiGi3ii i iii1i6i i2i6 Niii i i3ii:ii\iqiiii-iii i3i iiiix i i irii4i i_ iiU iiii@ii5i ii ii ii/i+ i6i iiiiiii i7 iZ iiii8i4iiCiii iilii` iiiiiiYiii5i {iiii$i7iiMiV i0irii iigiiVii8ii9i, iZiii{i#iW i0iii$i i i ii4ii[iviiiciiViM i$i- iiiX iii idiiiWi[ iii iiiq i ii1 iiiiitiiii ii i i2 ii2i:i3 i i.iii2ii iiiii%i iii i i iiiiii i i6i i4 ii|iiiSiiii_ i iiiii`iiiii i3iii;ir iiii7iYiLi;ii i iiiiT\iiii<iiVi5 iii iii ii"ixi%ii;i8 i iii2iEi=i!iii^iiwi i"iiiis ii#i<iQiiiri$ii]ii%ii. i&i i3i5iBiiy i'iii ii i i>iY ia ib i(i i i)i*i iii:ii6ii^ii iii(i i+i+i i ixi,i i.ihi/ i-iii iVi ii hiiz i.iiii<iii;i/i?iii i i0i8i i ii5i6i i_)i1i2i i3iyi ii i i^i4i i i?i$i+i\ i i5i_iWii iz i6i0 ii i] i ip i7i ii8i^ i< iiVi9i i6 iiIwi}ic i^ii i9i@ii iAi iii i:iei1iiiBiiiiii i i ii7 i;i<ii=i{ i(i`iRi1 iYiiIi i i i6i id i>iiie i?iioiqiYiniiiliiCiDi{ ii i_ iEiPiUii i iiiiEimii@ii:i ii iAiiiiii# i iNi i iBiiCiWiTiTii iif i;iDii&i i| iiiiii iii<i= i iii iVii iioii iEi iFiii iii iiiDi-i8 iiGidi i i iHit iiiIizi iiJi i iKii i| iiiii> iiiiiiLi:i i=iiMii? i iiiHiiiiiNiii iOiPiiFikiQi9 i ii i iu iiv iiiiiiRiSiii} i i>iiiii i: iTi iiN iiCiiiiUi~ii iWiiGiiii,iiiiiOii|iiiiOi?iVi` ii ii~ i iw iiii@i!iii; iiiiWii"i iXiiYiiRig iuii ih i ix i=i iiZii< iii[i i#ii= i i\i$ii]iHiIi^i7iO i$ i i_i%iviJii i!iwitii`iaibi9 i&ii"i{i i i'iciidi8iiiii[i9iiidiZ i ieiii i@ i!i(i"ifiii i#i$iTigiKii i%iWiMihiiiiiiii%iiiii i` iiyi7imiLijiki i: i> i!iii Bi)ili|i i iziii iiMi ii iiiminiuiq ivii i i*iNioipiiqi7i.iriiy i iii iifii i isi! iyi iOi i iii+iPij i i>iiii iYi iAitiiui% i i ivi iiz i2 iwi,i i ii3iQiii ixi i6i9ik iii&6i i-i iiRiyiiQi9ici i'i.i oi(iBiFi? il i i)iei i izi iSiTi iii{i/ii" i ibi/ii`iii0iuiiviii1ii i iiUii*i i/iEiSii8iZi|i}iFi+i ii!i~i2i,iFiP iim ii iieisiiCi ir iiii iiai3iZi%i-iiii i4iiiiAiii i iii iiiiDi.iiii inii iii iii ii3 i5iJi0i is i ii ii@ iiiVii/i i i6iWiA i7ioi iiPi0ii1iin iaQi2iipi:iiPiibiiiii i{ i3i7iEiii iii| iFiGiXiiiiii]i i4iii} ii i5ii&ii8i i i iiiii iLiiiii i iYi iiiii4 i iB i9i8iiiii iHi i/i3iZi[ii io iii:i0i ini\ii]ii^iii i iiiIiiii;ii4ii<i=i;i ii iiiXi iii5 i_ii i iiiii}i0i>ip iJiiiKi i& iFiiii i i#ii[iiifi >iq ii?ir ii6iiii i iiiiijiiiii@i-ipi9i; i6iyiAiii i i' iiiiiiiViii`ii4iii iKi iai i6 i iiiiii"iiiKi i iiii iYiGioiibifici7i is ipri i8iiii i iA iQ i iC i,i ii iiii\iLiiui~ i iii9iiiBiiZiii iCiiiijidii0ihigiiei iMi} i7 i ii iiDi iiiiifi:iiiNi;i iEiFii( ii<iiiGiMi=iwigii~ it i?iiii itimi# i ii+iiihiiiii[ i iOi i iii iiB iii$ it ii iiia ii iiHiiiiiQi"i< i i ii-i1ii#iu i'iiD i i ii i iIii>iJi% iiiPi i iii i i=ia iiKiiv iiii i ii _iijii?iE i1i i iikii8iQii iliii i imi@i ibiiii iRi ii5ii iiiLi iw iiniii4iHi iiMii iiiiii\ iioiiNi] i ii ii\ix igiiEi iiiiiiipii iiqi iiiiiiOiii iri iZi isitiiii iPeiii iiioi ii^ ii}iiiiziAi& iii i iiini-ii iQiiii iiiiRiiui iiiiBiii iy ii iviwiBihiqiiii<ii*iiiSi"iTiCi>i)i ixiUiiii~iiiziiViiiiiC i)iqiiiWi i iiiDiiETiFpiii#i#iyii iiiGiiz iiiii ii iiSiiXi iiiiiu i i=iHiii_ iiRiiiiiiwiiiYizi{iqiii3ii5ii i i{ ii i|i}iSi~ii i i iZi[iiiiii` iiF ii]i i iniiiIii i iiiii iG iTiJiiKiziSiri\i) ii iv i5ii ib iiijiiiii iii]i^ii iiciiii i ii iai:i1i iiiAihi ia i i6iii ib -ii iH i_ii ii i iii iiii| ii* ifii ii i iD ii iLiWiiiiUii i ii$ii i i iNiiiR ikiiE iiiiiMiiS i' ii`iisiiF ii iai} i i i( ijii i~ iViB[ib iWi iibi iI iic i i ii{ii i ii ici i i idi i i]iiii= ieiiiiii ii iNi iiifigi i i iihiiiii =iiXiiiiiiiiid iiHiCi iiiiTiWi i ii9ii iNi iKiEiji4iJ i iYi iiG i ikiiihiOii i i i]iPiZiiliiQi[ikiiminiRioic iiiiiSiXiiii\i+iiiiiIiTiUiUii iili iDiiiipiiqi ki imii iK iiiiiiVi8 i i iiri@iWiri iCiGiii ii^i ii 8iti i:i i i!iinisi i"i i#i$i]iti i%i i&iriui'i+ i(i)iie i i}i iiii*i41i+ii i i ii ii,ii i> iXitiri? ii i-i iviui{iiw iwii.ixiT i, iii i/i0ii ii1i ii2i iGiRi i i^iiYi iZi i i[i3i^iiii ii i) i\i i4i@ivii5ii6i7iid i]i ii^i8ii&i i i i9 iyiui i iiziRii{ii ii(i_ii<i9iili iii_i iSi`iki i[i iii ixi:i i;i<i! i$i=ii|iii>idi i i?iei iiii ii iii i}i@iAiBii.i~iaiOi i ii`ibii i%i iii i;i iiiiCiiDi iiiif i" iL i i i ii iEi;iiFi&iGi i iix iHi)iiiciiIidiTii i ieiiiii iiJi igi~iUiie i iiiifiai8igi i ibihiKiy iii iLii: i iii i*iM iiii icitiiMiNiii ii ii iiif iiiYidiei*i iiOiH ii# ii#i; i i iiiiI i\i@ iii isi$ i iPiQi i i iRijiSiTii+iiUiiVi iiLi i!i iJ i\4iWi iiXiYiZii[i>iwikifiii+iii% iii$ii\iiiili i]iili^i_ig i%ii`iaigiiii iiN iK ibicidii ic iwi iei ibiyi ifihigihihii'iii imiiz ijid iii i i i<iii|iiiii iiiO iki iliii iaiiimiii ini iiui iniiiie i& i ioiii i i< iipiqiP iQ iiji ii iii(ii_irisi i iii<iEiR ifiiii]iiiIiti=iiuiivii iioi i iki,iliwi' ii imiiiiFi`ii if i ii iSiJixiiyiziniiL ipiOii i i{i i iiA iyiiiU i|i}i~iFi iqii i iiiiii iiiipiiiB iioi iiiipii- iiriiiqiqii( iiriiiisi iii iii i(i. isi) iiti i ii* iiuiiiTiviM i{ iiitii'iiii iiiiiiiig iZiwi i iciiji+ ipiiiixiii ih iiii iiii i, i= i ii i iuiiiii/ iyii i iyivi i iiwiiiiii ii iziiiii>iiCi'iiii{iiZiiii iii iiaiii iiqi?ii ii|ii i"ii ii i}iiiii=iiAi i1ii)iiii?i i iiiixi ii ii i i iihiiS iiii(ii iii'ixiyii ii i i iiiii_i iii> ii}iPiii iiii~ii iN iicii iiiiHii ii iiiiiiiiiiiiij iii i* iiii i i iiih iii_ii/i i<ii~i7ik iT iii]i iU ibi itiiig iizii ii| iiiiiiiii{iii ii0 ii ii+ i i, iiiIiiiii i iiiBi ii4isi iiiii i iii?iCiii iiGi iiiiiiiiiiiiiii|i1 iiimiC iiil iiii i} ii? iiii iiih iiiIiiiiV iiiiiiii^iiii i- i. iii)iii iiii2 iiiiii ii iiAii ii- iiiii i ii ii iiiiii ii iii iiiQi i iO iiiiiiiiziKii i[i iJiii@ ii. iiiiiD ii}i/ i@ii iii i i@iiRiii ij i~iiiJiii iiii i0 iimiiiim i~ ii i ii1 iii iiiiii idiiiiXiii9iii iiiUiiiiiiLii3 ii ii i i iii i ii iii$i(iviii&iibii iii i iiiiii{iiiiiiiiiii2 ii iiii iii iiiiiiii^iiiV i iiiiiiiiiiiiii2iW ii iW ioii iik iX iii iA i4 ii ii3 iii iii ii iii iiiiiii i iHiiiiiiiiiiiDiiiIisi iii ii iiiiiwii{iiiiiii/ in i,iiiii i iii ii ii i ii4 iB iiiiP i5 i ii i ii ii iii|iiziiiii i'ii5 iiii! ii yiiiViii i i iiiiiiiiii i iii-iiiiii ii i i iiii ii" i%iiiiJiC iixiiii i i iil i6 iiiii ii iiiXii ii7 ii i iNi im iiii iWi i i!i ii i i>i8 ii"i#i9 ij iD i i ii$i i%ii iiiXi&ii'iE i i(iF ii)iixi ikiiiii*i+ii iiDiii,iiiiiiiKi-i.i/i: ii0iJiii1i|i iii iii iEi*i2i iiiiiiHixi iii3ii iii3iiii; ipii< i iii ii4i5i i i6iiOi i7i8ii9ii:i ii;iiiii<i iiY i=i>i i i?ii@iAiBi i ii= i iiio i ifiiii i i i iCi iDii# ii i> iiEii iFiZ iE iii i[ i$ i iiGi? ii iiiG iiii@ iHiiA i\ iLiiiii iIi i iiiiiiiJi i i i iKiLi] iMiNi iijiiQ i iB iOiPiiiQi iiiRi iSiTii(iiiiC iiUiiVi iWiXiiiYiiiiZiidi[iciH ii_ii#i0 i\ii]iini i iiii^iii_ik iD ii`iaii ibii i iciiiiidiii iiiidi^ iE ieiiii iiiifii_ i7iiii i iiF iiigi-iii! iiihi iqi;i iiiiXii i iiiiijiiii ikiliii~imiG i` iniyip iiioi>iipiiqi iiiriia iiiisiti" iui|ii?iiiiviiiiiieiiiwixiyiiiiizi{i@i|ii i}i i iii% isiiR ii.iiMi?i ii~iiib iii@ii iiiii iiiiiiii ii6 iI iiii iiiiic iiiiii i i2iiiimii@iiii iiiNii iifiiiiZi iiiiii i\iH iid iiiJ ii ii i iiii iiK iiii# iiii ii iiiiKiiiiigiiiihii>ii.iiiiiiiii)in tiiiii io i iI i i iiiq iiir i iiiiip ii ii iziiiiUiiJ iii1 iK itiiiiii iiiJiiiL i iiiiiiN)Z EUCTW_TYPICAL_DISTRIBUTION_RATIOZEUCTW_TABLE_SIZEZEUCTW_CHAR_TO_FREQ_ORDERrrA/usr/lib/python3.8/site-packages/pip/_vendor/chardet/euctwfreq.py,sPKd]℄>>)chardet/__pycache__/compat.cpython-38.pycnu[U .en@s@ddlZejdkr(dZdZeefZeZndZdZeefZeZdS)N)rTF) sys version_infoZPY2ZPY3strZunicodeZbase_strZ text_typebytesrr>/usr/lib/python3.8/site-packages/pip/_vendor/chardet/compat.pys PKd]*RVRV0chardet/__pycache__/jisfreq.cpython-38.opt-1.pycnu[U .ed@sdZdZdZdS)g@i((i'iOii}i ii ii] i i ii iiiiii iiiXi}iiikig i i ikiiiiiiii%i&01,-iiiiiii iii<iiipiiiiiiigiiiiWiXii ih i"iiiii i ii\iii i/ ii iiiii0 ii ihi iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiiiii ii!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7iiViji4iiiiBiii8i9i:i;i<i=i>iviiiiSiieiifi iid i+iiiaiw iiiiIii~ii ii?i@iAiBiCiDi ii- i iiiii iiEi^ i. i i3iii iFi/ iYi i iiiji iiGiHiIiJiqi1 iYik/i2#i *[\5i!i! %@il'iA 4 <ii-ii7Si~iKi=E;7i7i8m& OiK=i~idiLiMiNiOiPiQiRiSiTiUiVY>J"ip piTi_i.XiLijei9P ilyii Di )ihi F?+iiigciB]iN8j:i5iii7Ri4Gdinihit63$WCi i: ix ii*iV i iWiXiYiZi[i\i]i^i_i`iiaibicidieifigihiiijikiliminioipiqirisiti iuiviwixiyizi{i|iiiiili}i i~iii i i iiii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiikii i> i i i i i ij iiiZi[i\i]ii ii ii i i i i iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibicidieifigihiiijikiliminioipiqirisitiuiviwixiyizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i iiiiiii2 iii{iTiia i i^iii|i i=iimik i i ii iViy i ii iq iiii i iiii!ii ii ii iCiOi3iiiiiir iiinii+iiii ipiqi i; Ai iiiCi0 iini iiiTiCioi ii i# iii~iiPiiiiii ii i i$ iz ii i&iiiii iiiii_iiUii is i ii iIiiiiiiii3 iii$iWi1 i5iPi iiiiiiiX iiiil iiiHii iiiiii i iWii~ipii$iiii@iLi i iiiiuii iJiI iW iii_ii i<iiii]iDiiiiihiiiiifi-i}it ii iiii,i ibiiiXiiiFii{ i`iii+i3iqiimii4 iiiiiiBiliX i ii% iii% i2 iuii i iiJii|irii@i iii iii ii iL iiiiiiib iJ i icii iiiii4 iRiim iTiii iiiiiie iii? i iiiii-i ii*iEi ii+i ii& i iii/iii.isi[ii+ii ii iBic iiiiii i) ii,i iu ii ii9i& iiiiiiv iiY i i3 ii iiiiDiiiiidiii| i(iyiiiii<i8i iiii i id i5 iBiini iiiii|i i!ii)i@ in imi i i0iaiii zi'ii iWii[iviii iii io i i ii iii' ii i"iii9iii iiJiiihiiie ii\iiip i@iiQi9iii iiiw iiiEiiJiIi iiiiiifii ii i i1i ii iii' iri iiii iiici iqiixiii i2iiiii i*iiibiFiiviidi iii!iRiiiQiiiiPiiiiiiii( iii_ ii` iiif ii6 iiAiiia iiiuiTi i2iiiiii i^iCii ii[ii ivi%iiiini!iFiiZi^iiiidiiiix iii]i iBiici i iiiPiqi i iHiY iii( ii iigi}iKi iii4 iiWii iiCig i-idiikii4i} iiq i~ i+i iiihi@ i i i@iA iDi:iiiei iiqiwiiiiiiiidiiZii* iM i[iiisiZ i i ii>ii'i-i i ii ii) iiiiitiFi7 iiti#iiiiiiYiiifikib i1ii ii6ioic iiqi iiii iuii:iiiN iiUi=i iviilNiiii]ii;iii iiiliLi i}iiiiiB i8 iQii#i`iTii ixiiri iiiiii ii3iniiiiiii{iii@i iiii9 ii5 ih id iZ iiiiiiiiisi-ir iiiii[ ii0iiiii.iSi iRiO iii ii;i i4iy i i;iiz iipii i i ii: i(i|i ii"iiiiii iOiieiii iC iti) ii6Kiii8iiP iihii ii ii3i$iii* i=bie ii i4iii i.i7ii\ iiiiji iiiiiii/iii i=ii^ii5 i ii i\iiiii9i#i+ i is i,ii7iiiYiii iMii+ ii iQii6 iiiiiiyi iisi#i{ i iUifi<iiiviii)i iiiiiimi<iii iiigii lii iD ibiui i iDiBiii i[ i ii8iii>i iii iiii i] iiDiii6iZii i5ii i i<imi i, i iiui^ i iiigiiIiiigi ii\i:i iMti iiEioiiiiEiRii iiEij igiWiiiKi iCii=ii]i$i!ii iii`iKiviii0ii^i i3ii"iiiiaik ii; iwiiiiiii iyiiiiiPiii iwiiit i iii iiiJiaiii]iiii iiiiLihiiii iu ijiii#iCiii iai!si| ii iYii iiiihiOi5iiiziii iSiiLii.ii&ii i< i7iisiA iiiMi iisii*i, i%i i iikii&ifiOiji"ii(i-ii[iii ii- i=ii} iiMiSiii iiiii ii i i ii ii~ iiJitikivieiyiii< i if iiMki iiioiiiwiv ilii]iii.i iiii/if iqi$ig iiGinii>i6 i= ii iii iNi ixiiei* iih iiii$iiiioibi,ii iiitiii i ii iVii iiiiiiiw iiipiHi Viiii<iZi i8riwii&i ii/iiiii>ii> iE ixii&ieiiwi iii5iii ii\iiiSii iiii2iiii+i'ii%iiix iOii iQ iiiiiii_Hiiii igiiiy ii i0i&i+ i iiii il i'ii'izii i ii_ iiii i ii? i ii iz iim i|i ii ig i0iii ii*ii i i`iwiii i#ici)iiiR i iiTiiriiViiii_iiiiiriii i` ixiii iiifiiin i= i*iAii i(ixiS i{iT ii9iiiMi irii;ii(ii%ii[ia ib iiiDiiii- i\ iii iio iEimi)ii!iiic ii, i1ii] iii>iIii iTiiii iiiyiikizixiiNi iiii i5i i i"iiHi<id ii iiih i ii ip iii:iLi1iii iii> iiq i?iZiMiIi iiB iK iDii#i i iYi>iiii`iiiiiiiiiiiii iiiciiiiiiTiiaii2iyi/ii"iU ibii ii/ii ii i i{i iij i i5i*iiiiiaixiii iiFiiii7 iii i?iwiiiiii+ii8 ii iNi iii,iinii i i ioisi_i?ii iii i iii?i0i i iiyi3ifi i=iiilii iivi]ii i iiizi iiyijiiui iipiijii iiiziiir iiiiiiiiiFii'i i{ ini ixui$iiiiMiiik iipi i^ iqi i`i|ii ii i| i i i ii i iiii iGi ii-iiZi1iYii- i ieiii[iC iiie i i.i-iiii iii i i7 ibil i iii{ii.i i iizii i ii? iii9 ii iiii}ii iaii i Qi idi;iV ii/i^iD ii?im i i i9iIi iii iii i{i}i iiiii&ii~iiXii i} i ii9i ii:ii"i\iii i_ i8iWi~ i^i%iPisi iwii ii8 i iLiii. iii iiiNiiPiiSiiii:iRi'i0ibiii iiiiizii iiiiiKii i iriiqi iiin iL iiiiiiiiiiXi@ iigiii4ii: iiiiri iiQi ii i;i'i i>iibimiiwiiis iiiiA iit i9 iiiii io i^iii2iiciii i iriii i!iitii1i{i iiiiisiiiii ixiviaip iii iiLiOiiiUi i.ii)i. iiEi i"iiyii iiii(i iiiq iE i6i i i2iui6i iiii. iii iiiViiisi iiiGiGijitiiWii iii`iiiiui ii ii{iQii iOiCi ii iiJi i i i$iiii/ iii_iiiij iRii7iii/ ii3iDiu i6iXi4iii iiii>iiii0 i`i` i iiiiUii i irii i)ii5iiHii iii~ir ii iiiii ii]iiiiiii i@ iii iaiiviiii/i!i6iiii7iwi i i3ici8ixii iiB iiiM iiF iigiiii(ii i: iiiHii if ii"i i~iii i iyii i ii i!iNi i4iA iidieiziiii iiii0 ii iiiiiii{iii i iifi(iliiGi ii^iB imiF i|iiUiii2iRiii#ii iiiFi Uiiii1i icikiiN iSi i iii$iO ii iYiiii iiGi iiiW i iC i?i ii~iiiUiFiiiiiiii iC i iiiiei iiiii/ iQi_iv i; i i iPi)iGimi iiiG i,iIiz_i i i9inii iAi i iX ii#iVi)i< i%ii}iiiHiw i5iipi.iiiimiiii i#ihi|ibii ii@i(i^izi iiAi i i i"i ig ii|iiiii6iiXiii,iii iii$i#iIik iiiii:i iiQi ioih iVi$i iitiiiiY i,iii i iD ii i~i i iii%iii iii ii i i7i/i ii iEiVii iE iuii&iiii i iioiiiZiiiii i iiii!iini8ii'iiiiiii iiGi iRi2iii:ii,iiZ ilii(iXiP i?ii i ioiiiii iiWi*ii;i8ii&i)ii i ioiiiiiHi_iii0iix ii0 ii; ii iiiXii ii1iZi*i%i i|idi`iiiSiji}i\iiiiG i ii ifqi%iBii1 ipii"iiiii i|iiii iil i2 i i iii@ihii;iii ii iii&iiii}ii%i iii i?ii iia iy ii iii ii= i1 ii<ii{i#iiii iAii iitiii ii> i iKi3 iii=ii\i i i'iAi+igiib iKiiiii ii ii4 ii*iim i ii ioiNii0i(ii ii$i4i i{i iiiQ iiiUiiii,i`ii iii ij i)i ii-i6i iF i2i)ii i*i iYN)ZJIS_TYPICAL_DISTRIBUTION_RATIOZJIS_TABLE_SIZEZJIS_CHAR_TO_FREQ_ORDERrr?/usr/lib/python3.8/site-packages/pip/_vendor/chardet/jisfreq.py,sPKd]Y Y /chardet/__pycache__/latin1prober.cpython-38.pycnu[U ʗRe@s^ddlmZddlmZdZdZdZdZdZdZ dZ dZ d Z d Z eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeee ee ee eeeeeeeeeeee ee ee e eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee e e e e e e e e e e e e e e e e e e e e e e ee e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e ee e e e e e e e fZd ZGd d d eZdS)) CharSetProber) ProbingState)@rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrcsPeZdZfddZfddZeddZeddZd d Zd d Z Z S) Latin1Probercs"td|_d|_|dS)N)super__init___last_char_class _freq_counterresetself __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/latin1prober.pyrcs zLatin1Prober.__init__cs t|_dgt|_tdS)Nr)OTHr FREQ_CAT_NUMrr rrrrrris zLatin1Prober.resetcCsdS)Nz ISO-8859-1rrrrr charset_namenszLatin1Prober.charset_namecCsdS)NrrrrrlanguagerszLatin1Prober.languagecCs`||}|D]J}t|}t|jt|}|dkr@tj|_qZ|j|d7<||_q|j S)Nrr) remove_xml_tagsLatin1_CharToClassLatin1ClassModelr CLASS_NUMrNOT_ME_staterstate)rbyte_strc char_classfreqrrrfeedvs zLatin1Prober.feedcCsX|jtjkrdSt|j}|dkr&dn|jd|jdd|}t|d}|d9}|S)Ng{Gz?grrg4@g\(\?)r#rr!sumrmax)rtotal confidencerrrget_confidences   zLatin1Prober.get_confidence) __name__ __module__ __qualname__rrpropertyrrr(r- __classcell__rrrrr bs     r N) charsetproberrenumsrrUDFrASCASSACVACOASVASOr rrr rrrrs  'PKd]{ 8chardet/__pycache__/sbcharsetprober.cpython-38.opt-1.pycnu[U .e@s4ddlmZddlmZmZmZGdddeZdS)) CharSetProber)CharacterCategory ProbingStateSequenceLikelihoodcsbeZdZdZdZdZdZdfdd Zfd d Ze d d Z e d dZ ddZ ddZ ZS)SingleByteCharSetProber@igffffff?g?FNcsJtt|||_||_||_d|_d|_d|_d|_ d|_ | dS)N) superr__init___model _reversed _name_prober _last_order _seq_counters _total_seqs _total_char _freq_charreset)selfmodelreversedZ name_prober __class__G/usr/lib/python3.8/site-packages/pip/_vendor/chardet/sbcharsetprober.pyr 'sz SingleByteCharSetProber.__init__cs:tt|d|_dgt|_d|_d|_d|_ dS)N) rrrr rZget_num_categoriesrrrrrrrrr5s zSingleByteCharSetProber.resetcCs|jr|jjS|jdSdS)N charset_name)r rr rrrrr?sz$SingleByteCharSetProber.charset_namecCs|jr|jjS|jdSdS)Nlanguage)r rr getrrrrrFsz SingleByteCharSetProber.languagec Csj|jds||}|s|jS|jd}t|D]\}}||}|tjkrX|jd7_||jkr|jd7_|j |jkr|j d7_ |j s|j |j|}|jd|}n||j|j }|jd|}|j |d7<||_ q0|jd}|jt jkrd|j |jkrd|}||jkr<|jd||t j|_n(||jkrd|jd|||jt j|_|jS)NZkeep_english_letterchar_to_order_maprZprecedence_matrixrz$%s confidence = %s, we have a winnerz9%s confidence = %s, below negative shortcut threshhold %s)r Zfilter_international_wordsstate enumeraterZCONTROLr SAMPLE_SIZErr rr rrZ DETECTINGSB_ENOUGH_REL_THRESHOLDget_confidencePOSITIVE_SHORTCUT_THRESHOLDZloggerdebugZFOUND_ITZ_stateNEGATIVE_SHORTCUT_THRESHOLDZNOT_ME) rZbyte_strr icorderrrZ confidencerrrfeedMsL          zSingleByteCharSetProber.feedcCsNd}|jdkrJd|jtj|j|jd}||j|j}|dkrJd}|S)Ng{Gz?rg?Ztypical_positive_ratiogGz?)rrrZPOSITIVEr rr)rrrrrr%|s z&SingleByteCharSetProber.get_confidence)FN)__name__ __module__ __qualname__r#r$r&r(r rpropertyrrr,r% __classcell__rrrrr!s   /rN)Z charsetproberrZenumsrrrrrrrrs PKd]\C.chardet/__pycache__/euckrprober.cpython-38.pycnu[U ʗRe@sDddlmZddlmZddlmZddlmZGdddeZdS))EUCKRDistributionAnalysis)CodingStateMachine)MultiByteCharSetProber)EUCKR_SM_MODELcs4eZdZfddZeddZeddZZS) EUCKRProbercs(ttt|_t|_|dS)N)super__init__rr coding_smrdistribution_analyzerresetself __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/euckrprober.pyr#s  zEUCKRProber.__init__cCsdS)NzEUC-KRrr rrr charset_name)szEUCKRProber.charset_namecCsdS)NKoreanrr rrrlanguage-szEUCKRProber.language)__name__ __module__ __qualname__rpropertyrr __classcell__rrrrr"s   rN) chardistributionrcodingstatemachinermbcharsetproberrmbcssmrrrrrrs    PKd]z9AVV9chardet/__pycache__/langturkishmodel.cpython-38.opt-1.pycnu[U .e^+@sdZdZeedddddZdS)(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr%/'4$-5<1.*0E,#3&>A+8rrrrrr   @  9: rrrrrejd^P]i?~}|hIcOU{6zb\yx[gwDvuats2Zrqpo7)(VYF;NGRX!MBTSnK=`CmJWf"_QlLHk(r$r r$r$r$rr$r$r$r$r$r$r$r$r rrr$r$rr$r$r$r$r$r$r$rr$rr$r$r rrrrrrrrrrrrrrrrrrrrrrr r rrrrrrr$r r r$r$rr$r$r$r$r$r$r$r r$rrr$r$rr$r$rr$r$r$r$r$rr$rr$r$rrrrrrrrrrrrrrrrrrrrrrrr r rrrrrrr$r$r r$r$rr$r$r$r$r$r$r$r r$rrr$r$rr$r$rr r$r$r$r$rr$rr$r$rrrrrrrrrrrrrrr rrrrrrrrrr rrrrrrr$r$r$r$r$r$r r$r$r$r$r$r$r$r$rr$r$r rr$r rr r rr$r$rrrr r r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$r r$r$rr r$r$r$r$r$r$r$rr$r rrr$r rrr r$r$r rrrr r rrrrrrrrrrrrrrrrrrrrrrrrrr rr rrrrrrr$r$rr$r$r$r$r$r$r$rr rrr r$rr r$rrr r r r$rr$rrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$r$r$r$r$r$r$r$r$r$r$r$r$rr$r$r$rr$r rr r$r r$r$rrrr r$r rrrrrrrrrr rrrrrrrrrrrrrrrrr rrrr$r$r$r r$r$r r$r$r$r$r r$r$r$rr$r$rrr rrrr r$r r rrrr r r rrrrrrrrrrrrrrrrrrrrrrrrrrr rrrr$r$r$r r$r$r$r$r$r$r$r r$r$r$rr$r rrr$r rrr$r r$r rrrr r r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$r r$r$r$r$r$r$r$r r$r$r$rr$r r rr r$rrr r r r rrrr r$r$rrrrrrrrrrrrrrrrrrrrrrrrr rrrrrr$r$r$r$r$r$r$r r r r r$r r$r$rr$r$rrr r rrr r r$r rrrr$rr$rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$r r$r$r$r rr r r$r r$r$rr$r rrrrrrrr rr rrrrrr$rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$r r$r$r r$r r r r$r$r$r$rr$rrrr$r rrr$r$r r$rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrr$r r r$r$rr$r$r$r$r$r$r$r r rrr$r$rr$r$rrr$r$r r$rr$rr$r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r$r$rr$r$r$r$r$r$r$r$r$rrr$r rr$r$rr$r r$r$r$rr$rr$r rrrrrrrrrrrrrr rrrrrrrrrr r rrrrrrr$r$r$rr r$r$rrrrrrr$r$r r$rrr rrr rr rrrr rr rrr$rrrrrrr r rrrrr rr r r rr rrrrrr rrrrrrr rr$r$rr$r$r$r$r$r r$rrrrr r$rr r$rrr r$rr$rr$rr r$rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$rr$r$r r r$r r rrr r$rrr rrrrrrrrr r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$rr$r$rrr$r$rrr$r$rrr rr rr rrrrrr rrrrr r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$rrr rr$rrr rrr$r$rr$rrrrrr rrrrr r rrrrrr rrrrrrrrrrrrrrr r rr rrrrrrrrrrrr$r$r$r r$r r$r$rr r r r$r$r$rr$rrrr r rrr rrrrrrrrr$rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$r$r$r$r rr r r$r$r$r$r rr rrrr r rrr rr$r$rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r$r$rr$r$r$r$r$r$r r rr rr r$r r$r r r r r r r rr$r r$r rr rr r r r rrr r rr r rr rrr rrrr rrrrrrrrr r$r$rrrrrrrr r$r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$r r r r$r r$r r rr$r$r$rr rr rr rrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrr$r$r$r r$r$r$r$r$r r$rr r$r$rr rrrrrrrr$r rrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$r r r$r$r rrrrrr$r$rr$rrrrrrrr$rr rrrrrrr$rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$r r r$r r r r$r rrr$r$rr$rrrrrrrr$rrr rrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$rr$r$r$r$r$r r r rr rr rr r rrrrr r r r r r r rrr rr rr rrrrr$rr rrr rrr rrrrrrrrrrrrr$r$r$rr$r$r$rrrrr r r$rrr$rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r rrr r rrrrrrr$r$rr$rrrrrr rr$rrrr rrrrrr rrr r rr r r r rrr rrrr rr rr rrrrrrrrrr$r$r$rr$r r$r rr r r rr$r rr rr rrr rrrrr r rrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$rr$r$rrr r$rrr$r r$rr$rrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$rr$r$r r$r$r r rrrrrr rrr$rrrr$rrrr$rr r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$rr r rrr$rrrrr$r$r r$rrrrrr rr r rr r rr rrr r rrrrrr rrrrrrrr rr rr rrrrrrrrrrrr$r$r$rrrr$rrrrrrr r rr$rrrrrrrrrrrr rrrrr$rrrrrrr rrrrrrrrrr rrrr rrrrrrrrrr$r$r$rr rr rrrrrrr$r$rr rrrrrr rrrrrrrrrrr rrr rr rr rrrrrr rrrr rrrrrrrrrrrrrr$r r$rrrrrrrrrrrr rrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrr rrrrr rrrrrrrrrrrr$r$r$rrr r$rrrrrrr r$r r$rrrr$rr rrrrrr rrrrr rrrrrrr rrrrrrrrrrrr rrrrrrrrrrrr$r r rrrrrrrrrrr$rrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$rr r$r r rr r rrr rrr$r r r rrr r rrrrr rr$rr rrrrrrrrr r r rrr rrrrrrrrrrrrrrrrrrr r$rr$r$r$r r r r rrrrrrrr r rrr r rr$rrr rrrrrr rrrrrrr rr rrr rrrrrrrrrrrrrrrr$r$r rrr$rrrrrrrr$r rr rrrrrr rrrrrr rrrrr rrrrrrrr rrrrrrr rrrrrr rrrrrrrrrr$r$r rrrrrrrrrrr$r$r r rrrrrr rrrrrr rrrrrrrrrr rr rrrrrr rr rr rr rrrrrrrrrrrr$r$r rrr r rrrrrrr r rr$rrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$r rrrrrrrrrr r$rr rrrrrr rrrrrr rr rrrrr r rr rr rrrrrrrrrrrr rrrrrrrrrrrr$r$r$rr rr rrrrrrr$r$rr rrrrrr rr rrrr rrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrr$r$r$rr r r$r rrrrrr r$rrrrrrrr rr rrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r r$rrrrrrrrrrr r r r rrrrrr rrrrrr rrrrrr rrrrrr rrrrrrr rrr rr rrrrrr rrrrrrrrr r rr rrrrr r rrrrrrrrr$rrrrrrrr rrrrrrrrrrrrr rrrrrrrrrrrrr rrrrrrrrr rrr r$rr r$rr r rr rrr rr rrrr rrrrr rrr rrrrr rrrrrrrr r rr rrr rrrrrrrrrrrrrrrr$r$r$rr rr rrrrrrr$r rrrrrrrr rrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r rr r rrrrrrrrrrrr rrrrrrrrrrrrrrr rrrrrrrrr rr rrr rrrr rrr rrrrrrrrr$r r rrr rrrrrrrr r rr rrrrrr rrrrrr rrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$r rr r rrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrr rrrrrrrrrrrr rrrrrrrrr r r rrrrrrrrrrrr rrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrr r r r rrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrr r rr rr rrr r rrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r rrrrrrrrrrr r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrgX4 ?Tz ISO-8859-9ZTurkish)Zchar_to_order_mapZprecedence_matrixZtypical_positive_ratioZkeep_english_letterZ charset_nameZlanguageN)ZLatin5_TurkishCharToOrderMapZTurkishLangModelZLatin5TurkishModelrrH/usr/lib/python3.8/site-packages/pip/_vendor/chardet/langturkishmodel.py$sPKd] JJ-chardet/__pycache__/gb2312freq.cpython-38.pycnu[U ʗReP@sdZdZdZdS)g?i(iiii< iTii iQii i iii<iw ii9 i iiiiZ iiiqi i i iW iyiiieioiiv ii i iiii iLiBi iQ iiiQiiiEiifiiiiiiiidi( iyiii,i i i iE iei iWiRiii| iR ii i i iX i ijiEii i+iPiiiii;iim iiliiii iieiHiiiii^ iki6ii" Fi i i i i^ i i iii?i`iui$i1i ii i iUi i1 iiigiliii iiGii2iiq i i iPiiL iiiiiy ii i iMiikii4 iiiiii i i@ i`ii5iiN ii7i3iiniiuiGi&ibihi0i iM iNii i iY i ii ii &i iQi i7i^ihiiiJ iiPiiiiriiiiiiiT i-iGi,iui i ii$iii<iBii$i>iiix iLiWiiini iiTiiZii i i{ iii i ii i?i 0ibi;DiiiiCiSiiUi> i|igi ii i iKi iiii% i5 iiiiil iihi iii?i iUiii ii*i< i i ii i iii ii i! iX iii iiQ igiiii iiri ii iqii iiz ii i3i iii i i]iciziii7 ii_ii iCii&iaiHi| ili ii=iiiIiPi ii~ i8i`i iw i i iTii i iiii iiiii[iq ii igi|iCi ii iN iIiii5 i i(ii/iHiK i iiii9iiIiii|iii i iWii iii^~iiii i i= iXii3i iIiii iiii3iriioi ii i{iiiiC!iHi iifi= ii1[i i| iDii%iitii i ii ii.iiyiiTiii9 i i i#iiJiniiii ii>iBi"iiiai iiMiKi iW i i i i! ir iFi+ i i i iix HiJiiii2KiiR i$ii9i it ii ii iiiiiiiii%i~i i` iiii'iviii ii|i'i iin i*ii iiFii%i)i~ii iiiJi&ii i!iD iiwii[i ii i i i' i ikiii i i iiiiiih Bi_i i?iigihii'iiiiiiiiiiii5i] ii iiiiiii1 ii)ia iiiii; iii_iiQi/iu i i iji[ii}ii iii iiiiQi^ i iGiizi iiiViOii ii ii imiui i6ii i-i$i iiRii} i ipir i] i iDi iiiiiiiiiiii1iniiiitiYiG i i i/ i|ti0i iiiii\i i iivii iiciiii i~iAi"ii" i!i8Ci8 ii iji i1iili>i ii] i i i~iLi(iiiKidviDiiii%i iii i, i2ii iiij -i.i imiKi iioi i;i ii idi@iai iM i1 iLi@i2 iiwiitiQi i/ii ii~iiiii i/ii i_ i#i OiiOiGiiki[iOioii- i ii i!i i iIiiii{iri i.ihi i iT iii'iL aii i@ii iii iT i/ iiiii iiMiii il iii i{i8i#i iii9iiSiRi wiiZii0 iEigig ii iLiiipiiiSi iiiii i@iiI iLi; iOiqiii) i i:iFii5iJidiA ii i) iEiLYiiii im i ii i iiic iiRii!iiii i(iii]Iii i iieiiii iii`ii iii ii[iiC i(iPi,i i}iO i' iLi\ i i i iiiiZiiisi'i iUiiiiiN iii i iiMiiiiii iiiiigi'iii ii Pi0 is iiiip i iniiii i\i iii i!ihimi(i& i iCiiBi)i5 iiiiii ii>iii i i{iNiiiiEi3Ji#iicii ii$ i5iixi i]iiiki iiiiP ii iiiriiL i izidiii#i iii[ iSiihiiGiiiii iU+i iyiwi"iiVi2 i&izi i iiJ iP i iiii% iZi$ io iT iKi1 i ii`iVi ii id i iii+i iiAii iiii$ii i_i3i\ iiiibi ifiiii iAiniixiFi iOi[ii(i ii i#i7i2 ixiif i i i!i6i{ iiYiii+iiiii iiii i iKiei i i iTi$iiiih ii iRiii"i iZi i_ ii@iiai iii3 i iki)ijiii ieii iA i^ii iW iiihi: iz i) ii| iii ii i8 iji iii3i i iziipiyi i i2 ioiD i=i.ii9 iaifii*i_ii i*ii i i ii i- ii i}ii i ii* i ititi6 qiiiiiii iSi iii!i)iiyi ii ij ii iiViIiiig iiiLii iipiDii i ii%ii iM iiii$i i iiE i"iU iie i i|i iQiii ii ii i1 iiii$i i]i4i&iiiziii`iiwi iiii i)i% i&iiii*iii8i2i> iSi iii1i#i ii ii#i i iiii iF iii, i> i+i i iiZ 3iqi i$ii iVi i;iiiNimiKiWiii5i i Ri4i iIiiDiiii i i i iiii%iKi|iii iii9iin iii i-i3 i2 ipii? ii~iiiiiiCii[ii iii i3 i> iili i`ix iiii i# iiii0iii iL i iiQiiRii?i(imii` ii3iiii& i ii isiDii0 ib ifi@ i iii ii=i i i<iii ii6iiis iii iSiii i8iZ iii ii iii i ii iiiiNi i i iLi iJ iii ibiig iii[ iiiiii~ ii i iiifiiiii i i` i4i= iiiili? iici ii iiii iiiiiiiiwiii i%ii id i^i+iii iZiF iI iit i /i iiiyi* isi&i+iii) iii iii i i ie iiiQi] ii i_i7 ii0ciuiiiLiki iiii#iiiiiii?iii ini i iii iii iHiiYiiu ii i iiJii_ i_i&iiii iiiZi%i isiiSii i iViiiiii1i'iiFi\i i|i iWiii|iSWi i* i iRiliPi#i i i-iq ii i ii4iiiiiia iiiii@ i iXiii%iii8 i3i,ii} iiidixi ii# ii6i i i.iiiAi iir i i iR idiii+ iiii i{i{iHi i iiiiiici i i iii,iiI iici ii iii=i iJi. i,i>iiiiLiei]ii iC iiii*i; i ii iipi iiiRii9 i i ii iii?i:i i i iQi'isiiwi[i ii-i i)iiMiiiii]}i6i@i iiUiiii/iiis i iiik i? ii, i= i1iMi iii/iS id iio i6 ikiui iiiW{iixiWii iiiix i^ ii[ i+ 7i:iiU iii!iii i.iHiTiiYiii ii@i"iCisi i i iG bii7i~i. iUi iqi iiii{iiiYi/i iiiAi ii*i:i8i'i i ii iiA i_i0iiiiiiiiKi i iit i* iii iiii i i iiDiiii>iiivii i i'iViii iiikii i\iiii!i i*iU iiiiiizii\if iii i iii iiii i iiB iii iii{i=i i&i iiV i i"i! i i iii i( i=ii i ii9i ii4iaii-iQ i ii imiiiiiCiii7i}iqiDi4iuii iiiv iiiF iiu ia iiH ioi i iliKiA iii izi4 i i! iH ii i5 iijii`ii iB i:iOiai i#iiidii(i i& ii^imig iE iio ii(iG i$i@i iIiiiAi i`Xii7ii/ii$ii iihiiii iUi"iTiiiimii!iiiiii iiMi iii 2iqii9iii iiii/iii pi@iX iijii i^ ibi i iniiviiioioiiviii0ii9ii$ iifiS izi iiDi{iiXii iVi3 iYi ii iAiiiiiqiU i i: ii2iji ii i{ ii iFi i i ii iiiciiiR i;ik hii i iiY iOixiziZi<iv ii i i iiIiii4 iMiiiiib iiii ii iiCii iiiO ii8iii i.i]i iVic i iii iH iiTiii ii> i ii i3ii,iiifiiiiliTiWiHi.i'i>ipiiii"ii iJii i ivi2iii ixi i2iigi i4iii i iii{ iz i i i iii iiiiii?iii iJiiii i i8iE ij \ii8i8 ii iii`ii>ibiSiii i iii0i iiiEi iidiiii1iiin@ii iiTii iiQiCii iK i;ikiiiiii_i\ ieiiwiiiiiMii. iriaiii i ii iiiigii i' i iii i Tiii4ioii iXiyiixii i i iU ^i: iiii ii"i#iii ii iiiiNiUiiip i" i-i i ii:ii ii iiii iiW i iG iLii iGiw oiii iMir ii iiQ iiI iN%i iXiii i7 i iaii ii i' iiihi i}iNiyi?itii iD iiii liiii iie iJisi2i*iyiiiiii iiqi ii5i}is i$iiii5 iBiii# idisi} ii~iiib iiO i/ ]iii i]i2iifi7iiiOi iRii# i i[iEii if iS i idiFiiiC iV i>ii iiBii i i1i6imii iiiip i ii i i<izi i| iXiiisie i]iii i iiOi i+i iiiiii:i iAii ii ii( i imi4iP i inii ioioiiimiiyii8i i<iii<ic iC iii&iwi i i$i i9i&ii i)i`iiiiiiGibiEii:iQio iF i iii i iFi|i;i iii3i4 i%i:i iciipi6 i\iCii0i9 ii iiii~ iii"ih iiii i)ii i iii* ii i i i%ii iiii i.iii9i iii iii ii"i! ii, i ig iJ igiF iiii ii;ii iZiEi^iA iiili5ii ii4i' iiiki ii i2ii ii iXi7ii i{iiBixi=ei(i iii'iiiiiiiiii iD iiikii iii-i, i iei7 i ii iiini} ip i7ijii ii9ii iii0iPi iiiiiO i i i iUi iii< iii iJiitiNii)i i.ii*i iAir i] i)iiiiiGii_ ipik iii i% i ii ii>ibi_i^?ii:iYiDi%ii iiiiiYii i iiiiil Aii i i iDiBi i ii i@ i(iv iiigi i i}iviiii iiiii iiiiiiii i-i~iiy i%i i _i iiiiijiMi iiGi+i iii iiii3 i;i Gi)ii iii i ii ii i ii,iIi iii iXiAi\iiiP ivii iVii=i i i6 i<iiX i i i ii8 i- iY iiiii iiciiii9i i- iuii ii iR i i ii6ii iih i}i i? iw i ii ia i( i i1ii ii>iii i ii]i iXiriPi0 i,ii+ ijii`iiiii. iii ii& iWiB iii|i7 Uii iWiiYii iiw i iii iiiiiuiibiiq iiibiii =i$ iiNiJiiiUiiii iiiiKi,iii4iri{i iiHiipi5iii=i i iEi9ii;i <ii5i iii ii\iiipiiiiriNiii^iiiiiK ii i*ii{ i+ i ii*i8iiii iiii ij ii@il 6ii2i8ii iiii'iiiiB iiii\iiiS iV ii~iiiii i iiVi iz i i^i i iii_ i} iG iqiI i ii8itihiS ii}iRi i9Sin iPiiB iiisiiXi}ifiiii iiiiiin iIi^iTiixiiriii_ibiiOiPiQiRiSN)!GB2312_TYPICAL_DISTRIBUTION_RATIOGB2312_TABLE_SIZEGB2312_CHAR_TO_FREQ_ORDERrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/gb2312freq.py*sPKd]a52chardet/__pycache__/mbcharsetprober.cpython-38.pycnu[U ʗRe' @s0ddlmZddlmZmZGdddeZdS)) CharSetProber) MachineState ProbingStatecsVeZdZdZdfdd ZfddZeddZed d Zd d Z d dZ Z S)MultiByteCharSetProberz MultiByteCharSetProber Ncs(tj|dd|_d|_ddg|_dS)N) lang_filter)super__init__distribution_analyzer coding_sm _last_char)selfr __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/mbcharsetprober.pyr 'szMultiByteCharSetProber.__init__cs8t|jr|j|jr*|jddg|_dS)Nr)rresetr r r r rrrr-s    zMultiByteCharSetProber.resetcCstdSNNotImplementedErrorrrrr charset_name5sz#MultiByteCharSetProber.charset_namecCstdSrrrrrrlanguage9szMultiByteCharSetProber.languagecCst|D]\}}|j|}|tjkrH|jd|j|j|t j |_ q|tj kr^t j |_ q|tjkr|j}|dkr||jd<|j|j|q|j||d|d|q|d|jd<|jt jkr|jr||jkrt j |_ |jS)Nz!%s %s prober hit error at byte %srr) enumerater next_staterERRORloggerdebugrrrNOT_ME_stateITS_MEFOUND_ITSTARTget_current_charlenr r feedstate DETECTINGgot_enough_dataget_confidenceSHORTCUT_THRESHOLD)r byte_stribyte coding_statechar_lenrrrr%=s6          zMultiByteCharSetProber.feedcCs |jSr)r r)rrrrr)^sz%MultiByteCharSetProber.get_confidence)N) __name__ __module__ __qualname____doc__r rpropertyrrr%r) __classcell__rrrrr"s   !rN) charsetproberrenumsrrrrrrrs PKd]&X \ \;chardet/__pycache__/langhungarianmodel.cpython-38.opt-1.pycnu[U .e01@s4dZdZdZeedddddZeedddddZd S) (rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr(6- 21&'5$)"#/.G+!%90@D74rrrrrr   C A> rrrrrKO3QN,=:B;<E?RJFPHSMTLUI*8rr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrr;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNr}rOrrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_rrarbrcrdrerfrgrhr{rjrkrlrmrnrorprqrrrsrtrurvrwrxryrzrr|rr~rrrrrrrrrrrrrrrrrrrrrrrrrrrrr`rrrrrrrrriVrrWrrrrrrrrrrrrrrrr(r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r#r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2rr2r2r2r2r2r2r2r2rrr2r2r#r#rrrrrr#rr2rrr2r2r2r2r2rr2r2r2r2r2r2r#rr2r2r2r2rr2r2r#r#r2r2rr#r#r#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2rr#r2r2r2r2r2rr2r2r2r2r2r#r#rr2r2r2r2r2r2r2r#r#r2rrr#r#r#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr#rr2r2r2r2r2r2r2r2r2r2r2r#r#rr2r2r2r#r2r2r2r2r2r#r2r2rrrr2rr2rrrrrrrrrrr2rrrrrrrrrrrrrrrrrrrrrr2r2r2r2r2r2rr2r2r2rr2r2rr2r2r2r2r2rr2r2rrr2rr2rrr2rrrrrrrrrrrrrrrrrrrrrrrrrrr#rrrrrr#rr2r2r2r2r2r2rr2r2r2r2r2rr2r2r2r#rr2rrr2r#rr2r2rrrr2r2r2rrrrrrrrrrrrrrrrrrrrrrrrr#rrrrrrrr2r2r2r2r2r2r2r2r2r2rrr2r2r2r2r2r2rr2r2r2r2rr2r2r2r2rrr2rrrrr#r#rrrrrr2rrrrrrrrrrrrrr#rrrrrrrr2r2r2r2r2r2r2r2r2r2r2r#r#r#r2r2rr#r2rrr2rr#r2rrr#rr2r2r#rrrrrrrrrrr#rrrrrrrrrrrrrr#rrrrrrrr2rrr2r2r2r2r2r#rr2r2r2r2r#rr#r2r2r2r2rrr2r#r#r2rrr#r#r#rrrrrrrrrrrrrrrr#rrrrrrrrrrrrrrr#rr2r2r2r2r2r2r2r2rrr2r2r2r2r2rr#r2r2r2r2r2rrr#r2r2r2rr#r#rrrrrrrrrrrrrrrrrrrrrrrrrr#rrrrrr#rr2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2rr2r2r2rr2r2rr2r2r2rrr2rr2rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr#rr2r2r2r2r2r2rr2r2r2rr2rr2r2r2r#r2rrrr2r#r#r2r2r#r#rr2r2rrrrrrrrrrrrrrrrrrrrrrrrrr#rrrrrrrr2r2r2r2r2r2r2rr2r2r2rr2rr2r2r2rr2r2r2r2r2r#rr2rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr#rrrrrrrr2r2r2rrrr2r#r2r2rrr#r2r2r2r#r#r2r#rr2rr2rrrr#rrrrrrrrrrrrrrr#rrrrrrrrrrrrrrrrrrrrrr2r#r#r2r2r2r2r2r#rr2r2r2r2r#rr#r2r2r2rrr2rr#rr2rrr#r#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2r#r#r2r2r2r2r2r#rr2r2r2r2r#r#rr2r2r2r2rrr2rrrr#rr#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2r2r2r2r2r2rrr2r2rrrrr2r2rr#rr2rr2rrr2rr#rrrrrrrrrrrrrrrr#rrrrrrrrrrrrrrrrrrrrrr2r2r2r2r2r2r#rr2r2r2rr#rr2r2rrrr2rr2r2r#r2r2r#r#rrr2rrrrrrrrrrrrrrrrrrrrrrrrrr#rrrrrrrr2r2r2r#rrrrr2r2r2r#r#r#r2r2r#r#r2r#r#r2rr#rr2r#r#rrrrrrrrrrrrrrrrrrrrrrrrrrrrr#rrrrrrrr2r2r2rr#rr#r#r2r2r#r#r#r#r2r2r#r#rrr#rr#r#rrr#r#rrrr#rrrrrrrrrrr#rrrrrrrrrrrrrr#rrrrrrrr2r2r2r#r#rr#r#r2r2r#rr#r#r2r2rrr#r#rr2r#rrrr#rrr#r2rrrrrrrrrrrr#rrrrrrrrrrrrrr#rrrrrrrr2rr#r2r2r2r2r2r#rr2rr2r2rr#r#r2rr2rr#rrrr#rr#rrr#r#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr#rr2r2r2r2rrrrr2r#rrr#r#r2r2rr2rr#rr2rr#r2r2r#r#rrr#r2rrrrrrrrrrr#rrrrrrrrrrrrrr#rrrrrrrr2r2r2rrrr2rr2r2r2rr#r#r2r2r#r#r#rrr2rr2rrrr#rrrr#rrrrrrrrrrr#rrrrrrrrrrrrrr#rrrrrrrr#rrr2r2r2r2r2rrr2r2rr2rrrrr2r2r#rr#rrrr#r#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2r#rr2r2r2r2r2r#rr2r2rrr#r#rr2r2rrr#rrr#rrrrr#r#r#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2r2rrr#r2r#rr2r2rrr#r#rrr#r#r#r#r2rr#r#r#r#rr#rr#rr#rrrrrrrrrrrrrrrrrr#rrrrr#rrrrrrrrrrr2r2r#r#r#r#r#r2r2r2rr#r#r2r2r#r#r#r#r#rrrr2r#r#rrrr#r#rrrrrrrrrrr#rrrrrrrrrrrrrr#rrrrrrrr2r#rr#rr#rrrr#rr2r#rrrrrr#r#r#r#r#rrrr#r#rrrrr#rr#rrrr#rr#rrrrrrr#r#rr#r#rr#r#r#rr#rrrr#r#rr#r#r#rr2rr2r2rr#rrr2r#rr#rrr#rrrr#r#rrr#r#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr#rrr2r2rrr#rrr2rr2rrrrr#r#r2rrr#r#rrrr#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2r#r#rrr2r2r#rr#r2rr2r#r#r#rr#r#r#r#r#r2r#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2r#r#r#rrrr#rr#rr2r2rrrrrr#r#r#rr#r#r#rr#r#r#rrrr#rrrrrr#r#r#rrrr#r#r#r#r#rr#r#r#r#r#r#rr#r#r#rrr#r#r2rrr#rrr#r#rrrr2rr#rr#r#rrr#r#r#rr#r#r#r#rrr#r#r#rrr#r#r#rr#rr#r#r#r#r#r#r#rr#r#r#rr2r#r#r#r#r#r#r#r#r#rr#rr2r2rr#rrrr2r2r#rrr#rrr#rrrrrrrr#r#r#rrr#r#r#rr#r#r#r#r#r#rr#r#rr#r#rr#r#r#rr#rr#r#rr#r#r#r#r#r#r#rr#rr2r2rr#rrrrrrrrrr#rrrrrrr#rrr#r#rrrrr#rrr#r#r#r#rr#r#r#r#r#r#r#rr#r#r#r#r#r#r#r#r#rrr#r#r#r#r#rr#r2rrrr#rr#rrr2rrrr#rrr#rrr#r#r#rrrr#rr#rrr#r#rr#r#r#r#r#r#rr#r#r#r#r#r#rrr#rr#r#rr#r#r#rr#r#rr#r#rr#rrrrrr#rrrrr#r#rrrr#r#rrrr#rrrrr#rrrr#r#r#rr#r#r#r#rr#rr#r#r#rrr#r#rr#r#r#rr#r#r#r#r#r#r#r#r#r#rr#r#rr2rrrr#rr2rr#rrr#rr#r#rrrrrr#rr#r#rrrr#rr#r#r#rrrr#rr#r#r#r#r#rrrr#rrrrrrr#r#r#r#r#r#r#r#rr#r2rrrr#rrr#rrrr#rrrrrrr#r#r#rr#r#rrr#r#rrrrr#rr#rrr#r#rr#rrr#r#r#r#r#r#r#r#r#rr#r#rrr#r#r#r#rrr#r#r2rrrrr#rrrrrrrrrr#rrrrr2r#r#r#r#rrrr#r#r#rr#rr#r#r#rr#r#r#r#r#r#r#rrr#rrr#rr#r#rr#r#r#r#r#r#rr#rr2rrrrr#rrrrrrrrr#r#rrrrrr#rr#r#rrrr#r#rrr#r#r#r#rr#rr#rrr#r#r#rrr#r#r#rr#r#r#r#rr#r#r#r#r#rr#r2r#r#rrrr2rr#r#rrr#r#rr#rrrr#r#r#r#r#rrr#r#rr#r#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr#rrrr#r#rrr#rrrrr#r#r#rrr#r#r#rr#rr#r#rr#r#r#r#rr#r#r#rr#r#r#r#rr#rr#r#r#rr#r#rrr#rr2rr#rrrrr#r#rrrr#r#r#r#rr#r#rrr#rrrrrr#rr#rr#rr#r#r#rrrr#r#r#rr#rrrr#r#r#rrrrrrrrrrr2rrrrrrr#r#rr#rrr#r#r#rrrrrrrr#r#rrrr#r#r#rr#r#r#r#r#r#rr#rr#r#r#r#rrr#r#r#r#r#r#rr#rr#r#r#r#r#rr#r#rrrr#r#r#rrrrrrrr2rr#rrrr#r#rrr#r#rr#r#r#rrr#r#rr#r#r#r#r#r#r#r#rr#r#r#r#r#r#r#rr#r#r#rrr#r#r#rr#rr#rr#rrr#r#rrr#r#rr#r#r#rrrr#r#rr#r#r#r#rrr#r#r#rrrr#rrrrrr#r#r#rrrr#r#r#r#r#r#r#r#r#r#r#r#rr#r#rrrr#rr#rr2rrrr#rrrrrrrrrrrrrrr#rrr#rrrrrr#rrr#r#r#r#r#rrrrrr#rr#r#r#r#rr#rrr#rr#rr#r#r#rr#rr#rrrrrrr#rrr#rrrrr#r#rrrrrr#rrr#r#rrrr#rr#rr#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#rrr#r#r#r#r#rr#r#rrrrrr#rrrrrrrr#r#rrrrrr#r#rrrrr#r#r#rr#r#rr#r#r#r#r#r#rr#r#r#r#rrr#rrr#r#rr#rr#r#r#r#r#rrrr#r#rrr#rr#rr#rrr#r#r#rrrrr#r#rr#rr#r#rrr#rrrrrrrr#rr#r#r#r#r#rrrrr#r#rr#rr#rr#r#r#rrrrrrr#rrrr#r#rr#rrrr#r#r#rrrr#r#rrrrrr#rrr#rrrrr#rr#rrr#r#r#r#r#rr#r#rr#r#r#r#rr#r#r#rr#r#rr#rr#r#r#r#r#rr#r#rrrrrrrr#r#rrrrrr#rrrrrrrrrrrrrrrr#rr#r#r#r#r#r#r#rr#r#rr#r#rr#rrrr#r#r#r#rrr#r#r#r#rrr#r#r#rrrr2r#rrr#r#r#rrr#r#r#rrrr#r#rrrr#rrr#rr#rr#rr#rr#r#r#rr#r#rr#r#r#r#r#rrrr#r#r#r#r#rr#rrrr#rrrr#r#rrrrrr#rrrrrrrrr#rr#rrrr#rrrrrrrrrr#r#r#r#r#r#r#r#r#rr#r#r#r#r#r#r#r#r#rr#r#rrr#r#r#r#r#rr#rr#r#r#rr#r#r#rr#r#rr#rrrrr#r#r#r#rr#rrrrr#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr#r#rr#r#r#r#r#rrr#r#rr#rrrr#r#rrrr#r#rrr#rr#rrrr#rr#r#r#r#r#r#r#r#rr#rr#r#r#r#r#r#rr#r#r#rrrrrrr#rrrrrrr#r#r#r#rrr#r#rrrrrr#r#r#rrrr#rrr#rr#rrrrr#r#r#r#r#r#r#r#rrr#r#r#r#rr#r#r#rr#r#r#rrrrrrrrrr#rrr#r#r#r#r#rrrr#rr#rrrr#rr#rrrrrrr#rrrrrrr#r#r#r#r#r#rr#r#rr#rr#r#rr#r#rrr#r#r#rrrrrrrrrr#rrr#r#r#rrrrr#rrrrrrrrrrrrrrrrrrrrrrr#r#r#r#r#rrr#r#rr#rr#rrr#r#r#rr#r#r#rrrrrrrrrrrrr#rrrrrrr#r#rr#rrrrrrrrrrrrrrrrrrrr#r#r#rr#rrr#r#rr#rr#r#rr#r#r#rr#r#r#rrrrrrrrrrr#r#r#r#r#r#r#r#r#r#rrr#r#r#rrr#rrr#rr#rr#r#r#rrr#rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr#rrr#r#r#r#rrrr#r#r#rrrrr#r#r#rrrrrrrrrrrrrr#r#r#r#r#r#rr#r#rr#rr#rrr#r#rrr#r#rrrrrrrrrrg(P?Tz ISO-8859-2Z Hungarian)Zchar_to_order_mapZprecedence_matrixZtypical_positive_ratioZkeep_english_letterZ charset_nameZlanguagez windows-1250N)ZLatin2_HungarianCharToOrderMapZwin1250HungarianCharToOrderMapZHungarianLangModelZLatin2HungarianModelZWin1250HungarianModelrrJ/usr/lib/python3.8/site-packages/pip/_vendor/chardet/langhungarianmodel.py"s" PKd];즾 -chardet/__pycache__/sjisprober.cpython-38.pycnu[U ʗRe@s`ddlmZddlmZddlmZmZddlmZddl m Z ddl m Z Gddde Z d S) )SJISDistributionAnalysis)CodingStateMachine) MachineState ProbingState)SJISContextAnalysis)MultiByteCharSetProber) SJIS_SM_MODELcsPeZdZfddZfddZeddZeddZd d Zd d Z Z S) SJISProbercs0ttt|_t|_t|_| dSN) super__init__rr coding_smrdistribution_analyzerrcontext_analyzerresetself __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/sjisprober.pyr %s   zSJISProber.__init__cst|jdSr )r rrrrrrr,s zSJISProber.resetcCs|jjSr )r charset_namerrrrr0szSJISProber.charset_namecCsdS)NJapaneserrrrrlanguage4szSJISProber.languagecCs>t|D]\}}|j|}|tjkrH|jd|j|j|t j |_ q|tj kr^t j |_ q|tjkr|j}|dkr||jd<|j|jd|d||j|j|q|j||d||d|||j||d|d|q|d|jd<|jt jkr8|jr8||jkr8t j |_ |jS)Nz!%s %s prober hit error at byte %sr) enumerater next_staterERRORloggerdebugrrrNOT_ME_stateITS_MEFOUND_ITSTARTget_current_charlen _last_charrfeedrstate DETECTINGgot_enough_dataget_confidenceSHORTCUT_THRESHOLD)rbyte_stribyte coding_statechar_lenrrrr*8sF         zSJISProber.feedcCs|j}|j}t||Sr )rr.rmax)r context_conf distrib_confrrrr._s  zSJISProber.get_confidence) __name__ __module__ __qualname__r rpropertyrrr*r. __classcell__rrrrr $s    'r N)chardistributionrcodingstatemachinerenumsrrjpcntxrmbcharsetproberrmbcssmrr rrrrs     PKd]jf .chardet/__pycache__/eucjpprober.cpython-38.pycnu[U ʗRe\@s`ddlmZddlmZddlmZmZddlmZddl m Z ddl m Z Gddde Z d S) )EUCJPDistributionAnalysis)CodingStateMachine) MachineState ProbingState)EUCJPContextAnalysis)MultiByteCharSetProber)EUCJP_SM_MODELcsPeZdZfddZfddZeddZeddZd d Zd d Z Z S) EUCJPProbercs0ttt|_t|_t|_| dSN) super__init__rr coding_smrdistribution_analyzerrcontext_analyzerresetself __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/eucjpprober.pyr %s   zEUCJPProber.__init__cst|jdSr )r rrrrrrr,s zEUCJPProber.resetcCsdS)NzEUC-JPrrrrr charset_name0szEUCJPProber.charset_namecCsdS)NJapaneserrrrrlanguage4szEUCJPProber.languagecCs*t|D]\}}|j|}|tjkrH|jd|j|j|t j |_ q|tj kr^t j |_ q|tjkr|j}|dkr||jd<|j|j||j|j|q|j||d|d||j||d|d|q|d|jd<|jt jkr$|jr$||jkr$t j |_ |jS)Nz!%s %s prober hit error at byte %sr) enumerater next_staterERRORloggerdebugrrrNOT_ME_stateITS_MEFOUND_ITSTARTget_current_charlen _last_charrfeedrstate DETECTINGgot_enough_dataget_confidenceSHORTCUT_THRESHOLD)rbyte_stribyte coding_statechar_lenrrrr(8s:         zEUCJPProber.feedcCs|j}|j}t||Sr )rr,rmax)r context_conf distrib_confrrrr,\s  zEUCJPProber.get_confidence) __name__ __module__ __qualname__r rpropertyrrr(r, __classcell__rrrrr $s    $r N)chardistributionrcodingstatemachinerenumsrrjpcntxrmbcharsetproberrmbcssmrr rrrrs     PKd]~In n 4chardet/__pycache__/eucjpprober.cpython-38.opt-1.pycnu[U .e@s`ddlmZmZddlmZddlmZddlmZddl m Z ddl m Z GdddeZ d S) ) ProbingState MachineState)MultiByteCharSetProber)CodingStateMachine)EUCJPDistributionAnalysis)EUCJPContextAnalysis)EUCJP_SM_MODELcsPeZdZfddZfddZeddZeddZd d Zd d Z Z S) EUCJPProbercs4tt|tt|_t|_t|_ | dSN) superr __init__rr coding_smrdistribution_analyzerrcontext_analyzerresetself __class__C/usr/lib/python3.8/site-packages/pip/_vendor/chardet/eucjpprober.pyr %s  zEUCJPProber.__init__cstt||jdSr )r r rrrrrrr,szEUCJPProber.resetcCsdS)NzEUC-JPrrrrr charset_name0szEUCJPProber.charset_namecCsdS)NZJapaneserrrrrlanguage4szEUCJPProber.languagecCs6tt|D]}|j||}|tjkrN|jd|j|j |t j |_ qq |tj krft j|_ qq |tjkr |j}|dkr|d|jd<|j|j||j|j|q |j||d|d||j||d|d|q |d|jd<|jt jkr0|jr0||jkr0t j|_ |jS)Nz!%s %s prober hit error at byte %sr)rangelenr Z next_staterZERRORZloggerdebugrrrZNOT_MEZ_stateZITS_MEZFOUND_ITZSTARTZget_current_charlenZ _last_charrfeedrstateZ DETECTINGZgot_enough_dataget_confidenceZSHORTCUT_THRESHOLD)rZbyte_striZ coding_stateZchar_lenrrrr8s@      zEUCJPProber.feedcCs|j}|j}t||Sr )rr rmax)rZ context_confZ distrib_confrrrr Ys  zEUCJPProber.get_confidence) __name__ __module__ __qualname__r rpropertyrrrr __classcell__rrrrr $s    !r N)ZenumsrrZmbcharsetproberrZcodingstatemachinerZchardistributionrZjpcntxrZmbcssmrr rrrrs      PKd]M19VV6chardet/__pycache__/langthaimodel.cpython-38.opt-1.pycnu[U .e,@sdZdZeedddddZdS)(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjkde^lmnoY_pqrrrrrr@HIrJstfQuZgNR`[OThiab\rrrrrXvcUSK4"3w/:9157+,0'>6- = *.LB? $ ( #V )!2%CM&]D8;AE<FPGWrr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrr|rrrrrrrrrr|rr|rrrrr|rr|r|rrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrr|r|r|rrrr|rrrrrrrrrr|rrrrrrr|r|rrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrr|r|r|r|r|r|r|rrrrr|rrr|rrrrr|r|r|rrrr|rrrrrrrr|r|rr|rrrrrr|rrrrrrrrrrrrrrrrrrrrrrr|r|rrrrrrrrrr|rrrrrrrrrrr|r|r|r|rrrrr|r|rrrrr|r|rrr|rrr|r|rrrrrr|rrrr|r|rrrrrrr|rrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrr|r|rrrrrrrrr|rrr|r|rrrrr|r|rrr|r|r|r|rrrrrr|rrrrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrr|rrrrr|r|rrr|rrrrr|rrrrr|rrr|r|r|rrr|r|r|r|r|rr|rr|r|rrrrrrr|rrrr|r|rrrrrrrrrrrrrrr|rrrrr|rrrrrrr|rrrrr|rrrrrrrrrrrrr|r|rrrr|r|rrrrr|r|r|rr|r|rrrr|rrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrr|rrrrrrrr|rrrr|rr|r|r|r|rr|rrr|r|r|rr|r|rrrr|rrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrr|rrr|rr|r|rrrr|rrrr|rr|rrr|r|rrrr|rrr|r|rr|r|r|r|rr|r|rrrrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrr|rrr|r|r|rrr|r|rrr|r|rr|rrr|r|rrrrrr|r|r|rrr|r|r|rrrrr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrr|r|rrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrr|rrrrrrrrr|rrrrrrrrrrrrrrrr|rrrrrrrrrrrr|rrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrr|rrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrr|rrrrrr|r|rr|r|r|rrrrr|rr|rr|rr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rr|rrrrrrrr|rr|r|rr|rrrr|r|rr|rrrr|r|rrr|rr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrr|rrrrrrr|rrr|rr|r|rrr|rrrrrr|rrrrrrrrr|rr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrr|rrrr|rrrr|r|r|r|rrrrrrr|rrrrr|rrrr|rrrrr|r|r|rr|rrrrrrrrrrrrrrrrrrrrrrr|rrrrr|rrr|rrrrr|rrr|rrr|rrrrr|rrrrr|r|r|rr|r|r|rr|r|rr|rrr|r|r|rrrrrrrrrrrrrrr|rrr|rrrrrrrrrrrrrrrrrrrrrr|rrr|r|rrrrr|rrr|rrr|rrrr|r|rr|rr|r|r|rr|r|r|r|rrrr|rr|r|rrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrr|rrrrr|r|rrrrrr|rrrrrr|r|rrrrrrrrrrrrrrrrrrrrr|rr|rrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrr|rrr|rrrrrrrrrrr|rr|rrrrrrrr|rrrrrrrrrrrrrrr|r|r|r|rrrrrr|r|rrrrrrrrrrrrrrrrrrrrr|r|rrr|rrrrrr|rrr|r|rrr|r|rrrr|r|rr|rrrr|rr|r|r|r|r|rrrr|rr|r|r|rrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrr|rrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrr|r|r|rrrrrrrrrrr|rrrr|r|rrrrrrrrrrrrr|r|r|rr|r|rr|rr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrr|rrrrrrrrrrrrr|r|rrr|rrrrrrrrr|r|rrrrrrrrrrrrrrrr|r|rrrrrrr|r|r|rrrrrrrrrrrrrrrrrrrr|rrrrr|rrrrrr|r|rrrrrr|rrrr|rrr|r|rr|rrr|rrrrrrrrrrrrr|rrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|rr|rrrrrrrrrrrrrr|rrrrr|rrrrr|rrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|r|r|rrrrrrr|rrrr|rr|rrrr|rrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrr|rrr|rrrrrr|rrrrrrr|rrrrr|r|r|rrrr|r|rrrrrrrrrrrrrr|rrrrrrrrrr|rrrrrrrrrrrrrrrr|rrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrr|rrrrrrrr|r|rrr|rrr|rrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrr|r|r|r|r|r|rrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrr|r|rrrrrr|rrrrrrrrr|r|rr|rrrrrrrrrrr|rrrrr|rrrrrrrrr|rrrrrrrr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrr|rrrrrrr|r|rrr|rrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrr|r|rrrrrrrrrrr|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrr|rrrr|rrr|rrrrrrrr|rrrrrrrrrrrrrrr|r|rrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrr|r|rrr|rrrrrrrr|rrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|rrrr|rr|rrrrrrrrr|rrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrr|rrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrr|r|rrrrrrrrr|rrr|rr|r|rrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|rrrrrrr|rr|rrrrrrrrrrr|rrrrrrrrrrrr|rrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrr|rrrrrrr|rrrrrr|rrrr|rrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrr|rrrrrr|rrrrrr|rrrrrrrrrrrrrrrr|rrrrrrrrrrrr|rrrrrrrrr|rrrrrrrrrrrrrr|rrrr|rrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|r|r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrr|rrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrr|rrrrrr|rrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrr|rrr|rrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrr|rrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrr|rrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrr|rrrrrrrrrrrrrrr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrg@?FzTIS-620ZThai)Zchar_to_order_mapZprecedence_matrixZtypical_positive_ratioZkeep_english_letterZ charset_nameZlanguageN)ZTIS620CharToOrderMapZ ThaiLangModelZTIS620ThaiModelrrE/usr/lib/python3.8/site-packages/pip/_vendor/chardet/langthaimodel.py$sPKd]ӲN  .chardet/__pycache__/escsm.cpython-38.opt-1.pycnu[U .e)H@sddlmZdZejejdejejejejejejejejejejejejejejejejejejejdejdejdejdddejdejdddejdejdejejejejejejejf0ZdZedeedd d Zd Z ejdejejejejejejejejejejejejejejejejejejejejejejejejejejejejdejejejejejejejejejddejejejejejejejejejejejejejejejejejejejejejejf@Z d Z e d e e dd d Z dZ ejdejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejdejejejdejejejejejdejejejejejejejejejejejejejejejejejejejejejejejejejejejejfHZdZe deeddd ZdZejdejejejejejejejejejejejejejejejejejejejdejejejejejejdejejejejejejejejejejejf(ZdZedeeddd ZdS)) MachineState(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrz HZ-GB-2312ZChinese)Z class_tableZ class_factorZ state_tableZchar_len_tablenameZlanguage(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) rrrrrrrrr z ISO-2022-CN(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) rrrrrrrrrr z ISO-2022-JPZJapanese(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrz ISO-2022-KRZKoreanN)ZenumsrZHZ_CLSZSTARTZERRORZITS_MEZHZ_STZHZ_CHAR_LEN_TABLEZ HZ_SM_MODELZ ISO2022CN_CLSZ ISO2022CN_STZISO2022CN_CHAR_LEN_TABLEZISO2022CN_SM_MODELZ ISO2022JP_CLSZ ISO2022JP_STZISO2022JP_CHAR_LEN_TABLEZISO2022JP_SM_MODELZ ISO2022KR_CLSZ ISO2022KR_STZISO2022KR_CHAR_LEN_TABLEZISO2022KR_SM_MODELrr=/usr/lib/python3.8/site-packages/pip/_vendor/chardet/escsm.pys $ $ $ $PKd]L.chardet/__pycache__/euctwprober.cpython-38.pycnu[U ʗRe@sDddlmZddlmZddlmZddlmZGdddeZdS))EUCTWDistributionAnalysis)CodingStateMachine)MultiByteCharSetProber)EUCTW_SM_MODELcs4eZdZfddZeddZeddZZS) EUCTWProbercs(ttt|_t|_|dS)N)super__init__rr coding_smrdistribution_analyzerresetself __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/euctwprober.pyr#s  zEUCTWProber.__init__cCsdS)NzEUC-TWrr rrr charset_name)szEUCTWProber.charset_namecCsdS)NTaiwanrr rrrlanguage-szEUCTWProber.language)__name__ __module__ __qualname__rpropertyrr __classcell__rrrrr"s   rN) chardistributionrcodingstatemachinermbcharsetproberrmbcssmrrrrrrs    PKd]!gÒÒ/chardet/__pycache__/jpcntx.cpython-38.opt-1.pycnu[U .eL@s8dZGdddeZGdddeZGdddeZdS))S)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)SrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrSrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrc@sPeZdZdZdZdZdZdZddZdd Z d d Z d d Z ddZ ddZ dS)JapaneseContextAnalysisdircCs*d|_d|_d|_d|_d|_|dSN) _total_rel _rel_sample_need_to_skip_char_num_last_char_order_doneresetselfr>/usr/lib/python3.8/site-packages/pip/_vendor/chardet/jpcntx.py__init__{s z JapaneseContextAnalysis.__init__cCs*d|_dg|j|_d|_d|_d|_dS)Nrr F)r NUM_OF_CATEGORYrrrrrrrrrs zJapaneseContextAnalysis.resetcCs|jr dS|j}||kr||||d\}}||7}||krT|||_d|_q|dkr|jdkr|jd7_|j|jkrd|_q|jt|j|d7<||_qdS)Nrr rT)rr get_orderrr MAX_REL_THRESHOLDrjp2CharContext)rbyte_strZ num_bytesiorderchar_lenrrrfeeds    zJapaneseContextAnalysis.feedcCs |j|jkSr )r ENOUGH_REL_THRESHOLDrrrrgot_enough_datasz'JapaneseContextAnalysis.got_enough_datacCs,|j|jkr"|j|jd|jS|jSdS)Nr)r MINIMUM_DATA_THRESHOLDr DONT_KNOWrrrrget_confidences z&JapaneseContextAnalysis.get_confidencecCsdS)Nr rr)rrrrrrsz!JapaneseContextAnalysis.get_orderN)__name__ __module__ __qualname__rr$r!rr#rrr r"r%rrrrrrts rcs0eZdZfddZeddZddZZS)SJISContextAnalysiscstt|d|_dS)NZ SHIFT_JIS)superr*r _charset_namer __class__rrrszSJISContextAnalysis.__init__cCs|jSr )r,rrrr charset_namesz SJISContextAnalysis.charset_namecCs|sdS|d}d|kr$dks>nd|kr:dkrjnn,d}|dksbd |kr^dkrnnqnd |_nd }t|d kr|d }|d krd|krd krnn |d|fSd|fS)Nr&rrZCP932rr )r,lenrrZ first_charrZ second_charrrrrs.    zSJISContextAnalysis.get_order)r'r(r)rpropertyr/r __classcell__rrr-rr*s  r*c@seZdZddZdS)EUCJPContextAnalysiscCs|sdS|d}|dks0d|kr,dkr6nnd}n|dkrDd}nd }t|d kr|d }|d krd|krxd krnn |d|fSd |fS) Nr&rrrrr )r8r9rrrrs    zEUCJPContextAnalysis.get_orderN)r'r(r)rrrrrr<sr<N)robjectrr*r<rrrrsVCPKd]U\\7chardet/__pycache__/langgreekmodel.cpython-38.opt-1.pycnu[U .e1@s4dZdZdZeedddddZeedddddZd S) (rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrRdh^betfou\XqUOviSCrw_cmrrrrrrHFPQ<`]YDxaMVE7NsAB:LjgWkprrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrZrrrrrrrrrrJrrrrrr=$.GIr6rl{n3+)"[(4/,5&1;'#0%!-82T9r(y|     *@Kr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr9r>rrrrrrrrrrr;rrrrrrr<rrr?r@rArBrrCrrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r(r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rrrrrr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjryryrjrjrjrjrjrjrjrjrfrjrjrjrryryrjrjrrjrrjryrrjrjrjrrjrrrryrrrrrryrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrjrrjrjrrjryrjrjrrjryrjrjrjrrrjrrjrrjrjryrrrryrrrrrrrrrrrrrrrrrrrrrrryrrrrrrrrrryrjryryrjrjrjrjrjrjrjrjrrjrjrjrjrryrjrjrrjrjrjrjryrjrjrjrryrrrryrrrrrryrrrrrrrrrrrrrrrrrrrrrrryrjrjryrjrjrjrjrjrjrjrjrjrjrjrjrryrfrjrjrjrjryrjrjryrjrjryrrrrrryrrrrrryrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrrjrjrjrjrjrjrrjrjrrjrjrjrjrjrjrjrjrjrjrrjryrjrjrryrrfrryrrrrrryrrrrrrrrrrrrrfrrrrrrrrrrjrjrjrjrjryrjrrrrrjrjrrjrfrjrjrjrrjrjrrjrjrjrjrrrrryrrrryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrjrrjrrjrjrjrjrjrrjryryryrjrryrjrjrjrjrjryrjrjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrjrjryryryrjrjrjrjrrjrfrjrjrjrjryrjrjrjrjrjrjrjryryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrjryrrjrrrrjrjryrjrjrjrjrjrrrjryrjrryrjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrrjrjrjrjrrrjrjrryrjrrjrrjrjrjrrrjrrjrryryrjrjrrrrrfrrrrrrrryrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrjryrrjryrjrjrjrjrrjrjrjrjrjrrjrjryrjryrjrjryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrjryrjryrjrjrjrjrjrjrryrjryrjryryryrjryrjrjryrjrryryryrjrryrrrrrrrrrryrrrrrrrrrrrrrrrrrrrrrrrrjrrrrjrjrjryrjrjrrrjrrjrrrrjryrrjrrjrrryrryrrrrrryrrrrrryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrrjrjrjrjrjrjrrjrjrrjrrrrjrjrrjrjrjrrrfryrjrrjrrrrrrrrrryrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrjryrrrjryryrjrjrrjrjrjrjrjryrfrjrrjryrjrjryrfrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrjrryrjrjrjrjrjrjrrrjrrjrrrrjrjrrjryrjrrrjrjrjrrjrrrryrrrrrrjrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrrjrjrjrjrjrjrrrjrrjrrrrjryrrjryrjrrrjryrjrryrrrrrrrrrrjrrrrrrrrrrrrrrrrrrrrrrrrjrfryryrjrjrjrjrjrjrryrjrrjrrrrjrjrrjrryrrryrjrfrryrrrrrrrrrryrrrrrrrrrrrrrrrrrrrrrrrjrrjrjrjrjrrjrrjrjryrjrrjrjrjrjrjrjrrjrjrjrryrjrrrjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrrjrjrjrrrjrrrrjrjrrjrryrjrjrrrjrrjrrjrjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrrrrjrjrjrjrjrjrrrjrryrrrrjrjrrjrrjrrryrryrrrrrrfrrrrrryrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrjrjrrjrryrrjryrrjryrjryrjrrrjryrjryrjrjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrrryrjrjrjrjrjrrrrjrryrfrrrjryryryrrjrrryryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrrjrjrjryrrjrrjrrjrjrryrfryrjrjrrrjrrjrrjrjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrryrjrjrjrrjrjrjrjrjrjrryrjrrjrrrryrfrryryrjrrryryryrrrrrrrrrrrryrrrrrrrrrrrrrrrrrrrrrrrrjrrryrjrjrjryrjrrrfrjrryrrrrrjrrfrryrrrfrfrfrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjrjrfrrjrrrrjryrrjryrjrjrjrrrjrrjryryryrfrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrrjrjrjrrrjrrrrryrryrjrjryryryryrjrryrryryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrjrjrjryrrrrrrryrjrryrryrjryrrrjrrjrrjrfrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjryrjrjryryrjrryrrjrrrryrrrrrfryrryrryrrryrryrryryrrrfrryryryrryryryrryryryrrryrrrfrrrrrryrrjrjryrrrrrrrfrjrryrryryryrrryrrjrrryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjrryrjryrryryrryrryryrryrryryryrrrrrrryrjrrrryrrfryrrrrryryrrrryrfrryryrrrrrrrfrryrrrrrrrrryrfrryrjryryrjryrjryrrrjrjrjrrrjryrrrrfrfrryrryryrryrryrryryrrryrryryryrryryryryrrryrrrryrrfrrrrrrjrrjrjryryrrjrrrryryrryryryrfryrrrfryryrrrjrrrryrrfryrrrrfryrrrrrrrryryrrfrrryrrrryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrryrjrjryryrrrryrryrjrjrryrrrrrrryryryrryryrryrryrryryrrryryryryrfrrryryrryrrryrrrrrrryrrrrrrrryrrjryrjrrrrjrrryryrryrryryryrrryrrrrrrrrryrrryryrrryryryrrrrrrryrrrryrrrrrrrrrrrrrrryrrrjryrryryryryryrrrryrrrrryrrfrrryrrfrrrrryryryrryryrrfryrryryryrryryryryrfryryrrryrrrrrrrrrrrrrrfrrrrrrrrrryrrrrrrrfrrrrrrrrrryrryrryryrrrrrfryrfrrryryrrryrrrrrrrrrrrrrrrjryrjrrryrrrryryrryrrrrfrrryrryrryryrrrrrrryrrrrryryrrrrrrryrrrrrrrrrryrrrrrrrryryrjryryrrrrrrrfrjrryrryryrrrrfrryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrryrryrrjryrryrrrrrrryryrrrrrrrrrrrrrrrfrrryrrrrrfrfrrryrfryrryryrrfrrrfrrrryrrrrrrrrjrryryryrrryrrrryrrrryrjrryrrrrrrryryrrrryrrfryrrrrfryryrfrrrryrrryrrrrrrrrrfrrrrrrrrrrrrrrrrjrrrrrrryrrrrrrrrrrrrrrrrryrfryrryryrryrrryrrrrrfryrfrryrfrrrrrrrrrrrrryrrrrjrfryryrryrrrrryrrrryrrrjrrrrryryryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrryrfrryrrfryrrrrrrrrrrrrrryrrrfrrrrrrryrryryrrryryryryryrrfryrrrryryrrfrryrrryryrrrrrrrrrrrfrrrrrrrrjrrryrrrrrrrrryrryrrrrryrrfryrrrrryryrfrrfrrfrryryryrfrrrrrrrfrrrrrrrryrrfryrrrrrrrrrrryrrryryrrrrrfrrrrrrryrryryrrrrryryrrrrrrryrrrrrrrrrryrrryrrrrryryryryrrrrjrrrrrrrrryrrrrrrryrrrrrrrfrrryrrrrrfryrrrrrrryryrfrfrrrrrrrfrrrrrrrryrryryryrrryrrrrrrrryryryrrrryrrrrrrrrryrrrfrrrrryrfrrrrrrrfrrrrrrfrrrrrrrrrrrrjrryrrrrrrrrryrrrrrryrrrrrrrryrrrrryrrryrrrrryryrrrrrfrrrfrrrrrrrrrrrrrrrrryrryryrfrrrrrrryrrryrryryryrrrrrrryrrrrryrrryrrryrryryrrrrryrryrrrrrryrrrryrrrrrrrrrjrrrryryrryryrrrrrryrrrrrrryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrfrrrrrrfrrrrrrrrrrrrrrrrrrrrrrrrfrrrrrrrrrrrrrrrrrrryrrryrrrrrrryryryryryrrrrrrryrrrrrrrrrrrrrrfrfrrrrfrrrrrrrryrfrrrrrrryrrrrrrrrrrrrrrrrrrrrrrrryryrrrrrryrrrrrrrrrfrrrrrrrrrryrrrryrrrrrrfrrrrryryrrrrfrrrrrrrrrrrrrrrfrrrrrrrrrrrrryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrfrrrfrryrrrrryrryrrrrrrrrrrrrrrryrrrrrrrrrrrrrrrrfrrrrrfrfrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrfrrrrrrrrrrrrrrfrrrrrfrrryrryrrrrrrrrrrrryrfrrrrrrryrrrrfryrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrgs?Fz ISO-8859-7ZGreek)Zchar_to_order_mapZprecedence_matrixZtypical_positive_ratioZkeep_english_letterZ charset_nameZlanguagez windows-1253N)ZLatin7_char_to_order_mapZwin1253_char_to_order_mapZGreekLangModelZLatin7GreekModelZWin1253GreekModelrrF/usr/lib/python3.8/site-packages/pip/_vendor/chardet/langgreekmodel.py"s" PKd]QjQj+chardet/__pycache__/big5freq.cpython-38.pycnu[U ʗRe*z@sdZdZdZdS)g?(i ii Riiaii ni!i iL,iBi iiiii{ i] iii ijiii.iNiii:iii?iii=iNKikiq iii i i ib iii ioi2 iiii ici8iiiiiii{|i "i i @i\ii iiiiiiFii| iQHiiPivi iiiiDi^ iiiFi} iEi iOi0isii4<2i i&iMiii~ iiGii[ iii?ii iaiiK i*iigi Zi i:i iiKi i iiiii`iliii i i qii~ii i ii iiiciuii*iii i i~imiiieiGi^iini UiCiiCiiiiiii jioi/iiiPi7 i[ii i? iiiioSi(ii ip]ii6iji i@ iiiiii8+i3 i[ii\iiiii] iA ii i1iiHi i idii+i i2iiii iOiL iiifi1iiiiiii3i9li,i iiiiiii ieiz iQiMi&i Xiiiii iikipiMii %i iiii'i ii\ i i7Jii!iiiiiNiiB iPi_ iqi iii i i ii i iIii8 ii ii{ i i iimiiifiiixii iii ii iigii iiiiii&ii'iiiii.i iiiM iiii$#iiDihiAi iiriiiUiGiiii i iQiSiiiidi 0FiiiC iiiii iiJii iUiiN i iii<ii i:iA i ii i i9ii}ii iiiWiPi ii)iDiiii4 i i i)iiir iisiiitii9 iiiis i*iiiiiii] iiiii iD iji( i iii iiui5iYiji iliiuiii iii` i i=i iiiiiii5ii!iiiTiE ixiiiei iiO iPii| i6iAi i/iki i iili!i iiBii`ii i iAii iiii ivi i iiwiiiMi iiiiiia iii i} iixi,}ii iB iiiiiiiiiF ikimi ii ii ii iibii) i^ iP i i,ii ii7i5 i~ iyi|i iziiii iC i{iiiiiiiiii1bii i iiit ii ii_ iiiii i i ib iii5Diilii|i[i* ii ii%iG i^ iiliii ii` iii ipiincigimiii'i2iii{ii ii iiiD iifi ii|i: iiii i i i i ii inii ii;iiIiYi}ii iXi"ii iiiiiii-iiliiiiiiiiiEii~ii>i]ii,iiiiviLiBii&iii iiiiGiiiiBii i+ iii iiiii i iaiiii ia ii}iE iiDii=ii0i ii i6 iiiivi!iiiiii9iHiiiii iFiiiiii"iiH iii i ioiiiRi*ii.iiiiiiI 3ii, ii*iSiiiXiii/iibipii iiiiiiRii ii7 ii2ii iiiiiii_ iib ii iiii iiiiiii` Oii i i`i7i i iiiiiiia iiiiiiigiii ii i_ii~iiiii iaii ib iiiii ii i;i i-i iiQ iiiqiiii`ii#i#iiiiiri isiiiiditi iic ii ikiwi ii iiiiiiigi iQiiUi i iiiCiSiic iii5iiiBii_i iciNiiYiiii iLidi i i iKi i8 iaiGiii i iiisi6i iti; Niii i i4ii:ii\iqiiii.iii iui iiii i i iriii i iic iiii@iii ii ii ii/i9 ii iiiiiii i< id iiii8iviiCiii iimii iiiiiiZiiiwi {iiii$iiiMid i0irii iigiiViiiii: iZiii{i$ie i0iii$i i i ii5ii[iviiiciiViR i$i; iiif iii idiiiWie iii iii i iiJ iiiiiuii ii ii i iK ii2iiL i i.iii2ii iiiii%i iii i iiiiiii i ixi iM ii}iiiTiiiid i iiiii`iiiii i3iii;i iiiiyiYiLiii i iiiiU\iiiiiiViN iii iii ii"ixi%ii;i= i iii2iEii!iii^ii"iwi i#iiii ii$i<iQiiiri%ii]ii&ii< i'i i3i6iBii i(iii ii i iig i i i)i i i*i+i! iii:ii7ii^ii iii(i i,i+i i ixi-ii/ihi= i.iiiiVi ii hii i/iiii<iii;i0iiii i i1izi i ii5i6i i_)i2i3ii4iyi" ii ii^i5i i i?i%i+if i i6i_iWiii i7i> ii ig i# iu i8i ii9ih iF iiVi{i iO iiIwi~i i^iii:iiiiiiii i;iei1iiiiiiiii i i iiP i<i=ii>i i(i`iRi? iYiiIi ii i7i i i?iii i@iioiqiYiniiiliiii ii ii iEiPiVii! i iiiiiniiAii|i ii iBiiiiii- i iOi i iCiiDiWiTiTiiii i}iEii&i i iiiiii iii~iG i iii$ iWiiiioii iFiiGiii" iii# iiiDi-iQ iiHiei i iiIi iiiJizi iiKiiiLii$ i iiiiiH iiiiiiMi:i iiiNiiI i iiiHiiiiiOiii iPiQiiikiRiR i ii i i ii iiiiiiSiTiii i% iiiiii& iS iUi iiS iiCiiiiVi~ii!iXiiiiii,iiiiiOii|iiiiPiie iiii i i iiiiiiiiT iiiiWiiiiXiiYiiRi iviii ii i=i iiZiiU iii[i iiiV i% i\iii]iii^i8iT i. i' i_iiviiiiiwitii`iaibi> iii"i{i i iiciidi9iiiii[i9iiidih i ieiii iJ i!iiifiii iiiTigiii i%iWiMihiiiiiiiiiiiii( ij iiyi7imiijiki i? iW i"iii Biili|i i) izii iii iiiiiminiuiv iwii i* iiioipiiqi7i.irii i iii iifii i isi& iyi ii i iiiii i i>iiii iYi iitiiui/ i+ i ivi ii i@ iwii i ii3iiii, ixi i6i9i i ii6i ii! iiiyiiQi:ici iii- oiiiFiX i i iifi iizi iii iii{i/ii' i ibiii`iiiiui iviiiii i i iiii i0iEiSii8i[i|i}iGii ii!i~iiiFiU ii ii iieisiii iw iiii" i iai iZi&iiiii i iiiiAiii iiii iiiiiiiii ioii ii i i ii iiA i iJi0i ix i ii iiY iiiiii i i iiZ i8ioiiiQiiiii iaQiiipi;iiPiibiiiii i ii iiii iii iiiiiiiii]iiiii iiiii'iii. i i iiiii iLiiiiii ii/ iiiiiB i0 i[ ii8iiiii iii/i3iiiii iiii0i iniiiiiiii i iiiiiiiii4iiii<i ii iiiYi iiiC iiii iiiii}i1ii iiiiKi i0 iFiiii ii#ii\iiifi >i iii iiiiii i iiiiijiiiiii-ipi9i@ i6iyiiii i i1 iiiiiiiViiiii4iii iKi1 ii iD i iiiiii#iiii i2 iiii iZiHipiiigiii i iqri iiiii i iK iV i i\ i,i ii iiii]iiiui iiiiiiiiiZiii iiiiijiii0ihihiii ii iE iii iii iiiiiiiiiii iiii2 iiiiiiMiiwiii iy i?iiii itimi( i ii+iiiiiiiii i ii i iii iiL iii) i ii iiif ii iiiiiiiRi"iA i3 i ii-i1ii$i i(ii] i i# ii$ i iiii i* iiii i ii i i=ik ii!ii iiii i ii _iiiii^ i2ii iiii9iii iiii4 i iii ibiiii ii ii5ii iii"i i iiiii4iIi ii#ii iiiiiij iiii$ik i ii ii\i igiiEi5 iiiiiiiii iii6 iiii ii%iii ii i[i iiiiii i&eiii iiioi iil i i}iiiizii+ iii iiiini-ii i'iiii iiii(iii iiiiiiii ii iiiBiiiqiiii<ii*iji)i"i*ii>i)i7 ii+iiiiiiizii,iiiiiM i)iriii-i i iiiiiTipiii#i#iiiiiiii iiii i ii iiSii.i8 iiiiiz i9 i=iiiim iiSiiiiiixiii/iiiqiii3ii5ii: i i ii iiiiii i; i i0i1iiiiiin ii_ ii]i i iniiiii i% iiiii i` iiiiiziTisi2i3 ii i{ i5ii ig iiikiiiii iii3i4ii iici iii i iiiai:i1i iii!Aihi io i i6i"ii il -ii ia i5ii ii i ii#i! ii$ii ii4 ifii i%i& i iN ri iiWiiiiii i' ii$iii< i iNiiiW ikiiO iiiiiiiX i, ii6i&itiiP ii i7i i i i- ijii i iiC[ip ii i'i8i ib iim i i ii{i(i i ii i9i i i i:i i i^iiiiB i;iiiiii ii ii ii)i<i=i ii ii>iiiii =iiiiiiiiiiin iiHiDi i?iiUiWi i= ii:ii iNi iKiEi@i4ic i ii> iiQ i iAiiihiii i i( i]iiiiBi*iiiliiCiDiiEih iiiiiiXiiiii+iiii+iJiiiUii iimi iEiiiiFiiGi ki inii id iiiiiiiF i!i iiri@iiHi"iCiGiii ii^i ii 8iti) i;i i? i!iioiIi i"i#i#i$iiJi i%i i&iriKi'i5 i(i)iio i@ i}iA ii,ii*i41i+ii i i ii" ii,ii iC iiuiriD i-i i-i iLivi{ii| iMi.i.iNiY i6 iii i/i0i/i ii1i$ii2i%iGiRiB i i_iiiC ii iD ii3iiiii ii i. ii i4i@iwii5ii6i7iii ii&i0ii8i i&i i* i+ iG iOiui# i i1iPiRiiQii ii)iii=i9iili iiiiE iSiiki i\i iii iyi:i i;i<iF i%i=iiRiii>idi'i, i?iei$ ii2i3i- ii i4ii(iSi@iAiBii.iTiiOi i iiiii i&i iii i<i iiiiCiiDi iiUiip iG ie i i i ii iEi;iViFi'iGi)i ii} iHi*iiWiiiIiiTii i iiiiii iiJi. igi~iUiij i iiiXiii8ii*i iiiKi~ iii iLiiH i iii% i+if iii iitiiMiNiii ii ii iiik iYiiYiii*i/ iiOiR iZiH ii#iI i i iii5iS i]iE i[i\i isiI i+iPiQi,i i iRiiSiTii,iiUi]iVi iiLi-i!i iT i\4iWi iiXiYiZii[i>iwiiiii+i^iiJ ii_i$ii\iiiili.i]i`ii^i_iq i%ii`iaiiii i6ig iU ibicidiai iq ixi iei ibiyi ifihigihiii'iii iii ijir ii i0 i i=iibi|iiiii i iih iki iliii iaiicimiii ini iiui iidieiis iK i/ioi7ii& i iJ i8ipiqii ij ifii igi iii(ii`irisi i iii<iFik ifiiii]iiiIiti>iiuiivii iii i0ii-iiwiL ii iiiiiGiaii it i ii iSiKixiiyiziiiV iiOii1 i i{i i iiF iyii9iZ i|i}i~iFi iii i i:iiiii2 iiiipii;iG iii ihiiiii7 iiiiiqiiiM iiiiiii iii iii i(i8 iiN i ii3 i iiO i<iiiiTiiW i iiiii(iiii1iiiiiiiiu iZii i iciijiP ipiii iiii iv iiijii iiii iQ iK i ii i' iiiiii9 iii i izii i iiikiiiii ii2i iiliii>i=iCi'iii>i iiZiiii imini iibiii i iqi?ii ii ii i"ii i?i i}iiioi@i>iiAi i1ii)iiii?i i iiiixi ii ii i3i i ihii il iiii)ii ipii'iiii4ii i i iiiiAi_i iBiiL ii iPiqii iiriiiiiX iicisi! iiiiHii iw iiiiCiDitiiiiiiix i ii i/ iiii5i i4 iuiir iii_ii/i i<ii~i7iy im iii^i5 in ibi itiiil iiii6ii i7iiiiiiiviiii i8i: ii ii0 i i1 iiwiIiiiii i( iiiBi ii4isi iiiii i iii?iCiixi iEiHi iiFiyiziGiiiii{iiii|ii; i}i9imiH i~iiz iiis i iiM iiii iiim iiiIiiiio iiiiiiii_iiii i2 i3 iHii*iii iiii< iiii:ii ii iiAii iiR iiiii i ii" ii iiiiii ii iii iiiQi i iY iiiiiiii{iKii i[i iJiiiN iiS iiiiiI iiiT i@ii iii i i@iiRiii it iiiiJiIii iiii iU iimiiii{ i ii i i;iV iii iii<iii idiiiiXiii9iii6 iiiUiiii iiLi!i= ii) ii i i iii i ii ii=i$i(iviii&iicii iii i ii>iiii{i"iiiii#iiiiiW ii iiii ii$i i%iiiiii&i^iii[ i ii'iiiiiiii(i iii2i\ iJi ip ipin iiu iq i)ii iO i> ii i*iX iii i+ii i,i iii iiiiiKii i iIi-iii!iiiiii.iDiiiJisi# iii ii7 iiii/iwii|iiiiii"i4 i| i,iiiii iiiiiiiii?iY iP i0ii1iZ iZ i ii i ii i#i@i2ii|iiziiiiiAi'ii? ii ii8 ii yiiLiVi i3i i i i$iiiiMii%ii i i i i i.ii4iNiii ii i i iiii i5i9 i%iiiiKiQ iixi6i7iiBi i iOiv i[ iii&ii ii iiiXii* ii\ iPi i iNi+ iw iiiiiWiCi ii iQiDi i?i] iiii^ io iR i i iEii iiFi i'iiXiiGiiS i iiT iRii8ixi ikiSiiTiii ii iiDii9i!iiiii(iiLi"i#i$i%i_ ii&iJi:iUii}i i)ii i;i<i iEi+i'i iiHi=iVi*iHiyi, i+iWi3i>i ii?i(iIi,i-i` iqiia i iii ii)i*iXi i+iiOiYi,i-ii.ii/i ii0i.iiii1i iJir i2i3i$ i i4ii5i6i7i iib i iii} i ifiiKii i i i i8iZi9ii: ii ic ii:ii i;is iJ i@ii it i; i i/i<id ii iiiU ii0iie i=iif iu iMiiiii i>i i[iiAiLiiii?i i i i i@iAiv iBiCi\iijii[ i ig iDiEiiiFi iBiiGi iiHii(iiMiCih iiIiNiJi iKiLiiiMii1i2iNiidiOidiV iDi`ii#i5 iPi]iQiEini i iii^iRi_iFiSip ii iiTiUii i iVii i iiGiiiieiHiOi iiPi`iWiw ij iXi ii3i iaiiIiYiJix i7iiii- i i4ik iibiZi-iii. icii[i iri;i iKi5iLiXii i iii\i]iii6i% i^i_iii~i`il iy iaizi~ iiibi?iici7idi iiieiiz iiiMifigi/ ihi|ii@idiiiiiNiiii8ifiiijikiiOiPiiilimi@ini9i ioi i iii< isii\ iQi.iRiNi@i iipiiSi{ iqiiAii iiiiTi iiii:iiiri isi@ iW i;itiui iviwixiyi| iiiiizi i i3iQiiimiiAi{i|ii ii}iOiRi iigiii~iZi iiiiii i\im ii} ii<iX ii ii i iiii iiY iiii0 iiii i=i iiiiLiiiiihiiiiii>i>ii/i?iUiiiiiiei)ix tiifiSii iy i in i i iiTi i@ii i iiiiiii ii iziUigiiViio iii6 ip itiiiiii iAiiJiVihiZ i iiWiiiiN)BIG5_TYPICAL_DISTRIBUTION_RATIOBIG5_TABLE_SIZEBIG5_CHAR_TO_FREQ_ORDERrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/big5freq.py+sPKd]S--1chardet/__pycache__/__init__.cpython-38.opt-1.pycnu[U .e@s8ddlmZmZddlmZddlmZmZddZdS))PY2PY3)UniversalDetector) __version__VERSIONcCsHt|ts0t|ts(tdt|nt|}t}|||S)z Detect the encoding of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` z4Expected object of type bytes or bytearray, got: {0}) isinstance bytearraybytes TypeErrorformattyperZfeedclose)Zbyte_strZdetectorr@/usr/lib/python3.8/site-packages/pip/_vendor/chardet/__init__.pydetects   rN) compatrrZuniversaldetectorrversionrrrrrrrs PKd]ZZ0P0P1chardet/__pycache__/langgreekmodel.cpython-38.pycnu[U ʗRe@sX"ddlmZdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd=d=Zddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d dddddddd d d d ddddddddddddddddddd d!d"d#ddddddd$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?ddddddddddd@dddddddAdddBdCdDdEddFddGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbd-dcdddedfdgdhddidjdkddldmdndodpdqdrdsdtdudvdwdxdyddzd{d|d}d~dddddddZeddeeddddZddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d dddddddd d d d ddddddddddddddddddd d!d"d#ddddddd$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;ddddddddddddd@dddddddAdd?dBdCdDdEddFddGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbd-dcdddedfdgdhddidjdkddldmdndodpdqdrdsdtdudvdwdxdyddzd{d|d}d~dddddddZeddeeddddZdS))SingleByteCharSetModel)=<7:$=.63+)"(4/,5&1;'#0%!-829r    r *r)Rdh^betfou\XqUOviSCrw_cmHFPQr`]YDxaMVErNsABrLjgWkpr Jrr GIr l{nr r rrr[rrrrrrrrrrrrrrrr Tr!yr"r#r$r%|r&r'r(r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<@Kr=r>r?(rrrr)r3r-r1r7r5r4r0r.r8r+r6r%r/r"r#r=r'r(r$r:r<r,r>r?r9r&r2r r*rrrrrrrrrr;rrrr rrrr r rrr rrr!rrrr >?rrmrnrWrerjr_rxr^ryrvrrorhrkrSr`rarDrVrrRrirrrPrdZr}rOrcrGrZrbrgrHr[rErIrKrqrFrUrprsrzr\r|rLrtrQrXrlrJrNrTrYrfrzr{r}~rMr]rurwr~rCrBrAr@z windows-1253Greekgs?Fu~ΆΈΉΊΌΎΏΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩάέήίαβγδεζηθικλμνξοπρςστυφχψωόύώ) charset_namelanguagechar_to_order_maplanguage_modeltypical_positive_ratiokeep_ascii_lettersalphabetrrz ISO-8859-7N)#pip._vendor.chardet.sbcharsetproberrGREEK_LANG_MODEL WINDOWS_1253_GREEK_CHAR_TO_ORDERWINDOWS_1253_GREEK_MODELISO_8859_7_GREEK_CHAR_TO_ORDERISO_8859_7_GREEK_MODELrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/langgreekmodel.pys<" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@, PKd]Z VV8chardet/__pycache__/langhebrewmodel.cpython-38.opt-1.pycnu[U .eQ,@sdZdZeedddddZdS)(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrE[OP\YaZDopRI_UNyVGCfkTrgsrrrrrr2J<=*LF@5i]8A61Bn3+,?QMbKlrrrrr|(:S4/.H ^qm"tvduwh}Wcjz{7ex0'9;)X!%$#>~&-     r`r(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrg C|?Fz windows-1255ZHebrew)Zchar_to_order_mapZprecedence_matrixZtypical_positive_ratioZkeep_english_letterZ charset_nameZlanguageN)ZWIN1255_CHAR_TO_ORDER_MAPZHEBREW_LANG_MODELZWin1255HebrewModelrrG/usr/lib/python3.8/site-packages/pip/_vendor/chardet/langhebrewmodel.py%sPKd];Hj j (chardet/__pycache__/enums.cpython-38.pycnu[U ʗReS@s\dZGdddZGdddZGdddZGdddZGd d d ZGd d d Zd S)zr All of the Enums that are used throughout the chardet package. :author: Dan Blanchard (dan.blanchard@gmail.com) c@seZdZdZdZdZdZdS) InputStatezS This enum represents the different states a universal detector can be in. N)__name__ __module__ __qualname____doc__ PURE_ASCII ESC_ASCII HIGH_BYTEr r /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/enums.pyrsrc@s<eZdZdZdZdZdZdZdZdZ eeBZ e eBeBZ dS) LanguageFilterzj This enum represents the different language filters we can apply to a ``UniversalDetector``. rrN) rrrrCHINESE_SIMPLIFIEDCHINESE_TRADITIONALJAPANESEKOREANNON_CJKALLCHINESECJKr r r r rsrc@seZdZdZdZdZdZdS) ProbingStatezG This enum represents the different states a prober can be in. rrrN)rrrr DETECTINGFOUND_ITNOT_MEr r r r r"src@seZdZdZdZdZdZdS) MachineStatezN This enum represents the different states a state machine can be in. rrrN)rrrrSTARTERRORITS_MEr r r r r,src@s,eZdZdZdZdZdZdZeddZ dS) SequenceLikelihoodzX This enum represents the likelihood of a character following the previous one. rrrcCsdS)z::returns: The number of likelihood categories in the enum.rr )clsr r r get_num_categories@sz%SequenceLikelihood.get_num_categoriesN) rrrrNEGATIVEUNLIKELYLIKELYPOSITIVE classmethodr&r r r r r#6sr#c@s$eZdZdZdZdZdZdZdZdS)CharacterCategoryz This enum represents the different categories language models for ``SingleByteCharsetProber`` put characters into. Anything less than CONTROL is considered a letter. N) rrrr UNDEFINED LINE_BREAKSYMBOLDIGITCONTROLr r r r r,Fs r,N)rrrrrr#r,r r r r s    PKd]Rg)chardet/__pycache__/jpcntx.cpython-38.pycnu[U ʗReh@s6dZGdddZGdddeZGdddeZdS))S)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)SrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrSrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)Srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrc@sPeZdZdZdZdZdZdZddZdd Z d d Z d d Z ddZ ddZ dS)JapaneseContextAnalysisdircCs*d|_d|_d|_d|_d|_|dSN) _total_rel _rel_sample_need_to_skip_char_num_last_char_order_doneresetselfr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/jpcntx.py__init__~s z JapaneseContextAnalysis.__init__cCs*d|_dg|j|_d|_d|_d|_dS)Nrr F)r NUM_OF_CATEGORYrrrrrrrrrs zJapaneseContextAnalysis.resetcCs|jr dS|j}||kr||||d\}}||7}||krT|||_d|_q|dkr|jdkr|jd7_|j|jkrd|_q|jt|j|d7<||_qdS)Nrr rT)rr get_orderrr MAX_REL_THRESHOLDrjp2_char_context)rbyte_str num_bytesiorderchar_lenrrrfeeds(    zJapaneseContextAnalysis.feedcCs |j|jkSr )r ENOUGH_REL_THRESHOLDrrrrgot_enough_datasz'JapaneseContextAnalysis.got_enough_datacCs(|j|jkr"|j|jd|jS|jS)Nr)r MINIMUM_DATA_THRESHOLDr DONT_KNOWrrrrget_confidences z&JapaneseContextAnalysis.get_confidencecCsdS)Nr rr)r_rrrrsz!JapaneseContextAnalysis.get_orderN)__name__ __module__ __qualname__rr%r"rr$rrr!r#r&rrrrrrws rcs0eZdZfddZeddZddZZS)SJISContextAnalysiscstd|_dS)N SHIFT_JIS)superr _charset_namer __class__rrrs zSJISContextAnalysis.__init__cCs|jSr )r/rrrr charset_namesz SJISContextAnalysis.charset_namecCs|sdS|d}d|kr$dks>nd|kr:dkrjnn,d}|dksbd |kr^dkrnnqnd |_nd }t|d kr|d }|d krd|krd krnn |d|fSd|fS)Nr'rrCP932rr )r/lenrr first_charr second_charrrrrs.    zSJISContextAnalysis.get_order)r)r*r+rpropertyr2r __classcell__rrr0rr,s  r,c@seZdZddZdS)EUCJPContextAnalysiscCs|sdS|d}|dks0d|kr,dkr6nnd}n|dkrDd}nd }t|d kr|d }|d krd|krxd krnn |d|fSd |fS) Nr'rrrrr )r<r=rrrrs    zEUCJPContextAnalysis.get_orderN)r)r*r+rrrrrrBsrBN)rrr,rBrrrrsXEPKd]^zrj\U\U5chardet/__pycache__/langbulgarianmodel.cpython-38.pycnu[U ʗRer@sP$ddlmZdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?d?Zddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d dddddddd d d d ddddddddddddddddddd d!d"d#ddddddd$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVddWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dddddddddddddddddddddddddddddddddddddddddddddddddddddd ddZeddeeddddZddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d dddddddd d d d ddddddddddddddddddd d!d"d#ddddddd$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dr*r'MZcdHmkeOQfL^Rnl[JwT`osAEFBrDpg\h_VWGtU]aqirrrrr r r r r rrrrrrrrrrrrrrrrrrr Cr!r"r#r$r%r&r(r)r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<Kr=r>r?rAr@b(rrr*r'r0r4r/r2r3r$r-r&r,r1r.r)r?r<r#r5r%r9r8r(r;r7r+r:rr6rrrrrrrr rrrrr>r r rrr rrrrr=rrr r"rr@rr!r rAr@r`rcrrdrarbrmrJIrYrrRrFNrNPrPrTSr[rprkrlXYrGrXrgrqrSrjr\rrrrHrIrMrQrfrirjrLrWrKrUr]rersrr_rnuvrZxyz{|}~rOrVr^rhrortrurvrwrxryrzr{r|r}r~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrErDrCrBz ISO-8859-5 Bulgariang! _B?FuxАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя) charset_namelanguagechar_to_order_maplanguage_modeltypical_positive_ratiokeep_ascii_lettersalphabetrrrrrrrrrrrrrrz windows-1251N)#pip._vendor.chardet.sbcharsetproberrBULGARIAN_LANG_MODEL"ISO_8859_5_BULGARIAN_CHAR_TO_ORDERISO_8859_5_BULGARIAN_MODEL$WINDOWS_1251_BULGARIAN_CHAR_TO_ORDERWINDOWS_1251_BULGARIAN_MODELrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/langbulgarianmodel.pys8$ BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB* PKd]M}+\+\;chardet/__pycache__/langbulgarianmodel.cpython-38.opt-1.pycnu[U .e'2@s4dZdZdZeedddddZeedddd dZd S) (rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrMZcdHmkeOQfL^Rnl[JwT`osrrrrrrAEFB?Dpg\h_VWGtU]aqrrrrrr(r/r4r5r6r7r8ri- #+%,7/(;!.&$)'"3015269=C<8    K4*>:brrr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8rrrrrr>r?r@rArBrCrDrExrFrGrHrIrJrKrLrMN@SyrurWrNrOrPrQrRrSrTrUXrVrXrYrZzYjr[r\r]r_r`r^r|r~IPvrrrrrrrrrrrrrrarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{rr}rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr(rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrg! _B?Fz ISO-8859-5Z Bulgairan)Zchar_to_order_mapZprecedence_matrixZtypical_positive_ratioZkeep_english_letterZ charset_nameZlanguagez windows-1251Z BulgarianN)ZLatin5_BulgarianCharToOrderMapZwin1251BulgarianCharToOrderMapZBulgarianLangModelZLatin5BulgarianModelZWin1251BulgarianModelrrJ/usr/lib/python3.8/site-packages/pip/_vendor/chardet/langbulgarianmodel.py%s" PKd](rPrP2chardet/__pycache__/langhebrewmodel.cpython-38.pycnu[U ʗRe@s2"ddlmZdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd?d?Zddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d dddddddd d d d ddddddddddddddddddd d!d"d#ddddddd$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd ddddZeddeeddddZdS))SingleByteCharSetModel)?2<=*58613+,?"70'9;)!%$#>&- rr     4/.:(r'E[OP\YaZDopRI_UNyVGCfkTrgsrJrrrLF@r i]r Ar r Bnr rrrQMbKl|rAr@Sr=r>r?Hr<^qmrtvduwh}Wcjz{rexrrrrrrXrrrrrrrr ~r!r"r#r$r%r&r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;`(rrrr'r-r;r/r9r$r#r:r.r1r3r)r,r&r8r5r2r%r7r*r0r(r+r4r6r rrrr<rrrrrr!rrArrrrr"r?r>rr rr r=r r rr rr@rrrrrrcrfrgrYrNrFrbrXr~rRr`rlrarjrUrHrIrirQr}r\rTrWrrrKrMrGrJrerrSrrLrkrrrrZr^rrdrr[rmrrhrOrPrr]r_rrrrrrVrrrnrrrrrorprqrrrsrtrurvrwrxryrzr{r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrErDrCrBz windows-1255Hebrewg C|?Fu<אבגדהוזחטיךכלםמןנסעףפץצקרשתװױײ) charset_namelanguagechar_to_order_maplanguage_modeltypical_positive_ratiokeep_ascii_lettersalphabetN)#pip._vendor.chardet.sbcharsetproberrHEBREW_LANG_MODEL!WINDOWS_1255_HEBREW_CHAR_TO_ORDERWINDOWS_1255_HEBREW_MODELrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/langhebrewmodel.pys" BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*PKd]chardet/mbcsgroupprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # Shy Shalom - original C code # Proofpoint, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .charsetgroupprober import CharSetGroupProber from .utf8prober import UTF8Prober from .sjisprober import SJISProber from .eucjpprober import EUCJPProber from .gb2312prober import GB2312Prober from .euckrprober import EUCKRProber from .cp949prober import CP949Prober from .big5prober import Big5Prober from .euctwprober import EUCTWProber class MBCSGroupProber(CharSetGroupProber): def __init__(self, lang_filter=None): super(MBCSGroupProber, self).__init__(lang_filter=lang_filter) self.probers = [ UTF8Prober(), SJISProber(), EUCJPProber(), GB2312Prober(), EUCKRProber(), CP949Prober(), Big5Prober(), EUCTWProber() ] self.reset() PKd]Y(=$$chardet/chardistribution.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .euctwfreq import (EUCTW_CHAR_TO_FREQ_ORDER, EUCTW_TABLE_SIZE, EUCTW_TYPICAL_DISTRIBUTION_RATIO) from .euckrfreq import (EUCKR_CHAR_TO_FREQ_ORDER, EUCKR_TABLE_SIZE, EUCKR_TYPICAL_DISTRIBUTION_RATIO) from .gb2312freq import (GB2312_CHAR_TO_FREQ_ORDER, GB2312_TABLE_SIZE, GB2312_TYPICAL_DISTRIBUTION_RATIO) from .big5freq import (BIG5_CHAR_TO_FREQ_ORDER, BIG5_TABLE_SIZE, BIG5_TYPICAL_DISTRIBUTION_RATIO) from .jisfreq import (JIS_CHAR_TO_FREQ_ORDER, JIS_TABLE_SIZE, JIS_TYPICAL_DISTRIBUTION_RATIO) class CharDistributionAnalysis(object): ENOUGH_DATA_THRESHOLD = 1024 SURE_YES = 0.99 SURE_NO = 0.01 MINIMUM_DATA_THRESHOLD = 3 def __init__(self): # Mapping table to get frequency order from char order (get from # GetOrder()) self._char_to_freq_order = None self._table_size = None # Size of above table # This is a constant value which varies from language to language, # used in calculating confidence. See # http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html # for further detail. self.typical_distribution_ratio = None self._done = None self._total_chars = None self._freq_chars = None self.reset() def reset(self): """reset analyser, clear any state""" # If this flag is set to True, detection is done and conclusion has # been made self._done = False self._total_chars = 0 # Total characters encountered # The number of characters whose frequency order is less than 512 self._freq_chars = 0 def feed(self, char, char_len): """feed a character with known length""" if char_len == 2: # we only care about 2-bytes character in our distribution analysis order = self.get_order(char) else: order = -1 if order >= 0: self._total_chars += 1 # order is valid if order < self._table_size: if 512 > self._char_to_freq_order[order]: self._freq_chars += 1 def get_confidence(self): """return confidence based on existing data""" # if we didn't receive any character in our consideration range, # return negative answer if self._total_chars <= 0 or self._freq_chars <= self.MINIMUM_DATA_THRESHOLD: return self.SURE_NO if self._total_chars != self._freq_chars: r = (self._freq_chars / ((self._total_chars - self._freq_chars) * self.typical_distribution_ratio)) if r < self.SURE_YES: return r # normalize confidence (we don't want to be 100% sure) return self.SURE_YES def got_enough_data(self): # It is not necessary to receive all data to draw conclusion. # For charset detection, certain amount of data is enough return self._total_chars > self.ENOUGH_DATA_THRESHOLD def get_order(self, byte_str): # We do not handle characters based on the original encoding string, # but convert this encoding string to a number, here called order. # This allows multiple encodings of a language to share one frequency # table. return -1 class EUCTWDistributionAnalysis(CharDistributionAnalysis): def __init__(self): super(EUCTWDistributionAnalysis, self).__init__() self._char_to_freq_order = EUCTW_CHAR_TO_FREQ_ORDER self._table_size = EUCTW_TABLE_SIZE self.typical_distribution_ratio = EUCTW_TYPICAL_DISTRIBUTION_RATIO def get_order(self, byte_str): # for euc-TW encoding, we are interested # first byte range: 0xc4 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char = byte_str[0] if first_char >= 0xC4: return 94 * (first_char - 0xC4) + byte_str[1] - 0xA1 else: return -1 class EUCKRDistributionAnalysis(CharDistributionAnalysis): def __init__(self): super(EUCKRDistributionAnalysis, self).__init__() self._char_to_freq_order = EUCKR_CHAR_TO_FREQ_ORDER self._table_size = EUCKR_TABLE_SIZE self.typical_distribution_ratio = EUCKR_TYPICAL_DISTRIBUTION_RATIO def get_order(self, byte_str): # for euc-KR encoding, we are interested # first byte range: 0xb0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char = byte_str[0] if first_char >= 0xB0: return 94 * (first_char - 0xB0) + byte_str[1] - 0xA1 else: return -1 class GB2312DistributionAnalysis(CharDistributionAnalysis): def __init__(self): super(GB2312DistributionAnalysis, self).__init__() self._char_to_freq_order = GB2312_CHAR_TO_FREQ_ORDER self._table_size = GB2312_TABLE_SIZE self.typical_distribution_ratio = GB2312_TYPICAL_DISTRIBUTION_RATIO def get_order(self, byte_str): # for GB2312 encoding, we are interested # first byte range: 0xb0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char, second_char = byte_str[0], byte_str[1] if (first_char >= 0xB0) and (second_char >= 0xA1): return 94 * (first_char - 0xB0) + second_char - 0xA1 else: return -1 class Big5DistributionAnalysis(CharDistributionAnalysis): def __init__(self): super(Big5DistributionAnalysis, self).__init__() self._char_to_freq_order = BIG5_CHAR_TO_FREQ_ORDER self._table_size = BIG5_TABLE_SIZE self.typical_distribution_ratio = BIG5_TYPICAL_DISTRIBUTION_RATIO def get_order(self, byte_str): # for big5 encoding, we are interested # first byte range: 0xa4 -- 0xfe # second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char, second_char = byte_str[0], byte_str[1] if first_char >= 0xA4: if second_char >= 0xA1: return 157 * (first_char - 0xA4) + second_char - 0xA1 + 63 else: return 157 * (first_char - 0xA4) + second_char - 0x40 else: return -1 class SJISDistributionAnalysis(CharDistributionAnalysis): def __init__(self): super(SJISDistributionAnalysis, self).__init__() self._char_to_freq_order = JIS_CHAR_TO_FREQ_ORDER self._table_size = JIS_TABLE_SIZE self.typical_distribution_ratio = JIS_TYPICAL_DISTRIBUTION_RATIO def get_order(self, byte_str): # for sjis encoding, we are interested # first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe # second byte range: 0x40 -- 0x7e, 0x81 -- oxfe # no validation needed here. State machine has done that first_char, second_char = byte_str[0], byte_str[1] if (first_char >= 0x81) and (first_char <= 0x9F): order = 188 * (first_char - 0x81) elif (first_char >= 0xE0) and (first_char <= 0xEF): order = 188 * (first_char - 0xE0 + 31) else: return -1 order = order + second_char - 0x40 if second_char > 0x7F: order = -1 return order class EUCJPDistributionAnalysis(CharDistributionAnalysis): def __init__(self): super(EUCJPDistributionAnalysis, self).__init__() self._char_to_freq_order = JIS_CHAR_TO_FREQ_ORDER self._table_size = JIS_TABLE_SIZE self.typical_distribution_ratio = JIS_TYPICAL_DISTRIBUTION_RATIO def get_order(self, byte_str): # for euc-JP encoding, we are interested # first byte range: 0xa0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that char = byte_str[0] if char >= 0xA0: return 94 * (char - 0xA1) + byte_str[1] - 0xa1 else: return -1 PKd]~chardet/gb2312prober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import GB2312DistributionAnalysis from .mbcssm import GB2312_SM_MODEL class GB2312Prober(MultiByteCharSetProber): def __init__(self): super(GB2312Prober, self).__init__() self.coding_sm = CodingStateMachine(GB2312_SM_MODEL) self.distribution_analyzer = GB2312DistributionAnalysis() self.reset() @property def charset_name(self): return "GB2312" @property def language(self): return "Chinese" PKd]U0101chardet/langhungarianmodel.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # 255: Control characters that usually does not exist in any text # 254: Carriage/Return # 253: symbol (punctuation) that does not belong to word # 252: 0 - 9 # Character Mapping Table: Latin2_HungarianCharToOrderMap = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253, 28, 40, 54, 45, 32, 50, 49, 38, 39, 53, 36, 41, 34, 35, 47, 46, 71, 43, 33, 37, 57, 48, 64, 68, 55, 52,253,253,253,253,253, 253, 2, 18, 26, 17, 1, 27, 12, 20, 9, 22, 7, 6, 13, 4, 8, 23, 67, 10, 5, 3, 21, 19, 65, 62, 16, 11,253,253,253,253,253, 159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174, 175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190, 191,192,193,194,195,196,197, 75,198,199,200,201,202,203,204,205, 79,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220, 221, 51, 81,222, 78,223,224,225,226, 44,227,228,229, 61,230,231, 232,233,234, 58,235, 66, 59,236,237,238, 60, 69, 63,239,240,241, 82, 14, 74,242, 70, 80,243, 72,244, 15, 83, 77, 84, 30, 76, 85, 245,246,247, 25, 73, 42, 24,248,249,250, 31, 56, 29,251,252,253, ) win1250HungarianCharToOrderMap = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253, 28, 40, 54, 45, 32, 50, 49, 38, 39, 53, 36, 41, 34, 35, 47, 46, 72, 43, 33, 37, 57, 48, 64, 68, 55, 52,253,253,253,253,253, 253, 2, 18, 26, 17, 1, 27, 12, 20, 9, 22, 7, 6, 13, 4, 8, 23, 67, 10, 5, 3, 21, 19, 65, 62, 16, 11,253,253,253,253,253, 161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176, 177,178,179,180, 78,181, 69,182,183,184,185,186,187,188,189,190, 191,192,193,194,195,196,197, 76,198,199,200,201,202,203,204,205, 81,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220, 221, 51, 83,222, 80,223,224,225,226, 44,227,228,229, 61,230,231, 232,233,234, 58,235, 66, 59,236,237,238, 60, 70, 63,239,240,241, 84, 14, 75,242, 71, 82,243, 73,244, 15, 85, 79, 86, 30, 77, 87, 245,246,247, 25, 74, 42, 24,248,249,250, 31, 56, 29,251,252,253, ) # Model Table: # total sequences: 100% # first 512 sequences: 94.7368% # first 1024 sequences:5.2623% # rest sequences: 0.8894% # negative sequences: 0.0009% HungarianLangModel = ( 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,2,3,3,1,1,2,2,2,2,2,1,2, 3,2,2,3,3,3,3,3,2,3,3,3,3,3,3,1,2,3,3,3,3,2,3,3,1,1,3,3,0,1,1,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0, 3,2,1,3,3,3,3,3,2,3,3,3,3,3,1,1,2,3,3,3,3,3,3,3,1,1,3,2,0,1,1,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,1,1,2,3,3,3,1,3,3,3,3,3,1,3,3,2,2,0,3,2,3, 0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, 3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,3,3,2,3,3,2,2,3,2,3,2,0,3,2,2, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0, 3,3,3,3,3,3,2,3,3,3,3,3,2,3,3,3,1,2,3,2,2,3,1,2,3,3,2,2,0,3,3,3, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,2,3,3,3,3,2,3,3,3,3,0,2,3,2, 0,0,0,1,1,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,3,1,1,1,3,3,2,1,3,2,2,3,2,1,3,2,2,1,0,3,3,1, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,2,2,3,3,3,3,3,1,2,3,3,3,3,1,2,1,3,3,3,3,2,2,3,1,1,3,2,0,1,1,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,2,1,3,3,3,3,3,2,2,1,3,3,3,0,1,1,2, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,0,3,2,3, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0, 3,3,3,3,3,3,2,3,3,3,2,3,2,3,3,3,1,3,2,2,2,3,1,1,3,3,1,1,0,3,3,2, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,2,3,3,3,2,3,2,3,3,3,2,3,3,3,3,3,1,2,3,2,2,0,2,2,2, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,3,3,2,2,2,3,1,3,3,2,2,1,3,3,3,1,1,3,1,2,3,2,3,2,2,2,1,0,2,2,2, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, 3,1,1,3,3,3,3,3,1,2,3,3,3,3,1,2,1,3,3,3,2,2,3,2,1,0,3,2,0,1,1,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,1,1,3,3,3,3,3,1,2,3,3,3,3,1,1,0,3,3,3,3,0,2,3,0,0,2,1,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,2,2,3,3,2,2,2,2,3,3,0,1,2,3,2,3,2,2,3,2,1,2,0,2,2,2, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, 3,3,3,3,3,3,1,2,3,3,3,2,1,2,3,3,2,2,2,3,2,3,3,1,3,3,1,1,0,2,3,2, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,3,3,1,2,2,2,2,3,3,3,1,1,1,3,3,1,1,3,1,1,3,2,1,2,3,1,1,0,2,2,2, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,3,3,2,1,2,1,1,3,3,1,1,1,1,3,3,1,1,2,2,1,2,1,1,2,2,1,1,0,2,2,1, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,3,3,1,1,2,1,1,3,3,1,0,1,1,3,3,2,0,1,1,2,3,1,0,2,2,1,0,0,1,3,2, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,2,1,3,3,3,3,3,1,2,3,2,3,3,2,1,1,3,2,3,2,1,2,2,0,1,2,1,0,0,1,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 3,3,3,3,2,2,2,2,3,1,2,2,1,1,3,3,0,3,2,1,2,3,2,1,3,3,1,1,0,2,1,3, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,3,3,2,2,2,3,2,3,3,3,2,1,1,3,3,1,1,1,2,2,3,2,3,2,2,2,1,0,2,2,1, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 1,0,0,3,3,3,3,3,0,0,3,3,2,3,0,0,0,2,3,3,1,0,1,2,0,0,1,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,1,2,3,3,3,3,3,1,2,3,3,2,2,1,1,0,3,3,2,2,1,2,2,1,0,2,2,0,1,1,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,2,2,1,3,1,2,3,3,2,2,1,1,2,2,1,1,1,1,3,2,1,1,1,1,2,1,0,1,2,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0, 2,3,3,1,1,1,1,1,3,3,3,0,1,1,3,3,1,1,1,1,1,2,2,0,3,1,1,2,0,2,1,1, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 3,1,0,1,2,1,2,2,0,1,2,3,1,2,0,0,0,2,1,1,1,1,1,2,0,0,1,1,0,0,0,0, 1,2,1,2,2,2,1,2,1,2,0,2,0,2,2,1,1,2,1,1,2,1,1,1,0,1,0,0,0,1,1,0, 1,1,1,2,3,2,3,3,0,1,2,2,3,1,0,1,0,2,1,2,2,0,1,1,0,0,1,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,3,3,2,2,1,0,0,3,2,3,2,0,0,0,1,1,3,0,0,1,1,0,0,2,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,1,1,2,2,3,3,1,0,1,3,2,3,1,1,1,0,1,1,1,1,1,3,1,0,0,2,2,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,1,1,1,2,2,2,1,0,1,2,3,3,2,0,0,0,2,1,1,1,2,1,1,1,0,1,1,1,0,0,0, 1,2,2,2,2,2,1,1,1,2,0,2,1,1,1,1,1,2,1,1,1,1,1,1,0,1,1,1,0,0,1,1, 3,2,2,1,0,0,1,1,2,2,0,3,0,1,2,1,1,0,0,1,1,1,0,1,1,1,1,0,2,1,1,1, 2,2,1,1,1,2,1,2,1,1,1,1,1,1,1,2,1,1,1,2,3,1,1,1,1,1,1,1,1,1,0,1, 2,3,3,0,1,0,0,0,3,3,1,0,0,1,2,2,1,0,0,0,0,2,0,0,1,1,1,0,2,1,1,1, 2,1,1,1,1,1,1,2,1,1,0,1,1,0,1,1,1,0,1,2,1,1,0,1,1,1,1,1,1,1,0,1, 2,3,3,0,1,0,0,0,2,2,0,0,0,0,1,2,2,0,0,0,0,1,0,0,1,1,0,0,2,0,1,0, 2,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,0,1, 3,2,2,0,1,0,1,0,2,3,2,0,0,1,2,2,1,0,0,1,1,1,0,0,2,1,0,1,2,2,1,1, 2,1,1,1,1,1,1,2,1,1,1,1,1,1,0,2,1,0,1,1,0,1,1,1,0,1,1,2,1,1,0,1, 2,2,2,0,0,1,0,0,2,2,1,1,0,0,2,1,1,0,0,0,1,2,0,0,2,1,0,0,2,1,1,1, 2,1,1,1,1,2,1,2,1,1,1,2,2,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,0,1, 1,2,3,0,0,0,1,0,3,2,1,0,0,1,2,1,1,0,0,0,0,2,1,0,1,1,0,0,2,1,2,1, 1,1,0,0,0,1,0,1,1,1,1,1,2,0,0,1,0,0,0,2,0,0,1,1,1,1,1,1,1,1,0,1, 3,0,0,2,1,2,2,1,0,0,2,1,2,2,0,0,0,2,1,1,1,0,1,1,0,0,1,1,2,0,0,0, 1,2,1,2,2,1,1,2,1,2,0,1,1,1,1,1,1,1,1,1,2,1,1,0,0,1,1,1,1,0,0,1, 1,3,2,0,0,0,1,0,2,2,2,0,0,0,2,2,1,0,0,0,0,3,1,1,1,1,0,0,2,1,1,1, 2,1,0,1,1,1,0,1,1,1,1,1,1,1,0,2,1,0,0,1,0,1,1,0,1,1,1,1,1,1,0,1, 2,3,2,0,0,0,1,0,2,2,0,0,0,0,2,1,1,0,0,0,0,2,1,0,1,1,0,0,2,1,1,0, 2,1,1,1,1,2,1,2,1,2,0,1,1,1,0,2,1,1,1,2,1,1,1,1,0,1,1,1,1,1,0,1, 3,1,1,2,2,2,3,2,1,1,2,2,1,1,0,1,0,2,2,1,1,1,1,1,0,0,1,1,0,1,1,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,2,2,0,0,0,0,0,2,2,0,0,0,0,2,2,1,0,0,0,1,1,0,0,1,2,0,0,2,1,1,1, 2,2,1,1,1,2,1,2,1,1,0,1,1,1,1,2,1,1,1,2,1,1,1,1,0,1,2,1,1,1,0,1, 1,0,0,1,2,3,2,1,0,0,2,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,0,0,0,0,0, 1,2,1,2,1,2,1,1,1,2,0,2,1,1,1,0,1,2,0,0,1,1,1,0,0,0,0,0,0,0,0,0, 2,3,2,0,0,0,0,0,1,1,2,1,0,0,1,1,1,0,0,0,0,2,0,0,1,1,0,0,2,1,1,1, 2,1,1,1,1,1,1,2,1,0,1,1,1,1,0,2,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1, 1,2,2,0,1,1,1,0,2,2,2,0,0,0,3,2,1,0,0,0,1,1,0,0,1,1,0,1,1,1,0,0, 1,1,0,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,0,0,1,1,1,0,1,0,1, 2,1,0,2,1,1,2,2,1,1,2,1,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1,1,0,0,0, 1,2,2,2,2,2,1,1,1,2,0,2,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,1,0, 1,2,3,0,0,0,1,0,2,2,0,0,0,0,2,2,0,0,0,0,0,1,0,0,1,0,0,0,2,0,1,0, 2,1,1,1,1,1,0,2,0,0,0,1,2,1,1,1,1,0,1,2,0,1,0,1,0,1,1,1,0,1,0,1, 2,2,2,0,0,0,1,0,2,1,2,0,0,0,1,1,2,0,0,0,0,1,0,0,1,1,0,0,2,1,0,1, 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,0,1, 1,2,2,0,0,0,1,0,2,2,2,0,0,0,1,1,0,0,0,0,0,1,1,0,2,0,0,1,1,1,0,1, 1,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,0,0,1, 1,0,0,1,0,1,2,1,0,0,1,1,1,2,0,0,0,1,1,0,1,0,1,1,0,0,1,0,0,0,0,0, 0,2,1,2,1,1,1,1,1,2,0,2,0,1,1,0,1,2,1,0,1,1,1,0,0,0,0,0,0,1,0,0, 2,1,1,0,1,2,0,0,1,1,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,2,1,0,1, 2,2,1,1,1,1,1,2,1,1,0,1,1,1,1,2,1,1,1,2,1,1,0,1,0,1,1,1,1,1,0,1, 1,2,2,0,0,0,0,0,1,1,0,0,0,0,2,1,0,0,0,0,0,2,0,0,2,2,0,0,2,0,0,1, 2,1,1,1,1,1,1,1,0,1,1,0,1,1,0,1,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1, 1,1,2,0,0,3,1,0,2,1,1,1,0,0,1,1,1,0,0,0,1,1,0,0,0,1,0,0,1,0,1,0, 1,2,1,0,1,1,1,2,1,1,0,1,1,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,0,1,0,0, 2,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,2,0,0,0, 2,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,2,1,1,0,0,1,1,1,1,1,0,1, 2,1,1,1,2,1,1,1,0,1,1,2,1,0,0,0,0,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,0,1,1,1,1,1,0,0,1,1,2,1,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,0,0,0, 1,2,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1,0,0, 2,0,0,0,1,1,1,1,0,0,1,1,0,0,0,0,0,1,1,1,2,0,0,1,0,0,1,0,1,0,0,0, 0,1,1,1,1,1,1,1,1,2,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0, 1,0,0,1,1,1,1,1,0,0,2,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0, 0,1,1,1,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0, 1,0,0,1,1,1,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, 0,1,1,1,1,1,0,0,1,1,0,1,0,1,0,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0, 0,0,0,1,0,0,0,0,0,0,1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0, 2,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,0,1,0,1,1,1,0,0,1,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,1,1,1,1,1,0,1,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0, ) Latin2HungarianModel = { 'char_to_order_map': Latin2_HungarianCharToOrderMap, 'precedence_matrix': HungarianLangModel, 'typical_positive_ratio': 0.947368, 'keep_english_letter': True, 'charset_name': "ISO-8859-2", 'language': 'Hungarian', } Win1250HungarianModel = { 'char_to_order_map': win1250HungarianCharToOrderMap, 'precedence_matrix': HungarianLangModel, 'typical_positive_ratio': 0.947368, 'keep_english_letter': True, 'charset_name': "windows-1250", 'language': 'Hungarian', } PKd] 7Хchardet/eucjpprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .enums import ProbingState, MachineState from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import EUCJPDistributionAnalysis from .jpcntx import EUCJPContextAnalysis from .mbcssm import EUCJP_SM_MODEL class EUCJPProber(MultiByteCharSetProber): def __init__(self): super(EUCJPProber, self).__init__() self.coding_sm = CodingStateMachine(EUCJP_SM_MODEL) self.distribution_analyzer = EUCJPDistributionAnalysis() self.context_analyzer = EUCJPContextAnalysis() self.reset() def reset(self): super(EUCJPProber, self).reset() self.context_analyzer.reset() @property def charset_name(self): return "EUC-JP" @property def language(self): return "Japanese" def feed(self, byte_str): for i in range(len(byte_str)): # PY3K: byte_str is a byte array, so byte_str[i] is an int, not a byte coding_state = self.coding_sm.next_state(byte_str[i]) if coding_state == MachineState.ERROR: self.logger.debug('%s %s prober hit error at byte %s', self.charset_name, self.language, i) self._state = ProbingState.NOT_ME break elif coding_state == MachineState.ITS_ME: self._state = ProbingState.FOUND_IT break elif coding_state == MachineState.START: char_len = self.coding_sm.get_current_charlen() if i == 0: self._last_char[1] = byte_str[0] self.context_analyzer.feed(self._last_char, char_len) self.distribution_analyzer.feed(self._last_char, char_len) else: self.context_analyzer.feed(byte_str[i - 1:i + 1], char_len) self.distribution_analyzer.feed(byte_str[i - 1:i + 1], char_len) self._last_char[0] = byte_str[-1] if self.state == ProbingState.DETECTING: if (self.context_analyzer.got_enough_data() and (self.get_confidence() > self.SHORTCUT_THRESHOLD)): self._state = ProbingState.FOUND_IT return self.state def get_confidence(self): context_conf = self.context_analyzer.get_confidence() distrib_conf = self.distribution_analyzer.get_confidence() return max(context_conf, distrib_conf) PKd]Achardet/euctwprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import EUCTWDistributionAnalysis from .mbcssm import EUCTW_SM_MODEL class EUCTWProber(MultiByteCharSetProber): def __init__(self): super(EUCTWProber, self).__init__() self.coding_sm = CodingStateMachine(EUCTW_SM_MODEL) self.distribution_analyzer = EUCTWDistributionAnalysis() self.reset() @property def charset_name(self): return "EUC-TW" @property def language(self): return "Taiwan" PKd]B1??chardet/cp949prober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .chardistribution import EUCKRDistributionAnalysis from .codingstatemachine import CodingStateMachine from .mbcharsetprober import MultiByteCharSetProber from .mbcssm import CP949_SM_MODEL class CP949Prober(MultiByteCharSetProber): def __init__(self): super(CP949Prober, self).__init__() self.coding_sm = CodingStateMachine(CP949_SM_MODEL) # NOTE: CP949 is a superset of EUC-KR, so the distribution should be # not different. self.distribution_analyzer = EUCKRDistributionAnalysis() self.reset() @property def charset_name(self): return "CP949" @property def language(self): return "Korean" PKd]= chardet/utf8prober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .charsetprober import CharSetProber from .enums import ProbingState, MachineState from .codingstatemachine import CodingStateMachine from .mbcssm import UTF8_SM_MODEL class UTF8Prober(CharSetProber): ONE_CHAR_PROB = 0.5 def __init__(self): super(UTF8Prober, self).__init__() self.coding_sm = CodingStateMachine(UTF8_SM_MODEL) self._num_mb_chars = None self.reset() def reset(self): super(UTF8Prober, self).reset() self.coding_sm.reset() self._num_mb_chars = 0 @property def charset_name(self): return "utf-8" @property def language(self): return "" def feed(self, byte_str): for c in byte_str: coding_state = self.coding_sm.next_state(c) if coding_state == MachineState.ERROR: self._state = ProbingState.NOT_ME break elif coding_state == MachineState.ITS_ME: self._state = ProbingState.FOUND_IT break elif coding_state == MachineState.START: if self.coding_sm.get_current_charlen() >= 2: self._num_mb_chars += 1 if self.state == ProbingState.DETECTING: if self.get_confidence() > self.SHORTCUT_THRESHOLD: self._state = ProbingState.FOUND_IT return self.state def get_confidence(self): unlike = 0.99 if self._num_mb_chars < 6: unlike *= self.ONE_CHAR_PROB ** self._num_mb_chars return 1.0 - unlike else: return unlike PKd]gfchardet/big5prober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import Big5DistributionAnalysis from .mbcssm import BIG5_SM_MODEL class Big5Prober(MultiByteCharSetProber): def __init__(self): super(Big5Prober, self).__init__() self.coding_sm = CodingStateMachine(BIG5_SM_MODEL) self.distribution_analyzer = Big5DistributionAnalysis() self.reset() @property def charset_name(self): return "Big5" @property def language(self): return "Chinese" PKd]iccchardet/mbcssm.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .enums import MachineState # BIG5 BIG5_CLS = ( 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as legal value 1,1,1,1,1,1,0,0, # 08 - 0f 1,1,1,1,1,1,1,1, # 10 - 17 1,1,1,0,1,1,1,1, # 18 - 1f 1,1,1,1,1,1,1,1, # 20 - 27 1,1,1,1,1,1,1,1, # 28 - 2f 1,1,1,1,1,1,1,1, # 30 - 37 1,1,1,1,1,1,1,1, # 38 - 3f 2,2,2,2,2,2,2,2, # 40 - 47 2,2,2,2,2,2,2,2, # 48 - 4f 2,2,2,2,2,2,2,2, # 50 - 57 2,2,2,2,2,2,2,2, # 58 - 5f 2,2,2,2,2,2,2,2, # 60 - 67 2,2,2,2,2,2,2,2, # 68 - 6f 2,2,2,2,2,2,2,2, # 70 - 77 2,2,2,2,2,2,2,1, # 78 - 7f 4,4,4,4,4,4,4,4, # 80 - 87 4,4,4,4,4,4,4,4, # 88 - 8f 4,4,4,4,4,4,4,4, # 90 - 97 4,4,4,4,4,4,4,4, # 98 - 9f 4,3,3,3,3,3,3,3, # a0 - a7 3,3,3,3,3,3,3,3, # a8 - af 3,3,3,3,3,3,3,3, # b0 - b7 3,3,3,3,3,3,3,3, # b8 - bf 3,3,3,3,3,3,3,3, # c0 - c7 3,3,3,3,3,3,3,3, # c8 - cf 3,3,3,3,3,3,3,3, # d0 - d7 3,3,3,3,3,3,3,3, # d8 - df 3,3,3,3,3,3,3,3, # e0 - e7 3,3,3,3,3,3,3,3, # e8 - ef 3,3,3,3,3,3,3,3, # f0 - f7 3,3,3,3,3,3,3,0 # f8 - ff ) BIG5_ST = ( MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,#08-0f MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START#10-17 ) BIG5_CHAR_LEN_TABLE = (0, 1, 1, 2, 0) BIG5_SM_MODEL = {'class_table': BIG5_CLS, 'class_factor': 5, 'state_table': BIG5_ST, 'char_len_table': BIG5_CHAR_LEN_TABLE, 'name': 'Big5'} # CP949 CP949_CLS = ( 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0,0, # 00 - 0f 1,1,1,1,1,1,1,1, 1,1,1,0,1,1,1,1, # 10 - 1f 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 20 - 2f 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 30 - 3f 1,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4, # 40 - 4f 4,4,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 50 - 5f 1,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5, # 60 - 6f 5,5,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 70 - 7f 0,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 80 - 8f 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 90 - 9f 6,7,7,7,7,7,7,7, 7,7,7,7,7,8,8,8, # a0 - af 7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7, # b0 - bf 7,7,7,7,7,7,9,2, 2,3,2,2,2,2,2,2, # c0 - cf 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # d0 - df 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # e0 - ef 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,0, # f0 - ff ) CP949_ST = ( #cls= 0 1 2 3 4 5 6 7 8 9 # previous state = MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START, 4, 5,MachineState.ERROR, 6, # MachineState.START MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, # MachineState.ERROR MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME, # MachineState.ITS_ME MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 3 MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 4 MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 5 MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 6 ) CP949_CHAR_LEN_TABLE = (0, 1, 2, 0, 1, 1, 2, 2, 0, 2) CP949_SM_MODEL = {'class_table': CP949_CLS, 'class_factor': 10, 'state_table': CP949_ST, 'char_len_table': CP949_CHAR_LEN_TABLE, 'name': 'CP949'} # EUC-JP EUCJP_CLS = ( 4,4,4,4,4,4,4,4, # 00 - 07 4,4,4,4,4,4,5,5, # 08 - 0f 4,4,4,4,4,4,4,4, # 10 - 17 4,4,4,5,4,4,4,4, # 18 - 1f 4,4,4,4,4,4,4,4, # 20 - 27 4,4,4,4,4,4,4,4, # 28 - 2f 4,4,4,4,4,4,4,4, # 30 - 37 4,4,4,4,4,4,4,4, # 38 - 3f 4,4,4,4,4,4,4,4, # 40 - 47 4,4,4,4,4,4,4,4, # 48 - 4f 4,4,4,4,4,4,4,4, # 50 - 57 4,4,4,4,4,4,4,4, # 58 - 5f 4,4,4,4,4,4,4,4, # 60 - 67 4,4,4,4,4,4,4,4, # 68 - 6f 4,4,4,4,4,4,4,4, # 70 - 77 4,4,4,4,4,4,4,4, # 78 - 7f 5,5,5,5,5,5,5,5, # 80 - 87 5,5,5,5,5,5,1,3, # 88 - 8f 5,5,5,5,5,5,5,5, # 90 - 97 5,5,5,5,5,5,5,5, # 98 - 9f 5,2,2,2,2,2,2,2, # a0 - a7 2,2,2,2,2,2,2,2, # a8 - af 2,2,2,2,2,2,2,2, # b0 - b7 2,2,2,2,2,2,2,2, # b8 - bf 2,2,2,2,2,2,2,2, # c0 - c7 2,2,2,2,2,2,2,2, # c8 - cf 2,2,2,2,2,2,2,2, # d0 - d7 2,2,2,2,2,2,2,2, # d8 - df 0,0,0,0,0,0,0,0, # e0 - e7 0,0,0,0,0,0,0,0, # e8 - ef 0,0,0,0,0,0,0,0, # f0 - f7 0,0,0,0,0,0,0,5 # f8 - ff ) EUCJP_ST = ( 3, 4, 3, 5,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f MachineState.ITS_ME,MachineState.ITS_ME,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17 MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 3,MachineState.ERROR,#18-1f 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START#20-27 ) EUCJP_CHAR_LEN_TABLE = (2, 2, 2, 3, 1, 0) EUCJP_SM_MODEL = {'class_table': EUCJP_CLS, 'class_factor': 6, 'state_table': EUCJP_ST, 'char_len_table': EUCJP_CHAR_LEN_TABLE, 'name': 'EUC-JP'} # EUC-KR EUCKR_CLS = ( 1,1,1,1,1,1,1,1, # 00 - 07 1,1,1,1,1,1,0,0, # 08 - 0f 1,1,1,1,1,1,1,1, # 10 - 17 1,1,1,0,1,1,1,1, # 18 - 1f 1,1,1,1,1,1,1,1, # 20 - 27 1,1,1,1,1,1,1,1, # 28 - 2f 1,1,1,1,1,1,1,1, # 30 - 37 1,1,1,1,1,1,1,1, # 38 - 3f 1,1,1,1,1,1,1,1, # 40 - 47 1,1,1,1,1,1,1,1, # 48 - 4f 1,1,1,1,1,1,1,1, # 50 - 57 1,1,1,1,1,1,1,1, # 58 - 5f 1,1,1,1,1,1,1,1, # 60 - 67 1,1,1,1,1,1,1,1, # 68 - 6f 1,1,1,1,1,1,1,1, # 70 - 77 1,1,1,1,1,1,1,1, # 78 - 7f 0,0,0,0,0,0,0,0, # 80 - 87 0,0,0,0,0,0,0,0, # 88 - 8f 0,0,0,0,0,0,0,0, # 90 - 97 0,0,0,0,0,0,0,0, # 98 - 9f 0,2,2,2,2,2,2,2, # a0 - a7 2,2,2,2,2,3,3,3, # a8 - af 2,2,2,2,2,2,2,2, # b0 - b7 2,2,2,2,2,2,2,2, # b8 - bf 2,2,2,2,2,2,2,2, # c0 - c7 2,3,2,2,2,2,2,2, # c8 - cf 2,2,2,2,2,2,2,2, # d0 - d7 2,2,2,2,2,2,2,2, # d8 - df 2,2,2,2,2,2,2,2, # e0 - e7 2,2,2,2,2,2,2,2, # e8 - ef 2,2,2,2,2,2,2,2, # f0 - f7 2,2,2,2,2,2,2,0 # f8 - ff ) EUCKR_ST = ( MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #08-0f ) EUCKR_CHAR_LEN_TABLE = (0, 1, 2, 0) EUCKR_SM_MODEL = {'class_table': EUCKR_CLS, 'class_factor': 4, 'state_table': EUCKR_ST, 'char_len_table': EUCKR_CHAR_LEN_TABLE, 'name': 'EUC-KR'} # EUC-TW EUCTW_CLS = ( 2,2,2,2,2,2,2,2, # 00 - 07 2,2,2,2,2,2,0,0, # 08 - 0f 2,2,2,2,2,2,2,2, # 10 - 17 2,2,2,0,2,2,2,2, # 18 - 1f 2,2,2,2,2,2,2,2, # 20 - 27 2,2,2,2,2,2,2,2, # 28 - 2f 2,2,2,2,2,2,2,2, # 30 - 37 2,2,2,2,2,2,2,2, # 38 - 3f 2,2,2,2,2,2,2,2, # 40 - 47 2,2,2,2,2,2,2,2, # 48 - 4f 2,2,2,2,2,2,2,2, # 50 - 57 2,2,2,2,2,2,2,2, # 58 - 5f 2,2,2,2,2,2,2,2, # 60 - 67 2,2,2,2,2,2,2,2, # 68 - 6f 2,2,2,2,2,2,2,2, # 70 - 77 2,2,2,2,2,2,2,2, # 78 - 7f 0,0,0,0,0,0,0,0, # 80 - 87 0,0,0,0,0,0,6,0, # 88 - 8f 0,0,0,0,0,0,0,0, # 90 - 97 0,0,0,0,0,0,0,0, # 98 - 9f 0,3,4,4,4,4,4,4, # a0 - a7 5,5,1,1,1,1,1,1, # a8 - af 1,1,1,1,1,1,1,1, # b0 - b7 1,1,1,1,1,1,1,1, # b8 - bf 1,1,3,1,3,3,3,3, # c0 - c7 3,3,3,3,3,3,3,3, # c8 - cf 3,3,3,3,3,3,3,3, # d0 - d7 3,3,3,3,3,3,3,3, # d8 - df 3,3,3,3,3,3,3,3, # e0 - e7 3,3,3,3,3,3,3,3, # e8 - ef 3,3,3,3,3,3,3,3, # f0 - f7 3,3,3,3,3,3,3,0 # f8 - ff ) EUCTW_ST = ( MachineState.ERROR,MachineState.ERROR,MachineState.START, 3, 3, 3, 4,MachineState.ERROR,#00-07 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.ERROR,#10-17 MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,#20-27 MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f ) EUCTW_CHAR_LEN_TABLE = (0, 0, 1, 2, 2, 2, 3) EUCTW_SM_MODEL = {'class_table': EUCTW_CLS, 'class_factor': 7, 'state_table': EUCTW_ST, 'char_len_table': EUCTW_CHAR_LEN_TABLE, 'name': 'x-euc-tw'} # GB2312 GB2312_CLS = ( 1,1,1,1,1,1,1,1, # 00 - 07 1,1,1,1,1,1,0,0, # 08 - 0f 1,1,1,1,1,1,1,1, # 10 - 17 1,1,1,0,1,1,1,1, # 18 - 1f 1,1,1,1,1,1,1,1, # 20 - 27 1,1,1,1,1,1,1,1, # 28 - 2f 3,3,3,3,3,3,3,3, # 30 - 37 3,3,1,1,1,1,1,1, # 38 - 3f 2,2,2,2,2,2,2,2, # 40 - 47 2,2,2,2,2,2,2,2, # 48 - 4f 2,2,2,2,2,2,2,2, # 50 - 57 2,2,2,2,2,2,2,2, # 58 - 5f 2,2,2,2,2,2,2,2, # 60 - 67 2,2,2,2,2,2,2,2, # 68 - 6f 2,2,2,2,2,2,2,2, # 70 - 77 2,2,2,2,2,2,2,4, # 78 - 7f 5,6,6,6,6,6,6,6, # 80 - 87 6,6,6,6,6,6,6,6, # 88 - 8f 6,6,6,6,6,6,6,6, # 90 - 97 6,6,6,6,6,6,6,6, # 98 - 9f 6,6,6,6,6,6,6,6, # a0 - a7 6,6,6,6,6,6,6,6, # a8 - af 6,6,6,6,6,6,6,6, # b0 - b7 6,6,6,6,6,6,6,6, # b8 - bf 6,6,6,6,6,6,6,6, # c0 - c7 6,6,6,6,6,6,6,6, # c8 - cf 6,6,6,6,6,6,6,6, # d0 - d7 6,6,6,6,6,6,6,6, # d8 - df 6,6,6,6,6,6,6,6, # e0 - e7 6,6,6,6,6,6,6,6, # e8 - ef 6,6,6,6,6,6,6,6, # f0 - f7 6,6,6,6,6,6,6,0 # f8 - ff ) GB2312_ST = ( MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, 3,MachineState.ERROR,#00-07 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,#10-17 4,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f MachineState.ERROR,MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#20-27 MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f ) # To be accurate, the length of class 6 can be either 2 or 4. # But it is not necessary to discriminate between the two since # it is used for frequency analysis only, and we are validating # each code range there as well. So it is safe to set it to be # 2 here. GB2312_CHAR_LEN_TABLE = (0, 1, 1, 1, 1, 1, 2) GB2312_SM_MODEL = {'class_table': GB2312_CLS, 'class_factor': 7, 'state_table': GB2312_ST, 'char_len_table': GB2312_CHAR_LEN_TABLE, 'name': 'GB2312'} # Shift_JIS SJIS_CLS = ( 1,1,1,1,1,1,1,1, # 00 - 07 1,1,1,1,1,1,0,0, # 08 - 0f 1,1,1,1,1,1,1,1, # 10 - 17 1,1,1,0,1,1,1,1, # 18 - 1f 1,1,1,1,1,1,1,1, # 20 - 27 1,1,1,1,1,1,1,1, # 28 - 2f 1,1,1,1,1,1,1,1, # 30 - 37 1,1,1,1,1,1,1,1, # 38 - 3f 2,2,2,2,2,2,2,2, # 40 - 47 2,2,2,2,2,2,2,2, # 48 - 4f 2,2,2,2,2,2,2,2, # 50 - 57 2,2,2,2,2,2,2,2, # 58 - 5f 2,2,2,2,2,2,2,2, # 60 - 67 2,2,2,2,2,2,2,2, # 68 - 6f 2,2,2,2,2,2,2,2, # 70 - 77 2,2,2,2,2,2,2,1, # 78 - 7f 3,3,3,3,3,2,2,3, # 80 - 87 3,3,3,3,3,3,3,3, # 88 - 8f 3,3,3,3,3,3,3,3, # 90 - 97 3,3,3,3,3,3,3,3, # 98 - 9f #0xa0 is illegal in sjis encoding, but some pages does #contain such byte. We need to be more error forgiven. 2,2,2,2,2,2,2,2, # a0 - a7 2,2,2,2,2,2,2,2, # a8 - af 2,2,2,2,2,2,2,2, # b0 - b7 2,2,2,2,2,2,2,2, # b8 - bf 2,2,2,2,2,2,2,2, # c0 - c7 2,2,2,2,2,2,2,2, # c8 - cf 2,2,2,2,2,2,2,2, # d0 - d7 2,2,2,2,2,2,2,2, # d8 - df 3,3,3,3,3,3,3,3, # e0 - e7 3,3,3,3,3,4,4,4, # e8 - ef 3,3,3,3,3,3,3,3, # f0 - f7 3,3,3,3,3,0,0,0) # f8 - ff SJIS_ST = ( MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START #10-17 ) SJIS_CHAR_LEN_TABLE = (0, 1, 1, 2, 0, 0) SJIS_SM_MODEL = {'class_table': SJIS_CLS, 'class_factor': 6, 'state_table': SJIS_ST, 'char_len_table': SJIS_CHAR_LEN_TABLE, 'name': 'Shift_JIS'} # UCS2-BE UCS2BE_CLS = ( 0,0,0,0,0,0,0,0, # 00 - 07 0,0,1,0,0,2,0,0, # 08 - 0f 0,0,0,0,0,0,0,0, # 10 - 17 0,0,0,3,0,0,0,0, # 18 - 1f 0,0,0,0,0,0,0,0, # 20 - 27 0,3,3,3,3,3,0,0, # 28 - 2f 0,0,0,0,0,0,0,0, # 30 - 37 0,0,0,0,0,0,0,0, # 38 - 3f 0,0,0,0,0,0,0,0, # 40 - 47 0,0,0,0,0,0,0,0, # 48 - 4f 0,0,0,0,0,0,0,0, # 50 - 57 0,0,0,0,0,0,0,0, # 58 - 5f 0,0,0,0,0,0,0,0, # 60 - 67 0,0,0,0,0,0,0,0, # 68 - 6f 0,0,0,0,0,0,0,0, # 70 - 77 0,0,0,0,0,0,0,0, # 78 - 7f 0,0,0,0,0,0,0,0, # 80 - 87 0,0,0,0,0,0,0,0, # 88 - 8f 0,0,0,0,0,0,0,0, # 90 - 97 0,0,0,0,0,0,0,0, # 98 - 9f 0,0,0,0,0,0,0,0, # a0 - a7 0,0,0,0,0,0,0,0, # a8 - af 0,0,0,0,0,0,0,0, # b0 - b7 0,0,0,0,0,0,0,0, # b8 - bf 0,0,0,0,0,0,0,0, # c0 - c7 0,0,0,0,0,0,0,0, # c8 - cf 0,0,0,0,0,0,0,0, # d0 - d7 0,0,0,0,0,0,0,0, # d8 - df 0,0,0,0,0,0,0,0, # e0 - e7 0,0,0,0,0,0,0,0, # e8 - ef 0,0,0,0,0,0,0,0, # f0 - f7 0,0,0,0,0,0,4,5 # f8 - ff ) UCS2BE_ST = ( 5, 7, 7,MachineState.ERROR, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f MachineState.ITS_ME,MachineState.ITS_ME, 6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,#10-17 6, 6, 6, 6, 6,MachineState.ITS_ME, 6, 6,#18-1f 6, 6, 6, 6, 5, 7, 7,MachineState.ERROR,#20-27 5, 8, 6, 6,MachineState.ERROR, 6, 6, 6,#28-2f 6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #30-37 ) UCS2BE_CHAR_LEN_TABLE = (2, 2, 2, 0, 2, 2) UCS2BE_SM_MODEL = {'class_table': UCS2BE_CLS, 'class_factor': 6, 'state_table': UCS2BE_ST, 'char_len_table': UCS2BE_CHAR_LEN_TABLE, 'name': 'UTF-16BE'} # UCS2-LE UCS2LE_CLS = ( 0,0,0,0,0,0,0,0, # 00 - 07 0,0,1,0,0,2,0,0, # 08 - 0f 0,0,0,0,0,0,0,0, # 10 - 17 0,0,0,3,0,0,0,0, # 18 - 1f 0,0,0,0,0,0,0,0, # 20 - 27 0,3,3,3,3,3,0,0, # 28 - 2f 0,0,0,0,0,0,0,0, # 30 - 37 0,0,0,0,0,0,0,0, # 38 - 3f 0,0,0,0,0,0,0,0, # 40 - 47 0,0,0,0,0,0,0,0, # 48 - 4f 0,0,0,0,0,0,0,0, # 50 - 57 0,0,0,0,0,0,0,0, # 58 - 5f 0,0,0,0,0,0,0,0, # 60 - 67 0,0,0,0,0,0,0,0, # 68 - 6f 0,0,0,0,0,0,0,0, # 70 - 77 0,0,0,0,0,0,0,0, # 78 - 7f 0,0,0,0,0,0,0,0, # 80 - 87 0,0,0,0,0,0,0,0, # 88 - 8f 0,0,0,0,0,0,0,0, # 90 - 97 0,0,0,0,0,0,0,0, # 98 - 9f 0,0,0,0,0,0,0,0, # a0 - a7 0,0,0,0,0,0,0,0, # a8 - af 0,0,0,0,0,0,0,0, # b0 - b7 0,0,0,0,0,0,0,0, # b8 - bf 0,0,0,0,0,0,0,0, # c0 - c7 0,0,0,0,0,0,0,0, # c8 - cf 0,0,0,0,0,0,0,0, # d0 - d7 0,0,0,0,0,0,0,0, # d8 - df 0,0,0,0,0,0,0,0, # e0 - e7 0,0,0,0,0,0,0,0, # e8 - ef 0,0,0,0,0,0,0,0, # f0 - f7 0,0,0,0,0,0,4,5 # f8 - ff ) UCS2LE_ST = ( 6, 6, 7, 6, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f MachineState.ITS_ME,MachineState.ITS_ME, 5, 5, 5,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#10-17 5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR, 6, 6,#18-1f 7, 6, 8, 8, 5, 5, 5,MachineState.ERROR,#20-27 5, 5, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5,#28-2f 5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR,MachineState.START,MachineState.START #30-37 ) UCS2LE_CHAR_LEN_TABLE = (2, 2, 2, 2, 2, 2) UCS2LE_SM_MODEL = {'class_table': UCS2LE_CLS, 'class_factor': 6, 'state_table': UCS2LE_ST, 'char_len_table': UCS2LE_CHAR_LEN_TABLE, 'name': 'UTF-16LE'} # UTF-8 UTF8_CLS = ( 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as a legal value 1,1,1,1,1,1,0,0, # 08 - 0f 1,1,1,1,1,1,1,1, # 10 - 17 1,1,1,0,1,1,1,1, # 18 - 1f 1,1,1,1,1,1,1,1, # 20 - 27 1,1,1,1,1,1,1,1, # 28 - 2f 1,1,1,1,1,1,1,1, # 30 - 37 1,1,1,1,1,1,1,1, # 38 - 3f 1,1,1,1,1,1,1,1, # 40 - 47 1,1,1,1,1,1,1,1, # 48 - 4f 1,1,1,1,1,1,1,1, # 50 - 57 1,1,1,1,1,1,1,1, # 58 - 5f 1,1,1,1,1,1,1,1, # 60 - 67 1,1,1,1,1,1,1,1, # 68 - 6f 1,1,1,1,1,1,1,1, # 70 - 77 1,1,1,1,1,1,1,1, # 78 - 7f 2,2,2,2,3,3,3,3, # 80 - 87 4,4,4,4,4,4,4,4, # 88 - 8f 4,4,4,4,4,4,4,4, # 90 - 97 4,4,4,4,4,4,4,4, # 98 - 9f 5,5,5,5,5,5,5,5, # a0 - a7 5,5,5,5,5,5,5,5, # a8 - af 5,5,5,5,5,5,5,5, # b0 - b7 5,5,5,5,5,5,5,5, # b8 - bf 0,0,6,6,6,6,6,6, # c0 - c7 6,6,6,6,6,6,6,6, # c8 - cf 6,6,6,6,6,6,6,6, # d0 - d7 6,6,6,6,6,6,6,6, # d8 - df 7,8,8,8,8,8,8,8, # e0 - e7 8,8,8,8,8,9,8,8, # e8 - ef 10,11,11,11,11,11,11,11, # f0 - f7 12,13,13,13,14,15,0,0 # f8 - ff ) UTF8_ST = ( MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12, 10,#00-07 9, 11, 8, 7, 6, 5, 4, 3,#08-0f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#20-27 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#28-2f MachineState.ERROR,MachineState.ERROR, 5, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#30-37 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#38-3f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#40-47 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#48-4f MachineState.ERROR,MachineState.ERROR, 7, 7, 7, 7,MachineState.ERROR,MachineState.ERROR,#50-57 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#58-5f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 7, 7,MachineState.ERROR,MachineState.ERROR,#60-67 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#68-6f MachineState.ERROR,MachineState.ERROR, 9, 9, 9, 9,MachineState.ERROR,MachineState.ERROR,#70-77 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#78-7f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 9,MachineState.ERROR,MachineState.ERROR,#80-87 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#88-8f MachineState.ERROR,MachineState.ERROR, 12, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,#90-97 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#98-9f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12,MachineState.ERROR,MachineState.ERROR,#a0-a7 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#a8-af MachineState.ERROR,MachineState.ERROR, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b0-b7 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b8-bf MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,#c0-c7 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR #c8-cf ) UTF8_CHAR_LEN_TABLE = (0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6) UTF8_SM_MODEL = {'class_table': UTF8_CLS, 'class_factor': 16, 'state_table': UTF8_ST, 'char_len_table': UTF8_CHAR_LEN_TABLE, 'name': 'UTF-8'} PKd]y%jLLchardet/jpcntx.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # This is hiragana 2-char sequence table, the number in each cell represents its frequency category jp2CharContext = ( (0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1), (2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4), (0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2), (0,4,0,5,0,5,0,4,0,4,5,4,4,3,5,3,5,1,5,3,4,3,4,4,3,4,3,3,4,3,5,4,4,3,5,5,3,5,5,5,3,5,5,3,4,5,5,3,1,3,2,0,3,4,0,4,2,0,4,2,1,5,3,2,3,5,0,4,0,2,0,5,4,4,5,4,5,0,4,0,0,4,4), (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), (0,3,0,4,0,3,0,3,0,4,5,4,3,3,3,3,4,3,5,4,4,3,5,4,4,3,4,3,4,4,4,4,5,3,4,4,3,4,5,5,4,5,5,1,4,5,4,3,0,3,3,1,3,3,0,4,4,0,3,3,1,5,3,3,3,5,0,4,0,3,0,4,4,3,4,3,3,0,4,1,1,3,4), (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), (0,4,0,3,0,3,0,4,0,3,4,4,3,2,2,1,2,1,3,1,3,3,3,3,3,4,3,1,3,3,5,3,3,0,4,3,0,5,4,3,3,5,4,4,3,4,4,5,0,1,2,0,1,2,0,2,2,0,1,0,0,5,2,2,1,4,0,3,0,1,0,4,4,3,5,4,3,0,2,1,0,4,3), (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), (0,3,0,5,0,4,0,2,1,4,4,2,4,1,4,2,4,2,4,3,3,3,4,3,3,3,3,1,4,2,3,3,3,1,4,4,1,1,1,4,3,3,2,0,2,4,3,2,0,3,3,0,3,1,1,0,0,0,3,3,0,4,2,2,3,4,0,4,0,3,0,4,4,5,3,4,4,0,3,0,0,1,4), (1,4,0,4,0,4,0,4,0,3,5,4,4,3,4,3,5,4,3,3,4,3,5,4,4,4,4,3,4,2,4,3,3,1,5,4,3,2,4,5,4,5,5,4,4,5,4,4,0,3,2,2,3,3,0,4,3,1,3,2,1,4,3,3,4,5,0,3,0,2,0,4,5,5,4,5,4,0,4,0,0,5,4), (0,5,0,5,0,4,0,3,0,4,4,3,4,3,3,3,4,0,4,4,4,3,4,3,4,3,3,1,4,2,4,3,4,0,5,4,1,4,5,4,4,5,3,2,4,3,4,3,2,4,1,3,3,3,2,3,2,0,4,3,3,4,3,3,3,4,0,4,0,3,0,4,5,4,4,4,3,0,4,1,0,1,3), (0,3,1,4,0,3,0,2,0,3,4,4,3,1,4,2,3,3,4,3,4,3,4,3,4,4,3,2,3,1,5,4,4,1,4,4,3,5,4,4,3,5,5,4,3,4,4,3,1,2,3,1,2,2,0,3,2,0,3,1,0,5,3,3,3,4,3,3,3,3,4,4,4,4,5,4,2,0,3,3,2,4,3), (0,2,0,3,0,1,0,1,0,0,3,2,0,0,2,0,1,0,2,1,3,3,3,1,2,3,1,0,1,0,4,2,1,1,3,3,0,4,3,3,1,4,3,3,0,3,3,2,0,0,0,0,1,0,0,2,0,0,0,0,0,4,1,0,2,3,2,2,2,1,3,3,3,4,4,3,2,0,3,1,0,3,3), (0,4,0,4,0,3,0,3,0,4,4,4,3,3,3,3,3,3,4,3,4,2,4,3,4,3,3,2,4,3,4,5,4,1,4,5,3,5,4,5,3,5,4,0,3,5,5,3,1,3,3,2,2,3,0,3,4,1,3,3,2,4,3,3,3,4,0,4,0,3,0,4,5,4,4,5,3,0,4,1,0,3,4), (0,2,0,3,0,3,0,0,0,2,2,2,1,0,1,0,0,0,3,0,3,0,3,0,1,3,1,0,3,1,3,3,3,1,3,3,3,0,1,3,1,3,4,0,0,3,1,1,0,3,2,0,0,0,0,1,3,0,1,0,0,3,3,2,0,3,0,0,0,0,0,3,4,3,4,3,3,0,3,0,0,2,3), (2,3,0,3,0,2,0,1,0,3,3,4,3,1,3,1,1,1,3,1,4,3,4,3,3,3,0,0,3,1,5,4,3,1,4,3,2,5,5,4,4,4,4,3,3,4,4,4,0,2,1,1,3,2,0,1,2,0,0,1,0,4,1,3,3,3,0,3,0,1,0,4,4,4,5,5,3,0,2,0,0,4,4), (0,2,0,1,0,3,1,3,0,2,3,3,3,0,3,1,0,0,3,0,3,2,3,1,3,2,1,1,0,0,4,2,1,0,2,3,1,4,3,2,0,4,4,3,1,3,1,3,0,1,0,0,1,0,0,0,1,0,0,0,0,4,1,1,1,2,0,3,0,0,0,3,4,2,4,3,2,0,1,0,0,3,3), (0,1,0,4,0,5,0,4,0,2,4,4,2,3,3,2,3,3,5,3,3,3,4,3,4,2,3,0,4,3,3,3,4,1,4,3,2,1,5,5,3,4,5,1,3,5,4,2,0,3,3,0,1,3,0,4,2,0,1,3,1,4,3,3,3,3,0,3,0,1,0,3,4,4,4,5,5,0,3,0,1,4,5), (0,2,0,3,0,3,0,0,0,2,3,1,3,0,4,0,1,1,3,0,3,4,3,2,3,1,0,3,3,2,3,1,3,0,2,3,0,2,1,4,1,2,2,0,0,3,3,0,0,2,0,0,0,1,0,0,0,0,2,2,0,3,2,1,3,3,0,2,0,2,0,0,3,3,1,2,4,0,3,0,2,2,3), (2,4,0,5,0,4,0,4,0,2,4,4,4,3,4,3,3,3,1,2,4,3,4,3,4,4,5,0,3,3,3,3,2,0,4,3,1,4,3,4,1,4,4,3,3,4,4,3,1,2,3,0,4,2,0,4,1,0,3,3,0,4,3,3,3,4,0,4,0,2,0,3,5,3,4,5,2,0,3,0,0,4,5), (0,3,0,4,0,1,0,1,0,1,3,2,2,1,3,0,3,0,2,0,2,0,3,0,2,0,0,0,1,0,1,1,0,0,3,1,0,0,0,4,0,3,1,0,2,1,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,4,2,2,3,1,0,3,0,0,0,1,4,4,4,3,0,0,4,0,0,1,4), (1,4,1,5,0,3,0,3,0,4,5,4,4,3,5,3,3,4,4,3,4,1,3,3,3,3,2,1,4,1,5,4,3,1,4,4,3,5,4,4,3,5,4,3,3,4,4,4,0,3,3,1,2,3,0,3,1,0,3,3,0,5,4,4,4,4,4,4,3,3,5,4,4,3,3,5,4,0,3,2,0,4,4), (0,2,0,3,0,1,0,0,0,1,3,3,3,2,4,1,3,0,3,1,3,0,2,2,1,1,0,0,2,0,4,3,1,0,4,3,0,4,4,4,1,4,3,1,1,3,3,1,0,2,0,0,1,3,0,0,0,0,2,0,0,4,3,2,4,3,5,4,3,3,3,4,3,3,4,3,3,0,2,1,0,3,3), (0,2,0,4,0,3,0,2,0,2,5,5,3,4,4,4,4,1,4,3,3,0,4,3,4,3,1,3,3,2,4,3,0,3,4,3,0,3,4,4,2,4,4,0,4,5,3,3,2,2,1,1,1,2,0,1,5,0,3,3,2,4,3,3,3,4,0,3,0,2,0,4,4,3,5,5,0,0,3,0,2,3,3), (0,3,0,4,0,3,0,1,0,3,4,3,3,1,3,3,3,0,3,1,3,0,4,3,3,1,1,0,3,0,3,3,0,0,4,4,0,1,5,4,3,3,5,0,3,3,4,3,0,2,0,1,1,1,0,1,3,0,1,2,1,3,3,2,3,3,0,3,0,1,0,1,3,3,4,4,1,0,1,2,2,1,3), (0,1,0,4,0,4,0,3,0,1,3,3,3,2,3,1,1,0,3,0,3,3,4,3,2,4,2,0,1,0,4,3,2,0,4,3,0,5,3,3,2,4,4,4,3,3,3,4,0,1,3,0,0,1,0,0,1,0,0,0,0,4,2,3,3,3,0,3,0,0,0,4,4,4,5,3,2,0,3,3,0,3,5), (0,2,0,3,0,0,0,3,0,1,3,0,2,0,0,0,1,0,3,1,1,3,3,0,0,3,0,0,3,0,2,3,1,0,3,1,0,3,3,2,0,4,2,2,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,1,0,1,0,0,0,1,3,1,2,0,0,0,1,0,0,1,4), (0,3,0,3,0,5,0,1,0,2,4,3,1,3,3,2,1,1,5,2,1,0,5,1,2,0,0,0,3,3,2,2,3,2,4,3,0,0,3,3,1,3,3,0,2,5,3,4,0,3,3,0,1,2,0,2,2,0,3,2,0,2,2,3,3,3,0,2,0,1,0,3,4,4,2,5,4,0,3,0,0,3,5), (0,3,0,3,0,3,0,1,0,3,3,3,3,0,3,0,2,0,2,1,1,0,2,0,1,0,0,0,2,1,0,0,1,0,3,2,0,0,3,3,1,2,3,1,0,3,3,0,0,1,0,0,0,0,0,2,0,0,0,0,0,2,3,1,2,3,0,3,0,1,0,3,2,1,0,4,3,0,1,1,0,3,3), (0,4,0,5,0,3,0,3,0,4,5,5,4,3,5,3,4,3,5,3,3,2,5,3,4,4,4,3,4,3,4,5,5,3,4,4,3,4,4,5,4,4,4,3,4,5,5,4,2,3,4,2,3,4,0,3,3,1,4,3,2,4,3,3,5,5,0,3,0,3,0,5,5,5,5,4,4,0,4,0,1,4,4), (0,4,0,4,0,3,0,3,0,3,5,4,4,2,3,2,5,1,3,2,5,1,4,2,3,2,3,3,4,3,3,3,3,2,5,4,1,3,3,5,3,4,4,0,4,4,3,1,1,3,1,0,2,3,0,2,3,0,3,0,0,4,3,1,3,4,0,3,0,2,0,4,4,4,3,4,5,0,4,0,0,3,4), (0,3,0,3,0,3,1,2,0,3,4,4,3,3,3,0,2,2,4,3,3,1,3,3,3,1,1,0,3,1,4,3,2,3,4,4,2,4,4,4,3,4,4,3,2,4,4,3,1,3,3,1,3,3,0,4,1,0,2,2,1,4,3,2,3,3,5,4,3,3,5,4,4,3,3,0,4,0,3,2,2,4,4), (0,2,0,1,0,0,0,0,0,1,2,1,3,0,0,0,0,0,2,0,1,2,1,0,0,1,0,0,0,0,3,0,0,1,0,1,1,3,1,0,0,0,1,1,0,1,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,1,2,2,0,3,4,0,0,0,1,1,0,0,1,0,0,0,0,0,1,1), (0,1,0,0,0,1,0,0,0,0,4,0,4,1,4,0,3,0,4,0,3,0,4,0,3,0,3,0,4,1,5,1,4,0,0,3,0,5,0,5,2,0,1,0,0,0,2,1,4,0,1,3,0,0,3,0,0,3,1,1,4,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0), (1,4,0,5,0,3,0,2,0,3,5,4,4,3,4,3,5,3,4,3,3,0,4,3,3,3,3,3,3,2,4,4,3,1,3,4,4,5,4,4,3,4,4,1,3,5,4,3,3,3,1,2,2,3,3,1,3,1,3,3,3,5,3,3,4,5,0,3,0,3,0,3,4,3,4,4,3,0,3,0,2,4,3), (0,1,0,4,0,0,0,0,0,1,4,0,4,1,4,2,4,0,3,0,1,0,1,0,0,0,0,0,2,0,3,1,1,1,0,3,0,0,0,1,2,1,0,0,1,1,1,1,0,1,0,0,0,1,0,0,3,0,0,0,0,3,2,0,2,2,0,1,0,0,0,2,3,2,3,3,0,0,0,0,2,1,0), (0,5,1,5,0,3,0,3,0,5,4,4,5,1,5,3,3,0,4,3,4,3,5,3,4,3,3,2,4,3,4,3,3,0,3,3,1,4,4,3,4,4,4,3,4,5,5,3,2,3,1,1,3,3,1,3,1,1,3,3,2,4,5,3,3,5,0,4,0,3,0,4,4,3,5,3,3,0,3,4,0,4,3), (0,5,0,5,0,3,0,2,0,4,4,3,5,2,4,3,3,3,4,4,4,3,5,3,5,3,3,1,4,0,4,3,3,0,3,3,0,4,4,4,4,5,4,3,3,5,5,3,2,3,1,2,3,2,0,1,0,0,3,2,2,4,4,3,1,5,0,4,0,3,0,4,3,1,3,2,1,0,3,3,0,3,3), (0,4,0,5,0,5,0,4,0,4,5,5,5,3,4,3,3,2,5,4,4,3,5,3,5,3,4,0,4,3,4,4,3,2,4,4,3,4,5,4,4,5,5,0,3,5,5,4,1,3,3,2,3,3,1,3,1,0,4,3,1,4,4,3,4,5,0,4,0,2,0,4,3,4,4,3,3,0,4,0,0,5,5), (0,4,0,4,0,5,0,1,1,3,3,4,4,3,4,1,3,0,5,1,3,0,3,1,3,1,1,0,3,0,3,3,4,0,4,3,0,4,4,4,3,4,4,0,3,5,4,1,0,3,0,0,2,3,0,3,1,0,3,1,0,3,2,1,3,5,0,3,0,1,0,3,2,3,3,4,4,0,2,2,0,4,4), (2,4,0,5,0,4,0,3,0,4,5,5,4,3,5,3,5,3,5,3,5,2,5,3,4,3,3,4,3,4,5,3,2,1,5,4,3,2,3,4,5,3,4,1,2,5,4,3,0,3,3,0,3,2,0,2,3,0,4,1,0,3,4,3,3,5,0,3,0,1,0,4,5,5,5,4,3,0,4,2,0,3,5), (0,5,0,4,0,4,0,2,0,5,4,3,4,3,4,3,3,3,4,3,4,2,5,3,5,3,4,1,4,3,4,4,4,0,3,5,0,4,4,4,4,5,3,1,3,4,5,3,3,3,3,3,3,3,0,2,2,0,3,3,2,4,3,3,3,5,3,4,1,3,3,5,3,2,0,0,0,0,4,3,1,3,3), (0,1,0,3,0,3,0,1,0,1,3,3,3,2,3,3,3,0,3,0,0,0,3,1,3,0,0,0,2,2,2,3,0,0,3,2,0,1,2,4,1,3,3,0,0,3,3,3,0,1,0,0,2,1,0,0,3,0,3,1,0,3,0,0,1,3,0,2,0,1,0,3,3,1,3,3,0,0,1,1,0,3,3), (0,2,0,3,0,2,1,4,0,2,2,3,1,1,3,1,1,0,2,0,3,1,2,3,1,3,0,0,1,0,4,3,2,3,3,3,1,4,2,3,3,3,3,1,0,3,1,4,0,1,1,0,1,2,0,1,1,0,1,1,0,3,1,3,2,2,0,1,0,0,0,2,3,3,3,1,0,0,0,0,0,2,3), (0,5,0,4,0,5,0,2,0,4,5,5,3,3,4,3,3,1,5,4,4,2,4,4,4,3,4,2,4,3,5,5,4,3,3,4,3,3,5,5,4,5,5,1,3,4,5,3,1,4,3,1,3,3,0,3,3,1,4,3,1,4,5,3,3,5,0,4,0,3,0,5,3,3,1,4,3,0,4,0,1,5,3), (0,5,0,5,0,4,0,2,0,4,4,3,4,3,3,3,3,3,5,4,4,4,4,4,4,5,3,3,5,2,4,4,4,3,4,4,3,3,4,4,5,5,3,3,4,3,4,3,3,4,3,3,3,3,1,2,2,1,4,3,3,5,4,4,3,4,0,4,0,3,0,4,4,4,4,4,1,0,4,2,0,2,4), (0,4,0,4,0,3,0,1,0,3,5,2,3,0,3,0,2,1,4,2,3,3,4,1,4,3,3,2,4,1,3,3,3,0,3,3,0,0,3,3,3,5,3,3,3,3,3,2,0,2,0,0,2,0,0,2,0,0,1,0,0,3,1,2,2,3,0,3,0,2,0,4,4,3,3,4,1,0,3,0,0,2,4), (0,0,0,4,0,0,0,0,0,0,1,0,1,0,2,0,0,0,0,0,1,0,2,0,1,0,0,0,0,0,3,1,3,0,3,2,0,0,0,1,0,3,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,0,2,0,0,0,0,0,0,2), (0,2,1,3,0,2,0,2,0,3,3,3,3,1,3,1,3,3,3,3,3,3,4,2,2,1,2,1,4,0,4,3,1,3,3,3,2,4,3,5,4,3,3,3,3,3,3,3,0,1,3,0,2,0,0,1,0,0,1,0,0,4,2,0,2,3,0,3,3,0,3,3,4,2,3,1,4,0,1,2,0,2,3), (0,3,0,3,0,1,0,3,0,2,3,3,3,0,3,1,2,0,3,3,2,3,3,2,3,2,3,1,3,0,4,3,2,0,3,3,1,4,3,3,2,3,4,3,1,3,3,1,1,0,1,1,0,1,0,1,0,1,0,0,0,4,1,1,0,3,0,3,1,0,2,3,3,3,3,3,1,0,0,2,0,3,3), (0,0,0,0,0,0,0,0,0,0,3,0,2,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,3,0,3,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,2,3,0,0,0,0,0,0,0,0,3), (0,2,0,3,1,3,0,3,0,2,3,3,3,1,3,1,3,1,3,1,3,3,3,1,3,0,2,3,1,1,4,3,3,2,3,3,1,2,2,4,1,3,3,0,1,4,2,3,0,1,3,0,3,0,0,1,3,0,2,0,0,3,3,2,1,3,0,3,0,2,0,3,4,4,4,3,1,0,3,0,0,3,3), (0,2,0,1,0,2,0,0,0,1,3,2,2,1,3,0,1,1,3,0,3,2,3,1,2,0,2,0,1,1,3,3,3,0,3,3,1,1,2,3,2,3,3,1,2,3,2,0,0,1,0,0,0,0,0,0,3,0,1,0,0,2,1,2,1,3,0,3,0,0,0,3,4,4,4,3,2,0,2,0,0,2,4), (0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,3,1,0,0,0,0,0,0,0,3), (0,3,0,3,0,2,0,3,0,3,3,3,2,3,2,2,2,0,3,1,3,3,3,2,3,3,0,0,3,0,3,2,2,0,2,3,1,4,3,4,3,3,2,3,1,5,4,4,0,3,1,2,1,3,0,3,1,1,2,0,2,3,1,3,1,3,0,3,0,1,0,3,3,4,4,2,1,0,2,1,0,2,4), (0,1,0,3,0,1,0,2,0,1,4,2,5,1,4,0,2,0,2,1,3,1,4,0,2,1,0,0,2,1,4,1,1,0,3,3,0,5,1,3,2,3,3,1,0,3,2,3,0,1,0,0,0,0,0,0,1,0,0,0,0,4,0,1,0,3,0,2,0,1,0,3,3,3,4,3,3,0,0,0,0,2,3), (0,0,0,1,0,0,0,0,0,0,2,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,1,0,0,0,0,0,3), (0,1,0,3,0,4,0,3,0,2,4,3,1,0,3,2,2,1,3,1,2,2,3,1,1,1,2,1,3,0,1,2,0,1,3,2,1,3,0,5,5,1,0,0,1,3,2,1,0,3,0,0,1,0,0,0,0,0,3,4,0,1,1,1,3,2,0,2,0,1,0,2,3,3,1,2,3,0,1,0,1,0,4), (0,0,0,1,0,3,0,3,0,2,2,1,0,0,4,0,3,0,3,1,3,0,3,0,3,0,1,0,3,0,3,1,3,0,3,3,0,0,1,2,1,1,1,0,1,2,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,2,2,1,2,0,0,2,0,0,0,0,2,3,3,3,3,0,0,0,0,1,4), (0,0,0,3,0,3,0,0,0,0,3,1,1,0,3,0,1,0,2,0,1,0,0,0,0,0,0,0,1,0,3,0,2,0,2,3,0,0,2,2,3,1,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,2,3), (2,4,0,5,0,5,0,4,0,3,4,3,3,3,4,3,3,3,4,3,4,4,5,4,5,5,5,2,3,0,5,5,4,1,5,4,3,1,5,4,3,4,4,3,3,4,3,3,0,3,2,0,2,3,0,3,0,0,3,3,0,5,3,2,3,3,0,3,0,3,0,3,4,5,4,5,3,0,4,3,0,3,4), (0,3,0,3,0,3,0,3,0,3,3,4,3,2,3,2,3,0,4,3,3,3,3,3,3,3,3,0,3,2,4,3,3,1,3,4,3,4,4,4,3,4,4,3,2,4,4,1,0,2,0,0,1,1,0,2,0,0,3,1,0,5,3,2,1,3,0,3,0,1,2,4,3,2,4,3,3,0,3,2,0,4,4), (0,3,0,3,0,1,0,0,0,1,4,3,3,2,3,1,3,1,4,2,3,2,4,2,3,4,3,0,2,2,3,3,3,0,3,3,3,0,3,4,1,3,3,0,3,4,3,3,0,1,1,0,1,0,0,0,4,0,3,0,0,3,1,2,1,3,0,4,0,1,0,4,3,3,4,3,3,0,2,0,0,3,3), (0,3,0,4,0,1,0,3,0,3,4,3,3,0,3,3,3,1,3,1,3,3,4,3,3,3,0,0,3,1,5,3,3,1,3,3,2,5,4,3,3,4,5,3,2,5,3,4,0,1,0,0,0,0,0,2,0,0,1,1,0,4,2,2,1,3,0,3,0,2,0,4,4,3,5,3,2,0,1,1,0,3,4), (0,5,0,4,0,5,0,2,0,4,4,3,3,2,3,3,3,1,4,3,4,1,5,3,4,3,4,0,4,2,4,3,4,1,5,4,0,4,4,4,4,5,4,1,3,5,4,2,1,4,1,1,3,2,0,3,1,0,3,2,1,4,3,3,3,4,0,4,0,3,0,4,4,4,3,3,3,0,4,2,0,3,4), (1,4,0,4,0,3,0,1,0,3,3,3,1,1,3,3,2,2,3,3,1,0,3,2,2,1,2,0,3,1,2,1,2,0,3,2,0,2,2,3,3,4,3,0,3,3,1,2,0,1,1,3,1,2,0,0,3,0,1,1,0,3,2,2,3,3,0,3,0,0,0,2,3,3,4,3,3,0,1,0,0,1,4), (0,4,0,4,0,4,0,0,0,3,4,4,3,1,4,2,3,2,3,3,3,1,4,3,4,0,3,0,4,2,3,3,2,2,5,4,2,1,3,4,3,4,3,1,3,3,4,2,0,2,1,0,3,3,0,0,2,0,3,1,0,4,4,3,4,3,0,4,0,1,0,2,4,4,4,4,4,0,3,2,0,3,3), (0,0,0,1,0,4,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,3,2,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,2), (0,2,0,3,0,4,0,4,0,1,3,3,3,0,4,0,2,1,2,1,1,1,2,0,3,1,1,0,1,0,3,1,0,0,3,3,2,0,1,1,0,0,0,0,0,1,0,2,0,2,2,0,3,1,0,0,1,0,1,1,0,1,2,0,3,0,0,0,0,1,0,0,3,3,4,3,1,0,1,0,3,0,2), (0,0,0,3,0,5,0,0,0,0,1,0,2,0,3,1,0,1,3,0,0,0,2,0,0,0,1,0,0,0,1,1,0,0,4,0,0,0,2,3,0,1,4,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,3,0,0,0,0,0,3), (0,2,0,5,0,5,0,1,0,2,4,3,3,2,5,1,3,2,3,3,3,0,4,1,2,0,3,0,4,0,2,2,1,1,5,3,0,0,1,4,2,3,2,0,3,3,3,2,0,2,4,1,1,2,0,1,1,0,3,1,0,1,3,1,2,3,0,2,0,0,0,1,3,5,4,4,4,0,3,0,0,1,3), (0,4,0,5,0,4,0,4,0,4,5,4,3,3,4,3,3,3,4,3,4,4,5,3,4,5,4,2,4,2,3,4,3,1,4,4,1,3,5,4,4,5,5,4,4,5,5,5,2,3,3,1,4,3,1,3,3,0,3,3,1,4,3,4,4,4,0,3,0,4,0,3,3,4,4,5,0,0,4,3,0,4,5), (0,4,0,4,0,3,0,3,0,3,4,4,4,3,3,2,4,3,4,3,4,3,5,3,4,3,2,1,4,2,4,4,3,1,3,4,2,4,5,5,3,4,5,4,1,5,4,3,0,3,2,2,3,2,1,3,1,0,3,3,3,5,3,3,3,5,4,4,2,3,3,4,3,3,3,2,1,0,3,2,1,4,3), (0,4,0,5,0,4,0,3,0,3,5,5,3,2,4,3,4,0,5,4,4,1,4,4,4,3,3,3,4,3,5,5,2,3,3,4,1,2,5,5,3,5,5,2,3,5,5,4,0,3,2,0,3,3,1,1,5,1,4,1,0,4,3,2,3,5,0,4,0,3,0,5,4,3,4,3,0,0,4,1,0,4,4), (1,3,0,4,0,2,0,2,0,2,5,5,3,3,3,3,3,0,4,2,3,4,4,4,3,4,0,0,3,4,5,4,3,3,3,3,2,5,5,4,5,5,5,4,3,5,5,5,1,3,1,0,1,0,0,3,2,0,4,2,0,5,2,3,2,4,1,3,0,3,0,4,5,4,5,4,3,0,4,2,0,5,4), (0,3,0,4,0,5,0,3,0,3,4,4,3,2,3,2,3,3,3,3,3,2,4,3,3,2,2,0,3,3,3,3,3,1,3,3,3,0,4,4,3,4,4,1,1,4,4,2,0,3,1,0,1,1,0,4,1,0,2,3,1,3,3,1,3,4,0,3,0,1,0,3,1,3,0,0,1,0,2,0,0,4,4), (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), (0,3,0,3,0,2,0,3,0,1,5,4,3,3,3,1,4,2,1,2,3,4,4,2,4,4,5,0,3,1,4,3,4,0,4,3,3,3,2,3,2,5,3,4,3,2,2,3,0,0,3,0,2,1,0,1,2,0,0,0,0,2,1,1,3,1,0,2,0,4,0,3,4,4,4,5,2,0,2,0,0,1,3), (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,4,2,1,1,0,1,0,3,2,0,0,3,1,1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,2,0,0,0,1,4,0,4,2,1,0,0,0,0,0,1), (0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,3,1,0,0,0,2,0,2,1,0,0,1,2,1,0,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,0,0,2), (0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0,4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3), (0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1), ) class JapaneseContextAnalysis(object): NUM_OF_CATEGORY = 6 DONT_KNOW = -1 ENOUGH_REL_THRESHOLD = 100 MAX_REL_THRESHOLD = 1000 MINIMUM_DATA_THRESHOLD = 4 def __init__(self): self._total_rel = None self._rel_sample = None self._need_to_skip_char_num = None self._last_char_order = None self._done = None self.reset() def reset(self): self._total_rel = 0 # total sequence received # category counters, each integer counts sequence in its category self._rel_sample = [0] * self.NUM_OF_CATEGORY # if last byte in current buffer is not the last byte of a character, # we need to know how many bytes to skip in next buffer self._need_to_skip_char_num = 0 self._last_char_order = -1 # The order of previous char # If this flag is set to True, detection is done and conclusion has # been made self._done = False def feed(self, byte_str, num_bytes): if self._done: return # The buffer we got is byte oriented, and a character may span in more than one # buffers. In case the last one or two byte in last buffer is not # complete, we record how many byte needed to complete that character # and skip these bytes here. We can choose to record those bytes as # well and analyse the character once it is complete, but since a # character will not make much difference, by simply skipping # this character will simply our logic and improve performance. i = self._need_to_skip_char_num while i < num_bytes: order, char_len = self.get_order(byte_str[i:i + 2]) i += char_len if i > num_bytes: self._need_to_skip_char_num = i - num_bytes self._last_char_order = -1 else: if (order != -1) and (self._last_char_order != -1): self._total_rel += 1 if self._total_rel > self.MAX_REL_THRESHOLD: self._done = True break self._rel_sample[jp2CharContext[self._last_char_order][order]] += 1 self._last_char_order = order def got_enough_data(self): return self._total_rel > self.ENOUGH_REL_THRESHOLD def get_confidence(self): # This is just one way to calculate confidence. It works well for me. if self._total_rel > self.MINIMUM_DATA_THRESHOLD: return (self._total_rel - self._rel_sample[0]) / self._total_rel else: return self.DONT_KNOW def get_order(self, byte_str): return -1, 1 class SJISContextAnalysis(JapaneseContextAnalysis): def __init__(self): super(SJISContextAnalysis, self).__init__() self._charset_name = "SHIFT_JIS" @property def charset_name(self): return self._charset_name def get_order(self, byte_str): if not byte_str: return -1, 1 # find out current char's byte length first_char = byte_str[0] if (0x81 <= first_char <= 0x9F) or (0xE0 <= first_char <= 0xFC): char_len = 2 if (first_char == 0x87) or (0xFA <= first_char <= 0xFC): self._charset_name = "CP932" else: char_len = 1 # return its order if it is hiragana if len(byte_str) > 1: second_char = byte_str[1] if (first_char == 202) and (0x9F <= second_char <= 0xF1): return second_char - 0x9F, char_len return -1, char_len class EUCJPContextAnalysis(JapaneseContextAnalysis): def get_order(self, byte_str): if not byte_str: return -1, 1 # find out current char's byte length first_char = byte_str[0] if (first_char == 0x8E) or (0xA1 <= first_char <= 0xFE): char_len = 2 elif first_char == 0x8F: char_len = 3 else: char_len = 1 # return its order if it is hiragana if len(byte_str) > 1: second_char = byte_str[1] if (first_char == 0xA4) and (0xA1 <= second_char <= 0xF3): return second_char - 0xA1, char_len return -1, char_len PKd]IՅ{{chardet/euctwfreq.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # EUCTW frequency table # Converted from big5 work # by Taiwan's Mandarin Promotion Council # # 128 --> 0.42261 # 256 --> 0.57851 # 512 --> 0.74851 # 1024 --> 0.89384 # 2048 --> 0.97583 # # Idea Distribution Ratio = 0.74851/(1-0.74851) =2.98 # Random Distribution Ration = 512/(5401-512)=0.105 # # Typical Distribution Ratio about 25% of Ideal one, still much higher than RDR EUCTW_TYPICAL_DISTRIBUTION_RATIO = 0.75 # Char to FreqOrder table , EUCTW_TABLE_SIZE = 5376 EUCTW_CHAR_TO_FREQ_ORDER = ( 1,1800,1506, 255,1431, 198, 9, 82, 6,7310, 177, 202,3615,1256,2808, 110, # 2742 3735, 33,3241, 261, 76, 44,2113, 16,2931,2184,1176, 659,3868, 26,3404,2643, # 2758 1198,3869,3313,4060, 410,2211, 302, 590, 361,1963, 8, 204, 58,4296,7311,1931, # 2774 63,7312,7313, 317,1614, 75, 222, 159,4061,2412,1480,7314,3500,3068, 224,2809, # 2790 3616, 3, 10,3870,1471, 29,2774,1135,2852,1939, 873, 130,3242,1123, 312,7315, # 2806 4297,2051, 507, 252, 682,7316, 142,1914, 124, 206,2932, 34,3501,3173, 64, 604, # 2822 7317,2494,1976,1977, 155,1990, 645, 641,1606,7318,3405, 337, 72, 406,7319, 80, # 2838 630, 238,3174,1509, 263, 939,1092,2644, 756,1440,1094,3406, 449, 69,2969, 591, # 2854 179,2095, 471, 115,2034,1843, 60, 50,2970, 134, 806,1868, 734,2035,3407, 180, # 2870 995,1607, 156, 537,2893, 688,7320, 319,1305, 779,2144, 514,2374, 298,4298, 359, # 2886 2495, 90,2707,1338, 663, 11, 906,1099,2545, 20,2436, 182, 532,1716,7321, 732, # 2902 1376,4062,1311,1420,3175, 25,2312,1056, 113, 399, 382,1949, 242,3408,2467, 529, # 2918 3243, 475,1447,3617,7322, 117, 21, 656, 810,1297,2295,2329,3502,7323, 126,4063, # 2934 706, 456, 150, 613,4299, 71,1118,2036,4064, 145,3069, 85, 835, 486,2114,1246, # 2950 1426, 428, 727,1285,1015, 800, 106, 623, 303,1281,7324,2127,2354, 347,3736, 221, # 2966 3503,3110,7325,1955,1153,4065, 83, 296,1199,3070, 192, 624, 93,7326, 822,1897, # 2982 2810,3111, 795,2064, 991,1554,1542,1592, 27, 43,2853, 859, 139,1456, 860,4300, # 2998 437, 712,3871, 164,2392,3112, 695, 211,3017,2096, 195,3872,1608,3504,3505,3618, # 3014 3873, 234, 811,2971,2097,3874,2229,1441,3506,1615,2375, 668,2076,1638, 305, 228, # 3030 1664,4301, 467, 415,7327, 262,2098,1593, 239, 108, 300, 200,1033, 512,1247,2077, # 3046 7328,7329,2173,3176,3619,2673, 593, 845,1062,3244, 88,1723,2037,3875,1950, 212, # 3062 266, 152, 149, 468,1898,4066,4302, 77, 187,7330,3018, 37, 5,2972,7331,3876, # 3078 7332,7333, 39,2517,4303,2894,3177,2078, 55, 148, 74,4304, 545, 483,1474,1029, # 3094 1665, 217,1869,1531,3113,1104,2645,4067, 24, 172,3507, 900,3877,3508,3509,4305, # 3110 32,1408,2811,1312, 329, 487,2355,2247,2708, 784,2674, 4,3019,3314,1427,1788, # 3126 188, 109, 499,7334,3620,1717,1789, 888,1217,3020,4306,7335,3510,7336,3315,1520, # 3142 3621,3878, 196,1034, 775,7337,7338, 929,1815, 249, 439, 38,7339,1063,7340, 794, # 3158 3879,1435,2296, 46, 178,3245,2065,7341,2376,7342, 214,1709,4307, 804, 35, 707, # 3174 324,3622,1601,2546, 140, 459,4068,7343,7344,1365, 839, 272, 978,2257,2572,3409, # 3190 2128,1363,3623,1423, 697, 100,3071, 48, 70,1231, 495,3114,2193,7345,1294,7346, # 3206 2079, 462, 586,1042,3246, 853, 256, 988, 185,2377,3410,1698, 434,1084,7347,3411, # 3222 314,2615,2775,4308,2330,2331, 569,2280, 637,1816,2518, 757,1162,1878,1616,3412, # 3238 287,1577,2115, 768,4309,1671,2854,3511,2519,1321,3737, 909,2413,7348,4069, 933, # 3254 3738,7349,2052,2356,1222,4310, 765,2414,1322, 786,4311,7350,1919,1462,1677,2895, # 3270 1699,7351,4312,1424,2437,3115,3624,2590,3316,1774,1940,3413,3880,4070, 309,1369, # 3286 1130,2812, 364,2230,1653,1299,3881,3512,3882,3883,2646, 525,1085,3021, 902,2000, # 3302 1475, 964,4313, 421,1844,1415,1057,2281, 940,1364,3116, 376,4314,4315,1381, 7, # 3318 2520, 983,2378, 336,1710,2675,1845, 321,3414, 559,1131,3022,2742,1808,1132,1313, # 3334 265,1481,1857,7352, 352,1203,2813,3247, 167,1089, 420,2814, 776, 792,1724,3513, # 3350 4071,2438,3248,7353,4072,7354, 446, 229, 333,2743, 901,3739,1200,1557,4316,2647, # 3366 1920, 395,2744,2676,3740,4073,1835, 125, 916,3178,2616,4317,7355,7356,3741,7357, # 3382 7358,7359,4318,3117,3625,1133,2547,1757,3415,1510,2313,1409,3514,7360,2145, 438, # 3398 2591,2896,2379,3317,1068, 958,3023, 461, 311,2855,2677,4074,1915,3179,4075,1978, # 3414 383, 750,2745,2617,4076, 274, 539, 385,1278,1442,7361,1154,1964, 384, 561, 210, # 3430 98,1295,2548,3515,7362,1711,2415,1482,3416,3884,2897,1257, 129,7363,3742, 642, # 3446 523,2776,2777,2648,7364, 141,2231,1333, 68, 176, 441, 876, 907,4077, 603,2592, # 3462 710, 171,3417, 404, 549, 18,3118,2393,1410,3626,1666,7365,3516,4319,2898,4320, # 3478 7366,2973, 368,7367, 146, 366, 99, 871,3627,1543, 748, 807,1586,1185, 22,2258, # 3494 379,3743,3180,7368,3181, 505,1941,2618,1991,1382,2314,7369, 380,2357, 218, 702, # 3510 1817,1248,3418,3024,3517,3318,3249,7370,2974,3628, 930,3250,3744,7371, 59,7372, # 3526 585, 601,4078, 497,3419,1112,1314,4321,1801,7373,1223,1472,2174,7374, 749,1836, # 3542 690,1899,3745,1772,3885,1476, 429,1043,1790,2232,2116, 917,4079, 447,1086,1629, # 3558 7375, 556,7376,7377,2020,1654, 844,1090, 105, 550, 966,1758,2815,1008,1782, 686, # 3574 1095,7378,2282, 793,1602,7379,3518,2593,4322,4080,2933,2297,4323,3746, 980,2496, # 3590 544, 353, 527,4324, 908,2678,2899,7380, 381,2619,1942,1348,7381,1341,1252, 560, # 3606 3072,7382,3420,2856,7383,2053, 973, 886,2080, 143,4325,7384,7385, 157,3886, 496, # 3622 4081, 57, 840, 540,2038,4326,4327,3421,2117,1445, 970,2259,1748,1965,2081,4082, # 3638 3119,1234,1775,3251,2816,3629, 773,1206,2129,1066,2039,1326,3887,1738,1725,4083, # 3654 279,3120, 51,1544,2594, 423,1578,2130,2066, 173,4328,1879,7386,7387,1583, 264, # 3670 610,3630,4329,2439, 280, 154,7388,7389,7390,1739, 338,1282,3073, 693,2857,1411, # 3686 1074,3747,2440,7391,4330,7392,7393,1240, 952,2394,7394,2900,1538,2679, 685,1483, # 3702 4084,2468,1436, 953,4085,2054,4331, 671,2395, 79,4086,2441,3252, 608, 567,2680, # 3718 3422,4087,4088,1691, 393,1261,1791,2396,7395,4332,7396,7397,7398,7399,1383,1672, # 3734 3748,3182,1464, 522,1119, 661,1150, 216, 675,4333,3888,1432,3519, 609,4334,2681, # 3750 2397,7400,7401,7402,4089,3025, 0,7403,2469, 315, 231,2442, 301,3319,4335,2380, # 3766 7404, 233,4090,3631,1818,4336,4337,7405, 96,1776,1315,2082,7406, 257,7407,1809, # 3782 3632,2709,1139,1819,4091,2021,1124,2163,2778,1777,2649,7408,3074, 363,1655,3183, # 3798 7409,2975,7410,7411,7412,3889,1567,3890, 718, 103,3184, 849,1443, 341,3320,2934, # 3814 1484,7413,1712, 127, 67, 339,4092,2398, 679,1412, 821,7414,7415, 834, 738, 351, # 3830 2976,2146, 846, 235,1497,1880, 418,1992,3749,2710, 186,1100,2147,2746,3520,1545, # 3846 1355,2935,2858,1377, 583,3891,4093,2573,2977,7416,1298,3633,1078,2549,3634,2358, # 3862 78,3750,3751, 267,1289,2099,2001,1594,4094, 348, 369,1274,2194,2175,1837,4338, # 3878 1820,2817,3635,2747,2283,2002,4339,2936,2748, 144,3321, 882,4340,3892,2749,3423, # 3894 4341,2901,7417,4095,1726, 320,7418,3893,3026, 788,2978,7419,2818,1773,1327,2859, # 3910 3894,2819,7420,1306,4342,2003,1700,3752,3521,2359,2650, 787,2022, 506, 824,3636, # 3926 534, 323,4343,1044,3322,2023,1900, 946,3424,7421,1778,1500,1678,7422,1881,4344, # 3942 165, 243,4345,3637,2521, 123, 683,4096, 764,4346, 36,3895,1792, 589,2902, 816, # 3958 626,1667,3027,2233,1639,1555,1622,3753,3896,7423,3897,2860,1370,1228,1932, 891, # 3974 2083,2903, 304,4097,7424, 292,2979,2711,3522, 691,2100,4098,1115,4347, 118, 662, # 3990 7425, 611,1156, 854,2381,1316,2861, 2, 386, 515,2904,7426,7427,3253, 868,2234, # 4006 1486, 855,2651, 785,2212,3028,7428,1040,3185,3523,7429,3121, 448,7430,1525,7431, # 4022 2164,4348,7432,3754,7433,4099,2820,3524,3122, 503, 818,3898,3123,1568, 814, 676, # 4038 1444, 306,1749,7434,3755,1416,1030, 197,1428, 805,2821,1501,4349,7435,7436,7437, # 4054 1993,7438,4350,7439,7440,2195, 13,2779,3638,2980,3124,1229,1916,7441,3756,2131, # 4070 7442,4100,4351,2399,3525,7443,2213,1511,1727,1120,7444,7445, 646,3757,2443, 307, # 4086 7446,7447,1595,3186,7448,7449,7450,3639,1113,1356,3899,1465,2522,2523,7451, 519, # 4102 7452, 128,2132, 92,2284,1979,7453,3900,1512, 342,3125,2196,7454,2780,2214,1980, # 4118 3323,7455, 290,1656,1317, 789, 827,2360,7456,3758,4352, 562, 581,3901,7457, 401, # 4134 4353,2248, 94,4354,1399,2781,7458,1463,2024,4355,3187,1943,7459, 828,1105,4101, # 4150 1262,1394,7460,4102, 605,4356,7461,1783,2862,7462,2822, 819,2101, 578,2197,2937, # 4166 7463,1502, 436,3254,4103,3255,2823,3902,2905,3425,3426,7464,2712,2315,7465,7466, # 4182 2332,2067, 23,4357, 193, 826,3759,2102, 699,1630,4104,3075, 390,1793,1064,3526, # 4198 7467,1579,3076,3077,1400,7468,4105,1838,1640,2863,7469,4358,4359, 137,4106, 598, # 4214 3078,1966, 780, 104, 974,2938,7470, 278, 899, 253, 402, 572, 504, 493,1339,7471, # 4230 3903,1275,4360,2574,2550,7472,3640,3029,3079,2249, 565,1334,2713, 863, 41,7473, # 4246 7474,4361,7475,1657,2333, 19, 463,2750,4107, 606,7476,2981,3256,1087,2084,1323, # 4262 2652,2982,7477,1631,1623,1750,4108,2682,7478,2864, 791,2714,2653,2334, 232,2416, # 4278 7479,2983,1498,7480,2654,2620, 755,1366,3641,3257,3126,2025,1609, 119,1917,3427, # 4294 862,1026,4109,7481,3904,3760,4362,3905,4363,2260,1951,2470,7482,1125, 817,4110, # 4310 4111,3906,1513,1766,2040,1487,4112,3030,3258,2824,3761,3127,7483,7484,1507,7485, # 4326 2683, 733, 40,1632,1106,2865, 345,4113, 841,2524, 230,4364,2984,1846,3259,3428, # 4342 7486,1263, 986,3429,7487, 735, 879, 254,1137, 857, 622,1300,1180,1388,1562,3907, # 4358 3908,2939, 967,2751,2655,1349, 592,2133,1692,3324,2985,1994,4114,1679,3909,1901, # 4374 2185,7488, 739,3642,2715,1296,1290,7489,4115,2198,2199,1921,1563,2595,2551,1870, # 4390 2752,2986,7490, 435,7491, 343,1108, 596, 17,1751,4365,2235,3430,3643,7492,4366, # 4406 294,3527,2940,1693, 477, 979, 281,2041,3528, 643,2042,3644,2621,2782,2261,1031, # 4422 2335,2134,2298,3529,4367, 367,1249,2552,7493,3530,7494,4368,1283,3325,2004, 240, # 4438 1762,3326,4369,4370, 836,1069,3128, 474,7495,2148,2525, 268,3531,7496,3188,1521, # 4454 1284,7497,1658,1546,4116,7498,3532,3533,7499,4117,3327,2684,1685,4118, 961,1673, # 4470 2622, 190,2005,2200,3762,4371,4372,7500, 570,2497,3645,1490,7501,4373,2623,3260, # 4486 1956,4374, 584,1514, 396,1045,1944,7502,4375,1967,2444,7503,7504,4376,3910, 619, # 4502 7505,3129,3261, 215,2006,2783,2553,3189,4377,3190,4378, 763,4119,3763,4379,7506, # 4518 7507,1957,1767,2941,3328,3646,1174, 452,1477,4380,3329,3130,7508,2825,1253,2382, # 4534 2186,1091,2285,4120, 492,7509, 638,1169,1824,2135,1752,3911, 648, 926,1021,1324, # 4550 4381, 520,4382, 997, 847,1007, 892,4383,3764,2262,1871,3647,7510,2400,1784,4384, # 4566 1952,2942,3080,3191,1728,4121,2043,3648,4385,2007,1701,3131,1551, 30,2263,4122, # 4582 7511,2026,4386,3534,7512, 501,7513,4123, 594,3431,2165,1821,3535,3432,3536,3192, # 4598 829,2826,4124,7514,1680,3132,1225,4125,7515,3262,4387,4126,3133,2336,7516,4388, # 4614 4127,7517,3912,3913,7518,1847,2383,2596,3330,7519,4389, 374,3914, 652,4128,4129, # 4630 375,1140, 798,7520,7521,7522,2361,4390,2264, 546,1659, 138,3031,2445,4391,7523, # 4646 2250, 612,1848, 910, 796,3765,1740,1371, 825,3766,3767,7524,2906,2554,7525, 692, # 4662 444,3032,2624, 801,4392,4130,7526,1491, 244,1053,3033,4131,4132, 340,7527,3915, # 4678 1041,2987, 293,1168, 87,1357,7528,1539, 959,7529,2236, 721, 694,4133,3768, 219, # 4694 1478, 644,1417,3331,2656,1413,1401,1335,1389,3916,7530,7531,2988,2362,3134,1825, # 4710 730,1515, 184,2827, 66,4393,7532,1660,2943, 246,3332, 378,1457, 226,3433, 975, # 4726 3917,2944,1264,3537, 674, 696,7533, 163,7534,1141,2417,2166, 713,3538,3333,4394, # 4742 3918,7535,7536,1186, 15,7537,1079,1070,7538,1522,3193,3539, 276,1050,2716, 758, # 4758 1126, 653,2945,3263,7539,2337, 889,3540,3919,3081,2989, 903,1250,4395,3920,3434, # 4774 3541,1342,1681,1718, 766,3264, 286, 89,2946,3649,7540,1713,7541,2597,3334,2990, # 4790 7542,2947,2215,3194,2866,7543,4396,2498,2526, 181, 387,1075,3921, 731,2187,3335, # 4806 7544,3265, 310, 313,3435,2299, 770,4134, 54,3034, 189,4397,3082,3769,3922,7545, # 4822 1230,1617,1849, 355,3542,4135,4398,3336, 111,4136,3650,1350,3135,3436,3035,4137, # 4838 2149,3266,3543,7546,2784,3923,3924,2991, 722,2008,7547,1071, 247,1207,2338,2471, # 4854 1378,4399,2009, 864,1437,1214,4400, 373,3770,1142,2216, 667,4401, 442,2753,2555, # 4870 3771,3925,1968,4138,3267,1839, 837, 170,1107, 934,1336,1882,7548,7549,2118,4139, # 4886 2828, 743,1569,7550,4402,4140, 582,2384,1418,3437,7551,1802,7552, 357,1395,1729, # 4902 3651,3268,2418,1564,2237,7553,3083,3772,1633,4403,1114,2085,4141,1532,7554, 482, # 4918 2446,4404,7555,7556,1492, 833,1466,7557,2717,3544,1641,2829,7558,1526,1272,3652, # 4934 4142,1686,1794, 416,2556,1902,1953,1803,7559,3773,2785,3774,1159,2316,7560,2867, # 4950 4405,1610,1584,3036,2419,2754, 443,3269,1163,3136,7561,7562,3926,7563,4143,2499, # 4966 3037,4406,3927,3137,2103,1647,3545,2010,1872,4144,7564,4145, 431,3438,7565, 250, # 4982 97, 81,4146,7566,1648,1850,1558, 160, 848,7567, 866, 740,1694,7568,2201,2830, # 4998 3195,4147,4407,3653,1687, 950,2472, 426, 469,3196,3654,3655,3928,7569,7570,1188, # 5014 424,1995, 861,3546,4148,3775,2202,2685, 168,1235,3547,4149,7571,2086,1674,4408, # 5030 3337,3270, 220,2557,1009,7572,3776, 670,2992, 332,1208, 717,7573,7574,3548,2447, # 5046 3929,3338,7575, 513,7576,1209,2868,3339,3138,4409,1080,7577,7578,7579,7580,2527, # 5062 3656,3549, 815,1587,3930,3931,7581,3550,3439,3777,1254,4410,1328,3038,1390,3932, # 5078 1741,3933,3778,3934,7582, 236,3779,2448,3271,7583,7584,3657,3780,1273,3781,4411, # 5094 7585, 308,7586,4412, 245,4413,1851,2473,1307,2575, 430, 715,2136,2449,7587, 270, # 5110 199,2869,3935,7588,3551,2718,1753, 761,1754, 725,1661,1840,4414,3440,3658,7589, # 5126 7590, 587, 14,3272, 227,2598, 326, 480,2265, 943,2755,3552, 291, 650,1883,7591, # 5142 1702,1226, 102,1547, 62,3441, 904,4415,3442,1164,4150,7592,7593,1224,1548,2756, # 5158 391, 498,1493,7594,1386,1419,7595,2055,1177,4416, 813, 880,1081,2363, 566,1145, # 5174 4417,2286,1001,1035,2558,2599,2238, 394,1286,7596,7597,2068,7598, 86,1494,1730, # 5190 3936, 491,1588, 745, 897,2948, 843,3340,3937,2757,2870,3273,1768, 998,2217,2069, # 5206 397,1826,1195,1969,3659,2993,3341, 284,7599,3782,2500,2137,2119,1903,7600,3938, # 5222 2150,3939,4151,1036,3443,1904, 114,2559,4152, 209,1527,7601,7602,2949,2831,2625, # 5238 2385,2719,3139, 812,2560,7603,3274,7604,1559, 737,1884,3660,1210, 885, 28,2686, # 5254 3553,3783,7605,4153,1004,1779,4418,7606, 346,1981,2218,2687,4419,3784,1742, 797, # 5270 1642,3940,1933,1072,1384,2151, 896,3941,3275,3661,3197,2871,3554,7607,2561,1958, # 5286 4420,2450,1785,7608,7609,7610,3942,4154,1005,1308,3662,4155,2720,4421,4422,1528, # 5302 2600, 161,1178,4156,1982, 987,4423,1101,4157, 631,3943,1157,3198,2420,1343,1241, # 5318 1016,2239,2562, 372, 877,2339,2501,1160, 555,1934, 911,3944,7611, 466,1170, 169, # 5334 1051,2907,2688,3663,2474,2994,1182,2011,2563,1251,2626,7612, 992,2340,3444,1540, # 5350 2721,1201,2070,2401,1996,2475,7613,4424, 528,1922,2188,1503,1873,1570,2364,3342, # 5366 3276,7614, 557,1073,7615,1827,3445,2087,2266,3140,3039,3084, 767,3085,2786,4425, # 5382 1006,4158,4426,2341,1267,2176,3664,3199, 778,3945,3200,2722,1597,2657,7616,4427, # 5398 7617,3446,7618,7619,7620,3277,2689,1433,3278, 131, 95,1504,3946, 723,4159,3141, # 5414 1841,3555,2758,2189,3947,2027,2104,3665,7621,2995,3948,1218,7622,3343,3201,3949, # 5430 4160,2576, 248,1634,3785, 912,7623,2832,3666,3040,3786, 654, 53,7624,2996,7625, # 5446 1688,4428, 777,3447,1032,3950,1425,7626, 191, 820,2120,2833, 971,4429, 931,3202, # 5462 135, 664, 783,3787,1997, 772,2908,1935,3951,3788,4430,2909,3203, 282,2723, 640, # 5478 1372,3448,1127, 922, 325,3344,7627,7628, 711,2044,7629,7630,3952,2219,2787,1936, # 5494 3953,3345,2220,2251,3789,2300,7631,4431,3790,1258,3279,3954,3204,2138,2950,3955, # 5510 3956,7632,2221, 258,3205,4432, 101,1227,7633,3280,1755,7634,1391,3281,7635,2910, # 5526 2056, 893,7636,7637,7638,1402,4161,2342,7639,7640,3206,3556,7641,7642, 878,1325, # 5542 1780,2788,4433, 259,1385,2577, 744,1183,2267,4434,7643,3957,2502,7644, 684,1024, # 5558 4162,7645, 472,3557,3449,1165,3282,3958,3959, 322,2152, 881, 455,1695,1152,1340, # 5574 660, 554,2153,4435,1058,4436,4163, 830,1065,3346,3960,4437,1923,7646,1703,1918, # 5590 7647, 932,2268, 122,7648,4438, 947, 677,7649,3791,2627, 297,1905,1924,2269,4439, # 5606 2317,3283,7650,7651,4164,7652,4165, 84,4166, 112, 989,7653, 547,1059,3961, 701, # 5622 3558,1019,7654,4167,7655,3450, 942, 639, 457,2301,2451, 993,2951, 407, 851, 494, # 5638 4440,3347, 927,7656,1237,7657,2421,3348, 573,4168, 680, 921,2911,1279,1874, 285, # 5654 790,1448,1983, 719,2167,7658,7659,4441,3962,3963,1649,7660,1541, 563,7661,1077, # 5670 7662,3349,3041,3451, 511,2997,3964,3965,3667,3966,1268,2564,3350,3207,4442,4443, # 5686 7663, 535,1048,1276,1189,2912,2028,3142,1438,1373,2834,2952,1134,2012,7664,4169, # 5702 1238,2578,3086,1259,7665, 700,7666,2953,3143,3668,4170,7667,4171,1146,1875,1906, # 5718 4444,2601,3967, 781,2422, 132,1589, 203, 147, 273,2789,2402, 898,1786,2154,3968, # 5734 3969,7668,3792,2790,7669,7670,4445,4446,7671,3208,7672,1635,3793, 965,7673,1804, # 5750 2690,1516,3559,1121,1082,1329,3284,3970,1449,3794, 65,1128,2835,2913,2759,1590, # 5766 3795,7674,7675, 12,2658, 45, 976,2579,3144,4447, 517,2528,1013,1037,3209,7676, # 5782 3796,2836,7677,3797,7678,3452,7679,2602, 614,1998,2318,3798,3087,2724,2628,7680, # 5798 2580,4172, 599,1269,7681,1810,3669,7682,2691,3088, 759,1060, 489,1805,3351,3285, # 5814 1358,7683,7684,2386,1387,1215,2629,2252, 490,7685,7686,4173,1759,2387,2343,7687, # 5830 4448,3799,1907,3971,2630,1806,3210,4449,3453,3286,2760,2344, 874,7688,7689,3454, # 5846 3670,1858, 91,2914,3671,3042,3800,4450,7690,3145,3972,2659,7691,3455,1202,1403, # 5862 3801,2954,2529,1517,2503,4451,3456,2504,7692,4452,7693,2692,1885,1495,1731,3973, # 5878 2365,4453,7694,2029,7695,7696,3974,2693,1216, 237,2581,4174,2319,3975,3802,4454, # 5894 4455,2694,3560,3457, 445,4456,7697,7698,7699,7700,2761, 61,3976,3672,1822,3977, # 5910 7701, 687,2045, 935, 925, 405,2660, 703,1096,1859,2725,4457,3978,1876,1367,2695, # 5926 3352, 918,2105,1781,2476, 334,3287,1611,1093,4458, 564,3146,3458,3673,3353, 945, # 5942 2631,2057,4459,7702,1925, 872,4175,7703,3459,2696,3089, 349,4176,3674,3979,4460, # 5958 3803,4177,3675,2155,3980,4461,4462,4178,4463,2403,2046, 782,3981, 400, 251,4179, # 5974 1624,7704,7705, 277,3676, 299,1265, 476,1191,3804,2121,4180,4181,1109, 205,7706, # 5990 2582,1000,2156,3561,1860,7707,7708,7709,4464,7710,4465,2565, 107,2477,2157,3982, # 6006 3460,3147,7711,1533, 541,1301, 158, 753,4182,2872,3562,7712,1696, 370,1088,4183, # 6022 4466,3563, 579, 327, 440, 162,2240, 269,1937,1374,3461, 968,3043, 56,1396,3090, # 6038 2106,3288,3354,7713,1926,2158,4467,2998,7714,3564,7715,7716,3677,4468,2478,7717, # 6054 2791,7718,1650,4469,7719,2603,7720,7721,3983,2661,3355,1149,3356,3984,3805,3985, # 6070 7722,1076, 49,7723, 951,3211,3289,3290, 450,2837, 920,7724,1811,2792,2366,4184, # 6086 1908,1138,2367,3806,3462,7725,3212,4470,1909,1147,1518,2423,4471,3807,7726,4472, # 6102 2388,2604, 260,1795,3213,7727,7728,3808,3291, 708,7729,3565,1704,7730,3566,1351, # 6118 1618,3357,2999,1886, 944,4185,3358,4186,3044,3359,4187,7731,3678, 422, 413,1714, # 6134 3292, 500,2058,2345,4188,2479,7732,1344,1910, 954,7733,1668,7734,7735,3986,2404, # 6150 4189,3567,3809,4190,7736,2302,1318,2505,3091, 133,3092,2873,4473, 629, 31,2838, # 6166 2697,3810,4474, 850, 949,4475,3987,2955,1732,2088,4191,1496,1852,7737,3988, 620, # 6182 3214, 981,1242,3679,3360,1619,3680,1643,3293,2139,2452,1970,1719,3463,2168,7738, # 6198 3215,7739,7740,3361,1828,7741,1277,4476,1565,2047,7742,1636,3568,3093,7743, 869, # 6214 2839, 655,3811,3812,3094,3989,3000,3813,1310,3569,4477,7744,7745,7746,1733, 558, # 6230 4478,3681, 335,1549,3045,1756,4192,3682,1945,3464,1829,1291,1192, 470,2726,2107, # 6246 2793, 913,1054,3990,7747,1027,7748,3046,3991,4479, 982,2662,3362,3148,3465,3216, # 6262 3217,1946,2794,7749, 571,4480,7750,1830,7751,3570,2583,1523,2424,7752,2089, 984, # 6278 4481,3683,1959,7753,3684, 852, 923,2795,3466,3685, 969,1519, 999,2048,2320,1705, # 6294 7754,3095, 615,1662, 151, 597,3992,2405,2321,1049, 275,4482,3686,4193, 568,3687, # 6310 3571,2480,4194,3688,7755,2425,2270, 409,3218,7756,1566,2874,3467,1002, 769,2840, # 6326 194,2090,3149,3689,2222,3294,4195, 628,1505,7757,7758,1763,2177,3001,3993, 521, # 6342 1161,2584,1787,2203,2406,4483,3994,1625,4196,4197, 412, 42,3096, 464,7759,2632, # 6358 4484,3363,1760,1571,2875,3468,2530,1219,2204,3814,2633,2140,2368,4485,4486,3295, # 6374 1651,3364,3572,7760,7761,3573,2481,3469,7762,3690,7763,7764,2271,2091, 460,7765, # 6390 4487,7766,3002, 962, 588,3574, 289,3219,2634,1116, 52,7767,3047,1796,7768,7769, # 6406 7770,1467,7771,1598,1143,3691,4198,1984,1734,1067,4488,1280,3365, 465,4489,1572, # 6422 510,7772,1927,2241,1812,1644,3575,7773,4490,3692,7774,7775,2663,1573,1534,7776, # 6438 7777,4199, 536,1807,1761,3470,3815,3150,2635,7778,7779,7780,4491,3471,2915,1911, # 6454 2796,7781,3296,1122, 377,3220,7782, 360,7783,7784,4200,1529, 551,7785,2059,3693, # 6470 1769,2426,7786,2916,4201,3297,3097,2322,2108,2030,4492,1404, 136,1468,1479, 672, # 6486 1171,3221,2303, 271,3151,7787,2762,7788,2049, 678,2727, 865,1947,4493,7789,2013, # 6502 3995,2956,7790,2728,2223,1397,3048,3694,4494,4495,1735,2917,3366,3576,7791,3816, # 6518 509,2841,2453,2876,3817,7792,7793,3152,3153,4496,4202,2531,4497,2304,1166,1010, # 6534 552, 681,1887,7794,7795,2957,2958,3996,1287,1596,1861,3154, 358, 453, 736, 175, # 6550 478,1117, 905,1167,1097,7796,1853,1530,7797,1706,7798,2178,3472,2287,3695,3473, # 6566 3577,4203,2092,4204,7799,3367,1193,2482,4205,1458,2190,2205,1862,1888,1421,3298, # 6582 2918,3049,2179,3474, 595,2122,7800,3997,7801,7802,4206,1707,2636, 223,3696,1359, # 6598 751,3098, 183,3475,7803,2797,3003, 419,2369, 633, 704,3818,2389, 241,7804,7805, # 6614 7806, 838,3004,3697,2272,2763,2454,3819,1938,2050,3998,1309,3099,2242,1181,7807, # 6630 1136,2206,3820,2370,1446,4207,2305,4498,7808,7809,4208,1055,2605, 484,3698,7810, # 6646 3999, 625,4209,2273,3368,1499,4210,4000,7811,4001,4211,3222,2274,2275,3476,7812, # 6662 7813,2764, 808,2606,3699,3369,4002,4212,3100,2532, 526,3370,3821,4213, 955,7814, # 6678 1620,4214,2637,2427,7815,1429,3700,1669,1831, 994, 928,7816,3578,1260,7817,7818, # 6694 7819,1948,2288, 741,2919,1626,4215,2729,2455, 867,1184, 362,3371,1392,7820,7821, # 6710 4003,4216,1770,1736,3223,2920,4499,4500,1928,2698,1459,1158,7822,3050,3372,2877, # 6726 1292,1929,2506,2842,3701,1985,1187,2071,2014,2607,4217,7823,2566,2507,2169,3702, # 6742 2483,3299,7824,3703,4501,7825,7826, 666,1003,3005,1022,3579,4218,7827,4502,1813, # 6758 2253, 574,3822,1603, 295,1535, 705,3823,4219, 283, 858, 417,7828,7829,3224,4503, # 6774 4504,3051,1220,1889,1046,2276,2456,4004,1393,1599, 689,2567, 388,4220,7830,2484, # 6790 802,7831,2798,3824,2060,1405,2254,7832,4505,3825,2109,1052,1345,3225,1585,7833, # 6806 809,7834,7835,7836, 575,2730,3477, 956,1552,1469,1144,2323,7837,2324,1560,2457, # 6822 3580,3226,4005, 616,2207,3155,2180,2289,7838,1832,7839,3478,4506,7840,1319,3704, # 6838 3705,1211,3581,1023,3227,1293,2799,7841,7842,7843,3826, 607,2306,3827, 762,2878, # 6854 1439,4221,1360,7844,1485,3052,7845,4507,1038,4222,1450,2061,2638,4223,1379,4508, # 6870 2585,7846,7847,4224,1352,1414,2325,2921,1172,7848,7849,3828,3829,7850,1797,1451, # 6886 7851,7852,7853,7854,2922,4006,4007,2485,2346, 411,4008,4009,3582,3300,3101,4509, # 6902 1561,2664,1452,4010,1375,7855,7856, 47,2959, 316,7857,1406,1591,2923,3156,7858, # 6918 1025,2141,3102,3157, 354,2731, 884,2224,4225,2407, 508,3706, 726,3583, 996,2428, # 6934 3584, 729,7859, 392,2191,1453,4011,4510,3707,7860,7861,2458,3585,2608,1675,2800, # 6950 919,2347,2960,2348,1270,4511,4012, 73,7862,7863, 647,7864,3228,2843,2255,1550, # 6966 1346,3006,7865,1332, 883,3479,7866,7867,7868,7869,3301,2765,7870,1212, 831,1347, # 6982 4226,4512,2326,3830,1863,3053, 720,3831,4513,4514,3832,7871,4227,7872,7873,4515, # 6998 7874,7875,1798,4516,3708,2609,4517,3586,1645,2371,7876,7877,2924, 669,2208,2665, # 7014 2429,7878,2879,7879,7880,1028,3229,7881,4228,2408,7882,2256,1353,7883,7884,4518, # 7030 3158, 518,7885,4013,7886,4229,1960,7887,2142,4230,7888,7889,3007,2349,2350,3833, # 7046 516,1833,1454,4014,2699,4231,4519,2225,2610,1971,1129,3587,7890,2766,7891,2961, # 7062 1422, 577,1470,3008,1524,3373,7892,7893, 432,4232,3054,3480,7894,2586,1455,2508, # 7078 2226,1972,1175,7895,1020,2732,4015,3481,4520,7896,2733,7897,1743,1361,3055,3482, # 7094 2639,4016,4233,4521,2290, 895, 924,4234,2170, 331,2243,3056, 166,1627,3057,1098, # 7110 7898,1232,2880,2227,3374,4522, 657, 403,1196,2372, 542,3709,3375,1600,4235,3483, # 7126 7899,4523,2767,3230, 576, 530,1362,7900,4524,2533,2666,3710,4017,7901, 842,3834, # 7142 7902,2801,2031,1014,4018, 213,2700,3376, 665, 621,4236,7903,3711,2925,2430,7904, # 7158 2431,3302,3588,3377,7905,4237,2534,4238,4525,3589,1682,4239,3484,1380,7906, 724, # 7174 2277, 600,1670,7907,1337,1233,4526,3103,2244,7908,1621,4527,7909, 651,4240,7910, # 7190 1612,4241,2611,7911,2844,7912,2734,2307,3058,7913, 716,2459,3059, 174,1255,2701, # 7206 4019,3590, 548,1320,1398, 728,4020,1574,7914,1890,1197,3060,4021,7915,3061,3062, # 7222 3712,3591,3713, 747,7916, 635,4242,4528,7917,7918,7919,4243,7920,7921,4529,7922, # 7238 3378,4530,2432, 451,7923,3714,2535,2072,4244,2735,4245,4022,7924,1764,4531,7925, # 7254 4246, 350,7926,2278,2390,2486,7927,4247,4023,2245,1434,4024, 488,4532, 458,4248, # 7270 4025,3715, 771,1330,2391,3835,2568,3159,2159,2409,1553,2667,3160,4249,7928,2487, # 7286 2881,2612,1720,2702,4250,3379,4533,7929,2536,4251,7930,3231,4252,2768,7931,2015, # 7302 2736,7932,1155,1017,3716,3836,7933,3303,2308, 201,1864,4253,1430,7934,4026,7935, # 7318 7936,7937,7938,7939,4254,1604,7940, 414,1865, 371,2587,4534,4535,3485,2016,3104, # 7334 4536,1708, 960,4255, 887, 389,2171,1536,1663,1721,7941,2228,4027,2351,2926,1580, # 7350 7942,7943,7944,1744,7945,2537,4537,4538,7946,4539,7947,2073,7948,7949,3592,3380, # 7366 2882,4256,7950,4257,2640,3381,2802, 673,2703,2460, 709,3486,4028,3593,4258,7951, # 7382 1148, 502, 634,7952,7953,1204,4540,3594,1575,4541,2613,3717,7954,3718,3105, 948, # 7398 3232, 121,1745,3837,1110,7955,4259,3063,2509,3009,4029,3719,1151,1771,3838,1488, # 7414 4030,1986,7956,2433,3487,7957,7958,2093,7959,4260,3839,1213,1407,2803, 531,2737, # 7430 2538,3233,1011,1537,7960,2769,4261,3106,1061,7961,3720,3721,1866,2883,7962,2017, # 7446 120,4262,4263,2062,3595,3234,2309,3840,2668,3382,1954,4542,7963,7964,3488,1047, # 7462 2704,1266,7965,1368,4543,2845, 649,3383,3841,2539,2738,1102,2846,2669,7966,7967, # 7478 1999,7968,1111,3596,2962,7969,2488,3842,3597,2804,1854,3384,3722,7970,7971,3385, # 7494 2410,2884,3304,3235,3598,7972,2569,7973,3599,2805,4031,1460, 856,7974,3600,7975, # 7510 2885,2963,7976,2886,3843,7977,4264, 632,2510, 875,3844,1697,3845,2291,7978,7979, # 7526 4544,3010,1239, 580,4545,4265,7980, 914, 936,2074,1190,4032,1039,2123,7981,7982, # 7542 7983,3386,1473,7984,1354,4266,3846,7985,2172,3064,4033, 915,3305,4267,4268,3306, # 7558 1605,1834,7986,2739, 398,3601,4269,3847,4034, 328,1912,2847,4035,3848,1331,4270, # 7574 3011, 937,4271,7987,3602,4036,4037,3387,2160,4546,3388, 524, 742, 538,3065,1012, # 7590 7988,7989,3849,2461,7990, 658,1103, 225,3850,7991,7992,4547,7993,4548,7994,3236, # 7606 1243,7995,4038, 963,2246,4549,7996,2705,3603,3161,7997,7998,2588,2327,7999,4550, # 7622 8000,8001,8002,3489,3307, 957,3389,2540,2032,1930,2927,2462, 870,2018,3604,1746, # 7638 2770,2771,2434,2463,8003,3851,8004,3723,3107,3724,3490,3390,3725,8005,1179,3066, # 7654 8006,3162,2373,4272,3726,2541,3163,3108,2740,4039,8007,3391,1556,2542,2292, 977, # 7670 2887,2033,4040,1205,3392,8008,1765,3393,3164,2124,1271,1689, 714,4551,3491,8009, # 7686 2328,3852, 533,4273,3605,2181, 617,8010,2464,3308,3492,2310,8011,8012,3165,8013, # 7702 8014,3853,1987, 618, 427,2641,3493,3394,8015,8016,1244,1690,8017,2806,4274,4552, # 7718 8018,3494,8019,8020,2279,1576, 473,3606,4275,3395, 972,8021,3607,8022,3067,8023, # 7734 8024,4553,4554,8025,3727,4041,4042,8026, 153,4555, 356,8027,1891,2888,4276,2143, # 7750 408, 803,2352,8028,3854,8029,4277,1646,2570,2511,4556,4557,3855,8030,3856,4278, # 7766 8031,2411,3396, 752,8032,8033,1961,2964,8034, 746,3012,2465,8035,4279,3728, 698, # 7782 4558,1892,4280,3608,2543,4559,3609,3857,8036,3166,3397,8037,1823,1302,4043,2706, # 7798 3858,1973,4281,8038,4282,3167, 823,1303,1288,1236,2848,3495,4044,3398, 774,3859, # 7814 8039,1581,4560,1304,2849,3860,4561,8040,2435,2161,1083,3237,4283,4045,4284, 344, # 7830 1173, 288,2311, 454,1683,8041,8042,1461,4562,4046,2589,8043,8044,4563, 985, 894, # 7846 8045,3399,3168,8046,1913,2928,3729,1988,8047,2110,1974,8048,4047,8049,2571,1194, # 7862 425,8050,4564,3169,1245,3730,4285,8051,8052,2850,8053, 636,4565,1855,3861, 760, # 7878 1799,8054,4286,2209,1508,4566,4048,1893,1684,2293,8055,8056,8057,4287,4288,2210, # 7894 479,8058,8059, 832,8060,4049,2489,8061,2965,2490,3731, 990,3109, 627,1814,2642, # 7910 4289,1582,4290,2125,2111,3496,4567,8062, 799,4291,3170,8063,4568,2112,1737,3013, # 7926 1018, 543, 754,4292,3309,1676,4569,4570,4050,8064,1489,8065,3497,8066,2614,2889, # 7942 4051,8067,8068,2966,8069,8070,8071,8072,3171,4571,4572,2182,1722,8073,3238,3239, # 7958 1842,3610,1715, 481, 365,1975,1856,8074,8075,1962,2491,4573,8076,2126,3611,3240, # 7974 433,1894,2063,2075,8077, 602,2741,8078,8079,8080,8081,8082,3014,1628,3400,8083, # 7990 3172,4574,4052,2890,4575,2512,8084,2544,2772,8085,8086,8087,3310,4576,2891,8088, # 8006 4577,8089,2851,4578,4579,1221,2967,4053,2513,8090,8091,8092,1867,1989,8093,8094, # 8022 8095,1895,8096,8097,4580,1896,4054, 318,8098,2094,4055,4293,8099,8100, 485,8101, # 8038 938,3862, 553,2670, 116,8102,3863,3612,8103,3498,2671,2773,3401,3311,2807,8104, # 8054 3613,2929,4056,1747,2930,2968,8105,8106, 207,8107,8108,2672,4581,2514,8109,3015, # 8070 890,3614,3864,8110,1877,3732,3402,8111,2183,2353,3403,1652,8112,8113,8114, 941, # 8086 2294, 208,3499,4057,2019, 330,4294,3865,2892,2492,3733,4295,8115,8116,8117,8118, # 8102 ) PKd])11chardet/langgreekmodel.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # 255: Control characters that usually does not exist in any text # 254: Carriage/Return # 253: symbol (punctuation) that does not belong to word # 252: 0 - 9 # Character Mapping Table: Latin7_char_to_order_map = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253, 82,100,104, 94, 98,101,116,102,111,187,117, 92, 88,113, 85, # 40 79,118,105, 83, 67,114,119, 95, 99,109,188,253,253,253,253,253, # 50 253, 72, 70, 80, 81, 60, 96, 93, 89, 68,120, 97, 77, 86, 69, 55, # 60 78,115, 65, 66, 58, 76,106,103, 87,107,112,253,253,253,253,253, # 70 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 80 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 90 253,233, 90,253,253,253,253,253,253,253,253,253,253, 74,253,253, # a0 253,253,253,253,247,248, 61, 36, 46, 71, 73,253, 54,253,108,123, # b0 110, 31, 51, 43, 41, 34, 91, 40, 52, 47, 44, 53, 38, 49, 59, 39, # c0 35, 48,250, 37, 33, 45, 56, 50, 84, 57,120,121, 17, 18, 22, 15, # d0 124, 1, 29, 20, 21, 3, 32, 13, 25, 5, 11, 16, 10, 6, 30, 4, # e0 9, 8, 14, 7, 2, 12, 28, 23, 42, 24, 64, 75, 19, 26, 27,253, # f0 ) win1253_char_to_order_map = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253, 82,100,104, 94, 98,101,116,102,111,187,117, 92, 88,113, 85, # 40 79,118,105, 83, 67,114,119, 95, 99,109,188,253,253,253,253,253, # 50 253, 72, 70, 80, 81, 60, 96, 93, 89, 68,120, 97, 77, 86, 69, 55, # 60 78,115, 65, 66, 58, 76,106,103, 87,107,112,253,253,253,253,253, # 70 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 80 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 90 253,233, 61,253,253,253,253,253,253,253,253,253,253, 74,253,253, # a0 253,253,253,253,247,253,253, 36, 46, 71, 73,253, 54,253,108,123, # b0 110, 31, 51, 43, 41, 34, 91, 40, 52, 47, 44, 53, 38, 49, 59, 39, # c0 35, 48,250, 37, 33, 45, 56, 50, 84, 57,120,121, 17, 18, 22, 15, # d0 124, 1, 29, 20, 21, 3, 32, 13, 25, 5, 11, 16, 10, 6, 30, 4, # e0 9, 8, 14, 7, 2, 12, 28, 23, 42, 24, 64, 75, 19, 26, 27,253, # f0 ) # Model Table: # total sequences: 100% # first 512 sequences: 98.2851% # first 1024 sequences:1.7001% # rest sequences: 0.0359% # negative sequences: 0.0148% GreekLangModel = ( 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,3,2,2,3,3,3,3,3,3,3,3,1,3,3,3,0,2,2,3,3,0,3,0,3,2,0,3,3,3,0, 3,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,3,0,3,3,0,3,2,3,3,0,3,2,3,3,3,0,0,3,0,3,0,3,3,2,0,0,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0, 0,2,3,2,2,3,3,3,3,3,3,3,3,0,3,3,3,3,0,2,3,3,0,3,3,3,3,2,3,3,3,0, 2,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,2,1,3,3,3,3,2,3,3,2,3,3,2,0, 0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,0,3,3,3,3,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,2,3,3,0, 2,0,1,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 0,3,3,3,3,3,2,3,0,0,0,0,3,3,0,3,1,3,3,3,0,3,3,0,3,3,3,3,0,0,0,0, 2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,3,0,3,0,3,3,3,3,3,0,3,2,2,2,3,0,2,3,3,3,3,3,2,3,3,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,3,3,2,2,2,3,3,3,3,0,3,1,3,3,3,3,2,3,3,3,3,3,3,3,2,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,3,2,0,3,0,0,0,3,3,2,3,3,3,3,3,0,0,3,2,3,0,2,3,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,0,3,3,3,3,0,0,3,3,0,2,3,0,3,0,3,3,3,0,0,3,0,3,0,2,2,3,3,0,0, 0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,3,2,0,3,2,3,3,3,3,0,3,3,3,3,3,0,3,3,2,3,2,3,3,2,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,2,3,2,3,3,3,3,3,3,0,2,3,2,3,2,2,2,3,2,3,3,2,3,0,2,2,2,3,0, 2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,3,0,0,0,3,3,3,2,3,3,0,0,3,0,3,0,0,0,3,2,0,3,0,3,0,0,2,0,2,0, 0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,0,3,3,3,3,3,3,0,3,3,0,3,0,0,0,3,3,0,3,3,3,0,0,1,2,3,0, 3,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,3,2,0,0,3,2,2,3,3,0,3,3,3,3,3,2,1,3,0,3,2,3,3,2,1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,3,3,0,2,3,3,3,3,3,3,0,0,3,0,3,0,0,0,3,3,0,3,2,3,0,0,3,3,3,0, 3,0,0,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,0,3,3,3,3,3,3,0,0,3,0,3,0,0,0,3,2,0,3,2,3,0,0,3,2,3,0, 2,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,3,1,2,2,3,3,3,3,3,3,0,2,3,0,3,0,0,0,3,3,0,3,0,2,0,0,2,3,1,0, 2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,0,3,3,3,3,0,3,0,3,3,2,3,0,3,3,3,3,3,3,0,3,3,3,0,2,3,0,0,3,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,0,3,3,3,0,0,3,0,0,0,3,3,0,3,0,2,3,3,0,0,3,0,3,0,3,3,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,3,0,0,0,3,3,3,3,3,3,0,0,3,0,2,0,0,0,3,3,0,3,0,3,0,0,2,0,2,0, 0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,3,3,0,3,0,2,0,3,2,0,3,2,3,2,3,0,0,3,2,3,2,3,3,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,3,0,0,2,3,3,3,3,3,0,0,0,3,0,2,1,0,0,3,2,2,2,0,3,0,0,2,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,0,3,3,3,2,0,3,0,3,0,3,3,0,2,1,2,3,3,0,0,3,0,3,0,3,3,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,3,3,3,0,3,3,3,3,3,3,0,2,3,0,3,0,0,0,2,1,0,2,2,3,0,0,2,2,2,0, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,3,0,0,2,3,3,3,2,3,0,0,1,3,0,2,0,0,0,0,3,0,1,0,2,0,0,1,1,1,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,3,1,0,3,0,0,0,3,2,0,3,2,3,3,3,0,0,3,0,3,2,2,2,1,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,0,3,3,3,0,0,3,0,0,0,0,2,0,2,3,3,2,2,2,2,3,0,2,0,2,2,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,3,3,3,2,0,0,0,0,0,0,2,3,0,2,0,2,3,2,0,0,3,0,3,0,3,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,3,2,3,3,2,2,3,0,2,0,3,0,0,0,2,0,0,0,0,1,2,0,2,0,2,0, 0,2,0,2,0,2,2,0,0,1,0,2,2,2,0,2,2,2,0,2,2,2,0,0,2,0,0,1,0,0,0,0, 0,2,0,3,3,2,0,0,0,0,0,0,1,3,0,2,0,2,2,2,0,0,2,0,3,0,0,2,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,0,2,3,2,0,2,2,0,2,0,2,2,0,2,0,2,2,2,0,0,0,0,0,0,2,3,0,0,0,2, 0,1,2,0,0,0,0,2,2,0,0,0,2,1,0,2,2,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0, 0,0,2,1,0,2,3,2,2,3,2,3,2,0,0,3,3,3,0,0,3,2,0,0,0,1,1,0,2,0,2,2, 0,2,0,2,0,2,2,0,0,2,0,2,2,2,0,2,2,2,2,0,0,2,0,0,0,2,0,1,0,0,0,0, 0,3,0,3,3,2,2,0,3,0,0,0,2,2,0,2,2,2,1,2,0,0,1,2,2,0,0,3,0,0,0,2, 0,1,2,0,0,0,1,2,0,0,0,0,0,0,0,2,2,0,1,0,0,2,0,0,0,2,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,3,3,2,2,0,0,0,2,0,2,3,3,0,2,0,0,0,0,0,0,2,2,2,0,2,2,0,2,0,2, 0,2,2,0,0,2,2,2,2,1,0,0,2,2,0,2,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0, 0,2,0,3,2,3,0,0,0,3,0,0,2,2,0,2,0,2,2,2,0,0,2,0,0,0,0,0,0,0,0,2, 0,0,2,2,0,0,2,2,2,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,2,0,0,3,2,0,2,2,2,2,2,0,0,0,2,0,0,0,0,2,0,1,0,0,2,0,1,0,0,0, 0,2,2,2,0,2,2,0,1,2,0,2,2,2,0,2,2,2,2,1,2,2,0,0,2,0,0,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 0,2,0,2,0,2,2,0,0,0,0,1,2,1,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,3,2,3,0,0,2,0,0,0,2,2,0,2,0,0,0,1,0,0,2,0,2,0,2,2,0,0,0,0, 0,0,2,0,0,0,0,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0, 0,2,2,3,2,2,0,0,0,0,0,0,1,3,0,2,0,2,2,0,0,0,1,0,2,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,0,2,0,3,2,0,2,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 0,0,2,0,0,0,0,1,1,0,0,2,1,2,0,2,2,0,1,0,0,1,0,0,0,2,0,0,0,0,0,0, 0,3,0,2,2,2,0,0,2,0,0,0,2,0,0,0,2,3,0,2,0,0,0,0,0,0,2,2,0,0,0,2, 0,1,2,0,0,0,1,2,2,1,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,1,2,0,2,2,0,2,0,0,2,0,0,0,0,1,2,1,0,2,1,0,0,0,0,0,0,0,0,0,0, 0,0,2,0,0,0,3,1,2,2,0,2,0,0,0,0,2,0,0,0,2,0,0,3,0,0,0,0,2,2,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,1,0,2,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,2, 0,2,2,0,0,2,2,2,2,2,0,1,2,0,0,0,2,2,0,1,0,2,0,0,2,2,0,0,0,0,0,0, 0,0,0,0,1,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,2, 0,1,2,0,0,0,0,2,2,1,0,1,0,1,0,2,2,2,1,0,0,0,0,0,0,1,0,0,0,0,0,0, 0,2,0,1,2,0,0,0,0,0,0,0,0,0,0,2,0,0,2,2,0,0,0,0,1,0,0,0,0,0,0,2, 0,2,2,0,0,0,0,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0, 0,2,2,2,2,0,0,0,3,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,1, 0,0,2,0,0,0,0,1,2,0,0,0,0,0,0,2,2,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0, 0,2,0,2,2,2,0,0,2,0,0,0,0,0,0,0,2,2,2,0,0,0,2,0,0,0,0,0,0,0,0,2, 0,0,1,0,0,0,0,2,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0, 0,3,0,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,2, 0,0,2,0,0,0,0,2,2,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,0,2,2,1,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,0,0,0,0,2,0,0,0,0,2, 0,0,2,0,0,2,0,2,2,0,0,0,0,2,0,2,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0, 0,0,3,0,0,0,2,2,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0, 0,2,2,2,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1, 0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 0,2,0,0,0,2,0,0,0,0,0,1,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,2,0,0,0, 0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,2,0,2,0,0,0, 0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,2,0,0,0,1,2,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ) Latin7GreekModel = { 'char_to_order_map': Latin7_char_to_order_map, 'precedence_matrix': GreekLangModel, 'typical_positive_ratio': 0.982851, 'keep_english_letter': False, 'charset_name': "ISO-8859-7", 'language': 'Greek', } Win1253GreekModel = { 'char_to_order_map': win1253_char_to_order_map, 'precedence_matrix': GreekLangModel, 'typical_positive_ratio': 0.982851, 'keep_english_letter': False, 'charset_name': "windows-1253", 'language': 'Greek', } PKd]Y$chardet/charsetgroupprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .enums import ProbingState from .charsetprober import CharSetProber class CharSetGroupProber(CharSetProber): def __init__(self, lang_filter=None): super(CharSetGroupProber, self).__init__(lang_filter=lang_filter) self._active_num = 0 self.probers = [] self._best_guess_prober = None def reset(self): super(CharSetGroupProber, self).reset() self._active_num = 0 for prober in self.probers: if prober: prober.reset() prober.active = True self._active_num += 1 self._best_guess_prober = None @property def charset_name(self): if not self._best_guess_prober: self.get_confidence() if not self._best_guess_prober: return None return self._best_guess_prober.charset_name @property def language(self): if not self._best_guess_prober: self.get_confidence() if not self._best_guess_prober: return None return self._best_guess_prober.language def feed(self, byte_str): for prober in self.probers: if not prober: continue if not prober.active: continue state = prober.feed(byte_str) if not state: continue if state == ProbingState.FOUND_IT: self._best_guess_prober = prober return self.state elif state == ProbingState.NOT_ME: prober.active = False self._active_num -= 1 if self._active_num <= 0: self._state = ProbingState.NOT_ME return self.state return self.state def get_confidence(self): state = self.state if state == ProbingState.FOUND_IT: return 0.99 elif state == ProbingState.NOT_ME: return 0.01 best_conf = 0.0 self._best_guess_prober = None for prober in self.probers: if not prober: continue if not prober.active: self.logger.debug('%s not active', prober.charset_name) continue conf = prober.get_confidence() self.logger.debug('%s %s confidence = %s', prober.charset_name, prober.language, conf) if best_conf < conf: best_conf = conf self._best_guess_prober = prober if not self._best_guess_prober: return 0.0 return best_conf PKd]fQ,Q,chardet/langhebrewmodel.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # Shy Shalom - original C code # Shoshannah Forbes - original C code (?) # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # 255: Control characters that usually does not exist in any text # 254: Carriage/Return # 253: symbol (punctuation) that does not belong to word # 252: 0 - 9 # Windows-1255 language model # Character Mapping Table: WIN1255_CHAR_TO_ORDER_MAP = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253, 69, 91, 79, 80, 92, 89, 97, 90, 68,111,112, 82, 73, 95, 85, # 40 78,121, 86, 71, 67,102,107, 84,114,103,115,253,253,253,253,253, # 50 253, 50, 74, 60, 61, 42, 76, 70, 64, 53,105, 93, 56, 65, 54, 49, # 60 66,110, 51, 43, 44, 63, 81, 77, 98, 75,108,253,253,253,253,253, # 70 124,202,203,204,205, 40, 58,206,207,208,209,210,211,212,213,214, 215, 83, 52, 47, 46, 72, 32, 94,216,113,217,109,218,219,220,221, 34,116,222,118,100,223,224,117,119,104,125,225,226, 87, 99,227, 106,122,123,228, 55,229,230,101,231,232,120,233, 48, 39, 57,234, 30, 59, 41, 88, 33, 37, 36, 31, 29, 35,235, 62, 28,236,126,237, 238, 38, 45,239,240,241,242,243,127,244,245,246,247,248,249,250, 9, 8, 20, 16, 3, 2, 24, 14, 22, 1, 25, 15, 4, 11, 6, 23, 12, 19, 13, 26, 18, 27, 21, 17, 7, 10, 5,251,252,128, 96,253, ) # Model Table: # total sequences: 100% # first 512 sequences: 98.4004% # first 1024 sequences: 1.5981% # rest sequences: 0.087% # negative sequences: 0.0015% HEBREW_LANG_MODEL = ( 0,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,3,2,1,2,0,1,0,0, 3,0,3,1,0,0,1,3,2,0,1,1,2,0,2,2,2,1,1,1,1,2,1,1,1,2,0,0,2,2,0,1, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2, 1,2,1,2,1,2,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2, 1,2,1,3,1,1,0,0,2,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,1,2,2,1,3, 1,2,1,1,2,2,0,0,2,2,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,2,2,2,3,2, 1,2,1,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,2,2,3,2,2,2,1,2,2,2,2, 1,2,1,1,2,2,0,1,2,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,2,2,2,2,2, 0,2,0,2,2,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,0,2,2,2, 0,2,1,2,2,2,0,0,2,1,0,0,0,0,1,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2,1,2,3,2,2,2, 1,2,1,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0, 3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,2,0,2, 0,2,1,2,2,2,0,0,1,2,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,2,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,2,2,3,2,1,2,1,1,1, 0,1,1,1,1,1,3,0,1,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,0, 0,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2, 0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,2,3,3,3,2,1,2,3,3,2,3,3,3,3,2,3,2,1,2,0,2,1,2, 0,2,0,2,2,2,0,0,1,2,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0, 3,3,3,3,3,3,3,3,3,2,3,3,3,1,2,2,3,3,2,3,2,3,2,2,3,1,2,2,0,2,2,2, 0,2,1,2,2,2,0,0,1,2,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,2,2,2,3,3,3,3,1,3,2,2,2, 0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,2,3,2,2,2,1,2,2,0,2,2,2,2, 0,2,0,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,1,3,2,3,3,2,3,3,2,2,1,2,2,2,2,2,2, 0,2,1,2,1,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,2,3,2,3,3,2,3,3,3,3,2,3,2,3,3,3,3,3,2,2,2,2,2,2,2,1, 0,2,0,1,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,3,3,3,2,1,2,3,3,3,3,3,3,3,2,3,2,3,2,1,2,3,0,2,1,2,2, 0,2,1,1,2,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0, 3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,1,3,1,2,2,2,1,2,3,3,1,2,1,2,2,2,2, 0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,0,2,3,3,3,1,3,3,3,1,2,2,2,2,1,1,2,2,2,2,2,2, 0,2,0,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, 3,3,3,3,3,3,2,3,3,3,2,2,3,3,3,2,1,2,3,2,3,2,2,2,2,1,2,1,1,1,2,2, 0,2,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0, 1,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,2,3,3,2,3,1,2,2,2,2,3,2,3,1,1,2,2,1,2,2,1,1,0,2,2,2,2, 0,1,0,1,2,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, 3,0,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0, 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,1,0,1,0,1,1,0,1,1,0,0,0,1,1,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,0,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 3,2,2,1,2,2,2,2,2,2,2,1,2,2,1,2,2,1,1,1,1,1,1,1,1,2,1,1,0,3,3,3, 0,3,0,2,2,2,2,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,1,2,2,2,1,1,1,2,0,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,0,0,0,0,0,0, 0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,3,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,0,2,1,0, 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, 0,3,1,1,2,2,2,2,2,1,2,2,2,1,1,2,2,2,2,2,2,2,1,2,2,1,0,1,1,1,1,0, 0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,2,1,1,1,1,2,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0, 0,0,2,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,0, 2,1,1,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,1,2,1,2,1,1,1,1,0,0,0,0, 0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,1,2,1,1,2,1,1,1,2,1,2,1,2,0,1,0,1, 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,1,2,2,2,1,2,2,2,2,2,2,2,2,1,2,1,1,1,1,1,1,2,1,2,1,1,0,1,0,1, 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,1,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2, 0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,1,1,1,1,1,1,1,0,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,2,0,1,1,1,0,1,0,0,0,1,1,0,1,1,0,0,0,0,0,1,1,0,0, 0,1,1,1,2,1,2,2,2,0,2,0,2,0,1,1,2,1,1,1,1,2,1,0,1,1,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,1,0,0,0,0,0,1,0,1,2,2,0,1,0,0,1,1,2,2,1,2,0,2,0,0,0,1,2,0,1, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,2,0,2,1,2,0,2,0,0,1,1,1,1,1,1,0,1,0,0,0,1,0,0,1, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,1,0,0,0,0,0,1,0,2,1,1,0,1,0,0,1,1,1,2,2,0,0,1,0,0,0,1,0,0,1, 1,1,2,1,0,1,1,1,0,1,0,1,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,2,2,1, 0,2,0,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,1,0,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,1,1,0,1,0,0,0,1,1,0,1, 2,0,1,0,1,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,0,1,1,2,1,1,2,0,1,0,0,0,1,1,0,1, 1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,0,0,2,1,1,2,0,2,0,0,0,1,1,0,1, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0,2,1,1,0,1,0,0,2,2,1,2,1,1,0,1,0,0,0,1,1,0,1, 2,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,1,0,1, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,2,1,1,1,0,2,1,1,0,0,0,2,1,0,1, 1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,1,1,0,2,1,1,0,1,0,0,0,1,1,0,1, 2,2,1,1,1,0,1,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0,2,1,1,0,1,0,0,1,1,0,1,2,1,0,2,0,0,0,1,1,0,1, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0, 0,1,0,0,2,0,2,1,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,1,1,1,0,1,0,0,1,0,0,0,1,0,0,1, 1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,1,0,1,1,0,0,1,0,0,2,1,1,1,1,1,0,1,0,0,0,0,1,0,1, 0,1,1,1,2,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,1,2,1,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,1,0,0, ) Win1255HebrewModel = { 'char_to_order_map': WIN1255_CHAR_TO_ORDER_MAP, 'precedence_matrix': HEBREW_LANG_MODEL, 'typical_positive_ratio': 0.984004, 'keep_english_letter': False, 'charset_name': "windows-1255", 'language': 'Hebrew', } PKd]֑g2chardet/sjisprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import SJISDistributionAnalysis from .jpcntx import SJISContextAnalysis from .mbcssm import SJIS_SM_MODEL from .enums import ProbingState, MachineState class SJISProber(MultiByteCharSetProber): def __init__(self): super(SJISProber, self).__init__() self.coding_sm = CodingStateMachine(SJIS_SM_MODEL) self.distribution_analyzer = SJISDistributionAnalysis() self.context_analyzer = SJISContextAnalysis() self.reset() def reset(self): super(SJISProber, self).reset() self.context_analyzer.reset() @property def charset_name(self): return self.context_analyzer.charset_name @property def language(self): return "Japanese" def feed(self, byte_str): for i in range(len(byte_str)): coding_state = self.coding_sm.next_state(byte_str[i]) if coding_state == MachineState.ERROR: self.logger.debug('%s %s prober hit error at byte %s', self.charset_name, self.language, i) self._state = ProbingState.NOT_ME break elif coding_state == MachineState.ITS_ME: self._state = ProbingState.FOUND_IT break elif coding_state == MachineState.START: char_len = self.coding_sm.get_current_charlen() if i == 0: self._last_char[1] = byte_str[0] self.context_analyzer.feed(self._last_char[2 - char_len:], char_len) self.distribution_analyzer.feed(self._last_char, char_len) else: self.context_analyzer.feed(byte_str[i + 1 - char_len:i + 3 - char_len], char_len) self.distribution_analyzer.feed(byte_str[i - 1:i + 1], char_len) self._last_char[0] = byte_str[-1] if self.state == ProbingState.DETECTING: if (self.context_analyzer.got_enough_data() and (self.get_confidence() > self.SHORTCUT_THRESHOLD)): self._state = ProbingState.FOUND_IT return self.state def get_confidence(self): context_conf = self.context_analyzer.get_confidence() distrib_conf = self.distribution_analyzer.get_confidence() return max(context_conf, distrib_conf) PKd]D}}chardet/enums.pynu[""" All of the Enums that are used throughout the chardet package. :author: Dan Blanchard (dan.blanchard@gmail.com) """ class InputState(object): """ This enum represents the different states a universal detector can be in. """ PURE_ASCII = 0 ESC_ASCII = 1 HIGH_BYTE = 2 class LanguageFilter(object): """ This enum represents the different language filters we can apply to a ``UniversalDetector``. """ CHINESE_SIMPLIFIED = 0x01 CHINESE_TRADITIONAL = 0x02 JAPANESE = 0x04 KOREAN = 0x08 NON_CJK = 0x10 ALL = 0x1F CHINESE = CHINESE_SIMPLIFIED | CHINESE_TRADITIONAL CJK = CHINESE | JAPANESE | KOREAN class ProbingState(object): """ This enum represents the different states a prober can be in. """ DETECTING = 0 FOUND_IT = 1 NOT_ME = 2 class MachineState(object): """ This enum represents the different states a state machine can be in. """ START = 0 ERROR = 1 ITS_ME = 2 class SequenceLikelihood(object): """ This enum represents the likelihood of a character following the previous one. """ NEGATIVE = 0 UNLIKELY = 1 LIKELY = 2 POSITIVE = 3 @classmethod def get_num_categories(cls): """:returns: The number of likelihood categories in the enum.""" return 4 class CharacterCategory(object): """ This enum represents the different categories language models for ``SingleByteCharsetProber`` put characters into. Anything less than CONTROL is considered a letter. """ UNDEFINED = 255 LINE_BREAK = 254 SYMBOL = 253 DIGIT = 252 CONTROL = 251 PKd]=nnchardet/escprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .charsetprober import CharSetProber from .codingstatemachine import CodingStateMachine from .enums import LanguageFilter, ProbingState, MachineState from .escsm import (HZ_SM_MODEL, ISO2022CN_SM_MODEL, ISO2022JP_SM_MODEL, ISO2022KR_SM_MODEL) class EscCharSetProber(CharSetProber): """ This CharSetProber uses a "code scheme" approach for detecting encodings, whereby easily recognizable escape or shift sequences are relied on to identify these encodings. """ def __init__(self, lang_filter=None): super(EscCharSetProber, self).__init__(lang_filter=lang_filter) self.coding_sm = [] if self.lang_filter & LanguageFilter.CHINESE_SIMPLIFIED: self.coding_sm.append(CodingStateMachine(HZ_SM_MODEL)) self.coding_sm.append(CodingStateMachine(ISO2022CN_SM_MODEL)) if self.lang_filter & LanguageFilter.JAPANESE: self.coding_sm.append(CodingStateMachine(ISO2022JP_SM_MODEL)) if self.lang_filter & LanguageFilter.KOREAN: self.coding_sm.append(CodingStateMachine(ISO2022KR_SM_MODEL)) self.active_sm_count = None self._detected_charset = None self._detected_language = None self._state = None self.reset() def reset(self): super(EscCharSetProber, self).reset() for coding_sm in self.coding_sm: if not coding_sm: continue coding_sm.active = True coding_sm.reset() self.active_sm_count = len(self.coding_sm) self._detected_charset = None self._detected_language = None @property def charset_name(self): return self._detected_charset @property def language(self): return self._detected_language def get_confidence(self): if self._detected_charset: return 0.99 else: return 0.00 def feed(self, byte_str): for c in byte_str: for coding_sm in self.coding_sm: if not coding_sm or not coding_sm.active: continue coding_state = coding_sm.next_state(c) if coding_state == MachineState.ERROR: coding_sm.active = False self.active_sm_count -= 1 if self.active_sm_count <= 0: self._state = ProbingState.NOT_ME return self.state elif coding_state == MachineState.ITS_ME: self._state = ProbingState.FOUND_IT self._detected_charset = coding_sm.get_coding_state_machine() self._detected_language = coding_sm.language return self.state return self.state PKd]2d^+^+chardet/langturkishmodel.pynu[# -*- coding: utf-8 -*- ######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # Özgür Baskın - Turkish Language Model # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # 255: Control characters that usually does not exist in any text # 254: Carriage/Return # 253: symbol (punctuation) that does not belong to word # 252: 0 - 9 # Character Mapping Table: Latin5_TurkishCharToOrderMap = ( 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255, 23, 37, 47, 39, 29, 52, 36, 45, 53, 60, 16, 49, 20, 46, 42, 48, 69, 44, 35, 31, 51, 38, 62, 65, 43, 56,255,255,255,255,255, 255, 1, 21, 28, 12, 2, 18, 27, 25, 3, 24, 10, 5, 13, 4, 15, 26, 64, 7, 8, 9, 14, 32, 57, 58, 11, 22,255,255,255,255,255, 180,179,178,177,176,175,174,173,172,171,170,169,168,167,166,165, 164,163,162,161,160,159,101,158,157,156,155,154,153,152,151,106, 150,149,148,147,146,145,144,100,143,142,141,140,139,138,137,136, 94, 80, 93,135,105,134,133, 63,132,131,130,129,128,127,126,125, 124,104, 73, 99, 79, 85,123, 54,122, 98, 92,121,120, 91,103,119, 68,118,117, 97,116,115, 50, 90,114,113,112,111, 55, 41, 40, 86, 89, 70, 59, 78, 71, 82, 88, 33, 77, 66, 84, 83,110, 75, 61, 96, 30, 67,109, 74, 87,102, 34, 95, 81,108, 76, 72, 17, 6, 19,107, ) TurkishLangModel = ( 3,2,3,3,3,1,3,3,3,3,3,3,3,3,2,1,1,3,3,1,3,3,0,3,3,3,3,3,0,3,1,3, 3,2,1,0,0,1,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,2,2,0,0,1,0,0,1, 3,2,2,3,3,0,3,3,3,3,3,3,3,2,3,1,0,3,3,1,3,3,0,3,3,3,3,3,0,3,0,3, 3,1,1,0,1,0,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,2,2,0,0,0,1,0,1, 3,3,2,3,3,0,3,3,3,3,3,3,3,2,3,1,1,3,3,0,3,3,1,2,3,3,3,3,0,3,0,3, 3,1,1,0,0,0,1,0,0,0,0,1,1,0,1,2,1,0,0,0,1,0,0,0,0,2,0,0,0,0,0,1, 3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,1,3,3,2,0,3,2,1,2,2,1,3,3,0,0,0,2, 2,2,0,1,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,1, 3,3,3,2,3,3,1,2,3,3,3,3,3,3,3,1,3,2,1,0,3,2,0,1,2,3,3,2,1,0,0,2, 2,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0, 1,0,1,3,3,1,3,3,3,3,3,3,3,1,2,0,0,2,3,0,2,3,0,0,2,2,2,3,0,3,0,1, 2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,0,3,2,0,2,3,2,3,3,1,0,0,2, 3,2,0,0,1,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,2,0,0,1, 3,3,3,2,3,3,2,3,3,3,3,2,3,3,3,0,3,3,0,0,2,1,0,0,2,3,2,2,0,0,0,2, 2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,1,0,2,0,0,1, 3,3,3,2,3,3,3,3,3,3,3,2,3,3,3,0,3,2,0,1,3,2,1,1,3,2,3,2,1,0,0,2, 2,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, 3,3,3,2,3,3,3,3,3,3,3,2,3,3,3,0,3,2,2,0,2,3,0,0,2,2,2,2,0,0,0,2, 3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,1,0,0,0, 3,3,3,3,3,3,3,2,2,2,2,3,2,3,3,0,3,3,1,1,2,2,0,0,2,2,3,2,0,0,1,3, 0,3,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1, 3,3,3,2,3,3,3,2,1,2,2,3,2,3,3,0,3,2,0,0,1,1,0,1,1,2,1,2,0,0,0,1, 0,3,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0, 3,3,3,2,3,3,2,3,2,2,2,3,3,3,3,1,3,1,1,0,3,2,1,1,3,3,2,3,1,0,0,1, 1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,1, 3,2,2,3,3,0,3,3,3,3,3,3,3,2,2,1,0,3,3,1,3,3,0,1,3,3,2,3,0,3,0,3, 2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0, 2,2,2,3,3,0,3,3,3,3,3,3,3,3,3,0,0,3,2,0,3,3,0,3,2,3,3,3,0,3,1,3, 2,0,0,0,0,0,0,0,0,0,0,1,0,1,2,0,1,0,0,0,0,0,0,0,2,2,0,0,1,0,0,1, 3,3,3,1,2,3,3,1,0,0,1,0,0,3,3,2,3,0,0,2,0,0,2,0,2,0,0,0,2,0,2,0, 0,3,1,0,1,0,0,0,2,2,1,0,1,1,2,1,2,2,2,0,2,1,1,0,0,0,2,0,0,0,0,0, 1,2,1,3,3,0,3,3,3,3,3,2,3,0,0,0,0,2,3,0,2,3,1,0,2,3,1,3,0,3,0,2, 3,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,1,3,3,2,2,3,2,2,0,1,2,3,0,1,2,1,0,1,0,0,0,1,0,2,2,0,0,0,1, 1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0, 3,3,3,1,3,3,1,1,3,3,1,1,3,3,1,0,2,1,2,0,2,1,0,0,1,1,2,1,0,0,0,2, 2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,1,0,2,1,3,0,0,2,0,0,3,3,0,3,0,0,1,0,1,2,0,0,1,1,2,2,0,1,0, 0,1,2,1,1,0,1,0,1,1,1,1,1,0,1,1,1,2,2,1,2,0,1,0,0,0,0,0,0,1,0,0, 3,3,3,2,3,2,3,3,0,2,2,2,3,3,3,0,3,0,0,0,2,2,0,1,2,1,1,1,0,0,0,1, 0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, 3,3,3,3,3,3,2,1,2,2,3,3,3,3,2,0,2,0,0,0,2,2,0,0,2,1,3,3,0,0,1,1, 1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0, 1,1,2,3,3,0,3,3,3,3,3,3,2,2,0,2,0,2,3,2,3,2,2,2,2,2,2,2,1,3,2,3, 2,0,2,1,2,2,2,2,1,1,2,2,1,2,2,1,2,0,0,2,1,1,0,2,1,0,0,1,0,0,0,1, 2,3,3,1,1,1,0,1,1,1,2,3,2,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0, 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,2,2,2,3,2,3,2,2,1,3,3,3,0,2,1,2,0,2,1,0,0,1,1,1,1,1,0,0,1, 2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,2,0,1,0,0,0, 3,3,3,2,3,3,3,3,3,2,3,1,2,3,3,1,2,0,0,0,0,0,0,0,3,2,1,1,0,0,0,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0, 3,3,3,2,2,3,3,2,1,1,1,1,1,3,3,0,3,1,0,0,1,1,0,0,3,1,2,1,0,0,0,0, 0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0, 3,3,3,2,2,3,2,2,2,3,2,1,1,3,3,0,3,0,0,0,0,1,0,0,3,1,1,2,0,0,0,1, 1,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 1,1,1,3,3,0,3,3,3,3,3,2,2,2,1,2,0,2,1,2,2,1,1,0,1,2,2,2,2,2,2,2, 0,0,2,1,2,1,2,1,0,1,1,3,1,2,1,1,2,0,0,2,0,1,0,1,0,1,0,0,0,1,0,1, 3,3,3,1,3,3,3,0,1,1,0,2,2,3,1,0,3,0,0,0,1,0,0,0,1,0,0,1,0,1,0,0, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,2,0,0,2,2,1,0,0,1,0,0,3,3,1,3,0,0,1,1,0,2,0,3,0,0,0,2,0,1,1, 0,1,2,0,1,2,2,0,2,2,2,2,1,0,2,1,1,0,2,0,2,1,2,0,0,0,0,0,0,0,0,0, 3,3,3,1,3,2,3,2,0,2,2,2,1,3,2,0,2,1,2,0,1,2,0,0,1,0,2,2,0,0,0,2, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0, 3,3,3,0,3,3,1,1,2,3,1,0,3,2,3,0,3,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0, 1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,3,3,0,3,3,2,3,3,2,2,0,0,0,0,1,2,0,1,3,0,0,0,3,1,1,0,3,0,2, 2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,1,2,2,1,0,3,1,1,1,1,3,3,2,3,0,0,1,0,1,2,0,2,2,0,2,2,0,2,1, 0,2,2,1,1,1,1,0,2,1,1,0,1,1,1,1,2,1,2,1,2,0,1,0,1,0,0,0,0,0,0,0, 3,3,3,0,1,1,3,0,0,1,1,0,0,2,2,0,3,0,0,1,1,0,1,0,0,0,0,0,2,0,0,0, 0,3,1,0,1,0,1,0,2,0,0,1,0,1,0,1,1,1,2,1,1,0,2,0,0,0,0,0,0,0,0,0, 3,3,3,0,2,0,2,0,1,1,1,0,0,3,3,0,2,0,0,1,0,0,2,1,1,0,1,0,1,0,1,0, 0,2,0,1,2,0,2,0,2,1,1,0,1,0,2,1,1,0,2,1,1,0,1,0,0,0,1,1,0,0,0,0, 3,2,3,0,1,0,0,0,0,0,0,0,0,1,2,0,1,0,0,1,0,0,1,0,0,0,0,0,2,0,0,0, 0,0,1,1,0,0,1,0,1,0,0,1,0,0,0,2,1,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,0,0,2,3,0,0,1,0,1,0,2,3,2,3,0,0,1,3,0,2,1,0,0,0,0,2,0,1,0, 0,2,1,0,0,1,1,0,2,1,0,0,1,0,0,1,1,0,1,1,2,0,1,0,0,0,0,1,0,0,0,0, 3,2,2,0,0,1,1,0,0,0,0,0,0,3,1,1,1,0,0,0,0,0,1,0,0,0,0,0,2,0,1,0, 0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0, 0,0,0,3,3,0,2,3,2,2,1,2,2,1,1,2,0,1,3,2,2,2,0,0,2,2,0,0,0,1,2,1, 3,0,2,1,1,0,1,1,1,0,1,2,2,2,1,1,2,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0, 0,1,1,2,3,0,3,3,3,2,2,2,2,1,0,1,0,1,0,1,2,2,0,0,2,2,1,3,1,1,2,1, 0,0,1,1,2,0,1,1,0,0,1,2,0,2,1,1,2,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0, 3,3,2,0,0,3,1,0,0,0,0,0,0,3,2,1,2,0,0,1,0,0,2,0,0,0,0,0,2,0,1,0, 0,2,1,1,0,0,1,0,1,2,0,0,1,1,0,0,2,1,1,1,1,0,2,0,0,0,0,0,0,0,0,0, 3,3,2,0,0,1,0,0,0,0,1,0,0,3,3,2,2,0,0,1,0,0,2,0,1,0,0,0,2,0,1,0, 0,0,1,1,0,0,2,0,2,1,0,0,1,1,2,1,2,0,2,1,2,1,1,1,0,0,1,1,0,0,0,0, 3,3,2,0,0,2,2,0,0,0,1,1,0,2,2,1,3,1,0,1,0,1,2,0,0,0,0,0,1,0,1,0, 0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,2,0,0,0,1,0,0,1,0,0,2,3,1,2,0,0,1,0,0,2,0,0,0,1,0,2,0,2,0, 0,1,1,2,2,1,2,0,2,1,1,0,0,1,1,0,1,1,1,1,2,1,1,0,0,0,0,0,0,0,0,0, 3,3,3,0,2,1,2,1,0,0,1,1,0,3,3,1,2,0,0,1,0,0,2,0,2,0,1,1,2,0,0,0, 0,0,1,1,1,1,2,0,1,1,0,1,1,1,1,0,0,0,1,1,1,0,1,0,0,0,1,0,0,0,0,0, 3,3,3,0,2,2,3,2,0,0,1,0,0,2,3,1,0,0,0,0,0,0,2,0,2,0,0,0,2,0,0,0, 0,1,1,0,0,0,1,0,0,1,0,1,1,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0, 3,2,3,0,0,0,0,0,0,0,1,0,0,2,2,2,2,0,0,1,0,0,2,0,0,0,0,0,2,0,1,0, 0,0,2,1,1,0,1,0,2,1,1,0,0,1,1,2,1,0,2,0,2,0,1,0,0,0,2,0,0,0,0,0, 0,0,0,2,2,0,2,1,1,1,1,2,2,0,0,1,0,1,0,0,1,3,0,0,0,0,1,0,0,2,1,0, 0,0,1,0,1,0,0,0,0,0,2,1,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0, 2,0,0,2,3,0,2,3,1,2,2,0,2,0,0,2,0,2,1,1,1,2,1,0,0,1,2,1,1,2,1,0, 1,0,2,0,1,0,1,1,0,0,2,2,1,2,1,1,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,0,2,1,2,0,0,0,1,0,0,3,2,0,1,0,0,1,0,0,2,0,0,0,1,2,1,0,1,0, 0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0, 0,0,0,2,2,0,2,2,1,1,0,1,1,1,1,1,0,0,1,2,1,1,1,0,1,0,0,0,1,1,1,1, 0,0,2,1,0,1,1,1,0,1,1,2,1,2,1,1,2,0,1,1,2,1,0,2,0,0,0,0,0,0,0,0, 3,2,2,0,0,2,0,0,0,0,0,0,0,2,2,0,2,0,0,1,0,0,2,0,0,0,0,0,2,0,0,0, 0,2,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0, 0,0,0,3,2,0,2,2,0,1,1,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0, 2,0,1,0,1,0,1,1,0,0,1,2,0,1,0,1,1,0,0,1,0,1,0,2,0,0,0,0,0,0,0,0, 2,2,2,0,1,1,0,0,0,1,0,0,0,1,2,0,1,0,0,1,0,0,1,0,0,0,0,1,2,0,1,0, 0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0, 2,2,2,2,1,0,1,1,1,0,0,0,0,1,2,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, 1,1,2,0,1,0,0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,1, 0,0,1,2,2,0,2,1,2,1,1,2,2,0,0,0,0,1,0,0,1,1,0,0,2,0,0,0,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, 2,2,2,0,0,0,1,0,0,0,0,0,0,2,2,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, 0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,2,2,0,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,1,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ) Latin5TurkishModel = { 'char_to_order_map': Latin5_TurkishCharToOrderMap, 'precedence_matrix': TurkishLangModel, 'typical_positive_ratio': 0.970290, 'keep_english_letter': True, 'charset_name': "ISO-8859-9", 'language': 'Turkish', } PKd]chardet/latin1prober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # Shy Shalom - original C code # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .charsetprober import CharSetProber from .enums import ProbingState FREQ_CAT_NUM = 4 UDF = 0 # undefined OTH = 1 # other ASC = 2 # ascii capital letter ASS = 3 # ascii small letter ACV = 4 # accent capital vowel ACO = 5 # accent capital other ASV = 6 # accent small vowel ASO = 7 # accent small other CLASS_NUM = 8 # total classes Latin1_CharToClass = ( OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 00 - 07 OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 08 - 0F OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 10 - 17 OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 18 - 1F OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 20 - 27 OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 28 - 2F OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 30 - 37 OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 38 - 3F OTH, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 40 - 47 ASC, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 48 - 4F ASC, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 50 - 57 ASC, ASC, ASC, OTH, OTH, OTH, OTH, OTH, # 58 - 5F OTH, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 60 - 67 ASS, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 68 - 6F ASS, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 70 - 77 ASS, ASS, ASS, OTH, OTH, OTH, OTH, OTH, # 78 - 7F OTH, UDF, OTH, ASO, OTH, OTH, OTH, OTH, # 80 - 87 OTH, OTH, ACO, OTH, ACO, UDF, ACO, UDF, # 88 - 8F UDF, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 90 - 97 OTH, OTH, ASO, OTH, ASO, UDF, ASO, ACO, # 98 - 9F OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # A0 - A7 OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # A8 - AF OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # B0 - B7 OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # B8 - BF ACV, ACV, ACV, ACV, ACV, ACV, ACO, ACO, # C0 - C7 ACV, ACV, ACV, ACV, ACV, ACV, ACV, ACV, # C8 - CF ACO, ACO, ACV, ACV, ACV, ACV, ACV, OTH, # D0 - D7 ACV, ACV, ACV, ACV, ACV, ACO, ACO, ACO, # D8 - DF ASV, ASV, ASV, ASV, ASV, ASV, ASO, ASO, # E0 - E7 ASV, ASV, ASV, ASV, ASV, ASV, ASV, ASV, # E8 - EF ASO, ASO, ASV, ASV, ASV, ASV, ASV, OTH, # F0 - F7 ASV, ASV, ASV, ASV, ASV, ASO, ASO, ASO, # F8 - FF ) # 0 : illegal # 1 : very unlikely # 2 : normal # 3 : very likely Latin1ClassModel = ( # UDF OTH ASC ASS ACV ACO ASV ASO 0, 0, 0, 0, 0, 0, 0, 0, # UDF 0, 3, 3, 3, 3, 3, 3, 3, # OTH 0, 3, 3, 3, 3, 3, 3, 3, # ASC 0, 3, 3, 3, 1, 1, 3, 3, # ASS 0, 3, 3, 3, 1, 2, 1, 2, # ACV 0, 3, 3, 3, 3, 3, 3, 3, # ACO 0, 3, 1, 3, 1, 1, 1, 3, # ASV 0, 3, 1, 3, 1, 1, 3, 3, # ASO ) class Latin1Prober(CharSetProber): def __init__(self): super(Latin1Prober, self).__init__() self._last_char_class = None self._freq_counter = None self.reset() def reset(self): self._last_char_class = OTH self._freq_counter = [0] * FREQ_CAT_NUM CharSetProber.reset(self) @property def charset_name(self): return "ISO-8859-1" @property def language(self): return "" def feed(self, byte_str): byte_str = self.filter_with_english_letters(byte_str) for c in byte_str: char_class = Latin1_CharToClass[c] freq = Latin1ClassModel[(self._last_char_class * CLASS_NUM) + char_class] if freq == 0: self._state = ProbingState.NOT_ME break self._freq_counter[freq] += 1 self._last_char_class = char_class return self.state def get_confidence(self): if self.state == ProbingState.NOT_ME: return 0.01 total = sum(self._freq_counter) if total < 0.01: confidence = 0.0 else: confidence = ((self._freq_counter[3] - self._freq_counter[1] * 20.0) / total) if confidence < 0.0: confidence = 0.0 # lower the confidence of latin1 so that other more accurate # detector can take priority. confidence = confidence * 0.73 return confidence PKd]&chardet/euckrprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import EUCKRDistributionAnalysis from .mbcssm import EUCKR_SM_MODEL class EUCKRProber(MultiByteCharSetProber): def __init__(self): super(EUCKRProber, self).__init__() self.coding_sm = CodingStateMachine(EUCKR_SM_MODEL) self.distribution_analyzer = EUCKRDistributionAnalysis() self.reset() @property def charset_name(self): return "EUC-KR" @property def language(self): return "Korean" PKd]Gǐchardet/version.pynu[""" This module exists only to simplify retrieving the version number of chardet from within setup.py and from chardet subpackages. :author: Dan Blanchard (dan.blanchard@gmail.com) """ __version__ = "3.0.4" VERSION = __version__.split('.') PKd]|ennchardet/compat.pynu[######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Dan Blanchard # Ian Cordasco # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### import sys if sys.version_info < (3, 0): PY2 = True PY3 = False base_str = (str, unicode) text_type = unicode else: PY2 = False PY3 = True base_str = (bytes, str) text_type = str PKd]h'2'2chardet/langbulgarianmodel.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # 255: Control characters that usually does not exist in any text # 254: Carriage/Return # 253: symbol (punctuation) that does not belong to word # 252: 0 - 9 # Character Mapping Table: # this table is modified base on win1251BulgarianCharToOrderMap, so # only number <64 is sure valid Latin5_BulgarianCharToOrderMap = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253, 77, 90, 99,100, 72,109,107,101, 79,185, 81,102, 76, 94, 82, # 40 110,186,108, 91, 74,119, 84, 96,111,187,115,253,253,253,253,253, # 50 253, 65, 69, 70, 66, 63, 68,112,103, 92,194,104, 95, 86, 87, 71, # 60 116,195, 85, 93, 97,113,196,197,198,199,200,253,253,253,253,253, # 70 194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209, # 80 210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225, # 90 81,226,227,228,229,230,105,231,232,233,234,235,236, 45,237,238, # a0 31, 32, 35, 43, 37, 44, 55, 47, 40, 59, 33, 46, 38, 36, 41, 30, # b0 39, 28, 34, 51, 48, 49, 53, 50, 54, 57, 61,239, 67,240, 60, 56, # c0 1, 18, 9, 20, 11, 3, 23, 15, 2, 26, 12, 10, 14, 6, 4, 13, # d0 7, 8, 5, 19, 29, 25, 22, 21, 27, 24, 17, 75, 52,241, 42, 16, # e0 62,242,243,244, 58,245, 98,246,247,248,249,250,251, 91,252,253, # f0 ) win1251BulgarianCharToOrderMap = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253, 77, 90, 99,100, 72,109,107,101, 79,185, 81,102, 76, 94, 82, # 40 110,186,108, 91, 74,119, 84, 96,111,187,115,253,253,253,253,253, # 50 253, 65, 69, 70, 66, 63, 68,112,103, 92,194,104, 95, 86, 87, 71, # 60 116,195, 85, 93, 97,113,196,197,198,199,200,253,253,253,253,253, # 70 206,207,208,209,210,211,212,213,120,214,215,216,217,218,219,220, # 80 221, 78, 64, 83,121, 98,117,105,222,223,224,225,226,227,228,229, # 90 88,230,231,232,233,122, 89,106,234,235,236,237,238, 45,239,240, # a0 73, 80,118,114,241,242,243,244,245, 62, 58,246,247,248,249,250, # b0 31, 32, 35, 43, 37, 44, 55, 47, 40, 59, 33, 46, 38, 36, 41, 30, # c0 39, 28, 34, 51, 48, 49, 53, 50, 54, 57, 61,251, 67,252, 60, 56, # d0 1, 18, 9, 20, 11, 3, 23, 15, 2, 26, 12, 10, 14, 6, 4, 13, # e0 7, 8, 5, 19, 29, 25, 22, 21, 27, 24, 17, 75, 52,253, 42, 16, # f0 ) # Model Table: # total sequences: 100% # first 512 sequences: 96.9392% # first 1024 sequences:3.0618% # rest sequences: 0.2992% # negative sequences: 0.0020% BulgarianLangModel = ( 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,2,2,1,2,2, 3,1,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,0,1, 0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,3,3,0,3,1,0, 0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,1,3,3,3,3,2,2,2,1,1,2,0,1,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,3,3,2,3,2,2,3,3,1,1,2,3,3,2,3,3,3,3,2,1,2,0,2,0,3,0,0, 0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,3,3,1,3,3,3,3,3,2,3,2,3,3,3,3,3,2,3,3,1,3,0,3,0,2,0,0, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,3,3,3,1,3,3,2,3,3,3,1,3,3,2,3,2,2,2,0,0,2,0,2,0,2,0,0, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,3,3,1,2,2,3,2,1,1,2,0,2,0,0,0,0, 1,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,3,3,2,3,3,1,2,3,2,2,2,3,3,3,3,3,2,2,3,1,2,0,2,1,2,0,0, 0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,1,3,3,3,3,3,2,3,3,3,2,3,3,2,3,2,2,2,3,1,2,0,1,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,3,3,3,3,3,3,1,1,1,2,2,1,3,1,3,2,2,3,0,0,1,0,1,0,1,0,0, 0,0,0,1,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,2,2,3,2,2,3,1,2,1,1,1,2,3,1,3,1,2,2,0,1,1,1,1,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,1,3,2,2,3,3,1,2,3,1,1,3,3,3,3,1,2,2,1,1,1,0,2,0,2,0,1, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,2,2,3,3,3,2,2,1,1,2,0,2,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 3,0,1,2,1,3,3,2,3,3,3,3,3,2,3,2,1,0,3,1,2,1,2,1,2,3,2,1,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,2,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,1,3,3,2,3,3,2,2,2,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,3,3,3,3,0,3,3,3,3,3,2,1,1,2,1,3,3,0,3,1,1,1,1,3,2,0,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 3,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,1,1,3,1,3,3,2,3,2,2,2,3,0,2,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,2,3,3,2,2,3,2,1,1,1,1,1,3,1,3,1,1,0,0,0,1,0,0,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,2,3,2,0,3,2,0,3,0,2,0,0,2,1,3,1,0,0,1,0,0,0,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,2,1,1,1,1,2,1,1,2,1,1,1,2,2,1,2,1,1,1,0,1,1,0,1,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,2,1,3,1,1,2,1,3,2,1,1,0,1,2,3,2,1,1,1,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,3,3,3,3,2,2,1,0,1,0,0,1,0,0,0,2,1,0,3,0,0,1,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,2,3,2,3,3,1,3,2,1,1,1,2,1,1,2,1,3,0,1,0,0,0,1,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,1,1,2,2,3,3,2,3,2,2,2,3,1,2,2,1,1,2,1,1,2,2,0,1,1,0,1,0,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,2,1,3,1,0,2,2,1,3,2,1,0,0,2,0,2,0,1,0,0,0,0,0,0,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,3,1,2,0,2,3,1,2,3,2,0,1,3,1,2,1,1,1,0,0,1,0,0,2,2,2,3, 2,2,2,2,1,2,1,1,2,2,1,1,2,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,1, 3,3,3,3,3,2,1,2,2,1,2,0,2,0,1,0,1,2,1,2,1,1,0,0,0,1,0,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1, 3,3,2,3,3,1,1,3,1,0,3,2,1,0,0,0,1,2,0,2,0,1,0,0,0,1,0,1,2,1,2,2, 1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,0,1,2,1,1,1,0,0,0,0,0,1,1,0,0, 3,1,0,1,0,2,3,2,2,2,3,2,2,2,2,2,1,0,2,1,2,1,1,1,0,1,2,1,2,2,2,1, 1,1,2,2,2,2,1,2,1,1,0,1,2,1,2,2,2,1,1,1,0,1,1,1,1,2,0,1,0,0,0,0, 2,3,2,3,3,0,0,2,1,0,2,1,0,0,0,0,2,3,0,2,0,0,0,0,0,1,0,0,2,0,1,2, 2,1,2,1,2,2,1,1,1,2,1,1,1,0,1,2,2,1,1,1,1,1,0,1,1,1,0,0,1,2,0,0, 3,3,2,2,3,0,2,3,1,1,2,0,0,0,1,0,0,2,0,2,0,0,0,1,0,1,0,1,2,0,2,2, 1,1,1,1,2,1,0,1,2,2,2,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1,1,0,0, 2,3,2,3,3,0,0,3,0,1,1,0,1,0,0,0,2,2,1,2,0,0,0,0,0,0,0,0,2,0,1,2, 2,2,1,1,1,1,1,2,2,2,1,0,2,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0, 3,3,3,3,2,2,2,2,2,0,2,1,1,1,1,2,1,2,1,1,0,2,0,1,0,1,0,0,2,0,1,2, 1,1,1,1,1,1,1,2,2,1,1,0,2,0,1,0,2,0,0,1,1,1,0,0,2,0,0,0,1,1,0,0, 2,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,0,0,0,0,0,1,2,0,1,2, 2,2,2,1,1,2,1,1,2,2,2,1,2,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,1,1,0,0, 2,3,3,3,3,0,2,2,0,2,1,0,0,0,1,1,1,2,0,2,0,0,0,3,0,0,0,0,2,0,2,2, 1,1,1,2,1,2,1,1,2,2,2,1,2,0,1,1,1,0,1,1,1,1,0,2,1,0,0,0,1,1,0,0, 2,3,3,3,3,0,2,1,0,0,2,0,0,0,0,0,1,2,0,2,0,0,0,0,0,0,0,0,2,0,1,2, 1,1,1,2,1,1,1,1,2,2,2,0,1,0,1,1,1,0,0,1,1,1,0,0,1,0,0,0,0,1,0,0, 3,3,2,2,3,0,1,0,1,0,0,0,0,0,0,0,1,1,0,3,0,0,0,0,0,0,0,0,1,0,2,2, 1,1,1,1,1,2,1,1,2,2,1,2,2,1,0,1,1,1,1,1,0,1,0,0,1,0,0,0,1,1,0,0, 3,1,0,1,0,2,2,2,2,3,2,1,1,1,2,3,0,0,1,0,2,1,1,0,1,1,1,1,2,1,1,1, 1,2,2,1,2,1,2,2,1,1,0,1,2,1,2,2,1,1,1,0,0,1,1,1,2,1,0,1,0,0,0,0, 2,1,0,1,0,3,1,2,2,2,2,1,2,2,1,1,1,0,2,1,2,2,1,1,2,1,1,0,2,1,1,1, 1,2,2,2,2,2,2,2,1,2,0,1,1,0,2,1,1,1,1,1,0,0,1,1,1,1,0,1,0,0,0,0, 2,1,1,1,1,2,2,2,2,1,2,2,2,1,2,2,1,1,2,1,2,3,2,2,1,1,1,1,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,2,2,3,2,0,1,2,0,1,2,1,1,0,1,0,1,2,1,2,0,0,0,1,1,0,0,0,1,0,0,2, 1,1,0,0,1,1,0,1,1,1,1,0,2,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0, 2,0,0,0,0,1,2,2,2,2,2,2,2,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,2,1,1,1, 1,2,2,2,2,1,1,2,1,2,1,1,1,0,2,1,2,1,1,1,0,2,1,1,1,1,0,1,0,0,0,0, 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0, 1,1,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,2,2,3,2,0,0,0,0,1,0,0,0,0,0,0,1,1,0,2,0,0,0,0,0,0,0,0,1,0,1,2, 1,1,1,1,1,1,0,0,2,2,2,2,2,0,1,1,0,1,1,1,1,1,0,0,1,0,0,0,1,1,0,1, 2,3,1,2,1,0,1,1,0,2,2,2,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,2, 1,1,1,1,2,1,1,1,1,1,1,1,1,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0, 2,2,2,2,2,0,0,2,0,0,2,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,2,0,2,2, 1,1,1,1,1,0,0,1,2,1,1,0,1,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0, 1,2,2,2,2,0,0,2,0,1,1,0,0,0,1,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,1,1, 0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0, 1,2,2,3,2,0,0,1,0,0,1,0,0,0,0,0,0,1,0,2,0,0,0,1,0,0,0,0,0,0,0,2, 1,1,0,0,1,0,0,0,1,1,0,0,1,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0, 2,1,2,2,2,1,2,1,2,2,1,1,2,1,1,1,0,1,1,1,1,2,0,1,0,1,1,1,1,0,1,1, 1,1,2,1,1,1,1,1,1,0,0,1,2,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0, 1,0,0,1,3,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,2,2,2,1,0,0,1,0,2,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,2,0,0,1, 0,2,0,1,0,0,1,1,2,0,1,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0, 1,2,2,2,2,0,1,1,0,2,1,0,1,1,1,0,0,1,0,2,0,1,0,0,0,0,0,0,0,0,0,1, 0,1,0,0,1,0,0,0,1,1,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0, 2,2,2,2,2,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1, 0,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0, 2,0,1,0,0,1,2,1,1,1,1,1,1,2,2,1,0,0,1,0,1,0,0,0,0,1,1,1,1,0,0,0, 1,1,2,1,1,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,2,1,2,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1, 0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0, 0,1,1,0,1,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,2,0,0,2,0,1,0,0,1,0,0,1, 1,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0, 1,1,1,1,1,1,1,2,0,0,0,0,0,0,2,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, ) Latin5BulgarianModel = { 'char_to_order_map': Latin5_BulgarianCharToOrderMap, 'precedence_matrix': BulgarianLangModel, 'typical_positive_ratio': 0.969392, 'keep_english_letter': False, 'charset_name': "ISO-8859-5", 'language': 'Bulgairan', } Win1251BulgarianModel = { 'char_to_order_map': win1251BulgarianCharToOrderMap, 'precedence_matrix': BulgarianLangModel, 'typical_positive_ratio': 0.969392, 'keep_english_letter': False, 'charset_name': "windows-1251", 'language': 'Bulgarian', } PKd]& chardet/cli/chardetect.pynu[#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from __future__ import absolute_import, print_function, unicode_literals import argparse import sys from pip._vendor.chardet import __version__ from pip._vendor.chardet.compat import PY2 from pip._vendor.chardet.universaldetector import UniversalDetector def description_of(lines, name='stdin'): """ Return a string describing the probable encoding of a file or list of strings. :param lines: The lines to get the encoding of. :type lines: Iterable of bytes :param name: Name of file or collection of lines :type name: str """ u = UniversalDetector() for line in lines: line = bytearray(line) u.feed(line) # shortcut out of the loop to save reading further - particularly useful if we read a BOM. if u.done: break u.close() result = u.result if PY2: name = name.decode(sys.getfilesystemencoding(), 'ignore') if result['encoding']: return '{0}: {1} with confidence {2}'.format(name, result['encoding'], result['confidence']) else: return '{0}: no result'.format(name) def main(argv=None): """ Handles command line arguments and gets things started. :param argv: List of arguments, as if specified on the command-line. If None, ``sys.argv[1:]`` is used instead. :type argv: list of str """ # Get command line arguments parser = argparse.ArgumentParser( description="Takes one or more file paths and reports their detected \ encodings") parser.add_argument('input', help='File whose encoding we would like to determine. \ (default: stdin)', type=argparse.FileType('rb'), nargs='*', default=[sys.stdin if PY2 else sys.stdin.buffer]) parser.add_argument('--version', action='version', version='%(prog)s {0}'.format(__version__)) args = parser.parse_args(argv) for f in args.input: if f.isatty(): print("You are running chardetect interactively. Press " + "CTRL-D twice at the start of a blank line to signal the " + "end of your input. If you want help, run chardetect " + "--help\n", file=sys.stderr) print(description_of(f, f.name)) if __name__ == '__main__': main() PKd]j. 1chardet/cli/__pycache__/chardetect.cpython-38.pycnu[U ʗRef @sRdZddlZddlZddlmZddlmZd ddZd d d Ze d krNedS)a Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. N) __version__)UniversalDetectorstdincCsht}|D] }t|}|||jr q,q ||j}|dr^|d|dd|dS|dS)z Return a string describing the probable encoding of a file or list of strings. :param lines: The lines to get the encoding of. :type lines: Iterable of bytes :param name: Name of file or collection of lines :type name: str encodingz: z with confidence confidencez : no result)r bytearrayfeeddonecloseresult)linesnameuliner r/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/cli/chardetect.pydescription_ofs  rcCstjdd}|jddtddtjjgd|jdd d td ||}|j D]*}| rlt d tj d t t ||jqRdS)z Handles command line arguments and gets things started. :param argv: List of arguments, as if specified on the command-line. If None, ``sys.argv[1:]`` is used instead. :type argv: list of str zVTakes one or more file paths and reports their detected encodings) descriptioninputz^File whose encoding we would like to determine. (default: stdin)rb*)helptypenargsdefaultz --versionversionz %(prog)s )actionrzYou are running chardetect interactively. Press CTRL-D twice at the start of a blank line to signal the end of your input. If you want help, run chardetect --help )fileN)argparseArgumentParser add_argumentFileTypesysrbufferr parse_argsrisattyprintstderrrr)argvparserargsfrrrmain/s.   r-__main__)r)N) __doc__rr#runiversaldetectorrrr-__name__rrrrs    &PKd]m1/chardet/cli/__pycache__/__init__.cpython-38.pycnu[U ʗRe@sdS)Nrrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/cli/__init__.pyPKd](^d d 7chardet/cli/__pycache__/chardetect.cpython-38.opt-1.pycnu[U .e @srdZddlmZmZmZddlZddlZddlmZddl m Z ddl m Z d dd Z dd d Zed krnedS)a Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. )absolute_importprint_functionunicode_literalsN) __version__)PY2)UniversalDetectorstdincCszt}|D] }t|}|||jr q,q ||j}trN|t d}|drld ||d|dSd |SdS)z Return a string describing the probable encoding of a file or list of strings. :param lines: The lines to get the encoding of. :type lines: Iterable of bytes :param name: Name of file or collection of lines :type name: str ignoreencodingz{0}: {1} with confidence {2}Z confidencez{0}: no resultN) r bytearrayZfeedZdonecloseresultrdecodesysgetfilesystemencodingformat)linesnameuliner rF/usr/lib/python3.8/site-packages/pip/_vendor/chardet/cli/chardetect.pydescription_ofs   rcCstjdd}|jddtddtr(tjntjjgd|jdd d t d | |}|j D]*}| rvt d tjd t t||jq\dS)z Handles command line arguments and gets things started. :param argv: List of arguments, as if specified on the command-line. If None, ``sys.argv[1:]`` is used instead. :type argv: list of str zVTakes one or more file paths and reports their detected encodings) descriptioninputz^File whose encoding we would like to determine. (default: stdin)rb*)helptypenargsdefaultz --versionversionz %(prog)s {0})actionr!zYou are running chardetect interactively. Press CTRL-D twice at the start of a blank line to signal the end of your input. If you want help, run chardetect --help )fileN)argparseArgumentParser add_argumentZFileTyperrrbufferrr parse_argsrisattyprintstderrrr)argvparserargsfrrrmain6s&   r0__main__)r)N)__doc__Z __future__rrrr$rZpip._vendor.chardetrZpip._vendor.chardet.compatrZ%pip._vendor.chardet.universaldetectorrrr0__name__rrrrs     PKd]AП5chardet/cli/__pycache__/__init__.cpython-38.opt-1.pycnu[U .e@sdS)NrrrD/usr/lib/python3.8/site-packages/pip/_vendor/chardet/cli/__init__.pyPKd]2chardet/cli/__init__.pynu[ PKd]6uMU U chardet/mbcharsetprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # Shy Shalom - original C code # Proofpoint, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .charsetprober import CharSetProber from .enums import ProbingState, MachineState class MultiByteCharSetProber(CharSetProber): """ MultiByteCharSetProber """ def __init__(self, lang_filter=None): super(MultiByteCharSetProber, self).__init__(lang_filter=lang_filter) self.distribution_analyzer = None self.coding_sm = None self._last_char = [0, 0] def reset(self): super(MultiByteCharSetProber, self).reset() if self.coding_sm: self.coding_sm.reset() if self.distribution_analyzer: self.distribution_analyzer.reset() self._last_char = [0, 0] @property def charset_name(self): raise NotImplementedError @property def language(self): raise NotImplementedError def feed(self, byte_str): for i in range(len(byte_str)): coding_state = self.coding_sm.next_state(byte_str[i]) if coding_state == MachineState.ERROR: self.logger.debug('%s %s prober hit error at byte %s', self.charset_name, self.language, i) self._state = ProbingState.NOT_ME break elif coding_state == MachineState.ITS_ME: self._state = ProbingState.FOUND_IT break elif coding_state == MachineState.START: char_len = self.coding_sm.get_current_charlen() if i == 0: self._last_char[1] = byte_str[0] self.distribution_analyzer.feed(self._last_char, char_len) else: self.distribution_analyzer.feed(byte_str[i - 1:i + 1], char_len) self._last_char[0] = byte_str[-1] if self.state == ProbingState.DETECTING: if (self.distribution_analyzer.got_enough_data() and (self.get_confidence() > self.SHORTCUT_THRESHOLD)): self._state = ProbingState.FOUND_IT return self.state def get_confidence(self): return self.distribution_analyzer.get_confidence() PKd]9zzchardet/big5freq.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # Big5 frequency table # by Taiwan's Mandarin Promotion Council # # # 128 --> 0.42261 # 256 --> 0.57851 # 512 --> 0.74851 # 1024 --> 0.89384 # 2048 --> 0.97583 # # Ideal Distribution Ratio = 0.74851/(1-0.74851) =2.98 # Random Distribution Ration = 512/(5401-512)=0.105 # # Typical Distribution Ratio about 25% of Ideal one, still much higher than RDR BIG5_TYPICAL_DISTRIBUTION_RATIO = 0.75 #Char to FreqOrder table BIG5_TABLE_SIZE = 5376 BIG5_CHAR_TO_FREQ_ORDER = ( 1,1801,1506, 255,1431, 198, 9, 82, 6,5008, 177, 202,3681,1256,2821, 110, # 16 3814, 33,3274, 261, 76, 44,2114, 16,2946,2187,1176, 659,3971, 26,3451,2653, # 32 1198,3972,3350,4202, 410,2215, 302, 590, 361,1964, 8, 204, 58,4510,5009,1932, # 48 63,5010,5011, 317,1614, 75, 222, 159,4203,2417,1480,5012,3555,3091, 224,2822, # 64 3682, 3, 10,3973,1471, 29,2787,1135,2866,1940, 873, 130,3275,1123, 312,5013, # 80 4511,2052, 507, 252, 682,5014, 142,1915, 124, 206,2947, 34,3556,3204, 64, 604, # 96 5015,2501,1977,1978, 155,1991, 645, 641,1606,5016,3452, 337, 72, 406,5017, 80, # 112 630, 238,3205,1509, 263, 939,1092,2654, 756,1440,1094,3453, 449, 69,2987, 591, # 128 179,2096, 471, 115,2035,1844, 60, 50,2988, 134, 806,1869, 734,2036,3454, 180, # 144 995,1607, 156, 537,2907, 688,5018, 319,1305, 779,2145, 514,2379, 298,4512, 359, # 160 2502, 90,2716,1338, 663, 11, 906,1099,2553, 20,2441, 182, 532,1716,5019, 732, # 176 1376,4204,1311,1420,3206, 25,2317,1056, 113, 399, 382,1950, 242,3455,2474, 529, # 192 3276, 475,1447,3683,5020, 117, 21, 656, 810,1297,2300,2334,3557,5021, 126,4205, # 208 706, 456, 150, 613,4513, 71,1118,2037,4206, 145,3092, 85, 835, 486,2115,1246, # 224 1426, 428, 727,1285,1015, 800, 106, 623, 303,1281,5022,2128,2359, 347,3815, 221, # 240 3558,3135,5023,1956,1153,4207, 83, 296,1199,3093, 192, 624, 93,5024, 822,1898, # 256 2823,3136, 795,2065, 991,1554,1542,1592, 27, 43,2867, 859, 139,1456, 860,4514, # 272 437, 712,3974, 164,2397,3137, 695, 211,3037,2097, 195,3975,1608,3559,3560,3684, # 288 3976, 234, 811,2989,2098,3977,2233,1441,3561,1615,2380, 668,2077,1638, 305, 228, # 304 1664,4515, 467, 415,5025, 262,2099,1593, 239, 108, 300, 200,1033, 512,1247,2078, # 320 5026,5027,2176,3207,3685,2682, 593, 845,1062,3277, 88,1723,2038,3978,1951, 212, # 336 266, 152, 149, 468,1899,4208,4516, 77, 187,5028,3038, 37, 5,2990,5029,3979, # 352 5030,5031, 39,2524,4517,2908,3208,2079, 55, 148, 74,4518, 545, 483,1474,1029, # 368 1665, 217,1870,1531,3138,1104,2655,4209, 24, 172,3562, 900,3980,3563,3564,4519, # 384 32,1408,2824,1312, 329, 487,2360,2251,2717, 784,2683, 4,3039,3351,1427,1789, # 400 188, 109, 499,5032,3686,1717,1790, 888,1217,3040,4520,5033,3565,5034,3352,1520, # 416 3687,3981, 196,1034, 775,5035,5036, 929,1816, 249, 439, 38,5037,1063,5038, 794, # 432 3982,1435,2301, 46, 178,3278,2066,5039,2381,5040, 214,1709,4521, 804, 35, 707, # 448 324,3688,1601,2554, 140, 459,4210,5041,5042,1365, 839, 272, 978,2262,2580,3456, # 464 2129,1363,3689,1423, 697, 100,3094, 48, 70,1231, 495,3139,2196,5043,1294,5044, # 480 2080, 462, 586,1042,3279, 853, 256, 988, 185,2382,3457,1698, 434,1084,5045,3458, # 496 314,2625,2788,4522,2335,2336, 569,2285, 637,1817,2525, 757,1162,1879,1616,3459, # 512 287,1577,2116, 768,4523,1671,2868,3566,2526,1321,3816, 909,2418,5046,4211, 933, # 528 3817,4212,2053,2361,1222,4524, 765,2419,1322, 786,4525,5047,1920,1462,1677,2909, # 544 1699,5048,4526,1424,2442,3140,3690,2600,3353,1775,1941,3460,3983,4213, 309,1369, # 560 1130,2825, 364,2234,1653,1299,3984,3567,3985,3986,2656, 525,1085,3041, 902,2001, # 576 1475, 964,4527, 421,1845,1415,1057,2286, 940,1364,3141, 376,4528,4529,1381, 7, # 592 2527, 983,2383, 336,1710,2684,1846, 321,3461, 559,1131,3042,2752,1809,1132,1313, # 608 265,1481,1858,5049, 352,1203,2826,3280, 167,1089, 420,2827, 776, 792,1724,3568, # 624 4214,2443,3281,5050,4215,5051, 446, 229, 333,2753, 901,3818,1200,1557,4530,2657, # 640 1921, 395,2754,2685,3819,4216,1836, 125, 916,3209,2626,4531,5052,5053,3820,5054, # 656 5055,5056,4532,3142,3691,1133,2555,1757,3462,1510,2318,1409,3569,5057,2146, 438, # 672 2601,2910,2384,3354,1068, 958,3043, 461, 311,2869,2686,4217,1916,3210,4218,1979, # 688 383, 750,2755,2627,4219, 274, 539, 385,1278,1442,5058,1154,1965, 384, 561, 210, # 704 98,1295,2556,3570,5059,1711,2420,1482,3463,3987,2911,1257, 129,5060,3821, 642, # 720 523,2789,2790,2658,5061, 141,2235,1333, 68, 176, 441, 876, 907,4220, 603,2602, # 736 710, 171,3464, 404, 549, 18,3143,2398,1410,3692,1666,5062,3571,4533,2912,4534, # 752 5063,2991, 368,5064, 146, 366, 99, 871,3693,1543, 748, 807,1586,1185, 22,2263, # 768 379,3822,3211,5065,3212, 505,1942,2628,1992,1382,2319,5066, 380,2362, 218, 702, # 784 1818,1248,3465,3044,3572,3355,3282,5067,2992,3694, 930,3283,3823,5068, 59,5069, # 800 585, 601,4221, 497,3466,1112,1314,4535,1802,5070,1223,1472,2177,5071, 749,1837, # 816 690,1900,3824,1773,3988,1476, 429,1043,1791,2236,2117, 917,4222, 447,1086,1629, # 832 5072, 556,5073,5074,2021,1654, 844,1090, 105, 550, 966,1758,2828,1008,1783, 686, # 848 1095,5075,2287, 793,1602,5076,3573,2603,4536,4223,2948,2302,4537,3825, 980,2503, # 864 544, 353, 527,4538, 908,2687,2913,5077, 381,2629,1943,1348,5078,1341,1252, 560, # 880 3095,5079,3467,2870,5080,2054, 973, 886,2081, 143,4539,5081,5082, 157,3989, 496, # 896 4224, 57, 840, 540,2039,4540,4541,3468,2118,1445, 970,2264,1748,1966,2082,4225, # 912 3144,1234,1776,3284,2829,3695, 773,1206,2130,1066,2040,1326,3990,1738,1725,4226, # 928 279,3145, 51,1544,2604, 423,1578,2131,2067, 173,4542,1880,5083,5084,1583, 264, # 944 610,3696,4543,2444, 280, 154,5085,5086,5087,1739, 338,1282,3096, 693,2871,1411, # 960 1074,3826,2445,5088,4544,5089,5090,1240, 952,2399,5091,2914,1538,2688, 685,1483, # 976 4227,2475,1436, 953,4228,2055,4545, 671,2400, 79,4229,2446,3285, 608, 567,2689, # 992 3469,4230,4231,1691, 393,1261,1792,2401,5092,4546,5093,5094,5095,5096,1383,1672, # 1008 3827,3213,1464, 522,1119, 661,1150, 216, 675,4547,3991,1432,3574, 609,4548,2690, # 1024 2402,5097,5098,5099,4232,3045, 0,5100,2476, 315, 231,2447, 301,3356,4549,2385, # 1040 5101, 233,4233,3697,1819,4550,4551,5102, 96,1777,1315,2083,5103, 257,5104,1810, # 1056 3698,2718,1139,1820,4234,2022,1124,2164,2791,1778,2659,5105,3097, 363,1655,3214, # 1072 5106,2993,5107,5108,5109,3992,1567,3993, 718, 103,3215, 849,1443, 341,3357,2949, # 1088 1484,5110,1712, 127, 67, 339,4235,2403, 679,1412, 821,5111,5112, 834, 738, 351, # 1104 2994,2147, 846, 235,1497,1881, 418,1993,3828,2719, 186,1100,2148,2756,3575,1545, # 1120 1355,2950,2872,1377, 583,3994,4236,2581,2995,5113,1298,3699,1078,2557,3700,2363, # 1136 78,3829,3830, 267,1289,2100,2002,1594,4237, 348, 369,1274,2197,2178,1838,4552, # 1152 1821,2830,3701,2757,2288,2003,4553,2951,2758, 144,3358, 882,4554,3995,2759,3470, # 1168 4555,2915,5114,4238,1726, 320,5115,3996,3046, 788,2996,5116,2831,1774,1327,2873, # 1184 3997,2832,5117,1306,4556,2004,1700,3831,3576,2364,2660, 787,2023, 506, 824,3702, # 1200 534, 323,4557,1044,3359,2024,1901, 946,3471,5118,1779,1500,1678,5119,1882,4558, # 1216 165, 243,4559,3703,2528, 123, 683,4239, 764,4560, 36,3998,1793, 589,2916, 816, # 1232 626,1667,3047,2237,1639,1555,1622,3832,3999,5120,4000,2874,1370,1228,1933, 891, # 1248 2084,2917, 304,4240,5121, 292,2997,2720,3577, 691,2101,4241,1115,4561, 118, 662, # 1264 5122, 611,1156, 854,2386,1316,2875, 2, 386, 515,2918,5123,5124,3286, 868,2238, # 1280 1486, 855,2661, 785,2216,3048,5125,1040,3216,3578,5126,3146, 448,5127,1525,5128, # 1296 2165,4562,5129,3833,5130,4242,2833,3579,3147, 503, 818,4001,3148,1568, 814, 676, # 1312 1444, 306,1749,5131,3834,1416,1030, 197,1428, 805,2834,1501,4563,5132,5133,5134, # 1328 1994,5135,4564,5136,5137,2198, 13,2792,3704,2998,3149,1229,1917,5138,3835,2132, # 1344 5139,4243,4565,2404,3580,5140,2217,1511,1727,1120,5141,5142, 646,3836,2448, 307, # 1360 5143,5144,1595,3217,5145,5146,5147,3705,1113,1356,4002,1465,2529,2530,5148, 519, # 1376 5149, 128,2133, 92,2289,1980,5150,4003,1512, 342,3150,2199,5151,2793,2218,1981, # 1392 3360,4244, 290,1656,1317, 789, 827,2365,5152,3837,4566, 562, 581,4004,5153, 401, # 1408 4567,2252, 94,4568,5154,1399,2794,5155,1463,2025,4569,3218,1944,5156, 828,1105, # 1424 4245,1262,1394,5157,4246, 605,4570,5158,1784,2876,5159,2835, 819,2102, 578,2200, # 1440 2952,5160,1502, 436,3287,4247,3288,2836,4005,2919,3472,3473,5161,2721,2320,5162, # 1456 5163,2337,2068, 23,4571, 193, 826,3838,2103, 699,1630,4248,3098, 390,1794,1064, # 1472 3581,5164,1579,3099,3100,1400,5165,4249,1839,1640,2877,5166,4572,4573, 137,4250, # 1488 598,3101,1967, 780, 104, 974,2953,5167, 278, 899, 253, 402, 572, 504, 493,1339, # 1504 5168,4006,1275,4574,2582,2558,5169,3706,3049,3102,2253, 565,1334,2722, 863, 41, # 1520 5170,5171,4575,5172,1657,2338, 19, 463,2760,4251, 606,5173,2999,3289,1087,2085, # 1536 1323,2662,3000,5174,1631,1623,1750,4252,2691,5175,2878, 791,2723,2663,2339, 232, # 1552 2421,5176,3001,1498,5177,2664,2630, 755,1366,3707,3290,3151,2026,1609, 119,1918, # 1568 3474, 862,1026,4253,5178,4007,3839,4576,4008,4577,2265,1952,2477,5179,1125, 817, # 1584 4254,4255,4009,1513,1766,2041,1487,4256,3050,3291,2837,3840,3152,5180,5181,1507, # 1600 5182,2692, 733, 40,1632,1106,2879, 345,4257, 841,2531, 230,4578,3002,1847,3292, # 1616 3475,5183,1263, 986,3476,5184, 735, 879, 254,1137, 857, 622,1300,1180,1388,1562, # 1632 4010,4011,2954, 967,2761,2665,1349, 592,2134,1692,3361,3003,1995,4258,1679,4012, # 1648 1902,2188,5185, 739,3708,2724,1296,1290,5186,4259,2201,2202,1922,1563,2605,2559, # 1664 1871,2762,3004,5187, 435,5188, 343,1108, 596, 17,1751,4579,2239,3477,3709,5189, # 1680 4580, 294,3582,2955,1693, 477, 979, 281,2042,3583, 643,2043,3710,2631,2795,2266, # 1696 1031,2340,2135,2303,3584,4581, 367,1249,2560,5190,3585,5191,4582,1283,3362,2005, # 1712 240,1762,3363,4583,4584, 836,1069,3153, 474,5192,2149,2532, 268,3586,5193,3219, # 1728 1521,1284,5194,1658,1546,4260,5195,3587,3588,5196,4261,3364,2693,1685,4262, 961, # 1744 1673,2632, 190,2006,2203,3841,4585,4586,5197, 570,2504,3711,1490,5198,4587,2633, # 1760 3293,1957,4588, 584,1514, 396,1045,1945,5199,4589,1968,2449,5200,5201,4590,4013, # 1776 619,5202,3154,3294, 215,2007,2796,2561,3220,4591,3221,4592, 763,4263,3842,4593, # 1792 5203,5204,1958,1767,2956,3365,3712,1174, 452,1477,4594,3366,3155,5205,2838,1253, # 1808 2387,2189,1091,2290,4264, 492,5206, 638,1169,1825,2136,1752,4014, 648, 926,1021, # 1824 1324,4595, 520,4596, 997, 847,1007, 892,4597,3843,2267,1872,3713,2405,1785,4598, # 1840 1953,2957,3103,3222,1728,4265,2044,3714,4599,2008,1701,3156,1551, 30,2268,4266, # 1856 5207,2027,4600,3589,5208, 501,5209,4267, 594,3478,2166,1822,3590,3479,3591,3223, # 1872 829,2839,4268,5210,1680,3157,1225,4269,5211,3295,4601,4270,3158,2341,5212,4602, # 1888 4271,5213,4015,4016,5214,1848,2388,2606,3367,5215,4603, 374,4017, 652,4272,4273, # 1904 375,1140, 798,5216,5217,5218,2366,4604,2269, 546,1659, 138,3051,2450,4605,5219, # 1920 2254, 612,1849, 910, 796,3844,1740,1371, 825,3845,3846,5220,2920,2562,5221, 692, # 1936 444,3052,2634, 801,4606,4274,5222,1491, 244,1053,3053,4275,4276, 340,5223,4018, # 1952 1041,3005, 293,1168, 87,1357,5224,1539, 959,5225,2240, 721, 694,4277,3847, 219, # 1968 1478, 644,1417,3368,2666,1413,1401,1335,1389,4019,5226,5227,3006,2367,3159,1826, # 1984 730,1515, 184,2840, 66,4607,5228,1660,2958, 246,3369, 378,1457, 226,3480, 975, # 2000 4020,2959,1264,3592, 674, 696,5229, 163,5230,1141,2422,2167, 713,3593,3370,4608, # 2016 4021,5231,5232,1186, 15,5233,1079,1070,5234,1522,3224,3594, 276,1050,2725, 758, # 2032 1126, 653,2960,3296,5235,2342, 889,3595,4022,3104,3007, 903,1250,4609,4023,3481, # 2048 3596,1342,1681,1718, 766,3297, 286, 89,2961,3715,5236,1713,5237,2607,3371,3008, # 2064 5238,2962,2219,3225,2880,5239,4610,2505,2533, 181, 387,1075,4024, 731,2190,3372, # 2080 5240,3298, 310, 313,3482,2304, 770,4278, 54,3054, 189,4611,3105,3848,4025,5241, # 2096 1230,1617,1850, 355,3597,4279,4612,3373, 111,4280,3716,1350,3160,3483,3055,4281, # 2112 2150,3299,3598,5242,2797,4026,4027,3009, 722,2009,5243,1071, 247,1207,2343,2478, # 2128 1378,4613,2010, 864,1437,1214,4614, 373,3849,1142,2220, 667,4615, 442,2763,2563, # 2144 3850,4028,1969,4282,3300,1840, 837, 170,1107, 934,1336,1883,5244,5245,2119,4283, # 2160 2841, 743,1569,5246,4616,4284, 582,2389,1418,3484,5247,1803,5248, 357,1395,1729, # 2176 3717,3301,2423,1564,2241,5249,3106,3851,1633,4617,1114,2086,4285,1532,5250, 482, # 2192 2451,4618,5251,5252,1492, 833,1466,5253,2726,3599,1641,2842,5254,1526,1272,3718, # 2208 4286,1686,1795, 416,2564,1903,1954,1804,5255,3852,2798,3853,1159,2321,5256,2881, # 2224 4619,1610,1584,3056,2424,2764, 443,3302,1163,3161,5257,5258,4029,5259,4287,2506, # 2240 3057,4620,4030,3162,2104,1647,3600,2011,1873,4288,5260,4289, 431,3485,5261, 250, # 2256 97, 81,4290,5262,1648,1851,1558, 160, 848,5263, 866, 740,1694,5264,2204,2843, # 2272 3226,4291,4621,3719,1687, 950,2479, 426, 469,3227,3720,3721,4031,5265,5266,1188, # 2288 424,1996, 861,3601,4292,3854,2205,2694, 168,1235,3602,4293,5267,2087,1674,4622, # 2304 3374,3303, 220,2565,1009,5268,3855, 670,3010, 332,1208, 717,5269,5270,3603,2452, # 2320 4032,3375,5271, 513,5272,1209,2882,3376,3163,4623,1080,5273,5274,5275,5276,2534, # 2336 3722,3604, 815,1587,4033,4034,5277,3605,3486,3856,1254,4624,1328,3058,1390,4035, # 2352 1741,4036,3857,4037,5278, 236,3858,2453,3304,5279,5280,3723,3859,1273,3860,4625, # 2368 5281, 308,5282,4626, 245,4627,1852,2480,1307,2583, 430, 715,2137,2454,5283, 270, # 2384 199,2883,4038,5284,3606,2727,1753, 761,1754, 725,1661,1841,4628,3487,3724,5285, # 2400 5286, 587, 14,3305, 227,2608, 326, 480,2270, 943,2765,3607, 291, 650,1884,5287, # 2416 1702,1226, 102,1547, 62,3488, 904,4629,3489,1164,4294,5288,5289,1224,1548,2766, # 2432 391, 498,1493,5290,1386,1419,5291,2056,1177,4630, 813, 880,1081,2368, 566,1145, # 2448 4631,2291,1001,1035,2566,2609,2242, 394,1286,5292,5293,2069,5294, 86,1494,1730, # 2464 4039, 491,1588, 745, 897,2963, 843,3377,4040,2767,2884,3306,1768, 998,2221,2070, # 2480 397,1827,1195,1970,3725,3011,3378, 284,5295,3861,2507,2138,2120,1904,5296,4041, # 2496 2151,4042,4295,1036,3490,1905, 114,2567,4296, 209,1527,5297,5298,2964,2844,2635, # 2512 2390,2728,3164, 812,2568,5299,3307,5300,1559, 737,1885,3726,1210, 885, 28,2695, # 2528 3608,3862,5301,4297,1004,1780,4632,5302, 346,1982,2222,2696,4633,3863,1742, 797, # 2544 1642,4043,1934,1072,1384,2152, 896,4044,3308,3727,3228,2885,3609,5303,2569,1959, # 2560 4634,2455,1786,5304,5305,5306,4045,4298,1005,1308,3728,4299,2729,4635,4636,1528, # 2576 2610, 161,1178,4300,1983, 987,4637,1101,4301, 631,4046,1157,3229,2425,1343,1241, # 2592 1016,2243,2570, 372, 877,2344,2508,1160, 555,1935, 911,4047,5307, 466,1170, 169, # 2608 1051,2921,2697,3729,2481,3012,1182,2012,2571,1251,2636,5308, 992,2345,3491,1540, # 2624 2730,1201,2071,2406,1997,2482,5309,4638, 528,1923,2191,1503,1874,1570,2369,3379, # 2640 3309,5310, 557,1073,5311,1828,3492,2088,2271,3165,3059,3107, 767,3108,2799,4639, # 2656 1006,4302,4640,2346,1267,2179,3730,3230, 778,4048,3231,2731,1597,2667,5312,4641, # 2672 5313,3493,5314,5315,5316,3310,2698,1433,3311, 131, 95,1504,4049, 723,4303,3166, # 2688 1842,3610,2768,2192,4050,2028,2105,3731,5317,3013,4051,1218,5318,3380,3232,4052, # 2704 4304,2584, 248,1634,3864, 912,5319,2845,3732,3060,3865, 654, 53,5320,3014,5321, # 2720 1688,4642, 777,3494,1032,4053,1425,5322, 191, 820,2121,2846, 971,4643, 931,3233, # 2736 135, 664, 783,3866,1998, 772,2922,1936,4054,3867,4644,2923,3234, 282,2732, 640, # 2752 1372,3495,1127, 922, 325,3381,5323,5324, 711,2045,5325,5326,4055,2223,2800,1937, # 2768 4056,3382,2224,2255,3868,2305,5327,4645,3869,1258,3312,4057,3235,2139,2965,4058, # 2784 4059,5328,2225, 258,3236,4646, 101,1227,5329,3313,1755,5330,1391,3314,5331,2924, # 2800 2057, 893,5332,5333,5334,1402,4305,2347,5335,5336,3237,3611,5337,5338, 878,1325, # 2816 1781,2801,4647, 259,1385,2585, 744,1183,2272,4648,5339,4060,2509,5340, 684,1024, # 2832 4306,5341, 472,3612,3496,1165,3315,4061,4062, 322,2153, 881, 455,1695,1152,1340, # 2848 660, 554,2154,4649,1058,4650,4307, 830,1065,3383,4063,4651,1924,5342,1703,1919, # 2864 5343, 932,2273, 122,5344,4652, 947, 677,5345,3870,2637, 297,1906,1925,2274,4653, # 2880 2322,3316,5346,5347,4308,5348,4309, 84,4310, 112, 989,5349, 547,1059,4064, 701, # 2896 3613,1019,5350,4311,5351,3497, 942, 639, 457,2306,2456, 993,2966, 407, 851, 494, # 2912 4654,3384, 927,5352,1237,5353,2426,3385, 573,4312, 680, 921,2925,1279,1875, 285, # 2928 790,1448,1984, 719,2168,5354,5355,4655,4065,4066,1649,5356,1541, 563,5357,1077, # 2944 5358,3386,3061,3498, 511,3015,4067,4068,3733,4069,1268,2572,3387,3238,4656,4657, # 2960 5359, 535,1048,1276,1189,2926,2029,3167,1438,1373,2847,2967,1134,2013,5360,4313, # 2976 1238,2586,3109,1259,5361, 700,5362,2968,3168,3734,4314,5363,4315,1146,1876,1907, # 2992 4658,2611,4070, 781,2427, 132,1589, 203, 147, 273,2802,2407, 898,1787,2155,4071, # 3008 4072,5364,3871,2803,5365,5366,4659,4660,5367,3239,5368,1635,3872, 965,5369,1805, # 3024 2699,1516,3614,1121,1082,1329,3317,4073,1449,3873, 65,1128,2848,2927,2769,1590, # 3040 3874,5370,5371, 12,2668, 45, 976,2587,3169,4661, 517,2535,1013,1037,3240,5372, # 3056 3875,2849,5373,3876,5374,3499,5375,2612, 614,1999,2323,3877,3110,2733,2638,5376, # 3072 2588,4316, 599,1269,5377,1811,3735,5378,2700,3111, 759,1060, 489,1806,3388,3318, # 3088 1358,5379,5380,2391,1387,1215,2639,2256, 490,5381,5382,4317,1759,2392,2348,5383, # 3104 4662,3878,1908,4074,2640,1807,3241,4663,3500,3319,2770,2349, 874,5384,5385,3501, # 3120 3736,1859, 91,2928,3737,3062,3879,4664,5386,3170,4075,2669,5387,3502,1202,1403, # 3136 3880,2969,2536,1517,2510,4665,3503,2511,5388,4666,5389,2701,1886,1495,1731,4076, # 3152 2370,4667,5390,2030,5391,5392,4077,2702,1216, 237,2589,4318,2324,4078,3881,4668, # 3168 4669,2703,3615,3504, 445,4670,5393,5394,5395,5396,2771, 61,4079,3738,1823,4080, # 3184 5397, 687,2046, 935, 925, 405,2670, 703,1096,1860,2734,4671,4081,1877,1367,2704, # 3200 3389, 918,2106,1782,2483, 334,3320,1611,1093,4672, 564,3171,3505,3739,3390, 945, # 3216 2641,2058,4673,5398,1926, 872,4319,5399,3506,2705,3112, 349,4320,3740,4082,4674, # 3232 3882,4321,3741,2156,4083,4675,4676,4322,4677,2408,2047, 782,4084, 400, 251,4323, # 3248 1624,5400,5401, 277,3742, 299,1265, 476,1191,3883,2122,4324,4325,1109, 205,5402, # 3264 2590,1000,2157,3616,1861,5403,5404,5405,4678,5406,4679,2573, 107,2484,2158,4085, # 3280 3507,3172,5407,1533, 541,1301, 158, 753,4326,2886,3617,5408,1696, 370,1088,4327, # 3296 4680,3618, 579, 327, 440, 162,2244, 269,1938,1374,3508, 968,3063, 56,1396,3113, # 3312 2107,3321,3391,5409,1927,2159,4681,3016,5410,3619,5411,5412,3743,4682,2485,5413, # 3328 2804,5414,1650,4683,5415,2613,5416,5417,4086,2671,3392,1149,3393,4087,3884,4088, # 3344 5418,1076, 49,5419, 951,3242,3322,3323, 450,2850, 920,5420,1812,2805,2371,4328, # 3360 1909,1138,2372,3885,3509,5421,3243,4684,1910,1147,1518,2428,4685,3886,5422,4686, # 3376 2393,2614, 260,1796,3244,5423,5424,3887,3324, 708,5425,3620,1704,5426,3621,1351, # 3392 1618,3394,3017,1887, 944,4329,3395,4330,3064,3396,4331,5427,3744, 422, 413,1714, # 3408 3325, 500,2059,2350,4332,2486,5428,1344,1911, 954,5429,1668,5430,5431,4089,2409, # 3424 4333,3622,3888,4334,5432,2307,1318,2512,3114, 133,3115,2887,4687, 629, 31,2851, # 3440 2706,3889,4688, 850, 949,4689,4090,2970,1732,2089,4335,1496,1853,5433,4091, 620, # 3456 3245, 981,1242,3745,3397,1619,3746,1643,3326,2140,2457,1971,1719,3510,2169,5434, # 3472 3246,5435,5436,3398,1829,5437,1277,4690,1565,2048,5438,1636,3623,3116,5439, 869, # 3488 2852, 655,3890,3891,3117,4092,3018,3892,1310,3624,4691,5440,5441,5442,1733, 558, # 3504 4692,3747, 335,1549,3065,1756,4336,3748,1946,3511,1830,1291,1192, 470,2735,2108, # 3520 2806, 913,1054,4093,5443,1027,5444,3066,4094,4693, 982,2672,3399,3173,3512,3247, # 3536 3248,1947,2807,5445, 571,4694,5446,1831,5447,3625,2591,1523,2429,5448,2090, 984, # 3552 4695,3749,1960,5449,3750, 852, 923,2808,3513,3751, 969,1519, 999,2049,2325,1705, # 3568 5450,3118, 615,1662, 151, 597,4095,2410,2326,1049, 275,4696,3752,4337, 568,3753, # 3584 3626,2487,4338,3754,5451,2430,2275, 409,3249,5452,1566,2888,3514,1002, 769,2853, # 3600 194,2091,3174,3755,2226,3327,4339, 628,1505,5453,5454,1763,2180,3019,4096, 521, # 3616 1161,2592,1788,2206,2411,4697,4097,1625,4340,4341, 412, 42,3119, 464,5455,2642, # 3632 4698,3400,1760,1571,2889,3515,2537,1219,2207,3893,2643,2141,2373,4699,4700,3328, # 3648 1651,3401,3627,5456,5457,3628,2488,3516,5458,3756,5459,5460,2276,2092, 460,5461, # 3664 4701,5462,3020, 962, 588,3629, 289,3250,2644,1116, 52,5463,3067,1797,5464,5465, # 3680 5466,1467,5467,1598,1143,3757,4342,1985,1734,1067,4702,1280,3402, 465,4703,1572, # 3696 510,5468,1928,2245,1813,1644,3630,5469,4704,3758,5470,5471,2673,1573,1534,5472, # 3712 5473, 536,1808,1761,3517,3894,3175,2645,5474,5475,5476,4705,3518,2929,1912,2809, # 3728 5477,3329,1122, 377,3251,5478, 360,5479,5480,4343,1529, 551,5481,2060,3759,1769, # 3744 2431,5482,2930,4344,3330,3120,2327,2109,2031,4706,1404, 136,1468,1479, 672,1171, # 3760 3252,2308, 271,3176,5483,2772,5484,2050, 678,2736, 865,1948,4707,5485,2014,4098, # 3776 2971,5486,2737,2227,1397,3068,3760,4708,4709,1735,2931,3403,3631,5487,3895, 509, # 3792 2854,2458,2890,3896,5488,5489,3177,3178,4710,4345,2538,4711,2309,1166,1010, 552, # 3808 681,1888,5490,5491,2972,2973,4099,1287,1596,1862,3179, 358, 453, 736, 175, 478, # 3824 1117, 905,1167,1097,5492,1854,1530,5493,1706,5494,2181,3519,2292,3761,3520,3632, # 3840 4346,2093,4347,5495,3404,1193,2489,4348,1458,2193,2208,1863,1889,1421,3331,2932, # 3856 3069,2182,3521, 595,2123,5496,4100,5497,5498,4349,1707,2646, 223,3762,1359, 751, # 3872 3121, 183,3522,5499,2810,3021, 419,2374, 633, 704,3897,2394, 241,5500,5501,5502, # 3888 838,3022,3763,2277,2773,2459,3898,1939,2051,4101,1309,3122,2246,1181,5503,1136, # 3904 2209,3899,2375,1446,4350,2310,4712,5504,5505,4351,1055,2615, 484,3764,5506,4102, # 3920 625,4352,2278,3405,1499,4353,4103,5507,4104,4354,3253,2279,2280,3523,5508,5509, # 3936 2774, 808,2616,3765,3406,4105,4355,3123,2539, 526,3407,3900,4356, 955,5510,1620, # 3952 4357,2647,2432,5511,1429,3766,1669,1832, 994, 928,5512,3633,1260,5513,5514,5515, # 3968 1949,2293, 741,2933,1626,4358,2738,2460, 867,1184, 362,3408,1392,5516,5517,4106, # 3984 4359,1770,1736,3254,2934,4713,4714,1929,2707,1459,1158,5518,3070,3409,2891,1292, # 4000 1930,2513,2855,3767,1986,1187,2072,2015,2617,4360,5519,2574,2514,2170,3768,2490, # 4016 3332,5520,3769,4715,5521,5522, 666,1003,3023,1022,3634,4361,5523,4716,1814,2257, # 4032 574,3901,1603, 295,1535, 705,3902,4362, 283, 858, 417,5524,5525,3255,4717,4718, # 4048 3071,1220,1890,1046,2281,2461,4107,1393,1599, 689,2575, 388,4363,5526,2491, 802, # 4064 5527,2811,3903,2061,1405,2258,5528,4719,3904,2110,1052,1345,3256,1585,5529, 809, # 4080 5530,5531,5532, 575,2739,3524, 956,1552,1469,1144,2328,5533,2329,1560,2462,3635, # 4096 3257,4108, 616,2210,4364,3180,2183,2294,5534,1833,5535,3525,4720,5536,1319,3770, # 4112 3771,1211,3636,1023,3258,1293,2812,5537,5538,5539,3905, 607,2311,3906, 762,2892, # 4128 1439,4365,1360,4721,1485,3072,5540,4722,1038,4366,1450,2062,2648,4367,1379,4723, # 4144 2593,5541,5542,4368,1352,1414,2330,2935,1172,5543,5544,3907,3908,4724,1798,1451, # 4160 5545,5546,5547,5548,2936,4109,4110,2492,2351, 411,4111,4112,3637,3333,3124,4725, # 4176 1561,2674,1452,4113,1375,5549,5550, 47,2974, 316,5551,1406,1591,2937,3181,5552, # 4192 1025,2142,3125,3182, 354,2740, 884,2228,4369,2412, 508,3772, 726,3638, 996,2433, # 4208 3639, 729,5553, 392,2194,1453,4114,4726,3773,5554,5555,2463,3640,2618,1675,2813, # 4224 919,2352,2975,2353,1270,4727,4115, 73,5556,5557, 647,5558,3259,2856,2259,1550, # 4240 1346,3024,5559,1332, 883,3526,5560,5561,5562,5563,3334,2775,5564,1212, 831,1347, # 4256 4370,4728,2331,3909,1864,3073, 720,3910,4729,4730,3911,5565,4371,5566,5567,4731, # 4272 5568,5569,1799,4732,3774,2619,4733,3641,1645,2376,4734,5570,2938, 669,2211,2675, # 4288 2434,5571,2893,5572,5573,1028,3260,5574,4372,2413,5575,2260,1353,5576,5577,4735, # 4304 3183, 518,5578,4116,5579,4373,1961,5580,2143,4374,5581,5582,3025,2354,2355,3912, # 4320 516,1834,1454,4117,2708,4375,4736,2229,2620,1972,1129,3642,5583,2776,5584,2976, # 4336 1422, 577,1470,3026,1524,3410,5585,5586, 432,4376,3074,3527,5587,2594,1455,2515, # 4352 2230,1973,1175,5588,1020,2741,4118,3528,4737,5589,2742,5590,1743,1361,3075,3529, # 4368 2649,4119,4377,4738,2295, 895, 924,4378,2171, 331,2247,3076, 166,1627,3077,1098, # 4384 5591,1232,2894,2231,3411,4739, 657, 403,1196,2377, 542,3775,3412,1600,4379,3530, # 4400 5592,4740,2777,3261, 576, 530,1362,4741,4742,2540,2676,3776,4120,5593, 842,3913, # 4416 5594,2814,2032,1014,4121, 213,2709,3413, 665, 621,4380,5595,3777,2939,2435,5596, # 4432 2436,3335,3643,3414,4743,4381,2541,4382,4744,3644,1682,4383,3531,1380,5597, 724, # 4448 2282, 600,1670,5598,1337,1233,4745,3126,2248,5599,1621,4746,5600, 651,4384,5601, # 4464 1612,4385,2621,5602,2857,5603,2743,2312,3078,5604, 716,2464,3079, 174,1255,2710, # 4480 4122,3645, 548,1320,1398, 728,4123,1574,5605,1891,1197,3080,4124,5606,3081,3082, # 4496 3778,3646,3779, 747,5607, 635,4386,4747,5608,5609,5610,4387,5611,5612,4748,5613, # 4512 3415,4749,2437, 451,5614,3780,2542,2073,4388,2744,4389,4125,5615,1764,4750,5616, # 4528 4390, 350,4751,2283,2395,2493,5617,4391,4126,2249,1434,4127, 488,4752, 458,4392, # 4544 4128,3781, 771,1330,2396,3914,2576,3184,2160,2414,1553,2677,3185,4393,5618,2494, # 4560 2895,2622,1720,2711,4394,3416,4753,5619,2543,4395,5620,3262,4396,2778,5621,2016, # 4576 2745,5622,1155,1017,3782,3915,5623,3336,2313, 201,1865,4397,1430,5624,4129,5625, # 4592 5626,5627,5628,5629,4398,1604,5630, 414,1866, 371,2595,4754,4755,3532,2017,3127, # 4608 4756,1708, 960,4399, 887, 389,2172,1536,1663,1721,5631,2232,4130,2356,2940,1580, # 4624 5632,5633,1744,4757,2544,4758,4759,5634,4760,5635,2074,5636,4761,3647,3417,2896, # 4640 4400,5637,4401,2650,3418,2815, 673,2712,2465, 709,3533,4131,3648,4402,5638,1148, # 4656 502, 634,5639,5640,1204,4762,3649,1575,4763,2623,3783,5641,3784,3128, 948,3263, # 4672 121,1745,3916,1110,5642,4403,3083,2516,3027,4132,3785,1151,1771,3917,1488,4133, # 4688 1987,5643,2438,3534,5644,5645,2094,5646,4404,3918,1213,1407,2816, 531,2746,2545, # 4704 3264,1011,1537,4764,2779,4405,3129,1061,5647,3786,3787,1867,2897,5648,2018, 120, # 4720 4406,4407,2063,3650,3265,2314,3919,2678,3419,1955,4765,4134,5649,3535,1047,2713, # 4736 1266,5650,1368,4766,2858, 649,3420,3920,2546,2747,1102,2859,2679,5651,5652,2000, # 4752 5653,1111,3651,2977,5654,2495,3921,3652,2817,1855,3421,3788,5655,5656,3422,2415, # 4768 2898,3337,3266,3653,5657,2577,5658,3654,2818,4135,1460, 856,5659,3655,5660,2899, # 4784 2978,5661,2900,3922,5662,4408, 632,2517, 875,3923,1697,3924,2296,5663,5664,4767, # 4800 3028,1239, 580,4768,4409,5665, 914, 936,2075,1190,4136,1039,2124,5666,5667,5668, # 4816 5669,3423,1473,5670,1354,4410,3925,4769,2173,3084,4137, 915,3338,4411,4412,3339, # 4832 1605,1835,5671,2748, 398,3656,4413,3926,4138, 328,1913,2860,4139,3927,1331,4414, # 4848 3029, 937,4415,5672,3657,4140,4141,3424,2161,4770,3425, 524, 742, 538,3085,1012, # 4864 5673,5674,3928,2466,5675, 658,1103, 225,3929,5676,5677,4771,5678,4772,5679,3267, # 4880 1243,5680,4142, 963,2250,4773,5681,2714,3658,3186,5682,5683,2596,2332,5684,4774, # 4896 5685,5686,5687,3536, 957,3426,2547,2033,1931,2941,2467, 870,2019,3659,1746,2780, # 4912 2781,2439,2468,5688,3930,5689,3789,3130,3790,3537,3427,3791,5690,1179,3086,5691, # 4928 3187,2378,4416,3792,2548,3188,3131,2749,4143,5692,3428,1556,2549,2297, 977,2901, # 4944 2034,4144,1205,3429,5693,1765,3430,3189,2125,1271, 714,1689,4775,3538,5694,2333, # 4960 3931, 533,4417,3660,2184, 617,5695,2469,3340,3539,2315,5696,5697,3190,5698,5699, # 4976 3932,1988, 618, 427,2651,3540,3431,5700,5701,1244,1690,5702,2819,4418,4776,5703, # 4992 3541,4777,5704,2284,1576, 473,3661,4419,3432, 972,5705,3662,5706,3087,5707,5708, # 5008 4778,4779,5709,3793,4145,4146,5710, 153,4780, 356,5711,1892,2902,4420,2144, 408, # 5024 803,2357,5712,3933,5713,4421,1646,2578,2518,4781,4782,3934,5714,3935,4422,5715, # 5040 2416,3433, 752,5716,5717,1962,3341,2979,5718, 746,3030,2470,4783,4423,3794, 698, # 5056 4784,1893,4424,3663,2550,4785,3664,3936,5719,3191,3434,5720,1824,1302,4147,2715, # 5072 3937,1974,4425,5721,4426,3192, 823,1303,1288,1236,2861,3542,4148,3435, 774,3938, # 5088 5722,1581,4786,1304,2862,3939,4787,5723,2440,2162,1083,3268,4427,4149,4428, 344, # 5104 1173, 288,2316, 454,1683,5724,5725,1461,4788,4150,2597,5726,5727,4789, 985, 894, # 5120 5728,3436,3193,5729,1914,2942,3795,1989,5730,2111,1975,5731,4151,5732,2579,1194, # 5136 425,5733,4790,3194,1245,3796,4429,5734,5735,2863,5736, 636,4791,1856,3940, 760, # 5152 1800,5737,4430,2212,1508,4792,4152,1894,1684,2298,5738,5739,4793,4431,4432,2213, # 5168 479,5740,5741, 832,5742,4153,2496,5743,2980,2497,3797, 990,3132, 627,1815,2652, # 5184 4433,1582,4434,2126,2112,3543,4794,5744, 799,4435,3195,5745,4795,2113,1737,3031, # 5200 1018, 543, 754,4436,3342,1676,4796,4797,4154,4798,1489,5746,3544,5747,2624,2903, # 5216 4155,5748,5749,2981,5750,5751,5752,5753,3196,4799,4800,2185,1722,5754,3269,3270, # 5232 1843,3665,1715, 481, 365,1976,1857,5755,5756,1963,2498,4801,5757,2127,3666,3271, # 5248 433,1895,2064,2076,5758, 602,2750,5759,5760,5761,5762,5763,3032,1628,3437,5764, # 5264 3197,4802,4156,2904,4803,2519,5765,2551,2782,5766,5767,5768,3343,4804,2905,5769, # 5280 4805,5770,2864,4806,4807,1221,2982,4157,2520,5771,5772,5773,1868,1990,5774,5775, # 5296 5776,1896,5777,5778,4808,1897,4158, 318,5779,2095,4159,4437,5780,5781, 485,5782, # 5312 938,3941, 553,2680, 116,5783,3942,3667,5784,3545,2681,2783,3438,3344,2820,5785, # 5328 3668,2943,4160,1747,2944,2983,5786,5787, 207,5788,4809,5789,4810,2521,5790,3033, # 5344 890,3669,3943,5791,1878,3798,3439,5792,2186,2358,3440,1652,5793,5794,5795, 941, # 5360 2299, 208,3546,4161,2020, 330,4438,3944,2906,2499,3799,4439,4811,5796,5797,5798, # 5376 ) PKd]"?,,chardet/langthaimodel.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # 255: Control characters that usually does not exist in any text # 254: Carriage/Return # 253: symbol (punctuation) that does not belong to word # 252: 0 - 9 # The following result for thai was collected from a limited sample (1M). # Character Mapping Table: TIS620CharToOrderMap = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253,182,106,107,100,183,184,185,101, 94,186,187,108,109,110,111, # 40 188,189,190, 89, 95,112,113,191,192,193,194,253,253,253,253,253, # 50 253, 64, 72, 73,114, 74,115,116,102, 81,201,117, 90,103, 78, 82, # 60 96,202, 91, 79, 84,104,105, 97, 98, 92,203,253,253,253,253,253, # 70 209,210,211,212,213, 88,214,215,216,217,218,219,220,118,221,222, 223,224, 99, 85, 83,225,226,227,228,229,230,231,232,233,234,235, 236, 5, 30,237, 24,238, 75, 8, 26, 52, 34, 51,119, 47, 58, 57, 49, 53, 55, 43, 20, 19, 44, 14, 48, 3, 17, 25, 39, 62, 31, 54, 45, 9, 16, 2, 61, 15,239, 12, 42, 46, 18, 21, 76, 4, 66, 63, 22, 10, 1, 36, 23, 13, 40, 27, 32, 35, 86,240,241,242,243,244, 11, 28, 41, 29, 33,245, 50, 37, 6, 7, 67, 77, 38, 93,246,247, 68, 56, 59, 65, 69, 60, 70, 80, 71, 87,248,249,250,251,252,253, ) # Model Table: # total sequences: 100% # first 512 sequences: 92.6386% # first 1024 sequences:7.3177% # rest sequences: 1.0230% # negative sequences: 0.0436% ThaiLangModel = ( 0,1,3,3,3,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,0,0,3,3,3,0,3,3,3,3, 0,3,3,0,0,0,1,3,0,3,3,2,3,3,0,1,2,3,3,3,3,0,2,0,2,0,0,3,2,1,2,2, 3,0,3,3,2,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,0,3,2,3,0,2,2,2,3, 0,2,3,0,0,0,0,1,0,1,2,3,1,1,3,2,2,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1, 3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,3,3,2,3,2,3,3,2,2,2, 3,1,2,3,0,3,3,2,2,1,2,3,3,1,2,0,1,3,0,1,0,0,1,0,0,0,0,0,0,0,1,1, 3,3,2,2,3,3,3,3,1,2,3,3,3,3,3,2,2,2,2,3,3,2,2,3,3,2,2,3,2,3,2,2, 3,3,1,2,3,1,2,2,3,3,1,0,2,1,0,0,3,1,2,1,0,0,1,0,0,0,0,0,0,1,0,1, 3,3,3,3,3,3,2,2,3,3,3,3,2,3,2,2,3,3,2,2,3,2,2,2,2,1,1,3,1,2,1,1, 3,2,1,0,2,1,0,1,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0, 3,3,3,2,3,2,3,3,2,2,3,2,3,3,2,3,1,1,2,3,2,2,2,3,2,2,2,2,2,1,2,1, 2,2,1,1,3,3,2,1,0,1,2,2,0,1,3,0,0,0,1,1,0,0,0,0,0,2,3,0,0,2,1,1, 3,3,2,3,3,2,0,0,3,3,0,3,3,0,2,2,3,1,2,2,1,1,1,0,2,2,2,0,2,2,1,1, 0,2,1,0,2,0,0,2,0,1,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0, 3,3,2,3,3,2,0,0,3,3,0,2,3,0,2,1,2,2,2,2,1,2,0,0,2,2,2,0,2,2,1,1, 0,2,1,0,2,0,0,2,0,1,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0, 3,3,2,3,2,3,2,0,2,2,1,3,2,1,3,2,1,2,3,2,2,3,0,2,3,2,2,1,2,2,2,2, 1,2,2,0,0,0,0,2,0,1,2,0,1,1,1,0,1,0,3,1,1,0,0,0,0,0,0,0,0,0,1,0, 3,3,2,3,3,2,3,2,2,2,3,2,2,3,2,2,1,2,3,2,2,3,1,3,2,2,2,3,2,2,2,3, 3,2,1,3,0,1,1,1,0,2,1,1,1,1,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,2,0,0, 1,0,0,3,0,3,3,3,3,3,0,0,3,0,2,2,3,3,3,3,3,0,0,0,1,1,3,0,0,0,0,2, 0,0,1,0,0,0,0,0,0,0,2,3,0,0,0,3,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0, 2,0,3,3,3,3,0,0,2,3,0,0,3,0,3,3,2,3,3,3,3,3,0,0,3,3,3,0,0,0,3,3, 0,0,3,0,0,0,0,2,0,0,2,1,1,3,0,0,1,0,0,2,3,0,1,0,0,0,0,0,0,0,1,0, 3,3,3,3,2,3,3,3,3,3,3,3,1,2,1,3,3,2,2,1,2,2,2,3,1,1,2,0,2,1,2,1, 2,2,1,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0, 3,0,2,1,2,3,3,3,0,2,0,2,2,0,2,1,3,2,2,1,2,1,0,0,2,2,1,0,2,1,2,2, 0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,2,1,3,3,1,1,3,0,2,3,1,1,3,2,1,1,2,0,2,2,3,2,1,1,1,1,1,2, 3,0,0,1,3,1,2,1,2,0,3,0,0,0,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, 3,3,1,1,3,2,3,3,3,1,3,2,1,3,2,1,3,2,2,2,2,1,3,3,1,2,1,3,1,2,3,0, 2,1,1,3,2,2,2,1,2,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 3,3,2,3,2,3,3,2,3,2,3,2,3,3,2,1,0,3,2,2,2,1,2,2,2,1,2,2,1,2,1,1, 2,2,2,3,0,1,3,1,1,1,1,0,1,1,0,2,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,2,3,2,2,1,1,3,2,3,2,3,2,0,3,2,2,1,2,0,2,2,2,1,2,2,2,2,1, 3,2,1,2,2,1,0,2,0,1,0,0,1,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,1, 3,3,3,3,3,2,3,1,2,3,3,2,2,3,0,1,1,2,0,3,3,2,2,3,0,1,1,3,0,0,0,0, 3,1,0,3,3,0,2,0,2,1,0,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,2,3,2,3,3,0,1,3,1,1,2,1,2,1,1,3,1,1,0,2,3,1,1,1,1,1,1,1,1, 3,1,1,2,2,2,2,1,1,1,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 3,2,2,1,1,2,1,3,3,2,3,2,2,3,2,2,3,1,2,2,1,2,0,3,2,1,2,2,2,2,2,1, 3,2,1,2,2,2,1,1,1,1,0,0,1,1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,1,3,3,0,2,1,0,3,2,0,0,3,1,0,1,1,0,1,0,0,0,0,0,1, 1,0,0,1,0,3,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,2,2,2,3,0,0,1,3,0,3,2,0,3,2,2,3,3,3,3,3,1,0,2,2,2,0,2,2,1,2, 0,2,3,0,0,0,0,1,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 3,0,2,3,1,3,3,2,3,3,0,3,3,0,3,2,2,3,2,3,3,3,0,0,2,2,3,0,1,1,1,3, 0,0,3,0,0,0,2,2,0,1,3,0,1,2,2,2,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1, 3,2,3,3,2,0,3,3,2,2,3,1,3,2,1,3,2,0,1,2,2,0,2,3,2,1,0,3,0,0,0,0, 3,0,0,2,3,1,3,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,1,3,2,2,2,1,2,0,1,3,1,1,3,1,3,0,0,2,1,1,1,1,2,1,1,1,0,2,1,0,1, 1,2,0,0,0,3,1,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,0,3,1,0,0,0,1,0, 3,3,3,3,2,2,2,2,2,1,3,1,1,1,2,0,1,1,2,1,2,1,3,2,0,0,3,1,1,1,1,1, 3,1,0,2,3,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,2,3,0,3,3,0,2,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0, 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,2,3,1,3,0,0,1,2,0,0,2,0,3,3,2,3,3,3,2,3,0,0,2,2,2,0,0,0,2,2, 0,0,1,0,0,0,0,3,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, 0,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,1,2,3,1,3,3,0,0,1,0,3,0,0,0,0,0, 0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,1,2,3,1,2,3,1,0,3,0,2,2,1,0,2,1,1,2,0,1,0,0,1,1,1,1,0,1,0,0, 1,0,0,0,0,1,1,0,3,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,2,1,0,1,1,1,3,1,2,2,2,2,2,2,1,1,1,1,0,3,1,0,1,3,1,1,1,1, 1,1,0,2,0,1,3,1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1, 3,0,2,2,1,3,3,2,3,3,0,1,1,0,2,2,1,2,1,3,3,1,0,0,3,2,0,0,0,0,2,1, 0,1,0,0,0,0,1,2,0,1,1,3,1,1,2,2,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 0,0,3,0,0,1,0,0,0,3,0,0,3,0,3,1,0,1,1,1,3,2,0,0,0,3,0,0,0,0,2,0, 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0, 3,3,1,3,2,1,3,3,1,2,2,0,1,2,1,0,1,2,0,0,0,0,0,3,0,0,0,3,0,0,0,0, 3,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,1,2,0,3,3,3,2,2,0,1,1,0,1,3,0,0,0,2,2,0,0,0,0,3,1,0,1,0,0,0, 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,2,3,1,2,0,0,2,1,0,3,1,0,1,2,0,1,1,1,1,3,0,0,3,1,1,0,2,2,1,1, 0,2,0,0,0,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,0,3,1,2,0,0,2,2,0,1,2,0,1,0,1,3,1,2,1,0,0,0,2,0,3,0,0,0,1,0, 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,1,1,2,2,0,0,0,2,0,2,1,0,1,1,0,1,1,1,2,1,0,0,1,1,1,0,2,1,1,1, 0,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1, 0,0,0,2,0,1,3,1,1,1,1,0,0,0,0,3,2,0,1,0,0,0,1,2,0,0,0,1,0,0,0,0, 0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,2,3,2,2,0,0,0,1,0,0,0,0,2,3,2,1,2,2,3,0,0,0,2,3,1,0,0,0,1,1, 0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0, 3,3,2,2,0,1,0,0,0,0,2,0,2,0,1,0,0,0,1,1,0,0,0,2,1,0,1,0,1,1,0,0, 0,1,0,2,0,0,1,0,3,0,1,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,1,0,0,1,0,0,0,0,0,1,1,2,0,0,0,0,1,0,0,1,3,1,0,0,0,0,1,1,0,0, 0,1,0,0,0,0,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0, 3,3,1,1,1,1,2,3,0,0,2,1,1,1,1,1,0,2,1,1,0,0,0,2,1,0,1,2,1,1,0,1, 2,1,0,3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,3,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1, 0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,2,0,0,0,0,0,0,1,2,1,0,1,1,0,2,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,2,0,0,0,1,3,0,1,0,0,0,2,0,0,0,0,0,0,0,1,2,0,0,0,0,0, 3,3,0,0,1,1,2,0,0,1,2,1,0,1,1,1,0,1,1,0,0,2,1,1,0,1,0,0,1,1,1,0, 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,2,2,1,0,0,0,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0, 2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,3,0,0,1,1,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,0,1,2,0,1,2,0,0,1,1,0,2,0,1,0,0,1,0,0,0,0,1,0,0,0,2,0,0,0,0, 1,0,0,1,0,1,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,0,0,0,0,0,0,0,1,1,0,1,1,0,2,1,3,0,0,0,0,1,1,0,0,0,0,0,0,0,3, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,0,1,0,1,0,0,2,0,0,2,0,0,1,1,2,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,0, 1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, 1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,0,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,3,0,0,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0, 1,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,1,1,0,0,2,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ) TIS620ThaiModel = { 'char_to_order_map': TIS620CharToOrderMap, 'precedence_matrix': ThaiLangModel, 'typical_positive_ratio': 0.926386, 'keep_english_letter': False, 'charset_name': "TIS-620", 'language': 'Thai', } PKd] )Ӳ66chardet/hebrewprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .charsetprober import CharSetProber from .enums import ProbingState # This prober doesn't actually recognize a language or a charset. # It is a helper prober for the use of the Hebrew model probers ### General ideas of the Hebrew charset recognition ### # # Four main charsets exist in Hebrew: # "ISO-8859-8" - Visual Hebrew # "windows-1255" - Logical Hebrew # "ISO-8859-8-I" - Logical Hebrew # "x-mac-hebrew" - ?? Logical Hebrew ?? # # Both "ISO" charsets use a completely identical set of code points, whereas # "windows-1255" and "x-mac-hebrew" are two different proper supersets of # these code points. windows-1255 defines additional characters in the range # 0x80-0x9F as some misc punctuation marks as well as some Hebrew-specific # diacritics and additional 'Yiddish' ligature letters in the range 0xc0-0xd6. # x-mac-hebrew defines similar additional code points but with a different # mapping. # # As far as an average Hebrew text with no diacritics is concerned, all four # charsets are identical with respect to code points. Meaning that for the # main Hebrew alphabet, all four map the same values to all 27 Hebrew letters # (including final letters). # # The dominant difference between these charsets is their directionality. # "Visual" directionality means that the text is ordered as if the renderer is # not aware of a BIDI rendering algorithm. The renderer sees the text and # draws it from left to right. The text itself when ordered naturally is read # backwards. A buffer of Visual Hebrew generally looks like so: # "[last word of first line spelled backwards] [whole line ordered backwards # and spelled backwards] [first word of first line spelled backwards] # [end of line] [last word of second line] ... etc' " # adding punctuation marks, numbers and English text to visual text is # naturally also "visual" and from left to right. # # "Logical" directionality means the text is ordered "naturally" according to # the order it is read. It is the responsibility of the renderer to display # the text from right to left. A BIDI algorithm is used to place general # punctuation marks, numbers and English text in the text. # # Texts in x-mac-hebrew are almost impossible to find on the Internet. From # what little evidence I could find, it seems that its general directionality # is Logical. # # To sum up all of the above, the Hebrew probing mechanism knows about two # charsets: # Visual Hebrew - "ISO-8859-8" - backwards text - Words and sentences are # backwards while line order is natural. For charset recognition purposes # the line order is unimportant (In fact, for this implementation, even # word order is unimportant). # Logical Hebrew - "windows-1255" - normal, naturally ordered text. # # "ISO-8859-8-I" is a subset of windows-1255 and doesn't need to be # specifically identified. # "x-mac-hebrew" is also identified as windows-1255. A text in x-mac-hebrew # that contain special punctuation marks or diacritics is displayed with # some unconverted characters showing as question marks. This problem might # be corrected using another model prober for x-mac-hebrew. Due to the fact # that x-mac-hebrew texts are so rare, writing another model prober isn't # worth the effort and performance hit. # #### The Prober #### # # The prober is divided between two SBCharSetProbers and a HebrewProber, # all of which are managed, created, fed data, inquired and deleted by the # SBCSGroupProber. The two SBCharSetProbers identify that the text is in # fact some kind of Hebrew, Logical or Visual. The final decision about which # one is it is made by the HebrewProber by combining final-letter scores # with the scores of the two SBCharSetProbers to produce a final answer. # # The SBCSGroupProber is responsible for stripping the original text of HTML # tags, English characters, numbers, low-ASCII punctuation characters, spaces # and new lines. It reduces any sequence of such characters to a single space. # The buffer fed to each prober in the SBCS group prober is pure text in # high-ASCII. # The two SBCharSetProbers (model probers) share the same language model: # Win1255Model. # The first SBCharSetProber uses the model normally as any other # SBCharSetProber does, to recognize windows-1255, upon which this model was # built. The second SBCharSetProber is told to make the pair-of-letter # lookup in the language model backwards. This in practice exactly simulates # a visual Hebrew model using the windows-1255 logical Hebrew model. # # The HebrewProber is not using any language model. All it does is look for # final-letter evidence suggesting the text is either logical Hebrew or visual # Hebrew. Disjointed from the model probers, the results of the HebrewProber # alone are meaningless. HebrewProber always returns 0.00 as confidence # since it never identifies a charset by itself. Instead, the pointer to the # HebrewProber is passed to the model probers as a helper "Name Prober". # When the Group prober receives a positive identification from any prober, # it asks for the name of the charset identified. If the prober queried is a # Hebrew model prober, the model prober forwards the call to the # HebrewProber to make the final decision. In the HebrewProber, the # decision is made according to the final-letters scores maintained and Both # model probers scores. The answer is returned in the form of the name of the # charset identified, either "windows-1255" or "ISO-8859-8". class HebrewProber(CharSetProber): # windows-1255 / ISO-8859-8 code points of interest FINAL_KAF = 0xea NORMAL_KAF = 0xeb FINAL_MEM = 0xed NORMAL_MEM = 0xee FINAL_NUN = 0xef NORMAL_NUN = 0xf0 FINAL_PE = 0xf3 NORMAL_PE = 0xf4 FINAL_TSADI = 0xf5 NORMAL_TSADI = 0xf6 # Minimum Visual vs Logical final letter score difference. # If the difference is below this, don't rely solely on the final letter score # distance. MIN_FINAL_CHAR_DISTANCE = 5 # Minimum Visual vs Logical model score difference. # If the difference is below this, don't rely at all on the model score # distance. MIN_MODEL_DISTANCE = 0.01 VISUAL_HEBREW_NAME = "ISO-8859-8" LOGICAL_HEBREW_NAME = "windows-1255" def __init__(self): super(HebrewProber, self).__init__() self._final_char_logical_score = None self._final_char_visual_score = None self._prev = None self._before_prev = None self._logical_prober = None self._visual_prober = None self.reset() def reset(self): self._final_char_logical_score = 0 self._final_char_visual_score = 0 # The two last characters seen in the previous buffer, # mPrev and mBeforePrev are initialized to space in order to simulate # a word delimiter at the beginning of the data self._prev = ' ' self._before_prev = ' ' # These probers are owned by the group prober. def set_model_probers(self, logicalProber, visualProber): self._logical_prober = logicalProber self._visual_prober = visualProber def is_final(self, c): return c in [self.FINAL_KAF, self.FINAL_MEM, self.FINAL_NUN, self.FINAL_PE, self.FINAL_TSADI] def is_non_final(self, c): # The normal Tsadi is not a good Non-Final letter due to words like # 'lechotet' (to chat) containing an apostrophe after the tsadi. This # apostrophe is converted to a space in FilterWithoutEnglishLetters # causing the Non-Final tsadi to appear at an end of a word even # though this is not the case in the original text. # The letters Pe and Kaf rarely display a related behavior of not being # a good Non-Final letter. Words like 'Pop', 'Winamp' and 'Mubarak' # for example legally end with a Non-Final Pe or Kaf. However, the # benefit of these letters as Non-Final letters outweighs the damage # since these words are quite rare. return c in [self.NORMAL_KAF, self.NORMAL_MEM, self.NORMAL_NUN, self.NORMAL_PE] def feed(self, byte_str): # Final letter analysis for logical-visual decision. # Look for evidence that the received buffer is either logical Hebrew # or visual Hebrew. # The following cases are checked: # 1) A word longer than 1 letter, ending with a final letter. This is # an indication that the text is laid out "naturally" since the # final letter really appears at the end. +1 for logical score. # 2) A word longer than 1 letter, ending with a Non-Final letter. In # normal Hebrew, words ending with Kaf, Mem, Nun, Pe or Tsadi, # should not end with the Non-Final form of that letter. Exceptions # to this rule are mentioned above in isNonFinal(). This is an # indication that the text is laid out backwards. +1 for visual # score # 3) A word longer than 1 letter, starting with a final letter. Final # letters should not appear at the beginning of a word. This is an # indication that the text is laid out backwards. +1 for visual # score. # # The visual score and logical score are accumulated throughout the # text and are finally checked against each other in GetCharSetName(). # No checking for final letters in the middle of words is done since # that case is not an indication for either Logical or Visual text. # # We automatically filter out all 7-bit characters (replace them with # spaces) so the word boundary detection works properly. [MAP] if self.state == ProbingState.NOT_ME: # Both model probers say it's not them. No reason to continue. return ProbingState.NOT_ME byte_str = self.filter_high_byte_only(byte_str) for cur in byte_str: if cur == ' ': # We stand on a space - a word just ended if self._before_prev != ' ': # next-to-last char was not a space so self._prev is not a # 1 letter word if self.is_final(self._prev): # case (1) [-2:not space][-1:final letter][cur:space] self._final_char_logical_score += 1 elif self.is_non_final(self._prev): # case (2) [-2:not space][-1:Non-Final letter][ # cur:space] self._final_char_visual_score += 1 else: # Not standing on a space if ((self._before_prev == ' ') and (self.is_final(self._prev)) and (cur != ' ')): # case (3) [-2:space][-1:final letter][cur:not space] self._final_char_visual_score += 1 self._before_prev = self._prev self._prev = cur # Forever detecting, till the end or until both model probers return # ProbingState.NOT_ME (handled above) return ProbingState.DETECTING @property def charset_name(self): # Make the decision: is it Logical or Visual? # If the final letter score distance is dominant enough, rely on it. finalsub = self._final_char_logical_score - self._final_char_visual_score if finalsub >= self.MIN_FINAL_CHAR_DISTANCE: return self.LOGICAL_HEBREW_NAME if finalsub <= -self.MIN_FINAL_CHAR_DISTANCE: return self.VISUAL_HEBREW_NAME # It's not dominant enough, try to rely on the model scores instead. modelsub = (self._logical_prober.get_confidence() - self._visual_prober.get_confidence()) if modelsub > self.MIN_MODEL_DISTANCE: return self.LOGICAL_HEBREW_NAME if modelsub < -self.MIN_MODEL_DISTANCE: return self.VISUAL_HEBREW_NAME # Still no good, back to final letter distance, maybe it'll save the # day. if finalsub < 0.0: return self.VISUAL_HEBREW_NAME # (finalsub > 0 - Logical) or (don't know what to do) default to # Logical. return self.LOGICAL_HEBREW_NAME @property def language(self): return 'Hebrew' @property def state(self): # Remain active as long as any of the model probers are active. if (self._logical_prober.state == ProbingState.NOT_ME) and \ (self._visual_prober.state == ProbingState.NOT_ME): return ProbingState.NOT_ME return ProbingState.DETECTING PKd] `))chardet/escsm.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .enums import MachineState HZ_CLS = ( 1,0,0,0,0,0,0,0, # 00 - 07 0,0,0,0,0,0,0,0, # 08 - 0f 0,0,0,0,0,0,0,0, # 10 - 17 0,0,0,1,0,0,0,0, # 18 - 1f 0,0,0,0,0,0,0,0, # 20 - 27 0,0,0,0,0,0,0,0, # 28 - 2f 0,0,0,0,0,0,0,0, # 30 - 37 0,0,0,0,0,0,0,0, # 38 - 3f 0,0,0,0,0,0,0,0, # 40 - 47 0,0,0,0,0,0,0,0, # 48 - 4f 0,0,0,0,0,0,0,0, # 50 - 57 0,0,0,0,0,0,0,0, # 58 - 5f 0,0,0,0,0,0,0,0, # 60 - 67 0,0,0,0,0,0,0,0, # 68 - 6f 0,0,0,0,0,0,0,0, # 70 - 77 0,0,0,4,0,5,2,0, # 78 - 7f 1,1,1,1,1,1,1,1, # 80 - 87 1,1,1,1,1,1,1,1, # 88 - 8f 1,1,1,1,1,1,1,1, # 90 - 97 1,1,1,1,1,1,1,1, # 98 - 9f 1,1,1,1,1,1,1,1, # a0 - a7 1,1,1,1,1,1,1,1, # a8 - af 1,1,1,1,1,1,1,1, # b0 - b7 1,1,1,1,1,1,1,1, # b8 - bf 1,1,1,1,1,1,1,1, # c0 - c7 1,1,1,1,1,1,1,1, # c8 - cf 1,1,1,1,1,1,1,1, # d0 - d7 1,1,1,1,1,1,1,1, # d8 - df 1,1,1,1,1,1,1,1, # e0 - e7 1,1,1,1,1,1,1,1, # e8 - ef 1,1,1,1,1,1,1,1, # f0 - f7 1,1,1,1,1,1,1,1, # f8 - ff ) HZ_ST = ( MachineState.START,MachineState.ERROR, 3,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,# 00-07 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 08-0f MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START, 4,MachineState.ERROR,# 10-17 5,MachineState.ERROR, 6,MachineState.ERROR, 5, 5, 4,MachineState.ERROR,# 18-1f 4,MachineState.ERROR, 4, 4, 4,MachineState.ERROR, 4,MachineState.ERROR,# 20-27 4,MachineState.ITS_ME,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 28-2f ) HZ_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0) HZ_SM_MODEL = {'class_table': HZ_CLS, 'class_factor': 6, 'state_table': HZ_ST, 'char_len_table': HZ_CHAR_LEN_TABLE, 'name': "HZ-GB-2312", 'language': 'Chinese'} ISO2022CN_CLS = ( 2,0,0,0,0,0,0,0, # 00 - 07 0,0,0,0,0,0,0,0, # 08 - 0f 0,0,0,0,0,0,0,0, # 10 - 17 0,0,0,1,0,0,0,0, # 18 - 1f 0,0,0,0,0,0,0,0, # 20 - 27 0,3,0,0,0,0,0,0, # 28 - 2f 0,0,0,0,0,0,0,0, # 30 - 37 0,0,0,0,0,0,0,0, # 38 - 3f 0,0,0,4,0,0,0,0, # 40 - 47 0,0,0,0,0,0,0,0, # 48 - 4f 0,0,0,0,0,0,0,0, # 50 - 57 0,0,0,0,0,0,0,0, # 58 - 5f 0,0,0,0,0,0,0,0, # 60 - 67 0,0,0,0,0,0,0,0, # 68 - 6f 0,0,0,0,0,0,0,0, # 70 - 77 0,0,0,0,0,0,0,0, # 78 - 7f 2,2,2,2,2,2,2,2, # 80 - 87 2,2,2,2,2,2,2,2, # 88 - 8f 2,2,2,2,2,2,2,2, # 90 - 97 2,2,2,2,2,2,2,2, # 98 - 9f 2,2,2,2,2,2,2,2, # a0 - a7 2,2,2,2,2,2,2,2, # a8 - af 2,2,2,2,2,2,2,2, # b0 - b7 2,2,2,2,2,2,2,2, # b8 - bf 2,2,2,2,2,2,2,2, # c0 - c7 2,2,2,2,2,2,2,2, # c8 - cf 2,2,2,2,2,2,2,2, # d0 - d7 2,2,2,2,2,2,2,2, # d8 - df 2,2,2,2,2,2,2,2, # e0 - e7 2,2,2,2,2,2,2,2, # e8 - ef 2,2,2,2,2,2,2,2, # f0 - f7 2,2,2,2,2,2,2,2, # f8 - ff ) ISO2022CN_ST = ( MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 00-07 MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 08-0f MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 10-17 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,# 18-1f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 20-27 5, 6,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 28-2f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 30-37 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,# 38-3f ) ISO2022CN_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0, 0, 0, 0) ISO2022CN_SM_MODEL = {'class_table': ISO2022CN_CLS, 'class_factor': 9, 'state_table': ISO2022CN_ST, 'char_len_table': ISO2022CN_CHAR_LEN_TABLE, 'name': "ISO-2022-CN", 'language': 'Chinese'} ISO2022JP_CLS = ( 2,0,0,0,0,0,0,0, # 00 - 07 0,0,0,0,0,0,2,2, # 08 - 0f 0,0,0,0,0,0,0,0, # 10 - 17 0,0,0,1,0,0,0,0, # 18 - 1f 0,0,0,0,7,0,0,0, # 20 - 27 3,0,0,0,0,0,0,0, # 28 - 2f 0,0,0,0,0,0,0,0, # 30 - 37 0,0,0,0,0,0,0,0, # 38 - 3f 6,0,4,0,8,0,0,0, # 40 - 47 0,9,5,0,0,0,0,0, # 48 - 4f 0,0,0,0,0,0,0,0, # 50 - 57 0,0,0,0,0,0,0,0, # 58 - 5f 0,0,0,0,0,0,0,0, # 60 - 67 0,0,0,0,0,0,0,0, # 68 - 6f 0,0,0,0,0,0,0,0, # 70 - 77 0,0,0,0,0,0,0,0, # 78 - 7f 2,2,2,2,2,2,2,2, # 80 - 87 2,2,2,2,2,2,2,2, # 88 - 8f 2,2,2,2,2,2,2,2, # 90 - 97 2,2,2,2,2,2,2,2, # 98 - 9f 2,2,2,2,2,2,2,2, # a0 - a7 2,2,2,2,2,2,2,2, # a8 - af 2,2,2,2,2,2,2,2, # b0 - b7 2,2,2,2,2,2,2,2, # b8 - bf 2,2,2,2,2,2,2,2, # c0 - c7 2,2,2,2,2,2,2,2, # c8 - cf 2,2,2,2,2,2,2,2, # d0 - d7 2,2,2,2,2,2,2,2, # d8 - df 2,2,2,2,2,2,2,2, # e0 - e7 2,2,2,2,2,2,2,2, # e8 - ef 2,2,2,2,2,2,2,2, # f0 - f7 2,2,2,2,2,2,2,2, # f8 - ff ) ISO2022JP_ST = ( MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 00-07 MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 08-0f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 10-17 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,# 18-1f MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,MachineState.ERROR,# 20-27 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 6,MachineState.ITS_ME,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,# 28-2f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,# 30-37 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 38-3f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.START,# 40-47 ) ISO2022JP_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ISO2022JP_SM_MODEL = {'class_table': ISO2022JP_CLS, 'class_factor': 10, 'state_table': ISO2022JP_ST, 'char_len_table': ISO2022JP_CHAR_LEN_TABLE, 'name': "ISO-2022-JP", 'language': 'Japanese'} ISO2022KR_CLS = ( 2,0,0,0,0,0,0,0, # 00 - 07 0,0,0,0,0,0,0,0, # 08 - 0f 0,0,0,0,0,0,0,0, # 10 - 17 0,0,0,1,0,0,0,0, # 18 - 1f 0,0,0,0,3,0,0,0, # 20 - 27 0,4,0,0,0,0,0,0, # 28 - 2f 0,0,0,0,0,0,0,0, # 30 - 37 0,0,0,0,0,0,0,0, # 38 - 3f 0,0,0,5,0,0,0,0, # 40 - 47 0,0,0,0,0,0,0,0, # 48 - 4f 0,0,0,0,0,0,0,0, # 50 - 57 0,0,0,0,0,0,0,0, # 58 - 5f 0,0,0,0,0,0,0,0, # 60 - 67 0,0,0,0,0,0,0,0, # 68 - 6f 0,0,0,0,0,0,0,0, # 70 - 77 0,0,0,0,0,0,0,0, # 78 - 7f 2,2,2,2,2,2,2,2, # 80 - 87 2,2,2,2,2,2,2,2, # 88 - 8f 2,2,2,2,2,2,2,2, # 90 - 97 2,2,2,2,2,2,2,2, # 98 - 9f 2,2,2,2,2,2,2,2, # a0 - a7 2,2,2,2,2,2,2,2, # a8 - af 2,2,2,2,2,2,2,2, # b0 - b7 2,2,2,2,2,2,2,2, # b8 - bf 2,2,2,2,2,2,2,2, # c0 - c7 2,2,2,2,2,2,2,2, # c8 - cf 2,2,2,2,2,2,2,2, # d0 - d7 2,2,2,2,2,2,2,2, # d8 - df 2,2,2,2,2,2,2,2, # e0 - e7 2,2,2,2,2,2,2,2, # e8 - ef 2,2,2,2,2,2,2,2, # f0 - f7 2,2,2,2,2,2,2,2, # f8 - ff ) ISO2022KR_ST = ( MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,# 00-07 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 08-0f MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,MachineState.ERROR,# 10-17 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 18-1f MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 20-27 ) ISO2022KR_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0) ISO2022KR_SM_MODEL = {'class_table': ISO2022KR_CLS, 'class_factor': 6, 'state_table': ISO2022KR_ST, 'char_len_table': ISO2022KR_CHAR_LEN_TABLE, 'name': "ISO-2022-KR", 'language': 'Korean'} PKd]9addchardet/jisfreq.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # Sampling from about 20M text materials include literature and computer technology # # Japanese frequency table, applied to both S-JIS and EUC-JP # They are sorted in order. # 128 --> 0.77094 # 256 --> 0.85710 # 512 --> 0.92635 # 1024 --> 0.97130 # 2048 --> 0.99431 # # Ideal Distribution Ratio = 0.92635 / (1-0.92635) = 12.58 # Random Distribution Ration = 512 / (2965+62+83+86-512) = 0.191 # # Typical Distribution Ratio, 25% of IDR JIS_TYPICAL_DISTRIBUTION_RATIO = 3.0 # Char to FreqOrder table , JIS_TABLE_SIZE = 4368 JIS_CHAR_TO_FREQ_ORDER = ( 40, 1, 6, 182, 152, 180, 295,2127, 285, 381,3295,4304,3068,4606,3165,3510, # 16 3511,1822,2785,4607,1193,2226,5070,4608, 171,2996,1247, 18, 179,5071, 856,1661, # 32 1262,5072, 619, 127,3431,3512,3230,1899,1700, 232, 228,1294,1298, 284, 283,2041, # 48 2042,1061,1062, 48, 49, 44, 45, 433, 434,1040,1041, 996, 787,2997,1255,4305, # 64 2108,4609,1684,1648,5073,5074,5075,5076,5077,5078,3687,5079,4610,5080,3927,3928, # 80 5081,3296,3432, 290,2285,1471,2187,5082,2580,2825,1303,2140,1739,1445,2691,3375, # 96 1691,3297,4306,4307,4611, 452,3376,1182,2713,3688,3069,4308,5083,5084,5085,5086, # 112 5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102, # 128 5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,4097,5113,5114,5115,5116,5117, # 144 5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133, # 160 5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149, # 176 5150,5151,5152,4612,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164, # 192 5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,1472, 598, 618, 820,1205, # 208 1309,1412,1858,1307,1692,5176,5177,5178,5179,5180,5181,5182,1142,1452,1234,1172, # 224 1875,2043,2149,1793,1382,2973, 925,2404,1067,1241, 960,1377,2935,1491, 919,1217, # 240 1865,2030,1406,1499,2749,4098,5183,5184,5185,5186,5187,5188,2561,4099,3117,1804, # 256 2049,3689,4309,3513,1663,5189,3166,3118,3298,1587,1561,3433,5190,3119,1625,2998, # 272 3299,4613,1766,3690,2786,4614,5191,5192,5193,5194,2161, 26,3377, 2,3929, 20, # 288 3691, 47,4100, 50, 17, 16, 35, 268, 27, 243, 42, 155, 24, 154, 29, 184, # 304 4, 91, 14, 92, 53, 396, 33, 289, 9, 37, 64, 620, 21, 39, 321, 5, # 320 12, 11, 52, 13, 3, 208, 138, 0, 7, 60, 526, 141, 151,1069, 181, 275, # 336 1591, 83, 132,1475, 126, 331, 829, 15, 69, 160, 59, 22, 157, 55,1079, 312, # 352 109, 38, 23, 25, 10, 19, 79,5195, 61, 382,1124, 8, 30,5196,5197,5198, # 368 5199,5200,5201,5202,5203,5204,5205,5206, 89, 62, 74, 34,2416, 112, 139, 196, # 384 271, 149, 84, 607, 131, 765, 46, 88, 153, 683, 76, 874, 101, 258, 57, 80, # 400 32, 364, 121,1508, 169,1547, 68, 235, 145,2999, 41, 360,3027, 70, 63, 31, # 416 43, 259, 262,1383, 99, 533, 194, 66, 93, 846, 217, 192, 56, 106, 58, 565, # 432 280, 272, 311, 256, 146, 82, 308, 71, 100, 128, 214, 655, 110, 261, 104,1140, # 448 54, 51, 36, 87, 67,3070, 185,2618,2936,2020, 28,1066,2390,2059,5207,5208, # 464 5209,5210,5211,5212,5213,5214,5215,5216,4615,5217,5218,5219,5220,5221,5222,5223, # 480 5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,3514,5237,5238, # 496 5239,5240,5241,5242,5243,5244,2297,2031,4616,4310,3692,5245,3071,5246,3598,5247, # 512 4617,3231,3515,5248,4101,4311,4618,3808,4312,4102,5249,4103,4104,3599,5250,5251, # 528 5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267, # 544 5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283, # 560 5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299, # 576 5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315, # 592 5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331, # 608 5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347, # 624 5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363, # 640 5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379, # 656 5380,5381, 363, 642,2787,2878,2788,2789,2316,3232,2317,3434,2011, 165,1942,3930, # 672 3931,3932,3933,5382,4619,5383,4620,5384,5385,5386,5387,5388,5389,5390,5391,5392, # 688 5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408, # 704 5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424, # 720 5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440, # 736 5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456, # 752 5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472, # 768 5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488, # 784 5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504, # 800 5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520, # 816 5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536, # 832 5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552, # 848 5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568, # 864 5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584, # 880 5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600, # 896 5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616, # 912 5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632, # 928 5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648, # 944 5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664, # 960 5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680, # 976 5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696, # 992 5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712, # 1008 5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728, # 1024 5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744, # 1040 5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760, # 1056 5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776, # 1072 5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792, # 1088 5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808, # 1104 5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824, # 1120 5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840, # 1136 5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856, # 1152 5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872, # 1168 5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888, # 1184 5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904, # 1200 5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920, # 1216 5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936, # 1232 5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952, # 1248 5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968, # 1264 5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984, # 1280 5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000, # 1296 6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016, # 1312 6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032, # 1328 6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048, # 1344 6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064, # 1360 6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080, # 1376 6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096, # 1392 6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112, # 1408 6113,6114,2044,2060,4621, 997,1235, 473,1186,4622, 920,3378,6115,6116, 379,1108, # 1424 4313,2657,2735,3934,6117,3809, 636,3233, 573,1026,3693,3435,2974,3300,2298,4105, # 1440 854,2937,2463, 393,2581,2417, 539, 752,1280,2750,2480, 140,1161, 440, 708,1569, # 1456 665,2497,1746,1291,1523,3000, 164,1603, 847,1331, 537,1997, 486, 508,1693,2418, # 1472 1970,2227, 878,1220, 299,1030, 969, 652,2751, 624,1137,3301,2619, 65,3302,2045, # 1488 1761,1859,3120,1930,3694,3516, 663,1767, 852, 835,3695, 269, 767,2826,2339,1305, # 1504 896,1150, 770,1616,6118, 506,1502,2075,1012,2519, 775,2520,2975,2340,2938,4314, # 1520 3028,2086,1224,1943,2286,6119,3072,4315,2240,1273,1987,3935,1557, 175, 597, 985, # 1536 3517,2419,2521,1416,3029, 585, 938,1931,1007,1052,1932,1685,6120,3379,4316,4623, # 1552 804, 599,3121,1333,2128,2539,1159,1554,2032,3810, 687,2033,2904, 952, 675,1467, # 1568 3436,6121,2241,1096,1786,2440,1543,1924, 980,1813,2228, 781,2692,1879, 728,1918, # 1584 3696,4624, 548,1950,4625,1809,1088,1356,3303,2522,1944, 502, 972, 373, 513,2827, # 1600 586,2377,2391,1003,1976,1631,6122,2464,1084, 648,1776,4626,2141, 324, 962,2012, # 1616 2177,2076,1384, 742,2178,1448,1173,1810, 222, 102, 301, 445, 125,2420, 662,2498, # 1632 277, 200,1476,1165,1068, 224,2562,1378,1446, 450,1880, 659, 791, 582,4627,2939, # 1648 3936,1516,1274, 555,2099,3697,1020,1389,1526,3380,1762,1723,1787,2229, 412,2114, # 1664 1900,2392,3518, 512,2597, 427,1925,2341,3122,1653,1686,2465,2499, 697, 330, 273, # 1680 380,2162, 951, 832, 780, 991,1301,3073, 965,2270,3519, 668,2523,2636,1286, 535, # 1696 1407, 518, 671, 957,2658,2378, 267, 611,2197,3030,6123, 248,2299, 967,1799,2356, # 1712 850,1418,3437,1876,1256,1480,2828,1718,6124,6125,1755,1664,2405,6126,4628,2879, # 1728 2829, 499,2179, 676,4629, 557,2329,2214,2090, 325,3234, 464, 811,3001, 992,2342, # 1744 2481,1232,1469, 303,2242, 466,1070,2163, 603,1777,2091,4630,2752,4631,2714, 322, # 1760 2659,1964,1768, 481,2188,1463,2330,2857,3600,2092,3031,2421,4632,2318,2070,1849, # 1776 2598,4633,1302,2254,1668,1701,2422,3811,2905,3032,3123,2046,4106,1763,1694,4634, # 1792 1604, 943,1724,1454, 917, 868,2215,1169,2940, 552,1145,1800,1228,1823,1955, 316, # 1808 1080,2510, 361,1807,2830,4107,2660,3381,1346,1423,1134,4108,6127, 541,1263,1229, # 1824 1148,2540, 545, 465,1833,2880,3438,1901,3074,2482, 816,3937, 713,1788,2500, 122, # 1840 1575, 195,1451,2501,1111,6128, 859, 374,1225,2243,2483,4317, 390,1033,3439,3075, # 1856 2524,1687, 266, 793,1440,2599, 946, 779, 802, 507, 897,1081, 528,2189,1292, 711, # 1872 1866,1725,1167,1640, 753, 398,2661,1053, 246, 348,4318, 137,1024,3440,1600,2077, # 1888 2129, 825,4319, 698, 238, 521, 187,2300,1157,2423,1641,1605,1464,1610,1097,2541, # 1904 1260,1436, 759,2255,1814,2150, 705,3235, 409,2563,3304, 561,3033,2005,2564, 726, # 1920 1956,2343,3698,4109, 949,3812,3813,3520,1669, 653,1379,2525, 881,2198, 632,2256, # 1936 1027, 778,1074, 733,1957, 514,1481,2466, 554,2180, 702,3938,1606,1017,1398,6129, # 1952 1380,3521, 921, 993,1313, 594, 449,1489,1617,1166, 768,1426,1360, 495,1794,3601, # 1968 1177,3602,1170,4320,2344, 476, 425,3167,4635,3168,1424, 401,2662,1171,3382,1998, # 1984 1089,4110, 477,3169, 474,6130,1909, 596,2831,1842, 494, 693,1051,1028,1207,3076, # 2000 606,2115, 727,2790,1473,1115, 743,3522, 630, 805,1532,4321,2021, 366,1057, 838, # 2016 684,1114,2142,4322,2050,1492,1892,1808,2271,3814,2424,1971,1447,1373,3305,1090, # 2032 1536,3939,3523,3306,1455,2199, 336, 369,2331,1035, 584,2393, 902, 718,2600,6131, # 2048 2753, 463,2151,1149,1611,2467, 715,1308,3124,1268, 343,1413,3236,1517,1347,2663, # 2064 2093,3940,2022,1131,1553,2100,2941,1427,3441,2942,1323,2484,6132,1980, 872,2368, # 2080 2441,2943, 320,2369,2116,1082, 679,1933,3941,2791,3815, 625,1143,2023, 422,2200, # 2096 3816,6133, 730,1695, 356,2257,1626,2301,2858,2637,1627,1778, 937, 883,2906,2693, # 2112 3002,1769,1086, 400,1063,1325,3307,2792,4111,3077, 456,2345,1046, 747,6134,1524, # 2128 884,1094,3383,1474,2164,1059, 974,1688,2181,2258,1047, 345,1665,1187, 358, 875, # 2144 3170, 305, 660,3524,2190,1334,1135,3171,1540,1649,2542,1527, 927, 968,2793, 885, # 2160 1972,1850, 482, 500,2638,1218,1109,1085,2543,1654,2034, 876, 78,2287,1482,1277, # 2176 861,1675,1083,1779, 724,2754, 454, 397,1132,1612,2332, 893, 672,1237, 257,2259, # 2192 2370, 135,3384, 337,2244, 547, 352, 340, 709,2485,1400, 788,1138,2511, 540, 772, # 2208 1682,2260,2272,2544,2013,1843,1902,4636,1999,1562,2288,4637,2201,1403,1533, 407, # 2224 576,3308,1254,2071, 978,3385, 170, 136,1201,3125,2664,3172,2394, 213, 912, 873, # 2240 3603,1713,2202, 699,3604,3699, 813,3442, 493, 531,1054, 468,2907,1483, 304, 281, # 2256 4112,1726,1252,2094, 339,2319,2130,2639, 756,1563,2944, 748, 571,2976,1588,2425, # 2272 2715,1851,1460,2426,1528,1392,1973,3237, 288,3309, 685,3386, 296, 892,2716,2216, # 2288 1570,2245, 722,1747,2217, 905,3238,1103,6135,1893,1441,1965, 251,1805,2371,3700, # 2304 2601,1919,1078, 75,2182,1509,1592,1270,2640,4638,2152,6136,3310,3817, 524, 706, # 2320 1075, 292,3818,1756,2602, 317, 98,3173,3605,3525,1844,2218,3819,2502, 814, 567, # 2336 385,2908,1534,6137, 534,1642,3239, 797,6138,1670,1529, 953,4323, 188,1071, 538, # 2352 178, 729,3240,2109,1226,1374,2000,2357,2977, 731,2468,1116,2014,2051,6139,1261, # 2368 1593, 803,2859,2736,3443, 556, 682, 823,1541,6140,1369,2289,1706,2794, 845, 462, # 2384 2603,2665,1361, 387, 162,2358,1740, 739,1770,1720,1304,1401,3241,1049, 627,1571, # 2400 2427,3526,1877,3942,1852,1500, 431,1910,1503, 677, 297,2795, 286,1433,1038,1198, # 2416 2290,1133,1596,4113,4639,2469,1510,1484,3943,6141,2442, 108, 712,4640,2372, 866, # 2432 3701,2755,3242,1348, 834,1945,1408,3527,2395,3243,1811, 824, 994,1179,2110,1548, # 2448 1453, 790,3003, 690,4324,4325,2832,2909,3820,1860,3821, 225,1748, 310, 346,1780, # 2464 2470, 821,1993,2717,2796, 828, 877,3528,2860,2471,1702,2165,2910,2486,1789, 453, # 2480 359,2291,1676, 73,1164,1461,1127,3311, 421, 604, 314,1037, 589, 116,2487, 737, # 2496 837,1180, 111, 244, 735,6142,2261,1861,1362, 986, 523, 418, 581,2666,3822, 103, # 2512 855, 503,1414,1867,2488,1091, 657,1597, 979, 605,1316,4641,1021,2443,2078,2001, # 2528 1209, 96, 587,2166,1032, 260,1072,2153, 173, 94, 226,3244, 819,2006,4642,4114, # 2544 2203, 231,1744, 782, 97,2667, 786,3387, 887, 391, 442,2219,4326,1425,6143,2694, # 2560 633,1544,1202, 483,2015, 592,2052,1958,2472,1655, 419, 129,4327,3444,3312,1714, # 2576 1257,3078,4328,1518,1098, 865,1310,1019,1885,1512,1734, 469,2444, 148, 773, 436, # 2592 1815,1868,1128,1055,4329,1245,2756,3445,2154,1934,1039,4643, 579,1238, 932,2320, # 2608 353, 205, 801, 115,2428, 944,2321,1881, 399,2565,1211, 678, 766,3944, 335,2101, # 2624 1459,1781,1402,3945,2737,2131,1010, 844, 981,1326,1013, 550,1816,1545,2620,1335, # 2640 1008, 371,2881, 936,1419,1613,3529,1456,1395,2273,1834,2604,1317,2738,2503, 416, # 2656 1643,4330, 806,1126, 229, 591,3946,1314,1981,1576,1837,1666, 347,1790, 977,3313, # 2672 764,2861,1853, 688,2429,1920,1462, 77, 595, 415,2002,3034, 798,1192,4115,6144, # 2688 2978,4331,3035,2695,2582,2072,2566, 430,2430,1727, 842,1396,3947,3702, 613, 377, # 2704 278, 236,1417,3388,3314,3174, 757,1869, 107,3530,6145,1194, 623,2262, 207,1253, # 2720 2167,3446,3948, 492,1117,1935, 536,1838,2757,1246,4332, 696,2095,2406,1393,1572, # 2736 3175,1782, 583, 190, 253,1390,2230, 830,3126,3389, 934,3245,1703,1749,2979,1870, # 2752 2545,1656,2204, 869,2346,4116,3176,1817, 496,1764,4644, 942,1504, 404,1903,1122, # 2768 1580,3606,2945,1022, 515, 372,1735, 955,2431,3036,6146,2797,1110,2302,2798, 617, # 2784 6147, 441, 762,1771,3447,3607,3608,1904, 840,3037, 86, 939,1385, 572,1370,2445, # 2800 1336, 114,3703, 898, 294, 203,3315, 703,1583,2274, 429, 961,4333,1854,1951,3390, # 2816 2373,3704,4334,1318,1381, 966,1911,2322,1006,1155, 309, 989, 458,2718,1795,1372, # 2832 1203, 252,1689,1363,3177, 517,1936, 168,1490, 562, 193,3823,1042,4117,1835, 551, # 2848 470,4645, 395, 489,3448,1871,1465,2583,2641, 417,1493, 279,1295, 511,1236,1119, # 2864 72,1231,1982,1812,3004, 871,1564, 984,3449,1667,2696,2096,4646,2347,2833,1673, # 2880 3609, 695,3246,2668, 807,1183,4647, 890, 388,2333,1801,1457,2911,1765,1477,1031, # 2896 3316,3317,1278,3391,2799,2292,2526, 163,3450,4335,2669,1404,1802,6148,2323,2407, # 2912 1584,1728,1494,1824,1269, 298, 909,3318,1034,1632, 375, 776,1683,2061, 291, 210, # 2928 1123, 809,1249,1002,2642,3038, 206,1011,2132, 144, 975, 882,1565, 342, 667, 754, # 2944 1442,2143,1299,2303,2062, 447, 626,2205,1221,2739,2912,1144,1214,2206,2584, 760, # 2960 1715, 614, 950,1281,2670,2621, 810, 577,1287,2546,4648, 242,2168, 250,2643, 691, # 2976 123,2644, 647, 313,1029, 689,1357,2946,1650, 216, 771,1339,1306, 808,2063, 549, # 2992 913,1371,2913,2914,6149,1466,1092,1174,1196,1311,2605,2396,1783,1796,3079, 406, # 3008 2671,2117,3949,4649, 487,1825,2220,6150,2915, 448,2348,1073,6151,2397,1707, 130, # 3024 900,1598, 329, 176,1959,2527,1620,6152,2275,4336,3319,1983,2191,3705,3610,2155, # 3040 3706,1912,1513,1614,6153,1988, 646, 392,2304,1589,3320,3039,1826,1239,1352,1340, # 3056 2916, 505,2567,1709,1437,2408,2547, 906,6154,2672, 384,1458,1594,1100,1329, 710, # 3072 423,3531,2064,2231,2622,1989,2673,1087,1882, 333, 841,3005,1296,2882,2379, 580, # 3088 1937,1827,1293,2585, 601, 574, 249,1772,4118,2079,1120, 645, 901,1176,1690, 795, # 3104 2207, 478,1434, 516,1190,1530, 761,2080, 930,1264, 355, 435,1552, 644,1791, 987, # 3120 220,1364,1163,1121,1538, 306,2169,1327,1222, 546,2645, 218, 241, 610,1704,3321, # 3136 1984,1839,1966,2528, 451,6155,2586,3707,2568, 907,3178, 254,2947, 186,1845,4650, # 3152 745, 432,1757, 428,1633, 888,2246,2221,2489,3611,2118,1258,1265, 956,3127,1784, # 3168 4337,2490, 319, 510, 119, 457,3612, 274,2035,2007,4651,1409,3128, 970,2758, 590, # 3184 2800, 661,2247,4652,2008,3950,1420,1549,3080,3322,3951,1651,1375,2111, 485,2491, # 3200 1429,1156,6156,2548,2183,1495, 831,1840,2529,2446, 501,1657, 307,1894,3247,1341, # 3216 666, 899,2156,1539,2549,1559, 886, 349,2208,3081,2305,1736,3824,2170,2759,1014, # 3232 1913,1386, 542,1397,2948, 490, 368, 716, 362, 159, 282,2569,1129,1658,1288,1750, # 3248 2674, 276, 649,2016, 751,1496, 658,1818,1284,1862,2209,2087,2512,3451, 622,2834, # 3264 376, 117,1060,2053,1208,1721,1101,1443, 247,1250,3179,1792,3952,2760,2398,3953, # 3280 6157,2144,3708, 446,2432,1151,2570,3452,2447,2761,2835,1210,2448,3082, 424,2222, # 3296 1251,2449,2119,2836, 504,1581,4338, 602, 817, 857,3825,2349,2306, 357,3826,1470, # 3312 1883,2883, 255, 958, 929,2917,3248, 302,4653,1050,1271,1751,2307,1952,1430,2697, # 3328 2719,2359, 354,3180, 777, 158,2036,4339,1659,4340,4654,2308,2949,2248,1146,2232, # 3344 3532,2720,1696,2623,3827,6158,3129,1550,2698,1485,1297,1428, 637, 931,2721,2145, # 3360 914,2550,2587, 81,2450, 612, 827,2646,1242,4655,1118,2884, 472,1855,3181,3533, # 3376 3534, 569,1353,2699,1244,1758,2588,4119,2009,2762,2171,3709,1312,1531,6159,1152, # 3392 1938, 134,1830, 471,3710,2276,1112,1535,3323,3453,3535, 982,1337,2950, 488, 826, # 3408 674,1058,1628,4120,2017, 522,2399, 211, 568,1367,3454, 350, 293,1872,1139,3249, # 3424 1399,1946,3006,1300,2360,3324, 588, 736,6160,2606, 744, 669,3536,3828,6161,1358, # 3440 199, 723, 848, 933, 851,1939,1505,1514,1338,1618,1831,4656,1634,3613, 443,2740, # 3456 3829, 717,1947, 491,1914,6162,2551,1542,4121,1025,6163,1099,1223, 198,3040,2722, # 3472 370, 410,1905,2589, 998,1248,3182,2380, 519,1449,4122,1710, 947, 928,1153,4341, # 3488 2277, 344,2624,1511, 615, 105, 161,1212,1076,1960,3130,2054,1926,1175,1906,2473, # 3504 414,1873,2801,6164,2309, 315,1319,3325, 318,2018,2146,2157, 963, 631, 223,4342, # 3520 4343,2675, 479,3711,1197,2625,3712,2676,2361,6165,4344,4123,6166,2451,3183,1886, # 3536 2184,1674,1330,1711,1635,1506, 799, 219,3250,3083,3954,1677,3713,3326,2081,3614, # 3552 1652,2073,4657,1147,3041,1752, 643,1961, 147,1974,3955,6167,1716,2037, 918,3007, # 3568 1994, 120,1537, 118, 609,3184,4345, 740,3455,1219, 332,1615,3830,6168,1621,2980, # 3584 1582, 783, 212, 553,2350,3714,1349,2433,2082,4124, 889,6169,2310,1275,1410, 973, # 3600 166,1320,3456,1797,1215,3185,2885,1846,2590,2763,4658, 629, 822,3008, 763, 940, # 3616 1990,2862, 439,2409,1566,1240,1622, 926,1282,1907,2764, 654,2210,1607, 327,1130, # 3632 3956,1678,1623,6170,2434,2192, 686, 608,3831,3715, 903,3957,3042,6171,2741,1522, # 3648 1915,1105,1555,2552,1359, 323,3251,4346,3457, 738,1354,2553,2311,2334,1828,2003, # 3664 3832,1753,2351,1227,6172,1887,4125,1478,6173,2410,1874,1712,1847, 520,1204,2607, # 3680 264,4659, 836,2677,2102, 600,4660,3833,2278,3084,6174,4347,3615,1342, 640, 532, # 3696 543,2608,1888,2400,2591,1009,4348,1497, 341,1737,3616,2723,1394, 529,3252,1321, # 3712 983,4661,1515,2120, 971,2592, 924, 287,1662,3186,4349,2700,4350,1519, 908,1948, # 3728 2452, 156, 796,1629,1486,2223,2055, 694,4126,1259,1036,3392,1213,2249,2742,1889, # 3744 1230,3958,1015, 910, 408, 559,3617,4662, 746, 725, 935,4663,3959,3009,1289, 563, # 3760 867,4664,3960,1567,2981,2038,2626, 988,2263,2381,4351, 143,2374, 704,1895,6175, # 3776 1188,3716,2088, 673,3085,2362,4352, 484,1608,1921,2765,2918, 215, 904,3618,3537, # 3792 894, 509, 976,3043,2701,3961,4353,2837,2982, 498,6176,6177,1102,3538,1332,3393, # 3808 1487,1636,1637, 233, 245,3962, 383, 650, 995,3044, 460,1520,1206,2352, 749,3327, # 3824 530, 700, 389,1438,1560,1773,3963,2264, 719,2951,2724,3834, 870,1832,1644,1000, # 3840 839,2474,3717, 197,1630,3394, 365,2886,3964,1285,2133, 734, 922, 818,1106, 732, # 3856 480,2083,1774,3458, 923,2279,1350, 221,3086, 85,2233,2234,3835,1585,3010,2147, # 3872 1387,1705,2382,1619,2475, 133, 239,2802,1991,1016,2084,2383, 411,2838,1113, 651, # 3888 1985,1160,3328, 990,1863,3087,1048,1276,2647, 265,2627,1599,3253,2056, 150, 638, # 3904 2019, 656, 853, 326,1479, 680,1439,4354,1001,1759, 413,3459,3395,2492,1431, 459, # 3920 4355,1125,3329,2265,1953,1450,2065,2863, 849, 351,2678,3131,3254,3255,1104,1577, # 3936 227,1351,1645,2453,2193,1421,2887, 812,2121, 634, 95,2435, 201,2312,4665,1646, # 3952 1671,2743,1601,2554,2702,2648,2280,1315,1366,2089,3132,1573,3718,3965,1729,1189, # 3968 328,2679,1077,1940,1136, 558,1283, 964,1195, 621,2074,1199,1743,3460,3619,1896, # 3984 1916,1890,3836,2952,1154,2112,1064, 862, 378,3011,2066,2113,2803,1568,2839,6178, # 4000 3088,2919,1941,1660,2004,1992,2194, 142, 707,1590,1708,1624,1922,1023,1836,1233, # 4016 1004,2313, 789, 741,3620,6179,1609,2411,1200,4127,3719,3720,4666,2057,3721, 593, # 4032 2840, 367,2920,1878,6180,3461,1521, 628,1168, 692,2211,2649, 300, 720,2067,2571, # 4048 2953,3396, 959,2504,3966,3539,3462,1977, 701,6181, 954,1043, 800, 681, 183,3722, # 4064 1803,1730,3540,4128,2103, 815,2314, 174, 467, 230,2454,1093,2134, 755,3541,3397, # 4080 1141,1162,6182,1738,2039, 270,3256,2513,1005,1647,2185,3837, 858,1679,1897,1719, # 4096 2954,2324,1806, 402, 670, 167,4129,1498,2158,2104, 750,6183, 915, 189,1680,1551, # 4112 455,4356,1501,2455, 405,1095,2955, 338,1586,1266,1819, 570, 641,1324, 237,1556, # 4128 2650,1388,3723,6184,1368,2384,1343,1978,3089,2436, 879,3724, 792,1191, 758,3012, # 4144 1411,2135,1322,4357, 240,4667,1848,3725,1574,6185, 420,3045,1546,1391, 714,4358, # 4160 1967, 941,1864, 863, 664, 426, 560,1731,2680,1785,2864,1949,2363, 403,3330,1415, # 4176 1279,2136,1697,2335, 204, 721,2097,3838, 90,6186,2085,2505, 191,3967, 124,2148, # 4192 1376,1798,1178,1107,1898,1405, 860,4359,1243,1272,2375,2983,1558,2456,1638, 113, # 4208 3621, 578,1923,2609, 880, 386,4130, 784,2186,2266,1422,2956,2172,1722, 497, 263, # 4224 2514,1267,2412,2610, 177,2703,3542, 774,1927,1344, 616,1432,1595,1018, 172,4360, # 4240 2325, 911,4361, 438,1468,3622, 794,3968,2024,2173,1681,1829,2957, 945, 895,3090, # 4256 575,2212,2476, 475,2401,2681, 785,2744,1745,2293,2555,1975,3133,2865, 394,4668, # 4272 3839, 635,4131, 639, 202,1507,2195,2766,1345,1435,2572,3726,1908,1184,1181,2457, # 4288 3727,3134,4362, 843,2611, 437, 916,4669, 234, 769,1884,3046,3047,3623, 833,6187, # 4304 1639,2250,2402,1355,1185,2010,2047, 999, 525,1732,1290,1488,2612, 948,1578,3728, # 4320 2413,2477,1216,2725,2159, 334,3840,1328,3624,2921,1525,4132, 564,1056, 891,4363, # 4336 1444,1698,2385,2251,3729,1365,2281,2235,1717,6188, 864,3841,2515, 444, 527,2767, # 4352 2922,3625, 544, 461,6189, 566, 209,2437,3398,2098,1065,2068,3331,3626,3257,2137, # 4368 #last 512 ) PKd]\7Hchardet/codingstatemachine.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### import logging from .enums import MachineState class CodingStateMachine(object): """ A state machine to verify a byte sequence for a particular encoding. For each byte the detector receives, it will feed that byte to every active state machine available, one byte at a time. The state machine changes its state based on its previous state and the byte it receives. There are 3 states in a state machine that are of interest to an auto-detector: START state: This is the state to start with, or a legal byte sequence (i.e. a valid code point) for character has been identified. ME state: This indicates that the state machine identified a byte sequence that is specific to the charset it is designed for and that there is no other possible encoding which can contain this byte sequence. This will to lead to an immediate positive answer for the detector. ERROR state: This indicates the state machine identified an illegal byte sequence for that encoding. This will lead to an immediate negative answer for this encoding. Detector will exclude this encoding from consideration from here on. """ def __init__(self, sm): self._model = sm self._curr_byte_pos = 0 self._curr_char_len = 0 self._curr_state = None self.logger = logging.getLogger(__name__) self.reset() def reset(self): self._curr_state = MachineState.START def next_state(self, c): # for each byte we get its class # if it is first byte, we also get byte length byte_class = self._model['class_table'][c] if self._curr_state == MachineState.START: self._curr_byte_pos = 0 self._curr_char_len = self._model['char_len_table'][byte_class] # from byte's class and state_table, we get its next state curr_state = (self._curr_state * self._model['class_factor'] + byte_class) self._curr_state = self._model['state_table'][curr_state] self._curr_byte_pos += 1 return self._curr_state def get_current_charlen(self): return self._curr_char_len def get_coding_state_machine(self): return self._model['name'] @property def language(self): return self._model['language'] PKd]Schardet/__init__.pynu[######################## BEGIN LICENSE BLOCK ######################## # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .compat import PY2, PY3 from .universaldetector import UniversalDetector from .version import __version__, VERSION def detect(byte_str): """ Detect the encoding of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` """ if not isinstance(byte_str, bytearray): if not isinstance(byte_str, bytes): raise TypeError('Expected object of type bytes or bytearray, got: ' '{0}'.format(type(byte_str))) else: byte_str = bytearray(byte_str) detector = UniversalDetector() detector.feed(byte_str) return detector.close() PKd]EPPchardet/gb2312freq.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # GB2312 most frequently used character table # # Char to FreqOrder table , from hz6763 # 512 --> 0.79 -- 0.79 # 1024 --> 0.92 -- 0.13 # 2048 --> 0.98 -- 0.06 # 6768 --> 1.00 -- 0.02 # # Ideal Distribution Ratio = 0.79135/(1-0.79135) = 3.79 # Random Distribution Ration = 512 / (3755 - 512) = 0.157 # # Typical Distribution Ratio about 25% of Ideal one, still much higher that RDR GB2312_TYPICAL_DISTRIBUTION_RATIO = 0.9 GB2312_TABLE_SIZE = 3760 GB2312_CHAR_TO_FREQ_ORDER = ( 1671, 749,1443,2364,3924,3807,2330,3921,1704,3463,2691,1511,1515, 572,3191,2205, 2361, 224,2558, 479,1711, 963,3162, 440,4060,1905,2966,2947,3580,2647,3961,3842, 2204, 869,4207, 970,2678,5626,2944,2956,1479,4048, 514,3595, 588,1346,2820,3409, 249,4088,1746,1873,2047,1774, 581,1813, 358,1174,3590,1014,1561,4844,2245, 670, 1636,3112, 889,1286, 953, 556,2327,3060,1290,3141, 613, 185,3477,1367, 850,3820, 1715,2428,2642,2303,2732,3041,2562,2648,3566,3946,1349, 388,3098,2091,1360,3585, 152,1687,1539, 738,1559, 59,1232,2925,2267,1388,1249,1741,1679,2960, 151,1566, 1125,1352,4271, 924,4296, 385,3166,4459, 310,1245,2850, 70,3285,2729,3534,3575, 2398,3298,3466,1960,2265, 217,3647, 864,1909,2084,4401,2773,1010,3269,5152, 853, 3051,3121,1244,4251,1895, 364,1499,1540,2313,1180,3655,2268, 562, 715,2417,3061, 544, 336,3768,2380,1752,4075, 950, 280,2425,4382, 183,2759,3272, 333,4297,2155, 1688,2356,1444,1039,4540, 736,1177,3349,2443,2368,2144,2225, 565, 196,1482,3406, 927,1335,4147, 692, 878,1311,1653,3911,3622,1378,4200,1840,2969,3149,2126,1816, 2534,1546,2393,2760, 737,2494, 13, 447, 245,2747, 38,2765,2129,2589,1079, 606, 360, 471,3755,2890, 404, 848, 699,1785,1236, 370,2221,1023,3746,2074,2026,2023, 2388,1581,2119, 812,1141,3091,2536,1519, 804,2053, 406,1596,1090, 784, 548,4414, 1806,2264,2936,1100, 343,4114,5096, 622,3358, 743,3668,1510,1626,5020,3567,2513, 3195,4115,5627,2489,2991, 24,2065,2697,1087,2719, 48,1634, 315, 68, 985,2052, 198,2239,1347,1107,1439, 597,2366,2172, 871,3307, 919,2487,2790,1867, 236,2570, 1413,3794, 906,3365,3381,1701,1982,1818,1524,2924,1205, 616,2586,2072,2004, 575, 253,3099, 32,1365,1182, 197,1714,2454,1201, 554,3388,3224,2748, 756,2587, 250, 2567,1507,1517,3529,1922,2761,2337,3416,1961,1677,2452,2238,3153, 615, 911,1506, 1474,2495,1265,1906,2749,3756,3280,2161, 898,2714,1759,3450,2243,2444, 563, 26, 3286,2266,3769,3344,2707,3677, 611,1402, 531,1028,2871,4548,1375, 261,2948, 835, 1190,4134, 353, 840,2684,1900,3082,1435,2109,1207,1674, 329,1872,2781,4055,2686, 2104, 608,3318,2423,2957,2768,1108,3739,3512,3271,3985,2203,1771,3520,1418,2054, 1681,1153, 225,1627,2929, 162,2050,2511,3687,1954, 124,1859,2431,1684,3032,2894, 585,4805,3969,2869,2704,2088,2032,2095,3656,2635,4362,2209, 256, 518,2042,2105, 3777,3657, 643,2298,1148,1779, 190, 989,3544, 414, 11,2135,2063,2979,1471, 403, 3678, 126, 770,1563, 671,2499,3216,2877, 600,1179, 307,2805,4937,1268,1297,2694, 252,4032,1448,1494,1331,1394, 127,2256, 222,1647,1035,1481,3056,1915,1048, 873, 3651, 210, 33,1608,2516, 200,1520, 415, 102, 0,3389,1287, 817, 91,3299,2940, 836,1814, 549,2197,1396,1669,2987,3582,2297,2848,4528,1070, 687, 20,1819, 121, 1552,1364,1461,1968,2617,3540,2824,2083, 177, 948,4938,2291, 110,4549,2066, 648, 3359,1755,2110,2114,4642,4845,1693,3937,3308,1257,1869,2123, 208,1804,3159,2992, 2531,2549,3361,2418,1350,2347,2800,2568,1291,2036,2680, 72, 842,1990, 212,1233, 1154,1586, 75,2027,3410,4900,1823,1337,2710,2676, 728,2810,1522,3026,4995, 157, 755,1050,4022, 710, 785,1936,2194,2085,1406,2777,2400, 150,1250,4049,1206, 807, 1910, 534, 529,3309,1721,1660, 274, 39,2827, 661,2670,1578, 925,3248,3815,1094, 4278,4901,4252, 41,1150,3747,2572,2227,4501,3658,4902,3813,3357,3617,2884,2258, 887, 538,4187,3199,1294,2439,3042,2329,2343,2497,1255, 107, 543,1527, 521,3478, 3568, 194,5062, 15, 961,3870,1241,1192,2664, 66,5215,3260,2111,1295,1127,2152, 3805,4135, 901,1164,1976, 398,1278, 530,1460, 748, 904,1054,1966,1426, 53,2909, 509, 523,2279,1534, 536,1019, 239,1685, 460,2353, 673,1065,2401,3600,4298,2272, 1272,2363, 284,1753,3679,4064,1695, 81, 815,2677,2757,2731,1386, 859, 500,4221, 2190,2566, 757,1006,2519,2068,1166,1455, 337,2654,3203,1863,1682,1914,3025,1252, 1409,1366, 847, 714,2834,2038,3209, 964,2970,1901, 885,2553,1078,1756,3049, 301, 1572,3326, 688,2130,1996,2429,1805,1648,2930,3421,2750,3652,3088, 262,1158,1254, 389,1641,1812, 526,1719, 923,2073,1073,1902, 468, 489,4625,1140, 857,2375,3070, 3319,2863, 380, 116,1328,2693,1161,2244, 273,1212,1884,2769,3011,1775,1142, 461, 3066,1200,2147,2212, 790, 702,2695,4222,1601,1058, 434,2338,5153,3640, 67,2360, 4099,2502, 618,3472,1329, 416,1132, 830,2782,1807,2653,3211,3510,1662, 192,2124, 296,3979,1739,1611,3684, 23, 118, 324, 446,1239,1225, 293,2520,3814,3795,2535, 3116, 17,1074, 467,2692,2201, 387,2922, 45,1326,3055,1645,3659,2817, 958, 243, 1903,2320,1339,2825,1784,3289, 356, 576, 865,2315,2381,3377,3916,1088,3122,1713, 1655, 935, 628,4689,1034,1327, 441, 800, 720, 894,1979,2183,1528,5289,2702,1071, 4046,3572,2399,1571,3281, 79, 761,1103, 327, 134, 758,1899,1371,1615, 879, 442, 215,2605,2579, 173,2048,2485,1057,2975,3317,1097,2253,3801,4263,1403,1650,2946, 814,4968,3487,1548,2644,1567,1285, 2, 295,2636, 97, 946,3576, 832, 141,4257, 3273, 760,3821,3521,3156,2607, 949,1024,1733,1516,1803,1920,2125,2283,2665,3180, 1501,2064,3560,2171,1592, 803,3518,1416, 732,3897,4258,1363,1362,2458, 119,1427, 602,1525,2608,1605,1639,3175, 694,3064, 10, 465, 76,2000,4846,4208, 444,3781, 1619,3353,2206,1273,3796, 740,2483, 320,1723,2377,3660,2619,1359,1137,1762,1724, 2345,2842,1850,1862, 912, 821,1866, 612,2625,1735,2573,3369,1093, 844, 89, 937, 930,1424,3564,2413,2972,1004,3046,3019,2011, 711,3171,1452,4178, 428, 801,1943, 432, 445,2811, 206,4136,1472, 730, 349, 73, 397,2802,2547, 998,1637,1167, 789, 396,3217, 154,1218, 716,1120,1780,2819,4826,1931,3334,3762,2139,1215,2627, 552, 3664,3628,3232,1405,2383,3111,1356,2652,3577,3320,3101,1703, 640,1045,1370,1246, 4996, 371,1575,2436,1621,2210, 984,4033,1734,2638, 16,4529, 663,2755,3255,1451, 3917,2257,1253,1955,2234,1263,2951, 214,1229, 617, 485, 359,1831,1969, 473,2310, 750,2058, 165, 80,2864,2419, 361,4344,2416,2479,1134, 796,3726,1266,2943, 860, 2715, 938, 390,2734,1313,1384, 248, 202, 877,1064,2854, 522,3907, 279,1602, 297, 2357, 395,3740, 137,2075, 944,4089,2584,1267,3802, 62,1533,2285, 178, 176, 780, 2440, 201,3707, 590, 478,1560,4354,2117,1075, 30, 74,4643,4004,1635,1441,2745, 776,2596, 238,1077,1692,1912,2844, 605, 499,1742,3947, 241,3053, 980,1749, 936, 2640,4511,2582, 515,1543,2162,5322,2892,2993, 890,2148,1924, 665,1827,3581,1032, 968,3163, 339,1044,1896, 270, 583,1791,1720,4367,1194,3488,3669, 43,2523,1657, 163,2167, 290,1209,1622,3378, 550, 634,2508,2510, 695,2634,2384,2512,1476,1414, 220,1469,2341,2138,2852,3183,2900,4939,2865,3502,1211,3680, 854,3227,1299,2976, 3172, 186,2998,1459, 443,1067,3251,1495, 321,1932,3054, 909, 753,1410,1828, 436, 2441,1119,1587,3164,2186,1258, 227, 231,1425,1890,3200,3942, 247, 959, 725,5254, 2741, 577,2158,2079, 929, 120, 174, 838,2813, 591,1115, 417,2024, 40,3240,1536, 1037, 291,4151,2354, 632,1298,2406,2500,3535,1825,1846,3451, 205,1171, 345,4238, 18,1163, 811, 685,2208,1217, 425,1312,1508,1175,4308,2552,1033, 587,1381,3059, 2984,3482, 340,1316,4023,3972, 792,3176, 519, 777,4690, 918, 933,4130,2981,3741, 90,3360,2911,2200,5184,4550, 609,3079,2030, 272,3379,2736, 363,3881,1130,1447, 286, 779, 357,1169,3350,3137,1630,1220,2687,2391, 747,1277,3688,2618,2682,2601, 1156,3196,5290,4034,3102,1689,3596,3128, 874, 219,2783, 798, 508,1843,2461, 269, 1658,1776,1392,1913,2983,3287,2866,2159,2372, 829,4076, 46,4253,2873,1889,1894, 915,1834,1631,2181,2318, 298, 664,2818,3555,2735, 954,3228,3117, 527,3511,2173, 681,2712,3033,2247,2346,3467,1652, 155,2164,3382, 113,1994, 450, 899, 494, 994, 1237,2958,1875,2336,1926,3727, 545,1577,1550, 633,3473, 204,1305,3072,2410,1956, 2471, 707,2134, 841,2195,2196,2663,3843,1026,4940, 990,3252,4997, 368,1092, 437, 3212,3258,1933,1829, 675,2977,2893, 412, 943,3723,4644,3294,3283,2230,2373,5154, 2389,2241,2661,2323,1404,2524, 593, 787, 677,3008,1275,2059, 438,2709,2609,2240, 2269,2246,1446, 36,1568,1373,3892,1574,2301,1456,3962, 693,2276,5216,2035,1143, 2720,1919,1797,1811,2763,4137,2597,1830,1699,1488,1198,2090, 424,1694, 312,3634, 3390,4179,3335,2252,1214, 561,1059,3243,2295,2561, 975,5155,2321,2751,3772, 472, 1537,3282,3398,1047,2077,2348,2878,1323,3340,3076, 690,2906, 51, 369, 170,3541, 1060,2187,2688,3670,2541,1083,1683, 928,3918, 459, 109,4427, 599,3744,4286, 143, 2101,2730,2490, 82,1588,3036,2121, 281,1860, 477,4035,1238,2812,3020,2716,3312, 1530,2188,2055,1317, 843, 636,1808,1173,3495, 649, 181,1002, 147,3641,1159,2414, 3750,2289,2795, 813,3123,2610,1136,4368, 5,3391,4541,2174, 420, 429,1728, 754, 1228,2115,2219, 347,2223,2733, 735,1518,3003,2355,3134,1764,3948,3329,1888,2424, 1001,1234,1972,3321,3363,1672,1021,1450,1584, 226, 765, 655,2526,3404,3244,2302, 3665, 731, 594,2184, 319,1576, 621, 658,2656,4299,2099,3864,1279,2071,2598,2739, 795,3086,3699,3908,1707,2352,2402,1382,3136,2475,1465,4847,3496,3865,1085,3004, 2591,1084, 213,2287,1963,3565,2250, 822, 793,4574,3187,1772,1789,3050, 595,1484, 1959,2770,1080,2650, 456, 422,2996, 940,3322,4328,4345,3092,2742, 965,2784, 739, 4124, 952,1358,2498,2949,2565, 332,2698,2378, 660,2260,2473,4194,3856,2919, 535, 1260,2651,1208,1428,1300,1949,1303,2942, 433,2455,2450,1251,1946, 614,1269, 641, 1306,1810,2737,3078,2912, 564,2365,1419,1415,1497,4460,2367,2185,1379,3005,1307, 3218,2175,1897,3063, 682,1157,4040,4005,1712,1160,1941,1399, 394, 402,2952,1573, 1151,2986,2404, 862, 299,2033,1489,3006, 346, 171,2886,3401,1726,2932, 168,2533, 47,2507,1030,3735,1145,3370,1395,1318,1579,3609,4560,2857,4116,1457,2529,1965, 504,1036,2690,2988,2405, 745,5871, 849,2397,2056,3081, 863,2359,3857,2096, 99, 1397,1769,2300,4428,1643,3455,1978,1757,3718,1440, 35,4879,3742,1296,4228,2280, 160,5063,1599,2013, 166, 520,3479,1646,3345,3012, 490,1937,1545,1264,2182,2505, 1096,1188,1369,1436,2421,1667,2792,2460,1270,2122, 727,3167,2143, 806,1706,1012, 1800,3037, 960,2218,1882, 805, 139,2456,1139,1521, 851,1052,3093,3089, 342,2039, 744,5097,1468,1502,1585,2087, 223, 939, 326,2140,2577, 892,2481,1623,4077, 982, 3708, 135,2131, 87,2503,3114,2326,1106, 876,1616, 547,2997,2831,2093,3441,4530, 4314, 9,3256,4229,4148, 659,1462,1986,1710,2046,2913,2231,4090,4880,5255,3392, 3274,1368,3689,4645,1477, 705,3384,3635,1068,1529,2941,1458,3782,1509, 100,1656, 2548, 718,2339, 408,1590,2780,3548,1838,4117,3719,1345,3530, 717,3442,2778,3220, 2898,1892,4590,3614,3371,2043,1998,1224,3483, 891, 635, 584,2559,3355, 733,1766, 1729,1172,3789,1891,2307, 781,2982,2271,1957,1580,5773,2633,2005,4195,3097,1535, 3213,1189,1934,5693,3262, 586,3118,1324,1598, 517,1564,2217,1868,1893,4445,3728, 2703,3139,1526,1787,1992,3882,2875,1549,1199,1056,2224,1904,2711,5098,4287, 338, 1993,3129,3489,2689,1809,2815,1997, 957,1855,3898,2550,3275,3057,1105,1319, 627, 1505,1911,1883,3526, 698,3629,3456,1833,1431, 746, 77,1261,2017,2296,1977,1885, 125,1334,1600, 525,1798,1109,2222,1470,1945, 559,2236,1186,3443,2476,1929,1411, 2411,3135,1777,3372,2621,1841,1613,3229, 668,1430,1839,2643,2916, 195,1989,2671, 2358,1387, 629,3205,2293,5256,4439, 123,1310, 888,1879,4300,3021,3605,1003,1162, 3192,2910,2010, 140,2395,2859, 55,1082,2012,2901, 662, 419,2081,1438, 680,2774, 4654,3912,1620,1731,1625,5035,4065,2328, 512,1344, 802,5443,2163,2311,2537, 524, 3399, 98,1155,2103,1918,2606,3925,2816,1393,2465,1504,3773,2177,3963,1478,4346, 180,1113,4655,3461,2028,1698, 833,2696,1235,1322,1594,4408,3623,3013,3225,2040, 3022, 541,2881, 607,3632,2029,1665,1219, 639,1385,1686,1099,2803,3231,1938,3188, 2858, 427, 676,2772,1168,2025, 454,3253,2486,3556, 230,1950, 580, 791,1991,1280, 1086,1974,2034, 630, 257,3338,2788,4903,1017, 86,4790, 966,2789,1995,1696,1131, 259,3095,4188,1308, 179,1463,5257, 289,4107,1248, 42,3413,1725,2288, 896,1947, 774,4474,4254, 604,3430,4264, 392,2514,2588, 452, 237,1408,3018, 988,4531,1970, 3034,3310, 540,2370,1562,1288,2990, 502,4765,1147, 4,1853,2708, 207, 294,2814, 4078,2902,2509, 684, 34,3105,3532,2551, 644, 709,2801,2344, 573,1727,3573,3557, 2021,1081,3100,4315,2100,3681, 199,2263,1837,2385, 146,3484,1195,2776,3949, 997, 1939,3973,1008,1091,1202,1962,1847,1149,4209,5444,1076, 493, 117,5400,2521, 972, 1490,2934,1796,4542,2374,1512,2933,2657, 413,2888,1135,2762,2314,2156,1355,2369, 766,2007,2527,2170,3124,2491,2593,2632,4757,2437, 234,3125,3591,1898,1750,1376, 1942,3468,3138, 570,2127,2145,3276,4131, 962, 132,1445,4196, 19, 941,3624,3480, 3366,1973,1374,4461,3431,2629, 283,2415,2275, 808,2887,3620,2112,2563,1353,3610, 955,1089,3103,1053, 96, 88,4097, 823,3808,1583, 399, 292,4091,3313, 421,1128, 642,4006, 903,2539,1877,2082, 596, 29,4066,1790, 722,2157, 130, 995,1569, 769, 1485, 464, 513,2213, 288,1923,1101,2453,4316, 133, 486,2445, 50, 625, 487,2207, 57, 423, 481,2962, 159,3729,1558, 491, 303, 482, 501, 240,2837, 112,3648,2392, 1783, 362, 8,3433,3422, 610,2793,3277,1390,1284,1654, 21,3823, 734, 367, 623, 193, 287, 374,1009,1483, 816, 476, 313,2255,2340,1262,2150,2899,1146,2581, 782, 2116,1659,2018,1880, 255,3586,3314,1110,2867,2137,2564, 986,2767,5185,2006, 650, 158, 926, 762, 881,3157,2717,2362,3587, 306,3690,3245,1542,3077,2427,1691,2478, 2118,2985,3490,2438, 539,2305, 983, 129,1754, 355,4201,2386, 827,2923, 104,1773, 2838,2771, 411,2905,3919, 376, 767, 122,1114, 828,2422,1817,3506, 266,3460,1007, 1609,4998, 945,2612,4429,2274, 726,1247,1964,2914,2199,2070,4002,4108, 657,3323, 1422, 579, 455,2764,4737,1222,2895,1670, 824,1223,1487,2525, 558, 861,3080, 598, 2659,2515,1967, 752,2583,2376,2214,4180, 977, 704,2464,4999,2622,4109,1210,2961, 819,1541, 142,2284, 44, 418, 457,1126,3730,4347,4626,1644,1876,3671,1864, 302, 1063,5694, 624, 723,1984,3745,1314,1676,2488,1610,1449,3558,3569,2166,2098, 409, 1011,2325,3704,2306, 818,1732,1383,1824,1844,3757, 999,2705,3497,1216,1423,2683, 2426,2954,2501,2726,2229,1475,2554,5064,1971,1794,1666,2014,1343, 783, 724, 191, 2434,1354,2220,5065,1763,2752,2472,4152, 131, 175,2885,3434, 92,1466,4920,2616, 3871,3872,3866, 128,1551,1632, 669,1854,3682,4691,4125,1230, 188,2973,3290,1302, 1213, 560,3266, 917, 763,3909,3249,1760, 868,1958, 764,1782,2097, 145,2277,3774, 4462, 64,1491,3062, 971,2132,3606,2442, 221,1226,1617, 218, 323,1185,3207,3147, 571, 619,1473,1005,1744,2281, 449,1887,2396,3685, 275, 375,3816,1743,3844,3731, 845,1983,2350,4210,1377, 773, 967,3499,3052,3743,2725,4007,1697,1022,3943,1464, 3264,2855,2722,1952,1029,2839,2467, 84,4383,2215, 820,1391,2015,2448,3672, 377, 1948,2168, 797,2545,3536,2578,2645, 94,2874,1678, 405,1259,3071, 771, 546,1315, 470,1243,3083, 895,2468, 981, 969,2037, 846,4181, 653,1276,2928, 14,2594, 557, 3007,2474, 156, 902,1338,1740,2574, 537,2518, 973,2282,2216,2433,1928, 138,2903, 1293,2631,1612, 646,3457, 839,2935, 111, 496,2191,2847, 589,3186, 149,3994,2060, 4031,2641,4067,3145,1870, 37,3597,2136,1025,2051,3009,3383,3549,1121,1016,3261, 1301, 251,2446,2599,2153, 872,3246, 637, 334,3705, 831, 884, 921,3065,3140,4092, 2198,1944, 246,2964, 108,2045,1152,1921,2308,1031, 203,3173,4170,1907,3890, 810, 1401,2003,1690, 506, 647,1242,2828,1761,1649,3208,2249,1589,3709,2931,5156,1708, 498, 666,2613, 834,3817,1231, 184,2851,1124, 883,3197,2261,3710,1765,1553,2658, 1178,2639,2351, 93,1193, 942,2538,2141,4402, 235,1821, 870,1591,2192,1709,1871, 3341,1618,4126,2595,2334, 603, 651, 69, 701, 268,2662,3411,2555,1380,1606, 503, 448, 254,2371,2646, 574,1187,2309,1770, 322,2235,1292,1801, 305, 566,1133, 229, 2067,2057, 706, 167, 483,2002,2672,3295,1820,3561,3067, 316, 378,2746,3452,1112, 136,1981, 507,1651,2917,1117, 285,4591, 182,2580,3522,1304, 335,3303,1835,2504, 1795,1792,2248, 674,1018,2106,2449,1857,2292,2845, 976,3047,1781,2600,2727,1389, 1281, 52,3152, 153, 265,3950, 672,3485,3951,4463, 430,1183, 365, 278,2169, 27, 1407,1336,2304, 209,1340,1730,2202,1852,2403,2883, 979,1737,1062, 631,2829,2542, 3876,2592, 825,2086,2226,3048,3625, 352,1417,3724, 542, 991, 431,1351,3938,1861, 2294, 826,1361,2927,3142,3503,1738, 463,2462,2723, 582,1916,1595,2808, 400,3845, 3891,2868,3621,2254, 58,2492,1123, 910,2160,2614,1372,1603,1196,1072,3385,1700, 3267,1980, 696, 480,2430, 920, 799,1570,2920,1951,2041,4047,2540,1321,4223,2469, 3562,2228,1271,2602, 401,2833,3351,2575,5157, 907,2312,1256, 410, 263,3507,1582, 996, 678,1849,2316,1480, 908,3545,2237, 703,2322, 667,1826,2849,1531,2604,2999, 2407,3146,2151,2630,1786,3711, 469,3542, 497,3899,2409, 858, 837,4446,3393,1274, 786, 620,1845,2001,3311, 484, 308,3367,1204,1815,3691,2332,1532,2557,1842,2020, 2724,1927,2333,4440, 567, 22,1673,2728,4475,1987,1858,1144,1597, 101,1832,3601, 12, 974,3783,4391, 951,1412, 1,3720, 453,4608,4041, 528,1041,1027,3230,2628, 1129, 875,1051,3291,1203,2262,1069,2860,2799,2149,2615,3278, 144,1758,3040, 31, 475,1680, 366,2685,3184, 311,1642,4008,2466,5036,1593,1493,2809, 216,1420,1668, 233, 304,2128,3284, 232,1429,1768,1040,2008,3407,2740,2967,2543, 242,2133, 778, 1565,2022,2620, 505,2189,2756,1098,2273, 372,1614, 708, 553,2846,2094,2278, 169, 3626,2835,4161, 228,2674,3165, 809,1454,1309, 466,1705,1095, 900,3423, 880,2667, 3751,5258,2317,3109,2571,4317,2766,1503,1342, 866,4447,1118, 63,2076, 314,1881, 1348,1061, 172, 978,3515,1747, 532, 511,3970, 6, 601, 905,2699,3300,1751, 276, 1467,3725,2668, 65,4239,2544,2779,2556,1604, 578,2451,1802, 992,2331,2624,1320, 3446, 713,1513,1013, 103,2786,2447,1661, 886,1702, 916, 654,3574,2031,1556, 751, 2178,2821,2179,1498,1538,2176, 271, 914,2251,2080,1325, 638,1953,2937,3877,2432, 2754, 95,3265,1716, 260,1227,4083, 775, 106,1357,3254, 426,1607, 555,2480, 772, 1985, 244,2546, 474, 495,1046,2611,1851,2061, 71,2089,1675,2590, 742,3758,2843, 3222,1433, 267,2180,2576,2826,2233,2092,3913,2435, 956,1745,3075, 856,2113,1116, 451, 3,1988,2896,1398, 993,2463,1878,2049,1341,2718,2721,2870,2108, 712,2904, 4363,2753,2324, 277,2872,2349,2649, 384, 987, 435, 691,3000, 922, 164,3939, 652, 1500,1184,4153,2482,3373,2165,4848,2335,3775,3508,3154,2806,2830,1554,2102,1664, 2530,1434,2408, 893,1547,2623,3447,2832,2242,2532,3169,2856,3223,2078, 49,3770, 3469, 462, 318, 656,2259,3250,3069, 679,1629,2758, 344,1138,1104,3120,1836,1283, 3115,2154,1437,4448, 934, 759,1999, 794,2862,1038, 533,2560,1722,2342, 855,2626, 1197,1663,4476,3127, 85,4240,2528, 25,1111,1181,3673, 407,3470,4561,2679,2713, 768,1925,2841,3986,1544,1165, 932, 373,1240,2146,1930,2673, 721,4766, 354,4333, 391,2963, 187, 61,3364,1442,1102, 330,1940,1767, 341,3809,4118, 393,2496,2062, 2211, 105, 331, 300, 439, 913,1332, 626, 379,3304,1557, 328, 689,3952, 309,1555, 931, 317,2517,3027, 325, 569, 686,2107,3084, 60,1042,1333,2794, 264,3177,4014, 1628, 258,3712, 7,4464,1176,1043,1778, 683, 114,1975, 78,1492, 383,1886, 510, 386, 645,5291,2891,2069,3305,4138,3867,2939,2603,2493,1935,1066,1848,3588,1015, 1282,1289,4609, 697,1453,3044,2666,3611,1856,2412, 54, 719,1330, 568,3778,2459, 1748, 788, 492, 551,1191,1000, 488,3394,3763, 282,1799, 348,2016,1523,3155,2390, 1049, 382,2019,1788,1170, 729,2968,3523, 897,3926,2785,2938,3292, 350,2319,3238, 1718,1717,2655,3453,3143,4465, 161,2889,2980,2009,1421, 56,1908,1640,2387,2232, 1917,1874,2477,4921, 148, 83,3438, 592,4245,2882,1822,1055, 741, 115,1496,1624, 381,1638,4592,1020, 516,3214, 458, 947,4575,1432, 211,1514,2926,1865,2142, 189, 852,1221,1400,1486, 882,2299,4036, 351, 28,1122, 700,6479,6480,6481,6482,6483, #last 512 ) PKd]O chardet/sbcsgroupprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # Shy Shalom - original C code # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .charsetgroupprober import CharSetGroupProber from .sbcharsetprober import SingleByteCharSetProber from .langcyrillicmodel import (Win1251CyrillicModel, Koi8rModel, Latin5CyrillicModel, MacCyrillicModel, Ibm866Model, Ibm855Model) from .langgreekmodel import Latin7GreekModel, Win1253GreekModel from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel # from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel from .langthaimodel import TIS620ThaiModel from .langhebrewmodel import Win1255HebrewModel from .hebrewprober import HebrewProber from .langturkishmodel import Latin5TurkishModel class SBCSGroupProber(CharSetGroupProber): def __init__(self): super(SBCSGroupProber, self).__init__() self.probers = [ SingleByteCharSetProber(Win1251CyrillicModel), SingleByteCharSetProber(Koi8rModel), SingleByteCharSetProber(Latin5CyrillicModel), SingleByteCharSetProber(MacCyrillicModel), SingleByteCharSetProber(Ibm866Model), SingleByteCharSetProber(Ibm855Model), SingleByteCharSetProber(Latin7GreekModel), SingleByteCharSetProber(Win1253GreekModel), SingleByteCharSetProber(Latin5BulgarianModel), SingleByteCharSetProber(Win1251BulgarianModel), # TODO: Restore Hungarian encodings (iso-8859-2 and windows-1250) # after we retrain model. # SingleByteCharSetProber(Latin2HungarianModel), # SingleByteCharSetProber(Win1250HungarianModel), SingleByteCharSetProber(TIS620ThaiModel), SingleByteCharSetProber(Latin5TurkishModel), ] hebrew_prober = HebrewProber() logical_hebrew_prober = SingleByteCharSetProber(Win1255HebrewModel, False, hebrew_prober) visual_hebrew_prober = SingleByteCharSetProber(Win1255HebrewModel, True, hebrew_prober) hebrew_prober.set_model_probers(logical_hebrew_prober, visual_hebrew_prober) self.probers.extend([hebrew_prober, logical_hebrew_prober, visual_hebrew_prober]) self.reset() PKd]Ay44chardet/euckrfreq.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # Sampling from about 20M text materials include literature and computer technology # 128 --> 0.79 # 256 --> 0.92 # 512 --> 0.986 # 1024 --> 0.99944 # 2048 --> 0.99999 # # Idea Distribution Ratio = 0.98653 / (1-0.98653) = 73.24 # Random Distribution Ration = 512 / (2350-512) = 0.279. # # Typical Distribution Ratio EUCKR_TYPICAL_DISTRIBUTION_RATIO = 6.0 EUCKR_TABLE_SIZE = 2352 # Char to FreqOrder table , EUCKR_CHAR_TO_FREQ_ORDER = ( 13, 130, 120,1396, 481,1719,1720, 328, 609, 212,1721, 707, 400, 299,1722, 87, 1397,1723, 104, 536,1117,1203,1724,1267, 685,1268, 508,1725,1726,1727,1728,1398, 1399,1729,1730,1731, 141, 621, 326,1057, 368,1732, 267, 488, 20,1733,1269,1734, 945,1400,1735, 47, 904,1270,1736,1737, 773, 248,1738, 409, 313, 786, 429,1739, 116, 987, 813,1401, 683, 75,1204, 145,1740,1741,1742,1743, 16, 847, 667, 622, 708,1744,1745,1746, 966, 787, 304, 129,1747, 60, 820, 123, 676,1748,1749,1750, 1751, 617,1752, 626,1753,1754,1755,1756, 653,1757,1758,1759,1760,1761,1762, 856, 344,1763,1764,1765,1766, 89, 401, 418, 806, 905, 848,1767,1768,1769, 946,1205, 709,1770,1118,1771, 241,1772,1773,1774,1271,1775, 569,1776, 999,1777,1778,1779, 1780, 337, 751,1058, 28, 628, 254,1781, 177, 906, 270, 349, 891,1079,1782, 19, 1783, 379,1784, 315,1785, 629, 754,1402, 559,1786, 636, 203,1206,1787, 710, 567, 1788, 935, 814,1789,1790,1207, 766, 528,1791,1792,1208,1793,1794,1795,1796,1797, 1403,1798,1799, 533,1059,1404,1405,1156,1406, 936, 884,1080,1800, 351,1801,1802, 1803,1804,1805, 801,1806,1807,1808,1119,1809,1157, 714, 474,1407,1810, 298, 899, 885,1811,1120, 802,1158,1812, 892,1813,1814,1408, 659,1815,1816,1121,1817,1818, 1819,1820,1821,1822, 319,1823, 594, 545,1824, 815, 937,1209,1825,1826, 573,1409, 1022,1827,1210,1828,1829,1830,1831,1832,1833, 556, 722, 807,1122,1060,1834, 697, 1835, 900, 557, 715,1836,1410, 540,1411, 752,1159, 294, 597,1211, 976, 803, 770, 1412,1837,1838, 39, 794,1413, 358,1839, 371, 925,1840, 453, 661, 788, 531, 723, 544,1023,1081, 869, 91,1841, 392, 430, 790, 602,1414, 677,1082, 457,1415,1416, 1842,1843, 475, 327,1024,1417, 795, 121,1844, 733, 403,1418,1845,1846,1847, 300, 119, 711,1212, 627,1848,1272, 207,1849,1850, 796,1213, 382,1851, 519,1852,1083, 893,1853,1854,1855, 367, 809, 487, 671,1856, 663,1857,1858, 956, 471, 306, 857, 1859,1860,1160,1084,1861,1862,1863,1864,1865,1061,1866,1867,1868,1869,1870,1871, 282, 96, 574,1872, 502,1085,1873,1214,1874, 907,1875,1876, 827, 977,1419,1420, 1421, 268,1877,1422,1878,1879,1880, 308,1881, 2, 537,1882,1883,1215,1884,1885, 127, 791,1886,1273,1423,1887, 34, 336, 404, 643,1888, 571, 654, 894, 840,1889, 0, 886,1274, 122, 575, 260, 908, 938,1890,1275, 410, 316,1891,1892, 100,1893, 1894,1123, 48,1161,1124,1025,1895, 633, 901,1276,1896,1897, 115, 816,1898, 317, 1899, 694,1900, 909, 734,1424, 572, 866,1425, 691, 85, 524,1010, 543, 394, 841, 1901,1902,1903,1026,1904,1905,1906,1907,1908,1909, 30, 451, 651, 988, 310,1910, 1911,1426, 810,1216, 93,1912,1913,1277,1217,1914, 858, 759, 45, 58, 181, 610, 269,1915,1916, 131,1062, 551, 443,1000, 821,1427, 957, 895,1086,1917,1918, 375, 1919, 359,1920, 687,1921, 822,1922, 293,1923,1924, 40, 662, 118, 692, 29, 939, 887, 640, 482, 174,1925, 69,1162, 728,1428, 910,1926,1278,1218,1279, 386, 870, 217, 854,1163, 823,1927,1928,1929,1930, 834,1931, 78,1932, 859,1933,1063,1934, 1935,1936,1937, 438,1164, 208, 595,1938,1939,1940,1941,1219,1125,1942, 280, 888, 1429,1430,1220,1431,1943,1944,1945,1946,1947,1280, 150, 510,1432,1948,1949,1950, 1951,1952,1953,1954,1011,1087,1955,1433,1043,1956, 881,1957, 614, 958,1064,1065, 1221,1958, 638,1001, 860, 967, 896,1434, 989, 492, 553,1281,1165,1959,1282,1002, 1283,1222,1960,1961,1962,1963, 36, 383, 228, 753, 247, 454,1964, 876, 678,1965, 1966,1284, 126, 464, 490, 835, 136, 672, 529, 940,1088,1435, 473,1967,1968, 467, 50, 390, 227, 587, 279, 378, 598, 792, 968, 240, 151, 160, 849, 882,1126,1285, 639,1044, 133, 140, 288, 360, 811, 563,1027, 561, 142, 523,1969,1970,1971, 7, 103, 296, 439, 407, 506, 634, 990,1972,1973,1974,1975, 645,1976,1977,1978,1979, 1980,1981, 236,1982,1436,1983,1984,1089, 192, 828, 618, 518,1166, 333,1127,1985, 818,1223,1986,1987,1988,1989,1990,1991,1992,1993, 342,1128,1286, 746, 842,1994, 1995, 560, 223,1287, 98, 8, 189, 650, 978,1288,1996,1437,1997, 17, 345, 250, 423, 277, 234, 512, 226, 97, 289, 42, 167,1998, 201,1999,2000, 843, 836, 824, 532, 338, 783,1090, 182, 576, 436,1438,1439, 527, 500,2001, 947, 889,2002,2003, 2004,2005, 262, 600, 314, 447,2006, 547,2007, 693, 738,1129,2008, 71,1440, 745, 619, 688,2009, 829,2010,2011, 147,2012, 33, 948,2013,2014, 74, 224,2015, 61, 191, 918, 399, 637,2016,1028,1130, 257, 902,2017,2018,2019,2020,2021,2022,2023, 2024,2025,2026, 837,2027,2028,2029,2030, 179, 874, 591, 52, 724, 246,2031,2032, 2033,2034,1167, 969,2035,1289, 630, 605, 911,1091,1168,2036,2037,2038,1441, 912, 2039, 623,2040,2041, 253,1169,1290,2042,1442, 146, 620, 611, 577, 433,2043,1224, 719,1170, 959, 440, 437, 534, 84, 388, 480,1131, 159, 220, 198, 679,2044,1012, 819,1066,1443, 113,1225, 194, 318,1003,1029,2045,2046,2047,2048,1067,2049,2050, 2051,2052,2053, 59, 913, 112,2054, 632,2055, 455, 144, 739,1291,2056, 273, 681, 499,2057, 448,2058,2059, 760,2060,2061, 970, 384, 169, 245,1132,2062,2063, 414, 1444,2064,2065, 41, 235,2066, 157, 252, 877, 568, 919, 789, 580,2067, 725,2068, 2069,1292,2070,2071,1445,2072,1446,2073,2074, 55, 588, 66,1447, 271,1092,2075, 1226,2076, 960,1013, 372,2077,2078,2079,2080,2081,1293,2082,2083,2084,2085, 850, 2086,2087,2088,2089,2090, 186,2091,1068, 180,2092,2093,2094, 109,1227, 522, 606, 2095, 867,1448,1093, 991,1171, 926, 353,1133,2096, 581,2097,2098,2099,1294,1449, 1450,2100, 596,1172,1014,1228,2101,1451,1295,1173,1229,2102,2103,1296,1134,1452, 949,1135,2104,2105,1094,1453,1454,1455,2106,1095,2107,2108,2109,2110,2111,2112, 2113,2114,2115,2116,2117, 804,2118,2119,1230,1231, 805,1456, 405,1136,2120,2121, 2122,2123,2124, 720, 701,1297, 992,1457, 927,1004,2125,2126,2127,2128,2129,2130, 22, 417,2131, 303,2132, 385,2133, 971, 520, 513,2134,1174, 73,1096, 231, 274, 962,1458, 673,2135,1459,2136, 152,1137,2137,2138,2139,2140,1005,1138,1460,1139, 2141,2142,2143,2144, 11, 374, 844,2145, 154,1232, 46,1461,2146, 838, 830, 721, 1233, 106,2147, 90, 428, 462, 578, 566,1175, 352,2148,2149, 538,1234, 124,1298, 2150,1462, 761, 565,2151, 686,2152, 649,2153, 72, 173,2154, 460, 415,2155,1463, 2156,1235, 305,2157,2158,2159,2160,2161,2162, 579,2163,2164,2165,2166,2167, 747, 2168,2169,2170,2171,1464, 669,2172,2173,2174,2175,2176,1465,2177, 23, 530, 285, 2178, 335, 729,2179, 397,2180,2181,2182,1030,2183,2184, 698,2185,2186, 325,2187, 2188, 369,2189, 799,1097,1015, 348,2190,1069, 680,2191, 851,1466,2192,2193, 10, 2194, 613, 424,2195, 979, 108, 449, 589, 27, 172, 81,1031, 80, 774, 281, 350, 1032, 525, 301, 582,1176,2196, 674,1045,2197,2198,1467, 730, 762,2199,2200,2201, 2202,1468,2203, 993,2204,2205, 266,1070, 963,1140,2206,2207,2208, 664,1098, 972, 2209,2210,2211,1177,1469,1470, 871,2212,2213,2214,2215,2216,1471,2217,2218,2219, 2220,2221,2222,2223,2224,2225,2226,2227,1472,1236,2228,2229,2230,2231,2232,2233, 2234,2235,1299,2236,2237, 200,2238, 477, 373,2239,2240, 731, 825, 777,2241,2242, 2243, 521, 486, 548,2244,2245,2246,1473,1300, 53, 549, 137, 875, 76, 158,2247, 1301,1474, 469, 396,1016, 278, 712,2248, 321, 442, 503, 767, 744, 941,1237,1178, 1475,2249, 82, 178,1141,1179, 973,2250,1302,2251, 297,2252,2253, 570,2254,2255, 2256, 18, 450, 206,2257, 290, 292,1142,2258, 511, 162, 99, 346, 164, 735,2259, 1476,1477, 4, 554, 343, 798,1099,2260,1100,2261, 43, 171,1303, 139, 215,2262, 2263, 717, 775,2264,1033, 322, 216,2265, 831,2266, 149,2267,1304,2268,2269, 702, 1238, 135, 845, 347, 309,2270, 484,2271, 878, 655, 238,1006,1478,2272, 67,2273, 295,2274,2275, 461,2276, 478, 942, 412,2277,1034,2278,2279,2280, 265,2281, 541, 2282,2283,2284,2285,2286, 70, 852,1071,2287,2288,2289,2290, 21, 56, 509, 117, 432,2291,2292, 331, 980, 552,1101, 148, 284, 105, 393,1180,1239, 755,2293, 187, 2294,1046,1479,2295, 340,2296, 63,1047, 230,2297,2298,1305, 763,1306, 101, 800, 808, 494,2299,2300,2301, 903,2302, 37,1072, 14, 5,2303, 79, 675,2304, 312, 2305,2306,2307,2308,2309,1480, 6,1307,2310,2311,2312, 1, 470, 35, 24, 229, 2313, 695, 210, 86, 778, 15, 784, 592, 779, 32, 77, 855, 964,2314, 259,2315, 501, 380,2316,2317, 83, 981, 153, 689,1308,1481,1482,1483,2318,2319, 716,1484, 2320,2321,2322,2323,2324,2325,1485,2326,2327, 128, 57, 68, 261,1048, 211, 170, 1240, 31,2328, 51, 435, 742,2329,2330,2331, 635,2332, 264, 456,2333,2334,2335, 425,2336,1486, 143, 507, 263, 943,2337, 363, 920,1487, 256,1488,1102, 243, 601, 1489,2338,2339,2340,2341,2342,2343,2344, 861,2345,2346,2347,2348,2349,2350, 395, 2351,1490,1491, 62, 535, 166, 225,2352,2353, 668, 419,1241, 138, 604, 928,2354, 1181,2355,1492,1493,2356,2357,2358,1143,2359, 696,2360, 387, 307,1309, 682, 476, 2361,2362, 332, 12, 222, 156,2363, 232,2364, 641, 276, 656, 517,1494,1495,1035, 416, 736,1496,2365,1017, 586,2366,2367,2368,1497,2369, 242,2370,2371,2372,1498, 2373, 965, 713,2374,2375,2376,2377, 740, 982,1499, 944,1500,1007,2378,2379,1310, 1501,2380,2381,2382, 785, 329,2383,2384,1502,2385,2386,2387, 932,2388,1503,2389, 2390,2391,2392,1242,2393,2394,2395,2396,2397, 994, 950,2398,2399,2400,2401,1504, 1311,2402,2403,2404,2405,1049, 749,2406,2407, 853, 718,1144,1312,2408,1182,1505, 2409,2410, 255, 516, 479, 564, 550, 214,1506,1507,1313, 413, 239, 444, 339,1145, 1036,1508,1509,1314,1037,1510,1315,2411,1511,2412,2413,2414, 176, 703, 497, 624, 593, 921, 302,2415, 341, 165,1103,1512,2416,1513,2417,2418,2419, 376,2420, 700, 2421,2422,2423, 258, 768,1316,2424,1183,2425, 995, 608,2426,2427,2428,2429, 221, 2430,2431,2432,2433,2434,2435,2436,2437, 195, 323, 726, 188, 897, 983,1317, 377, 644,1050, 879,2438, 452,2439,2440,2441,2442,2443,2444, 914,2445,2446,2447,2448, 915, 489,2449,1514,1184,2450,2451, 515, 64, 427, 495,2452, 583,2453, 483, 485, 1038, 562, 213,1515, 748, 666,2454,2455,2456,2457, 334,2458, 780, 996,1008, 705, 1243,2459,2460,2461,2462,2463, 114,2464, 493,1146, 366, 163,1516, 961,1104,2465, 291,2466,1318,1105,2467,1517, 365,2468, 355, 951,1244,2469,1319,2470, 631,2471, 2472, 218,1320, 364, 320, 756,1518,1519,1321,1520,1322,2473,2474,2475,2476, 997, 2477,2478,2479,2480, 665,1185,2481, 916,1521,2482,2483,2484, 584, 684,2485,2486, 797,2487,1051,1186,2488,2489,2490,1522,2491,2492, 370,2493,1039,1187, 65,2494, 434, 205, 463,1188,2495, 125, 812, 391, 402, 826, 699, 286, 398, 155, 781, 771, 585,2496, 590, 505,1073,2497, 599, 244, 219, 917,1018, 952, 646,1523,2498,1323, 2499,2500, 49, 984, 354, 741,2501, 625,2502,1324,2503,1019, 190, 357, 757, 491, 95, 782, 868,2504,2505,2506,2507,2508,2509, 134,1524,1074, 422,1525, 898,2510, 161,2511,2512,2513,2514, 769,2515,1526,2516,2517, 411,1325,2518, 472,1527,2519, 2520,2521,2522,2523,2524, 985,2525,2526,2527,2528,2529,2530, 764,2531,1245,2532, 2533, 25, 204, 311,2534, 496,2535,1052,2536,2537,2538,2539,2540,2541,2542, 199, 704, 504, 468, 758, 657,1528, 196, 44, 839,1246, 272, 750,2543, 765, 862,2544, 2545,1326,2546, 132, 615, 933,2547, 732,2548,2549,2550,1189,1529,2551, 283,1247, 1053, 607, 929,2552,2553,2554, 930, 183, 872, 616,1040,1147,2555,1148,1020, 441, 249,1075,2556,2557,2558, 466, 743,2559,2560,2561, 92, 514, 426, 420, 526,2562, 2563,2564,2565,2566,2567,2568, 185,2569,2570,2571,2572, 776,1530, 658,2573, 362, 2574, 361, 922,1076, 793,2575,2576,2577,2578,2579,2580,1531, 251,2581,2582,2583, 2584,1532, 54, 612, 237,1327,2585,2586, 275, 408, 647, 111,2587,1533,1106, 465, 3, 458, 9, 38,2588, 107, 110, 890, 209, 26, 737, 498,2589,1534,2590, 431, 202, 88,1535, 356, 287,1107, 660,1149,2591, 381,1536, 986,1150, 445,1248,1151, 974,2592,2593, 846,2594, 446, 953, 184,1249,1250, 727,2595, 923, 193, 883,2596, 2597,2598, 102, 324, 539, 817,2599, 421,1041,2600, 832,2601, 94, 175, 197, 406, 2602, 459,2603,2604,2605,2606,2607, 330, 555,2608,2609,2610, 706,1108, 389,2611, 2612,2613,2614, 233,2615, 833, 558, 931, 954,1251,2616,2617,1537, 546,2618,2619, 1009,2620,2621,2622,1538, 690,1328,2623, 955,2624,1539,2625,2626, 772,2627,2628, 2629,2630,2631, 924, 648, 863, 603,2632,2633, 934,1540, 864, 865,2634, 642,1042, 670,1190,2635,2636,2637,2638, 168,2639, 652, 873, 542,1054,1541,2640,2641,2642, # 512, 256 ) PKd]VFFchardet/langcyrillicmodel.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### # KOI8-R language model # Character Mapping Table: KOI8R_char_to_order_map = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, # 80 207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, # 90 223,224,225, 68,226,227,228,229,230,231,232,233,234,235,236,237, # a0 238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253, # b0 27, 3, 21, 28, 13, 2, 39, 19, 26, 4, 23, 11, 8, 12, 5, 1, # c0 15, 16, 9, 7, 6, 14, 24, 10, 17, 18, 20, 25, 30, 29, 22, 54, # d0 59, 37, 44, 58, 41, 48, 53, 46, 55, 42, 60, 36, 49, 38, 31, 34, # e0 35, 43, 45, 32, 40, 52, 56, 33, 61, 62, 51, 57, 47, 63, 50, 70, # f0 ) win1251_char_to_order_map = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, 207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, 223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238, 239,240,241,242,243,244,245,246, 68,247,248,249,250,251,252,253, 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, ) latin5_char_to_order_map = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, 207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, 223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238, 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, 239, 68,240,241,242,243,244,245,246,247,248,249,250,251,252,255, ) macCyrillic_char_to_order_map = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, 191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, 207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, 223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238, 239,240,241,242,243,244,245,246,247,248,249,250,251,252, 68, 16, 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27,255, ) IBM855_char_to_order_map = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 191,192,193,194, 68,195,196,197,198,199,200,201,202,203,204,205, 206,207,208,209,210,211,212,213,214,215,216,217, 27, 59, 54, 70, 3, 37, 21, 44, 28, 58, 13, 41, 2, 48, 39, 53, 19, 46,218,219, 220,221,222,223,224, 26, 55, 4, 42,225,226,227,228, 23, 60,229, 230,231,232,233,234,235, 11, 36,236,237,238,239,240,241,242,243, 8, 49, 12, 38, 5, 31, 1, 34, 15,244,245,246,247, 35, 16,248, 43, 9, 45, 7, 32, 6, 40, 14, 52, 24, 56, 10, 33, 17, 61,249, 250, 18, 62, 20, 51, 25, 57, 30, 47, 29, 63, 22, 50,251,252,255, ) IBM866_char_to_order_map = ( 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, 207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, 223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238, 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, 239, 68,240,241,242,243,244,245,246,247,248,249,250,251,252,255, ) # Model Table: # total sequences: 100% # first 512 sequences: 97.6601% # first 1024 sequences: 2.3389% # rest sequences: 0.1237% # negative sequences: 0.0009% RussianLangModel = ( 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,1,3,3,3,2,3,2,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,2,2,2,0,0,2, 3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,2,3,2,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,2,2,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,2,3,3,1,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1, 0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1, 0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,2,2,2,3,1,3,3,1,3,3,3,3,2,2,3,0,2,2,2,3,3,2,1,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,2,3,3,3,3,3,2,2,3,2,3,3,3,2,1,2,2,0,1,2,2,2,2,2,2,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,3,0,2,2,3,3,2,1,2,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,2,3,3,1,2,3,2,2,3,2,3,3,3,3,2,2,3,0,3,2,2,3,1,1,1,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,2,3,3,3,3,2,2,2,0,3,3,3,2,2,2,2,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,2,3,2,2,0,1,3,2,1,2,2,1,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,3,2,1,1,3,0,1,1,1,1,2,1,1,0,2,2,2,1,2,0,1,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,2,3,3,2,2,2,2,1,3,2,3,2,3,2,1,2,2,0,1,1,2,1,2,1,2,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,2,3,3,3,2,2,2,2,0,2,2,2,2,3,1,1,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, 3,2,3,2,2,3,3,3,3,3,3,3,3,3,1,3,2,0,0,3,3,3,3,2,3,3,3,3,2,3,2,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,3,3,3,3,3,2,2,3,3,0,2,1,0,3,2,3,2,3,0,0,1,2,0,0,1,0,1,2,1,1,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,0,3,0,2,3,3,3,3,2,3,3,3,3,1,2,2,0,0,2,3,2,2,2,3,2,3,2,2,3,0,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,2,3,0,2,3,2,3,0,1,2,3,3,2,0,2,3,0,0,2,3,2,2,0,1,3,1,3,2,2,1,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,1,3,0,2,3,3,3,3,3,3,3,3,2,1,3,2,0,0,2,2,3,3,3,2,3,3,0,2,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,2,2,3,3,2,2,2,3,3,0,0,1,1,1,1,1,2,0,0,1,1,1,1,0,1,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,2,2,3,3,3,3,3,3,3,0,3,2,3,3,2,3,2,0,2,1,0,1,1,0,1,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,3,2,3,3,3,2,2,2,2,3,1,3,2,3,1,1,2,1,0,2,2,2,2,1,3,1,0, 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, 2,2,3,3,3,3,3,1,2,2,1,3,1,0,3,0,0,3,0,0,0,1,1,0,1,2,1,0,0,0,0,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,2,2,1,1,3,3,3,2,2,1,2,2,3,1,1,2,0,0,2,2,1,3,0,0,2,1,1,2,1,1,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,2,3,3,3,3,1,2,2,2,1,2,1,3,3,1,1,2,1,2,1,2,2,0,2,0,0,1,1,0,1,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,3,3,3,3,3,2,1,3,2,2,3,2,0,3,2,0,3,0,1,0,1,1,0,0,1,1,1,1,0,1,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,2,3,3,3,2,2,2,3,3,1,2,1,2,1,0,1,0,1,1,0,1,0,0,2,1,1,1,0,1,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, 3,1,1,2,1,2,3,3,2,2,1,2,2,3,0,2,1,0,0,2,2,3,2,1,2,2,2,2,2,3,1,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 3,3,3,3,3,1,1,0,1,1,2,2,1,1,3,0,0,1,3,1,1,1,0,0,0,1,0,1,1,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,1,3,3,3,2,0,0,0,2,1,0,1,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,0,1,0,0,2,3,2,2,2,1,2,2,2,1,2,1,0,0,1,1,1,0,2,0,1,1,1,0,0,1,1, 1,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0, 2,3,3,3,3,0,0,0,0,1,0,0,0,0,3,0,1,2,1,0,0,0,0,0,0,0,1,1,0,0,1,1, 1,0,1,0,1,2,0,0,1,1,2,1,0,1,1,1,1,0,1,1,1,1,0,1,0,0,1,0,0,1,1,0, 2,2,3,2,2,2,3,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,0,1,0,1,1,1,0,2,1, 1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,0, 3,3,3,2,2,2,2,3,2,2,1,1,2,2,2,2,1,1,3,1,2,1,2,0,0,1,1,0,1,0,2,1, 1,1,1,1,1,2,1,0,1,1,1,1,0,1,0,0,1,1,0,0,1,0,1,0,0,1,0,0,0,1,1,0, 2,0,0,1,0,3,2,2,2,2,1,2,1,2,1,2,0,0,0,2,1,2,2,1,1,2,2,0,1,1,0,2, 1,1,1,1,1,0,1,1,1,2,1,1,1,2,1,0,1,2,1,1,1,1,0,1,1,1,0,0,1,0,0,1, 1,3,2,2,2,1,1,1,2,3,0,0,0,0,2,0,2,2,1,0,0,0,0,0,0,1,0,0,0,0,1,1, 1,0,1,1,0,1,0,1,1,0,1,1,0,2,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0, 2,3,2,3,2,1,2,2,2,2,1,0,0,0,2,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,2,1, 1,1,2,1,0,2,0,0,1,0,1,0,0,1,0,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0, 3,0,0,1,0,2,2,2,3,2,2,2,2,2,2,2,0,0,0,2,1,2,1,1,1,2,2,0,0,0,1,2, 1,1,1,1,1,0,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,1, 2,3,2,3,3,2,0,1,1,1,0,0,1,0,2,0,1,1,3,1,0,0,0,0,0,0,0,1,0,0,2,1, 1,1,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,0,1,0, 2,3,3,3,3,1,2,2,2,2,0,1,1,0,2,1,1,1,2,1,0,1,1,0,0,1,0,1,0,0,2,0, 0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,3,3,3,2,0,0,1,1,2,2,1,0,0,2,0,1,1,3,0,0,1,0,0,0,0,0,1,0,1,2,1, 1,1,2,0,1,1,1,0,1,0,1,1,0,1,0,1,1,1,1,0,1,0,0,0,0,0,0,1,0,1,1,0, 1,3,2,3,2,1,0,0,2,2,2,0,1,0,2,0,1,1,1,0,1,0,0,0,3,0,1,1,0,0,2,1, 1,1,1,0,1,1,0,0,0,0,1,1,0,1,0,0,2,1,1,0,1,0,0,0,1,0,1,0,0,1,1,0, 3,1,2,1,1,2,2,2,2,2,2,1,2,2,1,1,0,0,0,2,2,2,0,0,0,1,2,1,0,1,0,1, 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,1,1,1,0,1,0,1,1,0,1,1,1,0,0,1, 3,0,0,0,0,2,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,1, 1,1,0,0,1,0,0,0,1,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1, 1,3,3,2,2,0,0,0,2,2,0,0,0,1,2,0,1,1,2,0,0,0,0,0,0,0,0,1,0,0,2,1, 0,1,1,0,0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0, 2,3,2,3,2,0,0,0,0,1,1,0,0,0,2,0,2,0,2,0,0,0,0,0,1,0,0,1,0,0,1,1, 1,1,2,0,1,2,1,0,1,1,2,1,1,1,1,1,2,1,1,0,1,0,0,1,1,1,1,1,0,1,1,0, 1,3,2,2,2,1,0,0,2,2,1,0,1,2,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1, 0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,1,0,2,3,1,2,2,2,2,2,2,1,1,0,0,0,1,0,1,0,2,1,1,1,0,0,0,0,1, 1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0, 2,0,2,0,0,1,0,3,2,1,2,1,2,2,0,1,0,0,0,2,1,0,0,2,1,1,1,1,0,2,0,2, 2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,0,0,0,1,1,1,1,0,1,0,0,1, 1,2,2,2,2,1,0,0,1,0,0,0,0,0,2,0,1,1,1,1,0,0,0,0,1,0,1,2,0,0,2,0, 1,0,1,1,1,2,1,0,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,1,0,0,1,0,1,1,0, 2,1,2,2,2,0,3,0,1,1,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 0,0,0,1,1,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0, 1,2,2,3,2,2,0,0,1,1,2,0,1,2,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1, 0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0, 2,2,1,1,2,1,2,2,2,2,2,1,2,2,0,1,0,0,0,1,2,2,2,1,2,1,1,1,1,1,2,1, 1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,0,1,1,0,0,1, 1,2,2,2,2,0,1,0,2,2,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0, 0,0,1,0,0,1,0,0,0,0,1,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0, 0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,2,2,2,2,0,0,0,2,2,2,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1, 0,1,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,2,2,2,2,0,0,0,0,1,0,0,1,1,2,0,0,0,0,1,0,1,0,0,1,0,0,2,0,0,0,1, 0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0, 1,2,2,2,1,1,2,0,2,1,1,1,1,0,2,2,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1, 0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0, 1,0,2,1,2,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0, 0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0, 1,0,0,0,0,2,0,1,2,1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1, 0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1, 2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 1,1,1,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 1,1,0,1,1,0,1,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0,0,0, 0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, ) Koi8rModel = { 'char_to_order_map': KOI8R_char_to_order_map, 'precedence_matrix': RussianLangModel, 'typical_positive_ratio': 0.976601, 'keep_english_letter': False, 'charset_name': "KOI8-R", 'language': 'Russian', } Win1251CyrillicModel = { 'char_to_order_map': win1251_char_to_order_map, 'precedence_matrix': RussianLangModel, 'typical_positive_ratio': 0.976601, 'keep_english_letter': False, 'charset_name': "windows-1251", 'language': 'Russian', } Latin5CyrillicModel = { 'char_to_order_map': latin5_char_to_order_map, 'precedence_matrix': RussianLangModel, 'typical_positive_ratio': 0.976601, 'keep_english_letter': False, 'charset_name': "ISO-8859-5", 'language': 'Russian', } MacCyrillicModel = { 'char_to_order_map': macCyrillic_char_to_order_map, 'precedence_matrix': RussianLangModel, 'typical_positive_ratio': 0.976601, 'keep_english_letter': False, 'charset_name': "MacCyrillic", 'language': 'Russian', } Ibm866Model = { 'char_to_order_map': IBM866_char_to_order_map, 'precedence_matrix': RussianLangModel, 'typical_positive_ratio': 0.976601, 'keep_english_letter': False, 'charset_name': "IBM866", 'language': 'Russian', } Ibm855Model = { 'char_to_order_map': IBM855_char_to_order_map, 'precedence_matrix': RussianLangModel, 'typical_positive_ratio': 0.976601, 'keep_english_letter': False, 'charset_name': "IBM855", 'language': 'Russian', } PKd]aZchardet/charsetprober.pynu[######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # Shy Shalom - original C code # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### import logging import re from .enums import ProbingState class CharSetProber(object): SHORTCUT_THRESHOLD = 0.95 def __init__(self, lang_filter=None): self._state = None self.lang_filter = lang_filter self.logger = logging.getLogger(__name__) def reset(self): self._state = ProbingState.DETECTING @property def charset_name(self): return None def feed(self, buf): pass @property def state(self): return self._state def get_confidence(self): return 0.0 @staticmethod def filter_high_byte_only(buf): buf = re.sub(b'([\x00-\x7F])+', b' ', buf) return buf @staticmethod def filter_international_words(buf): """ We define three types of bytes: alphabet: english alphabets [a-zA-Z] international: international characters [\x80-\xFF] marker: everything else [^a-zA-Z\x80-\xFF] The input buffer can be thought to contain a series of words delimited by markers. This function works to filter all words that contain at least one international character. All contiguous sequences of markers are replaced by a single space ascii character. This filter applies to all scripts which do not use English characters. """ filtered = bytearray() # This regex expression filters out only words that have at-least one # international character. The word may include one marker character at # the end. words = re.findall(b'[a-zA-Z]*[\x80-\xFF]+[a-zA-Z]*[^a-zA-Z\x80-\xFF]?', buf) for word in words: filtered.extend(word[:-1]) # If the last character in the word is a marker, replace it with a # space as markers shouldn't affect our analysis (they are used # similarly across all languages and may thus have similar # frequencies). last_char = word[-1:] if not last_char.isalpha() and last_char < b'\x80': last_char = b' ' filtered.extend(last_char) return filtered @staticmethod def filter_with_english_letters(buf): """ Returns a copy of ``buf`` that retains only the sequences of English alphabet and high byte characters that are not between <> characters. Also retains English alphabet and high byte characters immediately before occurrences of >. This filter can be applied to all scripts which contain both English characters and extended ASCII characters, but is currently only used by ``Latin1Prober``. """ filtered = bytearray() in_tag = False prev = 0 for curr in range(len(buf)): # Slice here to get bytes instead of an int with Python 3 buf_char = buf[curr:curr + 1] # Check if we're coming out of or entering an HTML tag if buf_char == b'>': in_tag = False elif buf_char == b'<': in_tag = True # If current character is not extended-ASCII and not alphabetic... if buf_char < b'\x80' and not buf_char.isalpha(): # ...and we're not in a tag if curr > prev and not in_tag: # Keep everything after last non-extended-ASCII, # non-alphabetic character filtered.extend(buf[prev:curr]) # Output a space to delimit stretch we kept filtered.extend(b' ') prev = curr + 1 # If we're not in a tag... if not in_tag: # Keep everything after last non-extended-ASCII, non-alphabetic # character filtered.extend(buf[prev:]) return filtered PKd]Jq)colorama/__pycache__/win32.cpython-38.pycnu[U ʗRe @sdZdZz.ddlZddlmZeejZddlmZWn.eefk rddZddZ ddZ YnZXdd lm Z m Z m Z mZejZGd d d e ZejjZejge_eje_ejjZejeege_eje_ejj Zejejge_eje_ejjZejege_eje_ejj Z!eje ejeeejge!_eje!_ejj"Z#ejejejeeejge#_eje#_ejj$Z%ej&ge%_eje%_d d Z'ddZ efddZddZ dddZddZ(ddZ"ddZ)dS)iiN) LibraryLoader)wintypescGsdSN_rr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/colorama/win32.pyr cGsdSrrrrrrr r )byref Structurec_charPOINTERc@s>eZdZdZdefdefdejfdejfdefgZddZ d S) CONSOLE_SCREEN_BUFFER_INFOzstruct in wincon.h.dwSizedwCursorPosition wAttributessrWindowdwMaximumWindowSizec CsHd|jj|jj|jj|jj|j|jj|jj|jj|jj |j j|j jf S)Nz"(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)) rYXrrrTopLeftZBottomZRightr)selfrrr__str__sz"CONSOLE_SCREEN_BUFFER_INFO.__str__N) __name__ __module__ __qualname____doc__COORDrWORDZ SMALL_RECTZ_fields_rrrrrrsrcCst}t|t|}t|Sr)r_GetConsoleScreenBufferInfor bool)handlecsbisuccessrrr _winapi_test\s r&cCstddttttfDS)Ncss|]}t|VqdSr)r&).0hrrr cszwinapi_test..)any _GetStdHandleSTDOUTSTDERRrrrr winapi_testbsr.cCs t|}t}t|t|}|Sr)r+rr!r ) stream_idr#r$r%rrrGetConsoleScreenBufferInfofsr0cCst|}t||Sr)r+_SetConsoleTextAttribute)r/attrsr#rrrSetConsoleTextAttributemsr3TcCsvt|}|jdks|jdkr dSt|jd|jd}|rdttj}|j|j7_|j|j7_t|}t ||S)Nr) rrrr0r,rrrr+_SetConsoleCursorPosition)r/positionadjustZadjusted_positionsrr#rrrSetConsoleCursorPositionqs r9cCsBt|}t|}t|}td}t||||t|}|jS)Nr)r+r encoderDWORD_FillConsoleOutputCharacterAr value)r/charlengthstartr# num_writtenr%rrrFillConsoleOutputCharacters   rBcCs:t|}t|}t|}td}t||||t|S)za FillConsoleOutputAttribute( hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten )r)r+rr r;_FillConsoleOutputAttributer )r/attrr?r@r# attributerArrrFillConsoleOutputAttributes   rFcCst|Sr)_SetConsoleTitleW)titlerrrSetConsoleTitlesrI)T)*r,r-ctypesrZWinDLLwindllrAttributeError ImportErrorr3r.r r r rZ_COORDrrkernel32Z GetStdHandler+r;ZargtypesZHANDLErestyper0r!ZBOOLr1r r9r5ZFillConsoleOutputCharacterAr<rFrCZSetConsoleTitleWrGZLPCWSTRr&rBrIrrrrsx      PKd]&%N.colorama/__pycache__/initialise.cpython-38.pycnu[U ʗRe{@stddlZddlZddlZddlmZdadadadada ddZ ddd Z d d Z ej d d ZddZddZdS)N) AnsiToWin32FcCstdk rttdSN)r orig_stdout reset_allrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/colorama/initialise.pyrsrTcCs|st|||grtdtjatjatjdkr6dantt||||t_atjdkr\da ntt||||t_a t st t da dS)Nz,wrap=False conflicts with any other arg=TrueT)any ValueErrorsysstdoutrstderr orig_stderrwrapped_stdout wrap_streamwrapped_stderr atexit_doneatexitregisterr) autoresetconvertstripwraprrrinits   rcCs tdk rtt_tdk rtt_dSr)rr r rr rrrrdeinit3srcos"t||z dVW5tXdSr)rr)argskwargsrrr colorama_text:s  rcCs tdk rtt_tdk rtt_dSr)rr r rr rrrrreinitCsrcCs&|r"t||||d}|r"|j}|S)N)rrr)rZ should_wrapstream)rrrrrwrapperrrrrJsr)FNNT)r contextlibr Z ansitowin32rrrrrrrrrcontextmanagerrrrrrrrs   PKd]?=1colorama/__pycache__/winterm.cpython-38.opt-1.pycnu[U .e&@s@ddlmZGdddeZGdddeZGdddeZdS) )win32c@s,eZdZdZdZdZdZdZdZdZ dZ d S) WinColorrN) __name__ __module__ __qualname__ZBLACKZBLUEZGREENZCYANZREDZMAGENTAZYELLOWZGREYrr@/usr/lib/python3.8/site-packages/pip/_vendor/colorama/winterm.pyrsrc@seZdZdZdZdZdS)WinStylerN)r r r ZNORMALBRIGHTBRIGHT_BACKGROUNDrrrrrsrc@seZdZddZddZddZd dd Zd!d d Zd"d dZd#ddZ d$ddZ ddZ d%ddZ d&ddZ d'ddZd(ddZddZdS))WinTermcCs>ttjj|_||j|j|_|j|_ |j |_ d|_ dS)Nr) rGetConsoleScreenBufferInfoSTDOUTZ wAttributes_default set_attrs_fore _default_fore_back _default_back_style_default_style_lightselfrrr__init__s  zWinTerm.__init__cCs|j|jd|j|jBS)N)rrrr r!rrr get_attrs$szWinTerm.get_attrscCs.|d@|_|d?d@|_|tjtjB@|_dS)Nr r)rrrrrr)r"valuerrrr's zWinTerm.set_attrsNcCs$||j|j|jdd|_dS)N)attrsr)rr set_consoler )r" on_stderrrrr reset_all,s zWinTerm.reset_allFcCsL|dkr|j}||_|r*|jtjO_n|jtjM_|j|ddSN)r))rrr rrr()r"forelightr)rrrr,1sz WinTerm.forecCsL|dkr|j}||_|r*|jtjO_n|jtjM_|j|ddSr+)rrr rrr()r"backr-r)rrrr.<sz WinTerm.backcCs$|dkr|j}||_|j|ddSr+)rrr()r"styler)rrrr/Gsz WinTerm.stylecCs0|dkr|}tj}|r tj}t||dSN)r%rrSTDERRZSetConsoleTextAttribute)r"r'r)handlerrrr(Ms zWinTerm.set_consolecCs,t|j}|jd7_|jd7_|S)Nr)rrdwCursorPositionXY)r"r2positionrrr get_positionUs zWinTerm.get_positioncCs,|dkr dStj}|rtj}t||dSr0)rrr1SetConsoleCursorPosition)r"r6r)r2rrrset_cursor_position]s zWinTerm.set_cursor_positioncCsBtj}|rtj}||}|j||j|f}tj||dddS)NF)Zadjust)rrr1r7r5r4r8)r"xyr)r2r6Zadjusted_positionrrr cursor_adjustgs  zWinTerm.cursor_adjustrc Cstj}|rtj}t|}|jj|jj}|jj|jj|jj}|dkrZ|j}||}n8|dkrttdd}|}n|dkrtdd}|}ndSt |d||t || |||dkrt |ddS)Nrrr )rr) rrr1rdwSizer4r5r3COORDFillConsoleOutputCharacterFillConsoleOutputAttributer%r8) r"moder)r2csbiZcells_in_screenZcells_before_cursor from_coordcells_to_eraserrr erase_screenos(    zWinTerm.erase_screencCstj}|rtj}t|}|dkr:|j}|jj|jj}nH|dkr\td|jj}|jj}n&|dkr~td|jj}|jj}ndSt |d||t || ||dS)Nrrrr=) rrr1rr3r>r4r?r5r@rAr%)r"rBr)r2rCrDrErrr erase_lines    zWinTerm.erase_linecCst|dSr0)rZSetConsoleTitle)r"titlerrr set_titleszWinTerm.set_title)N)NFF)NFF)NF)NF)NF)F)rF)rF)r r r r#r%rr*r,r.r/r(r7r9r<rFrGrIrrrrrs      rN)robjectrrrrrrrs  PKd]`;L__+colorama/__pycache__/winterm.cpython-38.pycnu[U ʗRe&@s@ddlmZGdddeZGdddeZGdddeZdS) )win32c@s,eZdZdZdZdZdZdZdZdZ dZ d S) WinColorrN) __name__ __module__ __qualname__ZBLACKZBLUEZGREENZCYANZREDZMAGENTAZYELLOWZGREYrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/colorama/winterm.pyrsrc@seZdZdZdZdZdS)WinStylerN)r r r ZNORMALBRIGHTBRIGHT_BACKGROUNDrrrrrsrc@seZdZddZddZddZd dd Zd!d d Zd"d dZd#ddZ d$ddZ ddZ d%ddZ d&ddZ d'ddZd(ddZddZdS))WinTermcCs>ttjj|_||j|j|_|j|_ |j |_ d|_ dS)Nr) rGetConsoleScreenBufferInfoSTDOUTZ wAttributes_default set_attrs_fore _default_fore_back _default_back_style_default_style_lightselfrrr__init__s  zWinTerm.__init__cCs|j|jd|j|jBS)N)rrrr r!rrr get_attrs$szWinTerm.get_attrscCs.|d@|_|d?d@|_|tjtjB@|_dS)Nr r)rrrrrr)r"valuerrrr's zWinTerm.set_attrsNcCs$||j|j|jdd|_dS)N)attrsr)rr set_consoler )r" on_stderrrrr reset_all,s zWinTerm.reset_allFcCsL|dkr|j}||_|r*|jtjO_n|jtjM_|j|ddSN)r))rrr rrr()r"forelightr)rrrr,1sz WinTerm.forecCsL|dkr|j}||_|r*|jtjO_n|jtjM_|j|ddSr+)rrr rrr()r"backr-r)rrrr.<sz WinTerm.backcCs$|dkr|j}||_|j|ddSr+)rrr()r"styler)rrrr/Gsz WinTerm.stylecCs0|dkr|}tj}|r tj}t||dSN)r%rrSTDERRZSetConsoleTextAttribute)r"r'r)handlerrrr(Ms zWinTerm.set_consolecCs,t|j}|jd7_|jd7_|S)Nr)rrdwCursorPositionXY)r"r2positionrrr get_positionUs zWinTerm.get_positioncCs,|dkr dStj}|rtj}t||dSr0)rrr1SetConsoleCursorPosition)r"r6r)r2rrrset_cursor_position]s zWinTerm.set_cursor_positioncCsBtj}|rtj}||}|j||j|f}tj||dddS)NF)adjust)rrr1r7r5r4r8)r"xyr)r2r6Zadjusted_positionrrr cursor_adjustgs  zWinTerm.cursor_adjustrc Cstj}|rtj}t|}|jj|jj}|jj|jj|jj}|dkrZ|j}||}n8|dkrttdd}|}n|dkrtdd}|}ndSt |d||t || |||dkrt |ddS)Nrrr )rr) rrr1rdwSizer4r5r3COORDFillConsoleOutputCharacterFillConsoleOutputAttributer%r8) r"moder)r2csbiZcells_in_screenZcells_before_cursor from_coordcells_to_eraserrr erase_screenos(    zWinTerm.erase_screencCstj}|rtj}t|}|dkr:|j}|jj|jj}nH|dkr\td|jj}|jj}n&|dkr~td|jj}|jj}ndSt |d||t || ||dS)Nrrrr>) rrr1rr3r?r4r@r5rArBr%)r"rCr)r2rDrErFrrr erase_lines    zWinTerm.erase_linecCst|dSr0)rZSetConsoleTitle)r"titlerrr set_titleszWinTerm.set_title)N)NFF)NFF)NF)NF)NF)F)rF)rF)r r r r#r%rr*r,r.r/r(r7r9r=rGrHrJrrrrrs      rN)robjectrrrrrrrs  PKd][,colorama/__pycache__/__init__.cpython-38.pycnu[U ʗRe@sDddlmZmZmZmZddlmZmZmZm Z ddl m Z dZ dS))initdeinitreinit colorama_text)ForeBackStyleCursor) AnsiToWin32z0.4.5N) Z initialiserrrransirrrr Z ansitowin32r __version__r r /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/colorama/__init__.pys PKd]05y (colorama/__pycache__/ansi.cpython-38.pycnu[U ʗRe @sdZdZdZdZddZddZdd d Zdd d ZGd ddeZ GdddeZ Gddde Z Gddde Z Gddde Z e Ze Ze Ze ZdS)z This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code z]cCstt|dS)NmCSIstr)coder/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/colorama/ansi.py code_to_chars sr cCstd|tS)Nz2;)OSCBEL)titlerrr set_titlesr cCstt|dS)NJrmoderrr clear_screensrcCstt|dS)NKrrrrr clear_linesrc@seZdZddZdS) AnsiCodescCs6t|D](}|dst||}t||t|qdS)N_)dir startswithgetattrsetattrr )selfnamevaluerrr__init__s   zAnsiCodes.__init__N)__name__ __module__ __qualname__rrrrrrsrc@s>eZdZd ddZdddZdddZddd Zdd d Zd S) AnsiCursorcCstt|dS)NArrnrrrUP%sz AnsiCursor.UPcCstt|dS)NBrr%rrrDOWN'szAnsiCursor.DOWNcCstt|dS)NCrr%rrrFORWARD)szAnsiCursor.FORWARDcCstt|dS)NDrr%rrrBACK+szAnsiCursor.BACKcCstt|dt|dS)N;Hr)rxyrrrPOS-szAnsiCursor.POSN)r#)r#)r#)r#)r#r#)rr r!r'r)r+r-r2rrrrr"$s     r"c@sPeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdS)AnsiFore !"#$%'Z[\]^_`aNrr r!ZBLACKZREDZGREENZYELLOWZBLUEZMAGENTAZCYANZWHITERESETZ LIGHTBLACK_EXZ LIGHTRED_EXZ LIGHTGREEN_EXZLIGHTYELLOW_EXZ LIGHTBLUE_EXZLIGHTMAGENTA_EXZ LIGHTCYAN_EXZ LIGHTWHITE_EXrrrrr31s"r3c@sPeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdS)AnsiBack()*+,-./1defghijkNrErrrrrGGs"rGc@seZdZdZdZdZdZdS) AnsiStyler#rN)rr r!ZBRIGHTZDIMZNORMALZ RESET_ALLrrrrrY]srYN)r)r)__doc__rr r r r rrobjectrr"r3rGrYZForeZBackStyleZCursorrrrrs     PKd]s+^/colorama/__pycache__/ansitowin32.cpython-38.pycnu[U ʗReN*@sddlZddlZddlZddlmZmZmZmZmZddl m Z m Z m Z ddl mZmZdZ edk rje Z GdddeZGdd d eZdS) N)AnsiForeAnsiBack AnsiStyleStyleBEL)WinTermWinColorWinStyle)windll winapi_testc@s\eZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ e ddZ dS) StreamWrapperz Wraps a stream (such as stdout), acting as a transparent proxy for all attribute access apart from method 'write()', which is delegated to our Converter instance. cCs||_||_dSN)_StreamWrapper__wrapped_StreamWrapper__convertor)selfwrapped converterr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/colorama/ansitowin32.py__init__szStreamWrapper.__init__cCs t|j|Sr)getattrr)rnamerrr __getattr__szStreamWrapper.__getattr__cOs|jj||Sr)r __enter__rargskwargsrrrrszStreamWrapper.__enter__cOs|jj||Sr)r__exit__rrrrr%szStreamWrapper.__exit__cCs ||_dSr__dict__)rstaterrr __setstate__(szStreamWrapper.__setstate__cCs|jSrrrrrr __getstate__+szStreamWrapper.__getstate__cCs|j|dSr)rwritertextrrrr%.szStreamWrapper.writecCs\|j}dtjkr0|dk r0|tjks,|tjkr0dSz |j}Wntk rPYdSX|SdS)NZPYCHARM_HOSTEDTF)rosenvironsys __stdout__ __stderr__isattyAttributeError)rstreamZ stream_isattyrrrr-1s  zStreamWrapper.isattyc Cs.|j}z|jWSttfk r(YdSXdSNT)rclosedr. ValueError)rr/rrrr1=s zStreamWrapper.closedN)__name__ __module__ __qualname____doc__rrrrr"r$r%r-propertyr1rrrrr s r c@s~eZdZdZedZedZdddZdd Z d d Z d d Z ddZ ddZ ddZddZddZddZddZdS) AnsiToWin32z Implements a 'write()' method which, on Windows, will strip ANSI character sequences from the text, and if outputting to a tty, will convert them into win32 function calls. z?\[((?:\d|;)*)([a-zA-Z])?z?\]([^]*)()?NFcCs||_||_t|||_tjdk}|o*t}|dkrN|pL|jj oL|j }||_ |dkrt|or|jj or|j}||_ | |_ |jt jk|_dS)Nnt)r autoresetr r/r(rr r1r-stripconvertget_win32_calls win32_callsr*stderr on_stderr)rrr<r;r:Z on_windowsZconversion_supportedrrrrQs    zAnsiToWin32.__init__cCs|jp|jp|jS)aj True if this class is actually needed. If false, then the output stream will not be affected, nor will win32 calls be issued, so wrapping stdout is not actually required. This will generally be False on non-Windows platforms, unless optional functionality like autoreset has been requested using kwargs to init() )r<r;r:r#rrr should_wraprszAnsiToWin32.should_wrapcNCs@|jr:tr:tjtjftjtjtjftjtjtj ftj tjtj ft j tj t j ft jtj t jft jtj t jft jtj t jft jtj t jft jtj t jft jtj t jft jtj t jft jtj ft jtj t j dft jtj t jdft jtj t jdft jtj t jdft jtj t jdft jtj t jdft jtj t jdft jtj t jdftj tj t j ftjtj t jftjtj t jftjtj t jftjtj t jftjtj t jftjtj t jftjtj t jftjtj ftjtj t j dftjtj t jdftjtj t jdftjtj t jdftjtj t jdftjtj t jdftjtj t jdftjtj t jdfi&St!Sr0)"r<wintermr RESET_ALL reset_allZBRIGHTstyler ZDIMZNORMALrZBLACKforer ZREDZGREENZYELLOWZBLUEZMAGENTAZCYANZWHITEZGREYRESETZ LIGHTBLACK_EXZ LIGHTRED_EXZ LIGHTGREEN_EXZLIGHTYELLOW_EXZ LIGHTBLUE_EXZLIGHTMAGENTA_EXZ LIGHTCYAN_EXZ LIGHTWHITE_EXrbackdictr#rrrr=|s                                   (zAnsiToWin32.get_win32_callscCs@|js |jr||n|j||j|jr<|dSr)r;r<write_and_convertrr%flushr:rDr&rrrr%s     zAnsiToWin32.writecCs4|jr|ddn|js0|jjs0|jtjdS)Nmr) r< call_win32r;r/r1rr%rrCr#rrrrDszAnsiToWin32.reset_allcCsbd}||}|j|D]0}|\}}|||||j||}q|||t|dS)z Write the given text to our wrapped stream, stripping any ANSI sequences from the text, and optionally converting them into win32 calls. rN) convert_osc ANSI_CSI_REfinditerspanwrite_plain_text convert_ansigroupslen)rr'cursormatchstartendrrrrJs  zAnsiToWin32.write_and_convertcCs*||kr&|j||||jdSr)rr%rK)rr'rYrZrrrrSszAnsiToWin32.write_plain_textcCs"|jr|||}|||dSr)r<extract_paramsrN)r paramstringcommandparamsrrrrTs zAnsiToWin32.convert_ansicCsz|dkr8tdd|dD}t|dkrv|d}q n>tdd|dD}t|dkrv|d krjd }n |d krvd}|S) NHfcss&|]}t|dkrt|ndVqdS)rrNrVint.0prrr sz-AnsiToWin32.extract_params..;)rcss"|]}t|dkrt|VqdS)rNr`rbrrrres rZJKmrMABCD)tuplesplitrV)rr]r\r^rrrr[s   zAnsiToWin32.extract_paramsc Cs|dkrR|D]B}||jkr |j|}|d}|dd}t|jd}|||q n|dkrptj|d|jdn|dkrtj|d|jdnf|dkrtj||jdnL|dkr|d}d| fd|f|df| dfd |\} } tj| | |jddS) NrLrr)r@JKr_rh)ABCD)r>rIr@rBZ erase_screenZ erase_lineZset_cursor_positionZ cursor_adjust) rr]r^paramZ func_argsfuncrrnxyrrrrNs$    *zAnsiToWin32.call_win32cCs|j|D]n}|\}}|d|||d}|\}}|tkr |ddkr |d}|ddkr t|dq |S)NrfrrZ02) ANSI_OSC_RErQrRrUrcountrjrB set_title)rr'rXrYrZr\r]r^rrrrOs    zAnsiToWin32.convert_osc)NNF)r3r4r5r6recompilerPrvrrAr=r%rDrJrSrTr[rNrOrrrrr8Hs   ! , r8)ryr*r(ansirrrrrrBrr r win32r r objectr r8rrrrs8PKd]ݵ5colorama/__pycache__/ansitowin32.cpython-38.opt-1.pycnu[U .e(@sddlZddlZddlZddlmZmZmZmZddlm Z m Z m Z ddl m Z mZdZe dk rfe ZGdddeZGdd d eZdS) N)AnsiForeAnsiBack AnsiStyleStyle)WinTermWinColorWinStyle)windll winapi_testc@sLeZdZdZddZddZddZdd Zd d Zd d Z e ddZ dS) StreamWrapperz Wraps a stream (such as stdout), acting as a transparent proxy for all attribute access apart from method 'write()', which is delegated to our Converter instance. cCs||_||_dSN)_StreamWrapper__wrapped_StreamWrapper__convertor)selfwrappedZ converterrD/usr/lib/python3.8/site-packages/pip/_vendor/colorama/ansitowin32.py__init__szStreamWrapper.__init__cCs t|j|Sr )getattrr)rnamerrr __getattr__szStreamWrapper.__getattr__cOs|jj||Sr )r __enter__rargskwargsrrrrszStreamWrapper.__enter__cOs|jj||Sr )r__exit__rrrrr%szStreamWrapper.__exit__cCs|j|dSr )rwritertextrrrr(szStreamWrapper.writecCs\|j}dtjkr0|dk r0|tjks,|tjkr0dSz |j}Wntk rPYdSX|SdS)NZPYCHARM_HOSTEDTF)rosenvironsys __stdout__ __stderr__isattyAttributeError)rstreamZ stream_isattyrrrr%+s  zStreamWrapper.isattycCs*|j}z|jWStk r$YdSXdSNT)rclosedr&)rr'rrrr)7s zStreamWrapper.closedN) __name__ __module__ __qualname____doc__rrrrrr%propertyr)rrrrr s r c@s~eZdZdZedZedZdddZdd Z d d Z d d Z ddZ ddZ ddZddZddZddZddZdS) AnsiToWin32z Implements a 'write()' method which, on Windows, will strip ANSI character sequences from the text, and if outputting to a tty, will convert them into win32 function calls. z?\[((?:\d|;)*)([a-zA-Z])?z?\]((?:.|;)*?)()?NFcCs||_||_t|||_tjdk}|o*t}|dkrN|pL|jj oL|j }||_ |dkrt|or|jj or|j}||_ | |_ |jt jk|_dS)Nnt)r autoresetr r'r rr r)r%stripconvertget_win32_calls win32_callsr"stderr on_stderr)rrr3r2r1Z on_windowsZconversion_supportedrrrrIs    zAnsiToWin32.__init__cCs|jp|jp|jS)aj True if this class is actually needed. If false, then the output stream will not be affected, nor will win32 calls be issued, so wrapping stdout is not actually required. This will generally be False on non-Windows platforms, unless optional functionality like autoreset has been requested using kwargs to init() )r3r2r1rrrr should_wrapjszAnsiToWin32.should_wrapcNCs@|jr:tr:tjtjftjtjtjftjtjtj ftj tjtj ft j tj t j ft jtj t jft jtj t jft jtj t jft jtj t jft jtj t jft jtj t jft jtj t jft jtj ft jtj t j dft jtj t jdft jtj t jdft jtj t jdft jtj t jdft jtj t jdft jtj t jdft jtj t jdftj tj t j ftjtj t jftjtj t jftjtj t jftjtj t jftjtj t jftjtj t jftjtj t jftjtj ftjtj t j dftjtj t jdftjtj t jdftjtj t jdftjtj t jdftjtj t jdftjtj t jdftjtj t jdfi&St!Sr()"r3wintermr RESET_ALL reset_allZBRIGHTZstyler ZDIMZNORMALrZBLACKZforerZREDZGREENZYELLOWZBLUEZMAGENTAZCYANZWHITEZGREYZRESETZ LIGHTBLACK_EXZ LIGHTRED_EXZ LIGHTGREEN_EXZLIGHTYELLOW_EXZ LIGHTBLUE_EXZLIGHTMAGENTA_EXZ LIGHTCYAN_EXZ LIGHTWHITE_EXrZbackdictr8rrrr4ts                                   (zAnsiToWin32.get_win32_callscCs@|js |jr||n|j||j|jr<|dSr )r2r3write_and_convertrrflushr1r<rrrrrs     zAnsiToWin32.writecCs4|jr|ddn|js0|jjs0|jtjdS)Nmr) r3 call_win32r2r'r)rrrr;r8rrrr<szAnsiToWin32.reset_allcCsbd}||}|j|D]0}|\}}|||||j||}q|||t|dS)z Write the given text to our wrapped stream, stripping any ANSI sequences from the text, and optionally converting them into win32 calls. rN) convert_osc ANSI_CSI_REfinditerspanwrite_plain_text convert_ansigroupslen)rrZcursormatchstartendrrrr>s  zAnsiToWin32.write_and_convertcCs*||kr&|j||||jdSr )rrr?)rrrLrMrrrrGszAnsiToWin32.write_plain_textcCs"|jr|||}|||dSr )r3extract_paramsrB)r paramstringcommandparamsrrrrHs zAnsiToWin32.convert_ansicCsz|dkr8tdd|dD}t|dkrv|d}q n>tdd|dD}t|dkrv|d krjd }n |d krvd}|S) NHfcss&|]}t|dkrt|ndVqdS)rrNrJint.0prrr sz-AnsiToWin32.extract_params..;)rcss"|]}t|dkrt|VqdS)rNrSrUrrrrXs rZJKmrAABCD)tuplesplitrJ)rrPrOrQrrrrNs   zAnsiToWin32.extract_paramsc Cs|dkrR|D]B}||jkr |j|}|d}|dd}t|jd}|||q n|dkrptj|d|jdn|dkrtj|d|jdnf|dkrtj||jdnL|dkr|d}d| fd|f|df| dfd |\} } tj| | |jddS) Nr@rr)r7JKrRr[)ABCD)r5r=r7r:Z erase_screenZ erase_lineZset_cursor_positionZ cursor_adjust) rrPrQZparamZ func_argsfuncrrnxyrrrrBs$    *zAnsiToWin32.call_win32cCsr|j|D]`}|\}}|d|||d}|\}}|dkr |d}|ddkr t|dq |S)NrYrZ02r) ANSI_OSC_RErErFrIr]r:Z set_title)rrrKrLrMrOrPrQrrrrCs    zAnsiToWin32.convert_osc)NNF)r*r+r,r-recompilerDrirr9r4rr<r>rGrHrNrBrCrrrrr/@s   ! , r/)rjr"r ansirrrrr:rrr Zwin32r r objectr r/rrrrs0PKd] [px x .colorama/__pycache__/ansi.cpython-38.opt-1.pycnu[U .e @sdZdZdZdZddZddZdd d Zdd d ZGd ddeZ GdddeZ Gddde Z Gddde Z Gddde Z e Ze Ze Ze ZdS)z This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code z]cCstt|dS)NmCSIstr)coder=/usr/lib/python3.8/site-packages/pip/_vendor/colorama/ansi.py code_to_chars sr cCstd|tS)Nz2;)OSCBEL)titlerrr set_titlesr cCstt|dS)NJrmoderrr clear_screensrcCstt|dS)NKrrrrr clear_linesrc@seZdZddZdS) AnsiCodescCs6t|D](}|dst||}t||t|qdS)N_)dir startswithgetattrsetattrr )selfnamevaluerrr__init__s   zAnsiCodes.__init__N)__name__ __module__ __qualname__rrrrrrsrc@s>eZdZd ddZdddZdddZddd Zdd d Zd S) AnsiCursorcCstt|dS)NArrnrrrUP%sz AnsiCursor.UPcCstt|dS)NBrr%rrrDOWN'szAnsiCursor.DOWNcCstt|dS)NCrr%rrrFORWARD)szAnsiCursor.FORWARDcCstt|dS)NDrr%rrrBACK+szAnsiCursor.BACKcCstt|dt|dS)N;Hr)rxyrrrPOS-szAnsiCursor.POSN)r#)r#)r#)r#)r#r#)rr r!r'r)r+r-r2rrrrr"$s     r"c@sPeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdS)AnsiFore !"#$%'Z[\]^_`aNrr r!ZBLACKZREDZGREENZYELLOWZBLUEZMAGENTAZCYANZWHITEZRESETZ LIGHTBLACK_EXZ LIGHTRED_EXZ LIGHTGREEN_EXZLIGHTYELLOW_EXZ LIGHTBLUE_EXZLIGHTMAGENTA_EXZ LIGHTCYAN_EXZ LIGHTWHITE_EXrrrrr31s"r3c@sPeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdS)AnsiBack()*+,-./1defghijkNrErrrrrFGs"rFc@seZdZdZdZdZdZdS) AnsiStyler#rN)rr r!ZBRIGHTZDIMZNORMALZ RESET_ALLrrrrrX]srXN)r)r)__doc__rr r r r rrobjectrr"r3rFrXZForeZBackZStyleZCursorrrrrs     PKd])4colorama/__pycache__/initialise.cpython-38.opt-1.pycnu[U .e{@stddlZddlZddlZddlmZdadadadada ddZ ddd Z d d Z ej d d ZddZddZdS)N) AnsiToWin32FcCstdk rttdSN)r orig_stdout reset_allrrC/usr/lib/python3.8/site-packages/pip/_vendor/colorama/initialise.pyrsrTcCs|st|||grtdtjatjatjdkr6dantt||||t_atjdkr\da ntt||||t_a t st t da dS)Nz,wrap=False conflicts with any other arg=TrueT)any ValueErrorsysstdoutrstderr orig_stderrwrapped_stdout wrap_streamwrapped_stderr atexit_doneatexitregisterr) autoresetconvertstripwraprrrinits   rcCs tdk rtt_tdk rtt_dSr)rr r rr rrrrdeinit3srcos"t||z dVW5tXdSr)rr)argskwargsrrr colorama_text:s  rcCs tdk rtt_tdk rtt_dSr)rr r rr rrrrreinitCsrcCs&|r"t||||d}|r"|j}|S)N)rrr)rZ should_wrapstream)rrrrrwrapperrrrrJsr)FNNT)r contextlibr Z ansitowin32rrrrrrrrrcontextmanagerrrrrrrrs   PKd]wG%hh/colorama/__pycache__/win32.cpython-38.opt-1.pycnu[U .e @sdZdZz.ddlZddlmZeejZddlmZWn.eefk rddZddZ ddZ YnZXdd lm Z m Z m Z mZejZGd d d e ZejjZejge_eje_ejjZejeege_eje_ejj Zejejge_eje_ejjZejege_eje_ejj Z!eje ejeeejge!_eje!_ejj"Z#ejejejeeejge#_eje#_ejj$Z%ej&ge%_eje%_d d Z'ddZ efddZddZ dddZddZ(ddZ"ddZ)dS)iiN) LibraryLoader)wintypescGsdSN_rr>/usr/lib/python3.8/site-packages/pip/_vendor/colorama/win32.pyr cGsdSrrrrrrr r )byref Structurec_charPOINTERc@s>eZdZdZdefdefdejfdejfdefgZddZ d S) CONSOLE_SCREEN_BUFFER_INFOzstruct in wincon.h.dwSizedwCursorPosition wAttributessrWindowdwMaximumWindowSizec CsHd|jj|jj|jj|jj|j|jj|jj|jj|jj |j j|j jf S)Nz"(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)) rYXrrrTopLeftZBottomZRightr)selfrrr__str__sz"CONSOLE_SCREEN_BUFFER_INFO.__str__N) __name__ __module__ __qualname____doc__COORDrWORDZ SMALL_RECTZ_fields_rrrrrrsrcCst}t|t|}t|Sr)r_GetConsoleScreenBufferInfor bool)handlecsbisuccessrrr _winapi_test\s r&cCstddttttfDS)Ncss|]}t|VqdSr)r&).0hrrr cszwinapi_test..)any _GetStdHandleSTDOUTSTDERRrrrr winapi_testbsr.cCs t|}t}t|t|}|Sr)r+rr!r ) stream_idr#r$r%rrrGetConsoleScreenBufferInfofsr0cCst|}t||Sr)r+_SetConsoleTextAttribute)r/Zattrsr#rrrSetConsoleTextAttributemsr2TcCsvt|}|jdks|jdkr dSt|jd|jd}|rdttj}|j|j7_|j|j7_t|}t ||S)Nr) rrrr0r,rrrr+_SetConsoleCursorPosition)r/ZpositionZadjustZadjusted_positionsrr#rrrSetConsoleCursorPositionqs r6cCsBt|}t|}t|}td}t||||t|}|jS)Nr)r+r encoderDWORD_FillConsoleOutputCharacterAr value)r/charlengthstartr# num_writtenr%rrrFillConsoleOutputCharacters   r?cCs:t|}t|}t|}td}t||||t|S)za FillConsoleOutputAttribute( hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten )r)r+rr r8_FillConsoleOutputAttributer )r/attrr<r=r#Z attributer>rrrFillConsoleOutputAttributes   rBcCst|Sr)_SetConsoleTitleW)titlerrrSetConsoleTitlesrE)T)*r,r-ZctypesrZWinDLLZwindllrAttributeError ImportErrorr2r.r r r rZ_COORDrrZkernel32Z GetStdHandler+r8ZargtypesZHANDLEZrestyper0r!ZBOOLr1r r6r4ZFillConsoleOutputCharacterAr9rBr@ZSetConsoleTitleWrCZLPCWSTRr&r?rErrrrsx      PKd]3G2colorama/__pycache__/__init__.cpython-38.opt-1.pycnu[U .e@sDddlmZmZmZmZddlmZmZmZm Z ddl m Z dZ dS))initdeinitreinit colorama_text)ForeBackStyleCursor) AnsiToWin32z0.4.1N) Z initialiserrrransirrrr Z ansitowin32r __version__r r A/usr/lib/python3.8/site-packages/pip/_vendor/colorama/__init__.pys PKd]oEr{{colorama/initialise.pynu[# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import atexit import contextlib import sys from .ansitowin32 import AnsiToWin32 orig_stdout = None orig_stderr = None wrapped_stdout = None wrapped_stderr = None atexit_done = False def reset_all(): if AnsiToWin32 is not None: # Issue #74: objects might become None at exit AnsiToWin32(orig_stdout).reset_all() def init(autoreset=False, convert=None, strip=None, wrap=True): if not wrap and any([autoreset, convert, strip]): raise ValueError('wrap=False conflicts with any other arg=True') global wrapped_stdout, wrapped_stderr global orig_stdout, orig_stderr orig_stdout = sys.stdout orig_stderr = sys.stderr if sys.stdout is None: wrapped_stdout = None else: sys.stdout = wrapped_stdout = \ wrap_stream(orig_stdout, convert, strip, autoreset, wrap) if sys.stderr is None: wrapped_stderr = None else: sys.stderr = wrapped_stderr = \ wrap_stream(orig_stderr, convert, strip, autoreset, wrap) global atexit_done if not atexit_done: atexit.register(reset_all) atexit_done = True def deinit(): if orig_stdout is not None: sys.stdout = orig_stdout if orig_stderr is not None: sys.stderr = orig_stderr @contextlib.contextmanager def colorama_text(*args, **kwargs): init(*args, **kwargs) try: yield finally: deinit() def reinit(): if wrapped_stdout is not None: sys.stdout = wrapped_stdout if wrapped_stderr is not None: sys.stderr = wrapped_stderr def wrap_stream(stream, convert, strip, autoreset, wrap): if wrap: wrapper = AnsiToWin32(stream, convert=convert, strip=strip, autoreset=autoreset) if wrapper.should_wrap(): stream = wrapper.stream return stream PKd](&&colorama/winterm.pynu[# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. from . import win32 # from wincon.h class WinColor(object): BLACK = 0 BLUE = 1 GREEN = 2 CYAN = 3 RED = 4 MAGENTA = 5 YELLOW = 6 GREY = 7 # from wincon.h class WinStyle(object): NORMAL = 0x00 # dim text, dim background BRIGHT = 0x08 # bright text, dim background BRIGHT_BACKGROUND = 0x80 # dim text, bright background class WinTerm(object): def __init__(self): self._default = win32.GetConsoleScreenBufferInfo(win32.STDOUT).wAttributes self.set_attrs(self._default) self._default_fore = self._fore self._default_back = self._back self._default_style = self._style # In order to emulate LIGHT_EX in windows, we borrow the BRIGHT style. # So that LIGHT_EX colors and BRIGHT style do not clobber each other, # we track them separately, since LIGHT_EX is overwritten by Fore/Back # and BRIGHT is overwritten by Style codes. self._light = 0 def get_attrs(self): return self._fore + self._back * 16 + (self._style | self._light) def set_attrs(self, value): self._fore = value & 7 self._back = (value >> 4) & 7 self._style = value & (WinStyle.BRIGHT | WinStyle.BRIGHT_BACKGROUND) def reset_all(self, on_stderr=None): self.set_attrs(self._default) self.set_console(attrs=self._default) self._light = 0 def fore(self, fore=None, light=False, on_stderr=False): if fore is None: fore = self._default_fore self._fore = fore # Emulate LIGHT_EX with BRIGHT Style if light: self._light |= WinStyle.BRIGHT else: self._light &= ~WinStyle.BRIGHT self.set_console(on_stderr=on_stderr) def back(self, back=None, light=False, on_stderr=False): if back is None: back = self._default_back self._back = back # Emulate LIGHT_EX with BRIGHT_BACKGROUND Style if light: self._light |= WinStyle.BRIGHT_BACKGROUND else: self._light &= ~WinStyle.BRIGHT_BACKGROUND self.set_console(on_stderr=on_stderr) def style(self, style=None, on_stderr=False): if style is None: style = self._default_style self._style = style self.set_console(on_stderr=on_stderr) def set_console(self, attrs=None, on_stderr=False): if attrs is None: attrs = self.get_attrs() handle = win32.STDOUT if on_stderr: handle = win32.STDERR win32.SetConsoleTextAttribute(handle, attrs) def get_position(self, handle): position = win32.GetConsoleScreenBufferInfo(handle).dwCursorPosition # Because Windows coordinates are 0-based, # and win32.SetConsoleCursorPosition expects 1-based. position.X += 1 position.Y += 1 return position def set_cursor_position(self, position=None, on_stderr=False): if position is None: # I'm not currently tracking the position, so there is no default. # position = self.get_position() return handle = win32.STDOUT if on_stderr: handle = win32.STDERR win32.SetConsoleCursorPosition(handle, position) def cursor_adjust(self, x, y, on_stderr=False): handle = win32.STDOUT if on_stderr: handle = win32.STDERR position = self.get_position(handle) adjusted_position = (position.Y + y, position.X + x) win32.SetConsoleCursorPosition(handle, adjusted_position, adjust=False) def erase_screen(self, mode=0, on_stderr=False): # 0 should clear from the cursor to the end of the screen. # 1 should clear from the cursor to the beginning of the screen. # 2 should clear the entire screen, and move cursor to (1,1) handle = win32.STDOUT if on_stderr: handle = win32.STDERR csbi = win32.GetConsoleScreenBufferInfo(handle) # get the number of character cells in the current buffer cells_in_screen = csbi.dwSize.X * csbi.dwSize.Y # get number of character cells before current cursor position cells_before_cursor = csbi.dwSize.X * csbi.dwCursorPosition.Y + csbi.dwCursorPosition.X if mode == 0: from_coord = csbi.dwCursorPosition cells_to_erase = cells_in_screen - cells_before_cursor elif mode == 1: from_coord = win32.COORD(0, 0) cells_to_erase = cells_before_cursor elif mode == 2: from_coord = win32.COORD(0, 0) cells_to_erase = cells_in_screen else: # invalid mode return # fill the entire screen with blanks win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord) # now set the buffer's attributes accordingly win32.FillConsoleOutputAttribute(handle, self.get_attrs(), cells_to_erase, from_coord) if mode == 2: # put the cursor where needed win32.SetConsoleCursorPosition(handle, (1, 1)) def erase_line(self, mode=0, on_stderr=False): # 0 should clear from the cursor to the end of the line. # 1 should clear from the cursor to the beginning of the line. # 2 should clear the entire line. handle = win32.STDOUT if on_stderr: handle = win32.STDERR csbi = win32.GetConsoleScreenBufferInfo(handle) if mode == 0: from_coord = csbi.dwCursorPosition cells_to_erase = csbi.dwSize.X - csbi.dwCursorPosition.X elif mode == 1: from_coord = win32.COORD(0, csbi.dwCursorPosition.Y) cells_to_erase = csbi.dwCursorPosition.X elif mode == 2: from_coord = win32.COORD(0, csbi.dwCursorPosition.Y) cells_to_erase = csbi.dwSize.X else: # invalid mode return # fill the entire screen with blanks win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord) # now set the buffer's attributes accordingly win32.FillConsoleOutputAttribute(handle, self.get_attrs(), cells_to_erase, from_coord) def set_title(self, title): win32.SetConsoleTitle(title) PKd]>_ colorama/ansi.pynu[# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. ''' This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code ''' CSI = '\033[' OSC = '\033]' BEL = '\007' def code_to_chars(code): return CSI + str(code) + 'm' def set_title(title): return OSC + '2;' + title + BEL def clear_screen(mode=2): return CSI + str(mode) + 'J' def clear_line(mode=2): return CSI + str(mode) + 'K' class AnsiCodes(object): def __init__(self): # the subclasses declare class attributes which are numbers. # Upon instantiation we define instance attributes, which are the same # as the class attributes but wrapped with the ANSI escape sequence for name in dir(self): if not name.startswith('_'): value = getattr(self, name) setattr(self, name, code_to_chars(value)) class AnsiCursor(object): def UP(self, n=1): return CSI + str(n) + 'A' def DOWN(self, n=1): return CSI + str(n) + 'B' def FORWARD(self, n=1): return CSI + str(n) + 'C' def BACK(self, n=1): return CSI + str(n) + 'D' def POS(self, x=1, y=1): return CSI + str(y) + ';' + str(x) + 'H' class AnsiFore(AnsiCodes): BLACK = 30 RED = 31 GREEN = 32 YELLOW = 33 BLUE = 34 MAGENTA = 35 CYAN = 36 WHITE = 37 RESET = 39 # These are fairly well supported, but not part of the standard. LIGHTBLACK_EX = 90 LIGHTRED_EX = 91 LIGHTGREEN_EX = 92 LIGHTYELLOW_EX = 93 LIGHTBLUE_EX = 94 LIGHTMAGENTA_EX = 95 LIGHTCYAN_EX = 96 LIGHTWHITE_EX = 97 class AnsiBack(AnsiCodes): BLACK = 40 RED = 41 GREEN = 42 YELLOW = 43 BLUE = 44 MAGENTA = 45 CYAN = 46 WHITE = 47 RESET = 49 # These are fairly well supported, but not part of the standard. LIGHTBLACK_EX = 100 LIGHTRED_EX = 101 LIGHTGREEN_EX = 102 LIGHTYELLOW_EX = 103 LIGHTBLUE_EX = 104 LIGHTMAGENTA_EX = 105 LIGHTCYAN_EX = 106 LIGHTWHITE_EX = 107 class AnsiStyle(AnsiCodes): BRIGHT = 1 DIM = 2 NORMAL = 22 RESET_ALL = 0 Fore = AnsiFore() Back = AnsiBack() Style = AnsiStyle() Cursor = AnsiCursor() PKd]#ls((colorama/ansitowin32.pynu[# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import re import sys import os from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style from .winterm import WinTerm, WinColor, WinStyle from .win32 import windll, winapi_test winterm = None if windll is not None: winterm = WinTerm() class StreamWrapper(object): ''' Wraps a stream (such as stdout), acting as a transparent proxy for all attribute access apart from method 'write()', which is delegated to our Converter instance. ''' def __init__(self, wrapped, converter): # double-underscore everything to prevent clashes with names of # attributes on the wrapped stream object. self.__wrapped = wrapped self.__convertor = converter def __getattr__(self, name): return getattr(self.__wrapped, name) def __enter__(self, *args, **kwargs): # special method lookup bypasses __getattr__/__getattribute__, see # https://stackoverflow.com/questions/12632894/why-doesnt-getattr-work-with-exit # thus, contextlib magic methods are not proxied via __getattr__ return self.__wrapped.__enter__(*args, **kwargs) def __exit__(self, *args, **kwargs): return self.__wrapped.__exit__(*args, **kwargs) def write(self, text): self.__convertor.write(text) def isatty(self): stream = self.__wrapped if 'PYCHARM_HOSTED' in os.environ: if stream is not None and (stream is sys.__stdout__ or stream is sys.__stderr__): return True try: stream_isatty = stream.isatty except AttributeError: return False else: return stream_isatty() @property def closed(self): stream = self.__wrapped try: return stream.closed except AttributeError: return True class AnsiToWin32(object): ''' Implements a 'write()' method which, on Windows, will strip ANSI character sequences from the text, and if outputting to a tty, will convert them into win32 function calls. ''' ANSI_CSI_RE = re.compile('\001?\033\\[((?:\\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer ANSI_OSC_RE = re.compile('\001?\033\\]((?:.|;)*?)(\x07)\002?') # Operating System Command def __init__(self, wrapped, convert=None, strip=None, autoreset=False): # The wrapped stream (normally sys.stdout or sys.stderr) self.wrapped = wrapped # should we reset colors to defaults after every .write() self.autoreset = autoreset # create the proxy wrapping our output stream self.stream = StreamWrapper(wrapped, self) on_windows = os.name == 'nt' # We test if the WinAPI works, because even if we are on Windows # we may be using a terminal that doesn't support the WinAPI # (e.g. Cygwin Terminal). In this case it's up to the terminal # to support the ANSI codes. conversion_supported = on_windows and winapi_test() # should we strip ANSI sequences from our output? if strip is None: strip = conversion_supported or (not self.stream.closed and not self.stream.isatty()) self.strip = strip # should we should convert ANSI sequences into win32 calls? if convert is None: convert = conversion_supported and not self.stream.closed and self.stream.isatty() self.convert = convert # dict of ansi codes to win32 functions and parameters self.win32_calls = self.get_win32_calls() # are we wrapping stderr? self.on_stderr = self.wrapped is sys.stderr def should_wrap(self): ''' True if this class is actually needed. If false, then the output stream will not be affected, nor will win32 calls be issued, so wrapping stdout is not actually required. This will generally be False on non-Windows platforms, unless optional functionality like autoreset has been requested using kwargs to init() ''' return self.convert or self.strip or self.autoreset def get_win32_calls(self): if self.convert and winterm: return { AnsiStyle.RESET_ALL: (winterm.reset_all, ), AnsiStyle.BRIGHT: (winterm.style, WinStyle.BRIGHT), AnsiStyle.DIM: (winterm.style, WinStyle.NORMAL), AnsiStyle.NORMAL: (winterm.style, WinStyle.NORMAL), AnsiFore.BLACK: (winterm.fore, WinColor.BLACK), AnsiFore.RED: (winterm.fore, WinColor.RED), AnsiFore.GREEN: (winterm.fore, WinColor.GREEN), AnsiFore.YELLOW: (winterm.fore, WinColor.YELLOW), AnsiFore.BLUE: (winterm.fore, WinColor.BLUE), AnsiFore.MAGENTA: (winterm.fore, WinColor.MAGENTA), AnsiFore.CYAN: (winterm.fore, WinColor.CYAN), AnsiFore.WHITE: (winterm.fore, WinColor.GREY), AnsiFore.RESET: (winterm.fore, ), AnsiFore.LIGHTBLACK_EX: (winterm.fore, WinColor.BLACK, True), AnsiFore.LIGHTRED_EX: (winterm.fore, WinColor.RED, True), AnsiFore.LIGHTGREEN_EX: (winterm.fore, WinColor.GREEN, True), AnsiFore.LIGHTYELLOW_EX: (winterm.fore, WinColor.YELLOW, True), AnsiFore.LIGHTBLUE_EX: (winterm.fore, WinColor.BLUE, True), AnsiFore.LIGHTMAGENTA_EX: (winterm.fore, WinColor.MAGENTA, True), AnsiFore.LIGHTCYAN_EX: (winterm.fore, WinColor.CYAN, True), AnsiFore.LIGHTWHITE_EX: (winterm.fore, WinColor.GREY, True), AnsiBack.BLACK: (winterm.back, WinColor.BLACK), AnsiBack.RED: (winterm.back, WinColor.RED), AnsiBack.GREEN: (winterm.back, WinColor.GREEN), AnsiBack.YELLOW: (winterm.back, WinColor.YELLOW), AnsiBack.BLUE: (winterm.back, WinColor.BLUE), AnsiBack.MAGENTA: (winterm.back, WinColor.MAGENTA), AnsiBack.CYAN: (winterm.back, WinColor.CYAN), AnsiBack.WHITE: (winterm.back, WinColor.GREY), AnsiBack.RESET: (winterm.back, ), AnsiBack.LIGHTBLACK_EX: (winterm.back, WinColor.BLACK, True), AnsiBack.LIGHTRED_EX: (winterm.back, WinColor.RED, True), AnsiBack.LIGHTGREEN_EX: (winterm.back, WinColor.GREEN, True), AnsiBack.LIGHTYELLOW_EX: (winterm.back, WinColor.YELLOW, True), AnsiBack.LIGHTBLUE_EX: (winterm.back, WinColor.BLUE, True), AnsiBack.LIGHTMAGENTA_EX: (winterm.back, WinColor.MAGENTA, True), AnsiBack.LIGHTCYAN_EX: (winterm.back, WinColor.CYAN, True), AnsiBack.LIGHTWHITE_EX: (winterm.back, WinColor.GREY, True), } return dict() def write(self, text): if self.strip or self.convert: self.write_and_convert(text) else: self.wrapped.write(text) self.wrapped.flush() if self.autoreset: self.reset_all() def reset_all(self): if self.convert: self.call_win32('m', (0,)) elif not self.strip and not self.stream.closed: self.wrapped.write(Style.RESET_ALL) def write_and_convert(self, text): ''' Write the given text to our wrapped stream, stripping any ANSI sequences from the text, and optionally converting them into win32 calls. ''' cursor = 0 text = self.convert_osc(text) for match in self.ANSI_CSI_RE.finditer(text): start, end = match.span() self.write_plain_text(text, cursor, start) self.convert_ansi(*match.groups()) cursor = end self.write_plain_text(text, cursor, len(text)) def write_plain_text(self, text, start, end): if start < end: self.wrapped.write(text[start:end]) self.wrapped.flush() def convert_ansi(self, paramstring, command): if self.convert: params = self.extract_params(command, paramstring) self.call_win32(command, params) def extract_params(self, command, paramstring): if command in 'Hf': params = tuple(int(p) if len(p) != 0 else 1 for p in paramstring.split(';')) while len(params) < 2: # defaults: params = params + (1,) else: params = tuple(int(p) for p in paramstring.split(';') if len(p) != 0) if len(params) == 0: # defaults: if command in 'JKm': params = (0,) elif command in 'ABCD': params = (1,) return params def call_win32(self, command, params): if command == 'm': for param in params: if param in self.win32_calls: func_args = self.win32_calls[param] func = func_args[0] args = func_args[1:] kwargs = dict(on_stderr=self.on_stderr) func(*args, **kwargs) elif command in 'J': winterm.erase_screen(params[0], on_stderr=self.on_stderr) elif command in 'K': winterm.erase_line(params[0], on_stderr=self.on_stderr) elif command in 'Hf': # cursor position - absolute winterm.set_cursor_position(params, on_stderr=self.on_stderr) elif command in 'ABCD': # cursor position - relative n = params[0] # A - up, B - down, C - forward, D - back x, y = {'A': (0, -n), 'B': (0, n), 'C': (n, 0), 'D': (-n, 0)}[command] winterm.cursor_adjust(x, y, on_stderr=self.on_stderr) def convert_osc(self, text): for match in self.ANSI_OSC_RE.finditer(text): start, end = match.span() text = text[:start] + text[end:] paramstring, command = match.groups() if command in '\x07': # \x07 = BEL params = paramstring.split(";") # 0 - change title and icon (we will only change title) # 1 - change icon (we don't support this) # 2 - change title if params[0] in '02': winterm.set_title(params[1]) return text PKd] colorama/win32.pynu[# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. # from winbase.h STDOUT = -11 STDERR = -12 try: import ctypes from ctypes import LibraryLoader windll = LibraryLoader(ctypes.WinDLL) from ctypes import wintypes except (AttributeError, ImportError): windll = None SetConsoleTextAttribute = lambda *_: None winapi_test = lambda *_: None else: from ctypes import byref, Structure, c_char, POINTER COORD = wintypes._COORD class CONSOLE_SCREEN_BUFFER_INFO(Structure): """struct in wincon.h.""" _fields_ = [ ("dwSize", COORD), ("dwCursorPosition", COORD), ("wAttributes", wintypes.WORD), ("srWindow", wintypes.SMALL_RECT), ("dwMaximumWindowSize", COORD), ] def __str__(self): return '(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)' % ( self.dwSize.Y, self.dwSize.X , self.dwCursorPosition.Y, self.dwCursorPosition.X , self.wAttributes , self.srWindow.Top, self.srWindow.Left, self.srWindow.Bottom, self.srWindow.Right , self.dwMaximumWindowSize.Y, self.dwMaximumWindowSize.X ) _GetStdHandle = windll.kernel32.GetStdHandle _GetStdHandle.argtypes = [ wintypes.DWORD, ] _GetStdHandle.restype = wintypes.HANDLE _GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo _GetConsoleScreenBufferInfo.argtypes = [ wintypes.HANDLE, POINTER(CONSOLE_SCREEN_BUFFER_INFO), ] _GetConsoleScreenBufferInfo.restype = wintypes.BOOL _SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute _SetConsoleTextAttribute.argtypes = [ wintypes.HANDLE, wintypes.WORD, ] _SetConsoleTextAttribute.restype = wintypes.BOOL _SetConsoleCursorPosition = windll.kernel32.SetConsoleCursorPosition _SetConsoleCursorPosition.argtypes = [ wintypes.HANDLE, COORD, ] _SetConsoleCursorPosition.restype = wintypes.BOOL _FillConsoleOutputCharacterA = windll.kernel32.FillConsoleOutputCharacterA _FillConsoleOutputCharacterA.argtypes = [ wintypes.HANDLE, c_char, wintypes.DWORD, COORD, POINTER(wintypes.DWORD), ] _FillConsoleOutputCharacterA.restype = wintypes.BOOL _FillConsoleOutputAttribute = windll.kernel32.FillConsoleOutputAttribute _FillConsoleOutputAttribute.argtypes = [ wintypes.HANDLE, wintypes.WORD, wintypes.DWORD, COORD, POINTER(wintypes.DWORD), ] _FillConsoleOutputAttribute.restype = wintypes.BOOL _SetConsoleTitleW = windll.kernel32.SetConsoleTitleW _SetConsoleTitleW.argtypes = [ wintypes.LPCWSTR ] _SetConsoleTitleW.restype = wintypes.BOOL def _winapi_test(handle): csbi = CONSOLE_SCREEN_BUFFER_INFO() success = _GetConsoleScreenBufferInfo( handle, byref(csbi)) return bool(success) def winapi_test(): return any(_winapi_test(h) for h in (_GetStdHandle(STDOUT), _GetStdHandle(STDERR))) def GetConsoleScreenBufferInfo(stream_id=STDOUT): handle = _GetStdHandle(stream_id) csbi = CONSOLE_SCREEN_BUFFER_INFO() success = _GetConsoleScreenBufferInfo( handle, byref(csbi)) return csbi def SetConsoleTextAttribute(stream_id, attrs): handle = _GetStdHandle(stream_id) return _SetConsoleTextAttribute(handle, attrs) def SetConsoleCursorPosition(stream_id, position, adjust=True): position = COORD(*position) # If the position is out of range, do nothing. if position.Y <= 0 or position.X <= 0: return # Adjust for Windows' SetConsoleCursorPosition: # 1. being 0-based, while ANSI is 1-based. # 2. expecting (x,y), while ANSI uses (y,x). adjusted_position = COORD(position.Y - 1, position.X - 1) if adjust: # Adjust for viewport's scroll position sr = GetConsoleScreenBufferInfo(STDOUT).srWindow adjusted_position.Y += sr.Top adjusted_position.X += sr.Left # Resume normal processing handle = _GetStdHandle(stream_id) return _SetConsoleCursorPosition(handle, adjusted_position) def FillConsoleOutputCharacter(stream_id, char, length, start): handle = _GetStdHandle(stream_id) char = c_char(char.encode()) length = wintypes.DWORD(length) num_written = wintypes.DWORD(0) # Note that this is hard-coded for ANSI (vs wide) bytes. success = _FillConsoleOutputCharacterA( handle, char, length, start, byref(num_written)) return num_written.value def FillConsoleOutputAttribute(stream_id, attr, length, start): ''' FillConsoleOutputAttribute( hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten )''' handle = _GetStdHandle(stream_id) attribute = wintypes.WORD(attr) length = wintypes.DWORD(length) num_written = wintypes.DWORD(0) # Note that this is hard-coded for ANSI (vs wide) bytes. return _FillConsoleOutputAttribute( handle, attribute, length, start, byref(num_written)) def SetConsoleTitle(title): return _SetConsoleTitleW(title) PKd]$colorama/__init__.pynu[# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. from .initialise import init, deinit, reinit, colorama_text from .ansi import Fore, Back, Style, Cursor from .ansitowin32 import AnsiToWin32 __version__ = '0.4.3' PKd]^-a88 ipaddress.pynu[# Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """A fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. """ from __future__ import unicode_literals import itertools import struct __version__ = '1.0.23' # Compatibility functions _compat_int_types = (int,) try: _compat_int_types = (int, long) except NameError: pass try: _compat_str = unicode except NameError: _compat_str = str assert bytes != str if b'\0'[0] == 0: # Python 3 semantics def _compat_bytes_to_byte_vals(byt): return byt else: def _compat_bytes_to_byte_vals(byt): return [struct.unpack(b'!B', b)[0] for b in byt] try: _compat_int_from_byte_vals = int.from_bytes except AttributeError: def _compat_int_from_byte_vals(bytvals, endianess): assert endianess == 'big' res = 0 for bv in bytvals: assert isinstance(bv, _compat_int_types) res = (res << 8) + bv return res def _compat_to_bytes(intval, length, endianess): assert isinstance(intval, _compat_int_types) assert endianess == 'big' if length == 4: if intval < 0 or intval >= 2 ** 32: raise struct.error("integer out of range for 'I' format code") return struct.pack(b'!I', intval) elif length == 16: if intval < 0 or intval >= 2 ** 128: raise struct.error("integer out of range for 'QQ' format code") return struct.pack(b'!QQ', intval >> 64, intval & 0xffffffffffffffff) else: raise NotImplementedError() if hasattr(int, 'bit_length'): # Not int.bit_length , since that won't work in 2.7 where long exists def _compat_bit_length(i): return i.bit_length() else: def _compat_bit_length(i): for res in itertools.count(): if i >> res == 0: return res def _compat_range(start, end, step=1): assert step > 0 i = start while i < end: yield i i += step class _TotalOrderingMixin(object): __slots__ = () # Helper that derives the other comparison operations from # __lt__ and __eq__ # We avoid functools.total_ordering because it doesn't handle # NotImplemented correctly yet (http://bugs.python.org/issue10042) def __eq__(self, other): raise NotImplementedError def __ne__(self, other): equal = self.__eq__(other) if equal is NotImplemented: return NotImplemented return not equal def __lt__(self, other): raise NotImplementedError def __le__(self, other): less = self.__lt__(other) if less is NotImplemented or not less: return self.__eq__(other) return less def __gt__(self, other): less = self.__lt__(other) if less is NotImplemented: return NotImplemented equal = self.__eq__(other) if equal is NotImplemented: return NotImplemented return not (less or equal) def __ge__(self, other): less = self.__lt__(other) if less is NotImplemented: return NotImplemented return not less IPV4LENGTH = 32 IPV6LENGTH = 128 class AddressValueError(ValueError): """A Value Error related to the address.""" class NetmaskValueError(ValueError): """A Value Error related to the netmask.""" def ip_address(address): """Take an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP address. Either IPv4 or IPv6 addresses may be supplied; integers less than 2**32 will be considered to be IPv4 by default. Returns: An IPv4Address or IPv6Address object. Raises: ValueError: if the *address* passed isn't either a v4 or a v6 address """ try: return IPv4Address(address) except (AddressValueError, NetmaskValueError): pass try: return IPv6Address(address) except (AddressValueError, NetmaskValueError): pass if isinstance(address, bytes): raise AddressValueError( '%r does not appear to be an IPv4 or IPv6 address. ' 'Did you pass in a bytes (str in Python 2) instead of' ' a unicode object?' % address) raise ValueError('%r does not appear to be an IPv4 or IPv6 address' % address) def ip_network(address, strict=True): """Take an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP network. Either IPv4 or IPv6 networks may be supplied; integers less than 2**32 will be considered to be IPv4 by default. Returns: An IPv4Network or IPv6Network object. Raises: ValueError: if the string passed isn't either a v4 or a v6 address. Or if the network has host bits set. """ try: return IPv4Network(address, strict) except (AddressValueError, NetmaskValueError): pass try: return IPv6Network(address, strict) except (AddressValueError, NetmaskValueError): pass if isinstance(address, bytes): raise AddressValueError( '%r does not appear to be an IPv4 or IPv6 network. ' 'Did you pass in a bytes (str in Python 2) instead of' ' a unicode object?' % address) raise ValueError('%r does not appear to be an IPv4 or IPv6 network' % address) def ip_interface(address): """Take an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP address. Either IPv4 or IPv6 addresses may be supplied; integers less than 2**32 will be considered to be IPv4 by default. Returns: An IPv4Interface or IPv6Interface object. Raises: ValueError: if the string passed isn't either a v4 or a v6 address. Notes: The IPv?Interface classes describe an Address on a particular Network, so they're basically a combination of both the Address and Network classes. """ try: return IPv4Interface(address) except (AddressValueError, NetmaskValueError): pass try: return IPv6Interface(address) except (AddressValueError, NetmaskValueError): pass raise ValueError('%r does not appear to be an IPv4 or IPv6 interface' % address) def v4_int_to_packed(address): """Represent an address as 4 packed bytes in network (big-endian) order. Args: address: An integer representation of an IPv4 IP address. Returns: The integer address packed as 4 bytes in network (big-endian) order. Raises: ValueError: If the integer is negative or too large to be an IPv4 IP address. """ try: return _compat_to_bytes(address, 4, 'big') except (struct.error, OverflowError): raise ValueError("Address negative or too large for IPv4") def v6_int_to_packed(address): """Represent an address as 16 packed bytes in network (big-endian) order. Args: address: An integer representation of an IPv6 IP address. Returns: The integer address packed as 16 bytes in network (big-endian) order. """ try: return _compat_to_bytes(address, 16, 'big') except (struct.error, OverflowError): raise ValueError("Address negative or too large for IPv6") def _split_optional_netmask(address): """Helper to split the netmask and raise AddressValueError if needed""" addr = _compat_str(address).split('/') if len(addr) > 2: raise AddressValueError("Only one '/' permitted in %r" % address) return addr def _find_address_range(addresses): """Find a sequence of sorted deduplicated IPv#Address. Args: addresses: a list of IPv#Address objects. Yields: A tuple containing the first and last IP addresses in the sequence. """ it = iter(addresses) first = last = next(it) for ip in it: if ip._ip != last._ip + 1: yield first, last first = ip last = ip yield first, last def _count_righthand_zero_bits(number, bits): """Count the number of zero bits on the right hand side. Args: number: an integer. bits: maximum number of bits to count. Returns: The number of zero bits on the right hand side of the number. """ if number == 0: return bits return min(bits, _compat_bit_length(~number & (number - 1))) def summarize_address_range(first, last): """Summarize a network range given the first and last IP addresses. Example: >>> list(summarize_address_range(IPv4Address('192.0.2.0'), ... IPv4Address('192.0.2.130'))) ... #doctest: +NORMALIZE_WHITESPACE [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'), IPv4Network('192.0.2.130/32')] Args: first: the first IPv4Address or IPv6Address in the range. last: the last IPv4Address or IPv6Address in the range. Returns: An iterator of the summarized IPv(4|6) network objects. Raise: TypeError: If the first and last objects are not IP addresses. If the first and last objects are not the same version. ValueError: If the last object is not greater than the first. If the version of the first address is not 4 or 6. """ if (not (isinstance(first, _BaseAddress) and isinstance(last, _BaseAddress))): raise TypeError('first and last must be IP addresses, not networks') if first.version != last.version: raise TypeError("%s and %s are not of the same version" % ( first, last)) if first > last: raise ValueError('last IP address must be greater than first') if first.version == 4: ip = IPv4Network elif first.version == 6: ip = IPv6Network else: raise ValueError('unknown IP version') ip_bits = first._max_prefixlen first_int = first._ip last_int = last._ip while first_int <= last_int: nbits = min(_count_righthand_zero_bits(first_int, ip_bits), _compat_bit_length(last_int - first_int + 1) - 1) net = ip((first_int, ip_bits - nbits)) yield net first_int += 1 << nbits if first_int - 1 == ip._ALL_ONES: break def _collapse_addresses_internal(addresses): """Loops through the addresses, collapsing concurrent netblocks. Example: ip1 = IPv4Network('192.0.2.0/26') ip2 = IPv4Network('192.0.2.64/26') ip3 = IPv4Network('192.0.2.128/26') ip4 = IPv4Network('192.0.2.192/26') _collapse_addresses_internal([ip1, ip2, ip3, ip4]) -> [IPv4Network('192.0.2.0/24')] This shouldn't be called directly; it is called via collapse_addresses([]). Args: addresses: A list of IPv4Network's or IPv6Network's Returns: A list of IPv4Network's or IPv6Network's depending on what we were passed. """ # First merge to_merge = list(addresses) subnets = {} while to_merge: net = to_merge.pop() supernet = net.supernet() existing = subnets.get(supernet) if existing is None: subnets[supernet] = net elif existing != net: # Merge consecutive subnets del subnets[supernet] to_merge.append(supernet) # Then iterate over resulting networks, skipping subsumed subnets last = None for net in sorted(subnets.values()): if last is not None: # Since they are sorted, # last.network_address <= net.network_address is a given. if last.broadcast_address >= net.broadcast_address: continue yield net last = net def collapse_addresses(addresses): """Collapse a list of IP objects. Example: collapse_addresses([IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/25')]) -> [IPv4Network('192.0.2.0/24')] Args: addresses: An iterator of IPv4Network or IPv6Network objects. Returns: An iterator of the collapsed IPv(4|6)Network objects. Raises: TypeError: If passed a list of mixed version objects. """ addrs = [] ips = [] nets = [] # split IP addresses and networks for ip in addresses: if isinstance(ip, _BaseAddress): if ips and ips[-1]._version != ip._version: raise TypeError("%s and %s are not of the same version" % ( ip, ips[-1])) ips.append(ip) elif ip._prefixlen == ip._max_prefixlen: if ips and ips[-1]._version != ip._version: raise TypeError("%s and %s are not of the same version" % ( ip, ips[-1])) try: ips.append(ip.ip) except AttributeError: ips.append(ip.network_address) else: if nets and nets[-1]._version != ip._version: raise TypeError("%s and %s are not of the same version" % ( ip, nets[-1])) nets.append(ip) # sort and dedup ips = sorted(set(ips)) # find consecutive address ranges in the sorted sequence and summarize them if ips: for first, last in _find_address_range(ips): addrs.extend(summarize_address_range(first, last)) return _collapse_addresses_internal(addrs + nets) def get_mixed_type_key(obj): """Return a key suitable for sorting between networks and addresses. Address and Network objects are not sortable by default; they're fundamentally different so the expression IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24') doesn't make any sense. There are some times however, where you may wish to have ipaddress sort these for you anyway. If you need to do this, you can use this function as the key= argument to sorted(). Args: obj: either a Network or Address object. Returns: appropriate key. """ if isinstance(obj, _BaseNetwork): return obj._get_networks_key() elif isinstance(obj, _BaseAddress): return obj._get_address_key() return NotImplemented class _IPAddressBase(_TotalOrderingMixin): """The mother class.""" __slots__ = () @property def exploded(self): """Return the longhand version of the IP address as a string.""" return self._explode_shorthand_ip_string() @property def compressed(self): """Return the shorthand version of the IP address as a string.""" return _compat_str(self) @property def reverse_pointer(self): """The name of the reverse DNS pointer for the IP address, e.g.: >>> ipaddress.ip_address("127.0.0.1").reverse_pointer '1.0.0.127.in-addr.arpa' >>> ipaddress.ip_address("2001:db8::1").reverse_pointer '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa' """ return self._reverse_pointer() @property def version(self): msg = '%200s has no version specified' % (type(self),) raise NotImplementedError(msg) def _check_int_address(self, address): if address < 0: msg = "%d (< 0) is not permitted as an IPv%d address" raise AddressValueError(msg % (address, self._version)) if address > self._ALL_ONES: msg = "%d (>= 2**%d) is not permitted as an IPv%d address" raise AddressValueError(msg % (address, self._max_prefixlen, self._version)) def _check_packed_address(self, address, expected_len): address_len = len(address) if address_len != expected_len: msg = ( '%r (len %d != %d) is not permitted as an IPv%d address. ' 'Did you pass in a bytes (str in Python 2) instead of' ' a unicode object?') raise AddressValueError(msg % (address, address_len, expected_len, self._version)) @classmethod def _ip_int_from_prefix(cls, prefixlen): """Turn the prefix length into a bitwise netmask Args: prefixlen: An integer, the prefix length. Returns: An integer. """ return cls._ALL_ONES ^ (cls._ALL_ONES >> prefixlen) @classmethod def _prefix_from_ip_int(cls, ip_int): """Return prefix length from the bitwise netmask. Args: ip_int: An integer, the netmask in expanded bitwise format Returns: An integer, the prefix length. Raises: ValueError: If the input intermingles zeroes & ones """ trailing_zeroes = _count_righthand_zero_bits(ip_int, cls._max_prefixlen) prefixlen = cls._max_prefixlen - trailing_zeroes leading_ones = ip_int >> trailing_zeroes all_ones = (1 << prefixlen) - 1 if leading_ones != all_ones: byteslen = cls._max_prefixlen // 8 details = _compat_to_bytes(ip_int, byteslen, 'big') msg = 'Netmask pattern %r mixes zeroes & ones' raise ValueError(msg % details) return prefixlen @classmethod def _report_invalid_netmask(cls, netmask_str): msg = '%r is not a valid netmask' % netmask_str raise NetmaskValueError(msg) @classmethod def _prefix_from_prefix_string(cls, prefixlen_str): """Return prefix length from a numeric string Args: prefixlen_str: The string to be converted Returns: An integer, the prefix length. Raises: NetmaskValueError: If the input is not a valid netmask """ # int allows a leading +/- as well as surrounding whitespace, # so we ensure that isn't the case if not _BaseV4._DECIMAL_DIGITS.issuperset(prefixlen_str): cls._report_invalid_netmask(prefixlen_str) try: prefixlen = int(prefixlen_str) except ValueError: cls._report_invalid_netmask(prefixlen_str) if not (0 <= prefixlen <= cls._max_prefixlen): cls._report_invalid_netmask(prefixlen_str) return prefixlen @classmethod def _prefix_from_ip_string(cls, ip_str): """Turn a netmask/hostmask string into a prefix length Args: ip_str: The netmask/hostmask to be converted Returns: An integer, the prefix length. Raises: NetmaskValueError: If the input is not a valid netmask/hostmask """ # Parse the netmask/hostmask like an IP address. try: ip_int = cls._ip_int_from_string(ip_str) except AddressValueError: cls._report_invalid_netmask(ip_str) # Try matching a netmask (this would be /1*0*/ as a bitwise regexp). # Note that the two ambiguous cases (all-ones and all-zeroes) are # treated as netmasks. try: return cls._prefix_from_ip_int(ip_int) except ValueError: pass # Invert the bits, and try matching a /0+1+/ hostmask instead. ip_int ^= cls._ALL_ONES try: return cls._prefix_from_ip_int(ip_int) except ValueError: cls._report_invalid_netmask(ip_str) def __reduce__(self): return self.__class__, (_compat_str(self),) class _BaseAddress(_IPAddressBase): """A generic IP object. This IP class contains the version independent methods which are used by single IP addresses. """ __slots__ = () def __int__(self): return self._ip def __eq__(self, other): try: return (self._ip == other._ip and self._version == other._version) except AttributeError: return NotImplemented def __lt__(self, other): if not isinstance(other, _IPAddressBase): return NotImplemented if not isinstance(other, _BaseAddress): raise TypeError('%s and %s are not of the same type' % ( self, other)) if self._version != other._version: raise TypeError('%s and %s are not of the same version' % ( self, other)) if self._ip != other._ip: return self._ip < other._ip return False # Shorthand for Integer addition and subtraction. This is not # meant to ever support addition/subtraction of addresses. def __add__(self, other): if not isinstance(other, _compat_int_types): return NotImplemented return self.__class__(int(self) + other) def __sub__(self, other): if not isinstance(other, _compat_int_types): return NotImplemented return self.__class__(int(self) - other) def __repr__(self): return '%s(%r)' % (self.__class__.__name__, _compat_str(self)) def __str__(self): return _compat_str(self._string_from_ip_int(self._ip)) def __hash__(self): return hash(hex(int(self._ip))) def _get_address_key(self): return (self._version, self) def __reduce__(self): return self.__class__, (self._ip,) class _BaseNetwork(_IPAddressBase): """A generic IP network object. This IP class contains the version independent methods which are used by networks. """ def __init__(self, address): self._cache = {} def __repr__(self): return '%s(%r)' % (self.__class__.__name__, _compat_str(self)) def __str__(self): return '%s/%d' % (self.network_address, self.prefixlen) def hosts(self): """Generate Iterator over usable hosts in a network. This is like __iter__ except it doesn't return the network or broadcast addresses. """ network = int(self.network_address) broadcast = int(self.broadcast_address) for x in _compat_range(network + 1, broadcast): yield self._address_class(x) def __iter__(self): network = int(self.network_address) broadcast = int(self.broadcast_address) for x in _compat_range(network, broadcast + 1): yield self._address_class(x) def __getitem__(self, n): network = int(self.network_address) broadcast = int(self.broadcast_address) if n >= 0: if network + n > broadcast: raise IndexError('address out of range') return self._address_class(network + n) else: n += 1 if broadcast + n < network: raise IndexError('address out of range') return self._address_class(broadcast + n) def __lt__(self, other): if not isinstance(other, _IPAddressBase): return NotImplemented if not isinstance(other, _BaseNetwork): raise TypeError('%s and %s are not of the same type' % ( self, other)) if self._version != other._version: raise TypeError('%s and %s are not of the same version' % ( self, other)) if self.network_address != other.network_address: return self.network_address < other.network_address if self.netmask != other.netmask: return self.netmask < other.netmask return False def __eq__(self, other): try: return (self._version == other._version and self.network_address == other.network_address and int(self.netmask) == int(other.netmask)) except AttributeError: return NotImplemented def __hash__(self): return hash(int(self.network_address) ^ int(self.netmask)) def __contains__(self, other): # always false if one is v4 and the other is v6. if self._version != other._version: return False # dealing with another network. if isinstance(other, _BaseNetwork): return False # dealing with another address else: # address return (int(self.network_address) <= int(other._ip) <= int(self.broadcast_address)) def overlaps(self, other): """Tell if self is partly contained in other.""" return self.network_address in other or ( self.broadcast_address in other or ( other.network_address in self or ( other.broadcast_address in self))) @property def broadcast_address(self): x = self._cache.get('broadcast_address') if x is None: x = self._address_class(int(self.network_address) | int(self.hostmask)) self._cache['broadcast_address'] = x return x @property def hostmask(self): x = self._cache.get('hostmask') if x is None: x = self._address_class(int(self.netmask) ^ self._ALL_ONES) self._cache['hostmask'] = x return x @property def with_prefixlen(self): return '%s/%d' % (self.network_address, self._prefixlen) @property def with_netmask(self): return '%s/%s' % (self.network_address, self.netmask) @property def with_hostmask(self): return '%s/%s' % (self.network_address, self.hostmask) @property def num_addresses(self): """Number of hosts in the current subnet.""" return int(self.broadcast_address) - int(self.network_address) + 1 @property def _address_class(self): # Returning bare address objects (rather than interfaces) allows for # more consistent behaviour across the network address, broadcast # address and individual host addresses. msg = '%200s has no associated address class' % (type(self),) raise NotImplementedError(msg) @property def prefixlen(self): return self._prefixlen def address_exclude(self, other): """Remove an address from a larger block. For example: addr1 = ip_network('192.0.2.0/28') addr2 = ip_network('192.0.2.1/32') list(addr1.address_exclude(addr2)) = [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'), IPv4Network('192.0.2.4/30'), IPv4Network('192.0.2.8/29')] or IPv6: addr1 = ip_network('2001:db8::1/32') addr2 = ip_network('2001:db8::1/128') list(addr1.address_exclude(addr2)) = [ip_network('2001:db8::1/128'), ip_network('2001:db8::2/127'), ip_network('2001:db8::4/126'), ip_network('2001:db8::8/125'), ... ip_network('2001:db8:8000::/33')] Args: other: An IPv4Network or IPv6Network object of the same type. Returns: An iterator of the IPv(4|6)Network objects which is self minus other. Raises: TypeError: If self and other are of differing address versions, or if other is not a network object. ValueError: If other is not completely contained by self. """ if not self._version == other._version: raise TypeError("%s and %s are not of the same version" % ( self, other)) if not isinstance(other, _BaseNetwork): raise TypeError("%s is not a network object" % other) if not other.subnet_of(self): raise ValueError('%s not contained in %s' % (other, self)) if other == self: return # Make sure we're comparing the network of other. other = other.__class__('%s/%s' % (other.network_address, other.prefixlen)) s1, s2 = self.subnets() while s1 != other and s2 != other: if other.subnet_of(s1): yield s2 s1, s2 = s1.subnets() elif other.subnet_of(s2): yield s1 s1, s2 = s2.subnets() else: # If we got here, there's a bug somewhere. raise AssertionError('Error performing exclusion: ' 's1: %s s2: %s other: %s' % (s1, s2, other)) if s1 == other: yield s2 elif s2 == other: yield s1 else: # If we got here, there's a bug somewhere. raise AssertionError('Error performing exclusion: ' 's1: %s s2: %s other: %s' % (s1, s2, other)) def compare_networks(self, other): """Compare two IP objects. This is only concerned about the comparison of the integer representation of the network addresses. This means that the host bits aren't considered at all in this method. If you want to compare host bits, you can easily enough do a 'HostA._ip < HostB._ip' Args: other: An IP object. Returns: If the IP versions of self and other are the same, returns: -1 if self < other: eg: IPv4Network('192.0.2.0/25') < IPv4Network('192.0.2.128/25') IPv6Network('2001:db8::1000/124') < IPv6Network('2001:db8::2000/124') 0 if self == other eg: IPv4Network('192.0.2.0/24') == IPv4Network('192.0.2.0/24') IPv6Network('2001:db8::1000/124') == IPv6Network('2001:db8::1000/124') 1 if self > other eg: IPv4Network('192.0.2.128/25') > IPv4Network('192.0.2.0/25') IPv6Network('2001:db8::2000/124') > IPv6Network('2001:db8::1000/124') Raises: TypeError if the IP versions are different. """ # does this need to raise a ValueError? if self._version != other._version: raise TypeError('%s and %s are not of the same type' % ( self, other)) # self._version == other._version below here: if self.network_address < other.network_address: return -1 if self.network_address > other.network_address: return 1 # self.network_address == other.network_address below here: if self.netmask < other.netmask: return -1 if self.netmask > other.netmask: return 1 return 0 def _get_networks_key(self): """Network-only key function. Returns an object that identifies this address' network and netmask. This function is a suitable "key" argument for sorted() and list.sort(). """ return (self._version, self.network_address, self.netmask) def subnets(self, prefixlen_diff=1, new_prefix=None): """The subnets which join to make the current subnet. In the case that self contains only one IP (self._prefixlen == 32 for IPv4 or self._prefixlen == 128 for IPv6), yield an iterator with just ourself. Args: prefixlen_diff: An integer, the amount the prefix length should be increased by. This should not be set if new_prefix is also set. new_prefix: The desired new prefix length. This must be a larger number (smaller prefix) than the existing prefix. This should not be set if prefixlen_diff is also set. Returns: An iterator of IPv(4|6) objects. Raises: ValueError: The prefixlen_diff is too small or too large. OR prefixlen_diff and new_prefix are both set or new_prefix is a smaller number than the current prefix (smaller number means a larger network) """ if self._prefixlen == self._max_prefixlen: yield self return if new_prefix is not None: if new_prefix < self._prefixlen: raise ValueError('new prefix must be longer') if prefixlen_diff != 1: raise ValueError('cannot set prefixlen_diff and new_prefix') prefixlen_diff = new_prefix - self._prefixlen if prefixlen_diff < 0: raise ValueError('prefix length diff must be > 0') new_prefixlen = self._prefixlen + prefixlen_diff if new_prefixlen > self._max_prefixlen: raise ValueError( 'prefix length diff %d is invalid for netblock %s' % ( new_prefixlen, self)) start = int(self.network_address) end = int(self.broadcast_address) + 1 step = (int(self.hostmask) + 1) >> prefixlen_diff for new_addr in _compat_range(start, end, step): current = self.__class__((new_addr, new_prefixlen)) yield current def supernet(self, prefixlen_diff=1, new_prefix=None): """The supernet containing the current network. Args: prefixlen_diff: An integer, the amount the prefix length of the network should be decreased by. For example, given a /24 network and a prefixlen_diff of 3, a supernet with a /21 netmask is returned. Returns: An IPv4 network object. Raises: ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have a negative prefix length. OR If prefixlen_diff and new_prefix are both set or new_prefix is a larger number than the current prefix (larger number means a smaller network) """ if self._prefixlen == 0: return self if new_prefix is not None: if new_prefix > self._prefixlen: raise ValueError('new prefix must be shorter') if prefixlen_diff != 1: raise ValueError('cannot set prefixlen_diff and new_prefix') prefixlen_diff = self._prefixlen - new_prefix new_prefixlen = self.prefixlen - prefixlen_diff if new_prefixlen < 0: raise ValueError( 'current prefixlen is %d, cannot have a prefixlen_diff of %d' % (self.prefixlen, prefixlen_diff)) return self.__class__(( int(self.network_address) & (int(self.netmask) << prefixlen_diff), new_prefixlen)) @property def is_multicast(self): """Test if the address is reserved for multicast use. Returns: A boolean, True if the address is a multicast address. See RFC 2373 2.7 for details. """ return (self.network_address.is_multicast and self.broadcast_address.is_multicast) @staticmethod def _is_subnet_of(a, b): try: # Always false if one is v4 and the other is v6. if a._version != b._version: raise TypeError( "%s and %s are not of the same version" % (a, b)) return (b.network_address <= a.network_address and b.broadcast_address >= a.broadcast_address) except AttributeError: raise TypeError("Unable to test subnet containment " "between %s and %s" % (a, b)) def subnet_of(self, other): """Return True if this network is a subnet of other.""" return self._is_subnet_of(self, other) def supernet_of(self, other): """Return True if this network is a supernet of other.""" return self._is_subnet_of(other, self) @property def is_reserved(self): """Test if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within one of the reserved IPv6 Network ranges. """ return (self.network_address.is_reserved and self.broadcast_address.is_reserved) @property def is_link_local(self): """Test if the address is reserved for link-local. Returns: A boolean, True if the address is reserved per RFC 4291. """ return (self.network_address.is_link_local and self.broadcast_address.is_link_local) @property def is_private(self): """Test if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per iana-ipv4-special-registry or iana-ipv6-special-registry. """ return (self.network_address.is_private and self.broadcast_address.is_private) @property def is_global(self): """Test if this address is allocated for public networks. Returns: A boolean, True if the address is not reserved per iana-ipv4-special-registry or iana-ipv6-special-registry. """ return not self.is_private @property def is_unspecified(self): """Test if the address is unspecified. Returns: A boolean, True if this is the unspecified address as defined in RFC 2373 2.5.2. """ return (self.network_address.is_unspecified and self.broadcast_address.is_unspecified) @property def is_loopback(self): """Test if the address is a loopback address. Returns: A boolean, True if the address is a loopback address as defined in RFC 2373 2.5.3. """ return (self.network_address.is_loopback and self.broadcast_address.is_loopback) class _BaseV4(object): """Base IPv4 object. The following methods are used by IPv4 objects in both single IP addresses and networks. """ __slots__ = () _version = 4 # Equivalent to 255.255.255.255 or 32 bits of 1's. _ALL_ONES = (2 ** IPV4LENGTH) - 1 _DECIMAL_DIGITS = frozenset('0123456789') # the valid octets for host and netmasks. only useful for IPv4. _valid_mask_octets = frozenset([255, 254, 252, 248, 240, 224, 192, 128, 0]) _max_prefixlen = IPV4LENGTH # There are only a handful of valid v4 netmasks, so we cache them all # when constructed (see _make_netmask()). _netmask_cache = {} def _explode_shorthand_ip_string(self): return _compat_str(self) @classmethod def _make_netmask(cls, arg): """Make a (netmask, prefix_len) tuple from the given argument. Argument can be: - an integer (the prefix length) - a string representing the prefix length (e.g. "24") - a string representing the prefix netmask (e.g. "255.255.255.0") """ if arg not in cls._netmask_cache: if isinstance(arg, _compat_int_types): prefixlen = arg else: try: # Check for a netmask in prefix length form prefixlen = cls._prefix_from_prefix_string(arg) except NetmaskValueError: # Check for a netmask or hostmask in dotted-quad form. # This may raise NetmaskValueError. prefixlen = cls._prefix_from_ip_string(arg) netmask = IPv4Address(cls._ip_int_from_prefix(prefixlen)) cls._netmask_cache[arg] = netmask, prefixlen return cls._netmask_cache[arg] @classmethod def _ip_int_from_string(cls, ip_str): """Turn the given IP string into an integer for comparison. Args: ip_str: A string, the IP ip_str. Returns: The IP ip_str as an integer. Raises: AddressValueError: if ip_str isn't a valid IPv4 Address. """ if not ip_str: raise AddressValueError('Address cannot be empty') octets = ip_str.split('.') if len(octets) != 4: raise AddressValueError("Expected 4 octets in %r" % ip_str) try: return _compat_int_from_byte_vals( map(cls._parse_octet, octets), 'big') except ValueError as exc: raise AddressValueError("%s in %r" % (exc, ip_str)) @classmethod def _parse_octet(cls, octet_str): """Convert a decimal octet into an integer. Args: octet_str: A string, the number to parse. Returns: The octet as an integer. Raises: ValueError: if the octet isn't strictly a decimal from [0..255]. """ if not octet_str: raise ValueError("Empty octet not permitted") # Whitelist the characters, since int() allows a lot of bizarre stuff. if not cls._DECIMAL_DIGITS.issuperset(octet_str): msg = "Only decimal digits permitted in %r" raise ValueError(msg % octet_str) # We do the length check second, since the invalid character error # is likely to be more informative for the user if len(octet_str) > 3: msg = "At most 3 characters permitted in %r" raise ValueError(msg % octet_str) # Convert to integer (we know digits are legal) octet_int = int(octet_str, 10) # Any octets that look like they *might* be written in octal, # and which don't look exactly the same in both octal and # decimal are rejected as ambiguous if octet_int > 7 and octet_str[0] == '0': msg = "Ambiguous (octal/decimal) value in %r not permitted" raise ValueError(msg % octet_str) if octet_int > 255: raise ValueError("Octet %d (> 255) not permitted" % octet_int) return octet_int @classmethod def _string_from_ip_int(cls, ip_int): """Turns a 32-bit integer into dotted decimal notation. Args: ip_int: An integer, the IP address. Returns: The IP address as a string in dotted decimal notation. """ return '.'.join(_compat_str(struct.unpack(b'!B', b)[0] if isinstance(b, bytes) else b) for b in _compat_to_bytes(ip_int, 4, 'big')) def _is_hostmask(self, ip_str): """Test if the IP string is a hostmask (rather than a netmask). Args: ip_str: A string, the potential hostmask. Returns: A boolean, True if the IP string is a hostmask. """ bits = ip_str.split('.') try: parts = [x for x in map(int, bits) if x in self._valid_mask_octets] except ValueError: return False if len(parts) != len(bits): return False if parts[0] < parts[-1]: return True return False def _reverse_pointer(self): """Return the reverse DNS pointer name for the IPv4 address. This implements the method described in RFC1035 3.5. """ reverse_octets = _compat_str(self).split('.')[::-1] return '.'.join(reverse_octets) + '.in-addr.arpa' @property def max_prefixlen(self): return self._max_prefixlen @property def version(self): return self._version class IPv4Address(_BaseV4, _BaseAddress): """Represent and manipulate single IPv4 Addresses.""" __slots__ = ('_ip', '__weakref__') def __init__(self, address): """ Args: address: A string or integer representing the IP Additionally, an integer can be passed, so IPv4Address('192.0.2.1') == IPv4Address(3221225985). or, more generally IPv4Address(int(IPv4Address('192.0.2.1'))) == IPv4Address('192.0.2.1') Raises: AddressValueError: If ipaddress isn't a valid IPv4 address. """ # Efficient constructor from integer. if isinstance(address, _compat_int_types): self._check_int_address(address) self._ip = address return # Constructing from a packed address if isinstance(address, bytes): self._check_packed_address(address, 4) bvs = _compat_bytes_to_byte_vals(address) self._ip = _compat_int_from_byte_vals(bvs, 'big') return # Assume input argument to be string or any object representation # which converts into a formatted IP string. addr_str = _compat_str(address) if '/' in addr_str: raise AddressValueError("Unexpected '/' in %r" % address) self._ip = self._ip_int_from_string(addr_str) @property def packed(self): """The binary representation of this address.""" return v4_int_to_packed(self._ip) @property def is_reserved(self): """Test if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within the reserved IPv4 Network range. """ return self in self._constants._reserved_network @property def is_private(self): """Test if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per iana-ipv4-special-registry. """ return any(self in net for net in self._constants._private_networks) @property def is_global(self): return ( self not in self._constants._public_network and not self.is_private) @property def is_multicast(self): """Test if the address is reserved for multicast use. Returns: A boolean, True if the address is multicast. See RFC 3171 for details. """ return self in self._constants._multicast_network @property def is_unspecified(self): """Test if the address is unspecified. Returns: A boolean, True if this is the unspecified address as defined in RFC 5735 3. """ return self == self._constants._unspecified_address @property def is_loopback(self): """Test if the address is a loopback address. Returns: A boolean, True if the address is a loopback per RFC 3330. """ return self in self._constants._loopback_network @property def is_link_local(self): """Test if the address is reserved for link-local. Returns: A boolean, True if the address is link-local per RFC 3927. """ return self in self._constants._linklocal_network class IPv4Interface(IPv4Address): def __init__(self, address): if isinstance(address, (bytes, _compat_int_types)): IPv4Address.__init__(self, address) self.network = IPv4Network(self._ip) self._prefixlen = self._max_prefixlen return if isinstance(address, tuple): IPv4Address.__init__(self, address[0]) if len(address) > 1: self._prefixlen = int(address[1]) else: self._prefixlen = self._max_prefixlen self.network = IPv4Network(address, strict=False) self.netmask = self.network.netmask self.hostmask = self.network.hostmask return addr = _split_optional_netmask(address) IPv4Address.__init__(self, addr[0]) self.network = IPv4Network(address, strict=False) self._prefixlen = self.network._prefixlen self.netmask = self.network.netmask self.hostmask = self.network.hostmask def __str__(self): return '%s/%d' % (self._string_from_ip_int(self._ip), self.network.prefixlen) def __eq__(self, other): address_equal = IPv4Address.__eq__(self, other) if not address_equal or address_equal is NotImplemented: return address_equal try: return self.network == other.network except AttributeError: # An interface with an associated network is NOT the # same as an unassociated address. That's why the hash # takes the extra info into account. return False def __lt__(self, other): address_less = IPv4Address.__lt__(self, other) if address_less is NotImplemented: return NotImplemented try: return (self.network < other.network or self.network == other.network and address_less) except AttributeError: # We *do* allow addresses and interfaces to be sorted. The # unassociated address is considered less than all interfaces. return False def __hash__(self): return self._ip ^ self._prefixlen ^ int(self.network.network_address) __reduce__ = _IPAddressBase.__reduce__ @property def ip(self): return IPv4Address(self._ip) @property def with_prefixlen(self): return '%s/%s' % (self._string_from_ip_int(self._ip), self._prefixlen) @property def with_netmask(self): return '%s/%s' % (self._string_from_ip_int(self._ip), self.netmask) @property def with_hostmask(self): return '%s/%s' % (self._string_from_ip_int(self._ip), self.hostmask) class IPv4Network(_BaseV4, _BaseNetwork): """This class represents and manipulates 32-bit IPv4 network + addresses.. Attributes: [examples for IPv4Network('192.0.2.0/27')] .network_address: IPv4Address('192.0.2.0') .hostmask: IPv4Address('0.0.0.31') .broadcast_address: IPv4Address('192.0.2.32') .netmask: IPv4Address('255.255.255.224') .prefixlen: 27 """ # Class to use when creating address objects _address_class = IPv4Address def __init__(self, address, strict=True): """Instantiate a new IPv4 network object. Args: address: A string or integer representing the IP [& network]. '192.0.2.0/24' '192.0.2.0/255.255.255.0' '192.0.0.2/0.0.0.255' are all functionally the same in IPv4. Similarly, '192.0.2.1' '192.0.2.1/255.255.255.255' '192.0.2.1/32' are also functionally equivalent. That is to say, failing to provide a subnetmask will create an object with a mask of /32. If the mask (portion after the / in the argument) is given in dotted quad form, it is treated as a netmask if it starts with a non-zero field (e.g. /255.0.0.0 == /8) and as a hostmask if it starts with a zero field (e.g. 0.255.255.255 == /8), with the single exception of an all-zero mask which is treated as a netmask == /0. If no mask is given, a default of /32 is used. Additionally, an integer can be passed, so IPv4Network('192.0.2.1') == IPv4Network(3221225985) or, more generally IPv4Interface(int(IPv4Interface('192.0.2.1'))) == IPv4Interface('192.0.2.1') Raises: AddressValueError: If ipaddress isn't a valid IPv4 address. NetmaskValueError: If the netmask isn't valid for an IPv4 address. ValueError: If strict is True and a network address is not supplied. """ _BaseNetwork.__init__(self, address) # Constructing from a packed address or integer if isinstance(address, (_compat_int_types, bytes)): self.network_address = IPv4Address(address) self.netmask, self._prefixlen = self._make_netmask( self._max_prefixlen) # fixme: address/network test here. return if isinstance(address, tuple): if len(address) > 1: arg = address[1] else: # We weren't given an address[1] arg = self._max_prefixlen self.network_address = IPv4Address(address[0]) self.netmask, self._prefixlen = self._make_netmask(arg) packed = int(self.network_address) if packed & int(self.netmask) != packed: if strict: raise ValueError('%s has host bits set' % self) else: self.network_address = IPv4Address(packed & int(self.netmask)) return # Assume input argument to be string or any object representation # which converts into a formatted IP prefix string. addr = _split_optional_netmask(address) self.network_address = IPv4Address(self._ip_int_from_string(addr[0])) if len(addr) == 2: arg = addr[1] else: arg = self._max_prefixlen self.netmask, self._prefixlen = self._make_netmask(arg) if strict: if (IPv4Address(int(self.network_address) & int(self.netmask)) != self.network_address): raise ValueError('%s has host bits set' % self) self.network_address = IPv4Address(int(self.network_address) & int(self.netmask)) if self._prefixlen == (self._max_prefixlen - 1): self.hosts = self.__iter__ @property def is_global(self): """Test if this address is allocated for public networks. Returns: A boolean, True if the address is not reserved per iana-ipv4-special-registry. """ return (not (self.network_address in IPv4Network('100.64.0.0/10') and self.broadcast_address in IPv4Network('100.64.0.0/10')) and not self.is_private) class _IPv4Constants(object): _linklocal_network = IPv4Network('169.254.0.0/16') _loopback_network = IPv4Network('127.0.0.0/8') _multicast_network = IPv4Network('224.0.0.0/4') _public_network = IPv4Network('100.64.0.0/10') _private_networks = [ IPv4Network('0.0.0.0/8'), IPv4Network('10.0.0.0/8'), IPv4Network('127.0.0.0/8'), IPv4Network('169.254.0.0/16'), IPv4Network('172.16.0.0/12'), IPv4Network('192.0.0.0/29'), IPv4Network('192.0.0.170/31'), IPv4Network('192.0.2.0/24'), IPv4Network('192.168.0.0/16'), IPv4Network('198.18.0.0/15'), IPv4Network('198.51.100.0/24'), IPv4Network('203.0.113.0/24'), IPv4Network('240.0.0.0/4'), IPv4Network('255.255.255.255/32'), ] _reserved_network = IPv4Network('240.0.0.0/4') _unspecified_address = IPv4Address('0.0.0.0') IPv4Address._constants = _IPv4Constants class _BaseV6(object): """Base IPv6 object. The following methods are used by IPv6 objects in both single IP addresses and networks. """ __slots__ = () _version = 6 _ALL_ONES = (2 ** IPV6LENGTH) - 1 _HEXTET_COUNT = 8 _HEX_DIGITS = frozenset('0123456789ABCDEFabcdef') _max_prefixlen = IPV6LENGTH # There are only a bunch of valid v6 netmasks, so we cache them all # when constructed (see _make_netmask()). _netmask_cache = {} @classmethod def _make_netmask(cls, arg): """Make a (netmask, prefix_len) tuple from the given argument. Argument can be: - an integer (the prefix length) - a string representing the prefix length (e.g. "24") - a string representing the prefix netmask (e.g. "255.255.255.0") """ if arg not in cls._netmask_cache: if isinstance(arg, _compat_int_types): prefixlen = arg else: prefixlen = cls._prefix_from_prefix_string(arg) netmask = IPv6Address(cls._ip_int_from_prefix(prefixlen)) cls._netmask_cache[arg] = netmask, prefixlen return cls._netmask_cache[arg] @classmethod def _ip_int_from_string(cls, ip_str): """Turn an IPv6 ip_str into an integer. Args: ip_str: A string, the IPv6 ip_str. Returns: An int, the IPv6 address Raises: AddressValueError: if ip_str isn't a valid IPv6 Address. """ if not ip_str: raise AddressValueError('Address cannot be empty') parts = ip_str.split(':') # An IPv6 address needs at least 2 colons (3 parts). _min_parts = 3 if len(parts) < _min_parts: msg = "At least %d parts expected in %r" % (_min_parts, ip_str) raise AddressValueError(msg) # If the address has an IPv4-style suffix, convert it to hexadecimal. if '.' in parts[-1]: try: ipv4_int = IPv4Address(parts.pop())._ip except AddressValueError as exc: raise AddressValueError("%s in %r" % (exc, ip_str)) parts.append('%x' % ((ipv4_int >> 16) & 0xFFFF)) parts.append('%x' % (ipv4_int & 0xFFFF)) # An IPv6 address can't have more than 8 colons (9 parts). # The extra colon comes from using the "::" notation for a single # leading or trailing zero part. _max_parts = cls._HEXTET_COUNT + 1 if len(parts) > _max_parts: msg = "At most %d colons permitted in %r" % ( _max_parts - 1, ip_str) raise AddressValueError(msg) # Disregarding the endpoints, find '::' with nothing in between. # This indicates that a run of zeroes has been skipped. skip_index = None for i in _compat_range(1, len(parts) - 1): if not parts[i]: if skip_index is not None: # Can't have more than one '::' msg = "At most one '::' permitted in %r" % ip_str raise AddressValueError(msg) skip_index = i # parts_hi is the number of parts to copy from above/before the '::' # parts_lo is the number of parts to copy from below/after the '::' if skip_index is not None: # If we found a '::', then check if it also covers the endpoints. parts_hi = skip_index parts_lo = len(parts) - skip_index - 1 if not parts[0]: parts_hi -= 1 if parts_hi: msg = "Leading ':' only permitted as part of '::' in %r" raise AddressValueError(msg % ip_str) # ^: requires ^:: if not parts[-1]: parts_lo -= 1 if parts_lo: msg = "Trailing ':' only permitted as part of '::' in %r" raise AddressValueError(msg % ip_str) # :$ requires ::$ parts_skipped = cls._HEXTET_COUNT - (parts_hi + parts_lo) if parts_skipped < 1: msg = "Expected at most %d other parts with '::' in %r" raise AddressValueError(msg % (cls._HEXTET_COUNT - 1, ip_str)) else: # Otherwise, allocate the entire address to parts_hi. The # endpoints could still be empty, but _parse_hextet() will check # for that. if len(parts) != cls._HEXTET_COUNT: msg = "Exactly %d parts expected without '::' in %r" raise AddressValueError(msg % (cls._HEXTET_COUNT, ip_str)) if not parts[0]: msg = "Leading ':' only permitted as part of '::' in %r" raise AddressValueError(msg % ip_str) # ^: requires ^:: if not parts[-1]: msg = "Trailing ':' only permitted as part of '::' in %r" raise AddressValueError(msg % ip_str) # :$ requires ::$ parts_hi = len(parts) parts_lo = 0 parts_skipped = 0 try: # Now, parse the hextets into a 128-bit integer. ip_int = 0 for i in range(parts_hi): ip_int <<= 16 ip_int |= cls._parse_hextet(parts[i]) ip_int <<= 16 * parts_skipped for i in range(-parts_lo, 0): ip_int <<= 16 ip_int |= cls._parse_hextet(parts[i]) return ip_int except ValueError as exc: raise AddressValueError("%s in %r" % (exc, ip_str)) @classmethod def _parse_hextet(cls, hextet_str): """Convert an IPv6 hextet string into an integer. Args: hextet_str: A string, the number to parse. Returns: The hextet as an integer. Raises: ValueError: if the input isn't strictly a hex number from [0..FFFF]. """ # Whitelist the characters, since int() allows a lot of bizarre stuff. if not cls._HEX_DIGITS.issuperset(hextet_str): raise ValueError("Only hex digits permitted in %r" % hextet_str) # We do the length check second, since the invalid character error # is likely to be more informative for the user if len(hextet_str) > 4: msg = "At most 4 characters permitted in %r" raise ValueError(msg % hextet_str) # Length check means we can skip checking the integer value return int(hextet_str, 16) @classmethod def _compress_hextets(cls, hextets): """Compresses a list of hextets. Compresses a list of strings, replacing the longest continuous sequence of "0" in the list with "" and adding empty strings at the beginning or at the end of the string such that subsequently calling ":".join(hextets) will produce the compressed version of the IPv6 address. Args: hextets: A list of strings, the hextets to compress. Returns: A list of strings. """ best_doublecolon_start = -1 best_doublecolon_len = 0 doublecolon_start = -1 doublecolon_len = 0 for index, hextet in enumerate(hextets): if hextet == '0': doublecolon_len += 1 if doublecolon_start == -1: # Start of a sequence of zeros. doublecolon_start = index if doublecolon_len > best_doublecolon_len: # This is the longest sequence of zeros so far. best_doublecolon_len = doublecolon_len best_doublecolon_start = doublecolon_start else: doublecolon_len = 0 doublecolon_start = -1 if best_doublecolon_len > 1: best_doublecolon_end = (best_doublecolon_start + best_doublecolon_len) # For zeros at the end of the address. if best_doublecolon_end == len(hextets): hextets += [''] hextets[best_doublecolon_start:best_doublecolon_end] = [''] # For zeros at the beginning of the address. if best_doublecolon_start == 0: hextets = [''] + hextets return hextets @classmethod def _string_from_ip_int(cls, ip_int=None): """Turns a 128-bit integer into hexadecimal notation. Args: ip_int: An integer, the IP address. Returns: A string, the hexadecimal representation of the address. Raises: ValueError: The address is bigger than 128 bits of all ones. """ if ip_int is None: ip_int = int(cls._ip) if ip_int > cls._ALL_ONES: raise ValueError('IPv6 address is too large') hex_str = '%032x' % ip_int hextets = ['%x' % int(hex_str[x:x + 4], 16) for x in range(0, 32, 4)] hextets = cls._compress_hextets(hextets) return ':'.join(hextets) def _explode_shorthand_ip_string(self): """Expand a shortened IPv6 address. Args: ip_str: A string, the IPv6 address. Returns: A string, the expanded IPv6 address. """ if isinstance(self, IPv6Network): ip_str = _compat_str(self.network_address) elif isinstance(self, IPv6Interface): ip_str = _compat_str(self.ip) else: ip_str = _compat_str(self) ip_int = self._ip_int_from_string(ip_str) hex_str = '%032x' % ip_int parts = [hex_str[x:x + 4] for x in range(0, 32, 4)] if isinstance(self, (_BaseNetwork, IPv6Interface)): return '%s/%d' % (':'.join(parts), self._prefixlen) return ':'.join(parts) def _reverse_pointer(self): """Return the reverse DNS pointer name for the IPv6 address. This implements the method described in RFC3596 2.5. """ reverse_chars = self.exploded[::-1].replace(':', '') return '.'.join(reverse_chars) + '.ip6.arpa' @property def max_prefixlen(self): return self._max_prefixlen @property def version(self): return self._version class IPv6Address(_BaseV6, _BaseAddress): """Represent and manipulate single IPv6 Addresses.""" __slots__ = ('_ip', '__weakref__') def __init__(self, address): """Instantiate a new IPv6 address object. Args: address: A string or integer representing the IP Additionally, an integer can be passed, so IPv6Address('2001:db8::') == IPv6Address(42540766411282592856903984951653826560) or, more generally IPv6Address(int(IPv6Address('2001:db8::'))) == IPv6Address('2001:db8::') Raises: AddressValueError: If address isn't a valid IPv6 address. """ # Efficient constructor from integer. if isinstance(address, _compat_int_types): self._check_int_address(address) self._ip = address return # Constructing from a packed address if isinstance(address, bytes): self._check_packed_address(address, 16) bvs = _compat_bytes_to_byte_vals(address) self._ip = _compat_int_from_byte_vals(bvs, 'big') return # Assume input argument to be string or any object representation # which converts into a formatted IP string. addr_str = _compat_str(address) if '/' in addr_str: raise AddressValueError("Unexpected '/' in %r" % address) self._ip = self._ip_int_from_string(addr_str) @property def packed(self): """The binary representation of this address.""" return v6_int_to_packed(self._ip) @property def is_multicast(self): """Test if the address is reserved for multicast use. Returns: A boolean, True if the address is a multicast address. See RFC 2373 2.7 for details. """ return self in self._constants._multicast_network @property def is_reserved(self): """Test if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within one of the reserved IPv6 Network ranges. """ return any(self in x for x in self._constants._reserved_networks) @property def is_link_local(self): """Test if the address is reserved for link-local. Returns: A boolean, True if the address is reserved per RFC 4291. """ return self in self._constants._linklocal_network @property def is_site_local(self): """Test if the address is reserved for site-local. Note that the site-local address space has been deprecated by RFC 3879. Use is_private to test if this address is in the space of unique local addresses as defined by RFC 4193. Returns: A boolean, True if the address is reserved per RFC 3513 2.5.6. """ return self in self._constants._sitelocal_network @property def is_private(self): """Test if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per iana-ipv6-special-registry. """ return any(self in net for net in self._constants._private_networks) @property def is_global(self): """Test if this address is allocated for public networks. Returns: A boolean, true if the address is not reserved per iana-ipv6-special-registry. """ return not self.is_private @property def is_unspecified(self): """Test if the address is unspecified. Returns: A boolean, True if this is the unspecified address as defined in RFC 2373 2.5.2. """ return self._ip == 0 @property def is_loopback(self): """Test if the address is a loopback address. Returns: A boolean, True if the address is a loopback address as defined in RFC 2373 2.5.3. """ return self._ip == 1 @property def ipv4_mapped(self): """Return the IPv4 mapped address. Returns: If the IPv6 address is a v4 mapped address, return the IPv4 mapped address. Return None otherwise. """ if (self._ip >> 32) != 0xFFFF: return None return IPv4Address(self._ip & 0xFFFFFFFF) @property def teredo(self): """Tuple of embedded teredo IPs. Returns: Tuple of the (server, client) IPs or None if the address doesn't appear to be a teredo address (doesn't start with 2001::/32) """ if (self._ip >> 96) != 0x20010000: return None return (IPv4Address((self._ip >> 64) & 0xFFFFFFFF), IPv4Address(~self._ip & 0xFFFFFFFF)) @property def sixtofour(self): """Return the IPv4 6to4 embedded address. Returns: The IPv4 6to4-embedded address if present or None if the address doesn't appear to contain a 6to4 embedded address. """ if (self._ip >> 112) != 0x2002: return None return IPv4Address((self._ip >> 80) & 0xFFFFFFFF) class IPv6Interface(IPv6Address): def __init__(self, address): if isinstance(address, (bytes, _compat_int_types)): IPv6Address.__init__(self, address) self.network = IPv6Network(self._ip) self._prefixlen = self._max_prefixlen return if isinstance(address, tuple): IPv6Address.__init__(self, address[0]) if len(address) > 1: self._prefixlen = int(address[1]) else: self._prefixlen = self._max_prefixlen self.network = IPv6Network(address, strict=False) self.netmask = self.network.netmask self.hostmask = self.network.hostmask return addr = _split_optional_netmask(address) IPv6Address.__init__(self, addr[0]) self.network = IPv6Network(address, strict=False) self.netmask = self.network.netmask self._prefixlen = self.network._prefixlen self.hostmask = self.network.hostmask def __str__(self): return '%s/%d' % (self._string_from_ip_int(self._ip), self.network.prefixlen) def __eq__(self, other): address_equal = IPv6Address.__eq__(self, other) if not address_equal or address_equal is NotImplemented: return address_equal try: return self.network == other.network except AttributeError: # An interface with an associated network is NOT the # same as an unassociated address. That's why the hash # takes the extra info into account. return False def __lt__(self, other): address_less = IPv6Address.__lt__(self, other) if address_less is NotImplemented: return NotImplemented try: return (self.network < other.network or self.network == other.network and address_less) except AttributeError: # We *do* allow addresses and interfaces to be sorted. The # unassociated address is considered less than all interfaces. return False def __hash__(self): return self._ip ^ self._prefixlen ^ int(self.network.network_address) __reduce__ = _IPAddressBase.__reduce__ @property def ip(self): return IPv6Address(self._ip) @property def with_prefixlen(self): return '%s/%s' % (self._string_from_ip_int(self._ip), self._prefixlen) @property def with_netmask(self): return '%s/%s' % (self._string_from_ip_int(self._ip), self.netmask) @property def with_hostmask(self): return '%s/%s' % (self._string_from_ip_int(self._ip), self.hostmask) @property def is_unspecified(self): return self._ip == 0 and self.network.is_unspecified @property def is_loopback(self): return self._ip == 1 and self.network.is_loopback class IPv6Network(_BaseV6, _BaseNetwork): """This class represents and manipulates 128-bit IPv6 networks. Attributes: [examples for IPv6('2001:db8::1000/124')] .network_address: IPv6Address('2001:db8::1000') .hostmask: IPv6Address('::f') .broadcast_address: IPv6Address('2001:db8::100f') .netmask: IPv6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0') .prefixlen: 124 """ # Class to use when creating address objects _address_class = IPv6Address def __init__(self, address, strict=True): """Instantiate a new IPv6 Network object. Args: address: A string or integer representing the IPv6 network or the IP and prefix/netmask. '2001:db8::/128' '2001:db8:0000:0000:0000:0000:0000:0000/128' '2001:db8::' are all functionally the same in IPv6. That is to say, failing to provide a subnetmask will create an object with a mask of /128. Additionally, an integer can be passed, so IPv6Network('2001:db8::') == IPv6Network(42540766411282592856903984951653826560) or, more generally IPv6Network(int(IPv6Network('2001:db8::'))) == IPv6Network('2001:db8::') strict: A boolean. If true, ensure that we have been passed A true network address, eg, 2001:db8::1000/124 and not an IP address on a network, eg, 2001:db8::1/124. Raises: AddressValueError: If address isn't a valid IPv6 address. NetmaskValueError: If the netmask isn't valid for an IPv6 address. ValueError: If strict was True and a network address was not supplied. """ _BaseNetwork.__init__(self, address) # Efficient constructor from integer or packed address if isinstance(address, (bytes, _compat_int_types)): self.network_address = IPv6Address(address) self.netmask, self._prefixlen = self._make_netmask( self._max_prefixlen) return if isinstance(address, tuple): if len(address) > 1: arg = address[1] else: arg = self._max_prefixlen self.netmask, self._prefixlen = self._make_netmask(arg) self.network_address = IPv6Address(address[0]) packed = int(self.network_address) if packed & int(self.netmask) != packed: if strict: raise ValueError('%s has host bits set' % self) else: self.network_address = IPv6Address(packed & int(self.netmask)) return # Assume input argument to be string or any object representation # which converts into a formatted IP prefix string. addr = _split_optional_netmask(address) self.network_address = IPv6Address(self._ip_int_from_string(addr[0])) if len(addr) == 2: arg = addr[1] else: arg = self._max_prefixlen self.netmask, self._prefixlen = self._make_netmask(arg) if strict: if (IPv6Address(int(self.network_address) & int(self.netmask)) != self.network_address): raise ValueError('%s has host bits set' % self) self.network_address = IPv6Address(int(self.network_address) & int(self.netmask)) if self._prefixlen == (self._max_prefixlen - 1): self.hosts = self.__iter__ def hosts(self): """Generate Iterator over usable hosts in a network. This is like __iter__ except it doesn't return the Subnet-Router anycast address. """ network = int(self.network_address) broadcast = int(self.broadcast_address) for x in _compat_range(network + 1, broadcast + 1): yield self._address_class(x) @property def is_site_local(self): """Test if the address is reserved for site-local. Note that the site-local address space has been deprecated by RFC 3879. Use is_private to test if this address is in the space of unique local addresses as defined by RFC 4193. Returns: A boolean, True if the address is reserved per RFC 3513 2.5.6. """ return (self.network_address.is_site_local and self.broadcast_address.is_site_local) class _IPv6Constants(object): _linklocal_network = IPv6Network('fe80::/10') _multicast_network = IPv6Network('ff00::/8') _private_networks = [ IPv6Network('::1/128'), IPv6Network('::/128'), IPv6Network('::ffff:0:0/96'), IPv6Network('100::/64'), IPv6Network('2001::/23'), IPv6Network('2001:2::/48'), IPv6Network('2001:db8::/32'), IPv6Network('2001:10::/28'), IPv6Network('fc00::/7'), IPv6Network('fe80::/10'), ] _reserved_networks = [ IPv6Network('::/8'), IPv6Network('100::/8'), IPv6Network('200::/7'), IPv6Network('400::/6'), IPv6Network('800::/5'), IPv6Network('1000::/4'), IPv6Network('4000::/3'), IPv6Network('6000::/3'), IPv6Network('8000::/3'), IPv6Network('A000::/3'), IPv6Network('C000::/3'), IPv6Network('E000::/4'), IPv6Network('F000::/5'), IPv6Network('F800::/6'), IPv6Network('FE00::/9'), ] _sitelocal_network = IPv6Network('fec0::/10') IPv6Address._constants = _IPv6Constants PKd].JRJRdistlib/index.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import hashlib import logging import os import shutil import subprocess import tempfile try: from threading import Thread except ImportError: from dummy_threading import Thread from . import DistlibException from .compat import (HTTPBasicAuthHandler, Request, HTTPPasswordMgr, urlparse, build_opener, string_types) from .util import cached_property, zip_dir, ServerProxy logger = logging.getLogger(__name__) DEFAULT_INDEX = 'https://pypi.org/pypi' DEFAULT_REALM = 'pypi' class PackageIndex(object): """ This class represents a package index compatible with PyPI, the Python Package Index. """ boundary = b'----------ThIs_Is_tHe_distlib_index_bouNdaRY_$' def __init__(self, url=None): """ Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. """ self.url = url or DEFAULT_INDEX self.read_configuration() scheme, netloc, path, params, query, frag = urlparse(self.url) if params or query or frag or scheme not in ('http', 'https'): raise DistlibException('invalid repository: %s' % self.url) self.password_handler = None self.ssl_verifier = None self.gpg = None self.gpg_home = None with open(os.devnull, 'w') as sink: # Use gpg by default rather than gpg2, as gpg2 insists on # prompting for passwords for s in ('gpg', 'gpg2'): try: rc = subprocess.check_call([s, '--version'], stdout=sink, stderr=sink) if rc == 0: self.gpg = s break except OSError: pass def _get_pypirc_command(self): """ Get the distutils command for interacting with PyPI configurations. :return: the command. """ from distutils.core import Distribution from distutils.config import PyPIRCCommand d = Distribution() return PyPIRCCommand(d) def read_configuration(self): """ Read the PyPI access configuration as supported by distutils, getting PyPI to do the actual work. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. """ # get distutils to do the work c = self._get_pypirc_command() c.repository = self.url cfg = c._read_pypirc() self.username = cfg.get('username') self.password = cfg.get('password') self.realm = cfg.get('realm', 'pypi') self.url = cfg.get('repository', self.url) def save_configuration(self): """ Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. Again, distutils is used to do the actual work. """ self.check_credentials() # get distutils to do the work c = self._get_pypirc_command() c._store_pypirc(self.username, self.password) def check_credentials(self): """ Check that ``username`` and ``password`` have been set, and raise an exception if not. """ if self.username is None or self.password is None: raise DistlibException('username and password must be set') pm = HTTPPasswordMgr() _, netloc, _, _, _, _ = urlparse(self.url) pm.add_password(self.realm, netloc, self.username, self.password) self.password_handler = HTTPBasicAuthHandler(pm) def register(self, metadata): """ Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. """ self.check_credentials() metadata.validate() d = metadata.todict() d[':action'] = 'verify' request = self.encode_request(d.items(), []) response = self.send_request(request) d[':action'] = 'submit' request = self.encode_request(d.items(), []) return self.send_request(request) def _reader(self, name, stream, outbuf): """ Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. """ while True: s = stream.readline() if not s: break s = s.decode('utf-8').rstrip() outbuf.append(s) logger.debug('%s: %s' % (name, s)) stream.close() def get_sign_command(self, filename, signer, sign_password, keystore=None): """ Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. """ cmd = [self.gpg, '--status-fd', '2', '--no-tty'] if keystore is None: keystore = self.gpg_home if keystore: cmd.extend(['--homedir', keystore]) if sign_password is not None: cmd.extend(['--batch', '--passphrase-fd', '0']) td = tempfile.mkdtemp() sf = os.path.join(td, os.path.basename(filename) + '.asc') cmd.extend(['--detach-sign', '--armor', '--local-user', signer, '--output', sf, filename]) logger.debug('invoking: %s', ' '.join(cmd)) return cmd, sf def run_command(self, cmd, input_data=None): """ Run a command in a child process , passing it any input data specified. :param cmd: The command to run. :param input_data: If specified, this must be a byte string containing data to be sent to the child process. :return: A tuple consisting of the subprocess' exit code, a list of lines read from the subprocess' ``stdout``, and a list of lines read from the subprocess' ``stderr``. """ kwargs = { 'stdout': subprocess.PIPE, 'stderr': subprocess.PIPE, } if input_data is not None: kwargs['stdin'] = subprocess.PIPE stdout = [] stderr = [] p = subprocess.Popen(cmd, **kwargs) # We don't use communicate() here because we may need to # get clever with interacting with the command t1 = Thread(target=self._reader, args=('stdout', p.stdout, stdout)) t1.start() t2 = Thread(target=self._reader, args=('stderr', p.stderr, stderr)) t2.start() if input_data is not None: p.stdin.write(input_data) p.stdin.close() p.wait() t1.join() t2.join() return p.returncode, stdout, stderr def sign_file(self, filename, signer, sign_password, keystore=None): """ Sign a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The absolute pathname of the file where the signature is stored. """ cmd, sig_file = self.get_sign_command(filename, signer, sign_password, keystore) rc, stdout, stderr = self.run_command(cmd, sign_password.encode('utf-8')) if rc != 0: raise DistlibException('sign command failed with error ' 'code %s' % rc) return sig_file def upload_file(self, metadata, filename, signer=None, sign_password=None, filetype='sdist', pyversion='source', keystore=None): """ Upload a release file to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the file to be uploaded. :param filename: The pathname of the file to be uploaded. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param filetype: The type of the file being uploaded. This is the distutils command which produced that file, e.g. ``sdist`` or ``bdist_wheel``. :param pyversion: The version of Python which the release relates to. For code compatible with any Python, this would be ``source``, otherwise it would be e.g. ``3.2``. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The HTTP response received from PyPI upon submission of the request. """ self.check_credentials() if not os.path.exists(filename): raise DistlibException('not found: %s' % filename) metadata.validate() d = metadata.todict() sig_file = None if signer: if not self.gpg: logger.warning('no signing program available - not signed') else: sig_file = self.sign_file(filename, signer, sign_password, keystore) with open(filename, 'rb') as f: file_data = f.read() md5_digest = hashlib.md5(file_data).hexdigest() sha256_digest = hashlib.sha256(file_data).hexdigest() d.update({ ':action': 'file_upload', 'protocol_version': '1', 'filetype': filetype, 'pyversion': pyversion, 'md5_digest': md5_digest, 'sha256_digest': sha256_digest, }) files = [('content', os.path.basename(filename), file_data)] if sig_file: with open(sig_file, 'rb') as f: sig_data = f.read() files.append(('gpg_signature', os.path.basename(sig_file), sig_data)) shutil.rmtree(os.path.dirname(sig_file)) request = self.encode_request(d.items(), files) return self.send_request(request) def upload_documentation(self, metadata, doc_dir): """ Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. """ self.check_credentials() if not os.path.isdir(doc_dir): raise DistlibException('not a directory: %r' % doc_dir) fn = os.path.join(doc_dir, 'index.html') if not os.path.exists(fn): raise DistlibException('not found: %r' % fn) metadata.validate() name, version = metadata.name, metadata.version zip_data = zip_dir(doc_dir).getvalue() fields = [(':action', 'doc_upload'), ('name', name), ('version', version)] files = [('content', name, zip_data)] request = self.encode_request(fields, files) return self.send_request(request) def get_verify_command(self, signature_filename, data_filename, keystore=None): """ Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. """ cmd = [self.gpg, '--status-fd', '2', '--no-tty'] if keystore is None: keystore = self.gpg_home if keystore: cmd.extend(['--homedir', keystore]) cmd.extend(['--verify', signature_filename, data_filename]) logger.debug('invoking: %s', ' '.join(cmd)) return cmd def verify_signature(self, signature_filename, data_filename, keystore=None): """ Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. """ if not self.gpg: raise DistlibException('verification unavailable because gpg ' 'unavailable') cmd = self.get_verify_command(signature_filename, data_filename, keystore) rc, stdout, stderr = self.run_command(cmd) if rc not in (0, 1): raise DistlibException('verify command failed with error ' 'code %s' % rc) return rc == 0 def download_file(self, url, destfile, digest=None, reporthook=None): """ This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. """ if digest is None: digester = None logger.debug('No digest specified') else: if isinstance(digest, (list, tuple)): hasher, digest = digest else: hasher = 'md5' digester = getattr(hashlib, hasher)() logger.debug('Digest specified: %s' % digest) # The following code is equivalent to urlretrieve. # We need to do it this way so that we can compute the # digest of the file as we go. with open(destfile, 'wb') as dfp: # addinfourl is not a context manager on 2.x # so we have to use try/finally sfp = self.send_request(Request(url)) try: headers = sfp.info() blocksize = 8192 size = -1 read = 0 blocknum = 0 if "content-length" in headers: size = int(headers["Content-Length"]) if reporthook: reporthook(blocknum, blocksize, size) while True: block = sfp.read(blocksize) if not block: break read += len(block) dfp.write(block) if digester: digester.update(block) blocknum += 1 if reporthook: reporthook(blocknum, blocksize, size) finally: sfp.close() # check that we got the whole file, if we can if size >= 0 and read < size: raise DistlibException( 'retrieval incomplete: got only %d out of %d bytes' % (read, size)) # if we have a digest, it must match. if digester: actual = digester.hexdigest() if digest != actual: raise DistlibException('%s digest mismatch for %s: expected ' '%s, got %s' % (hasher, destfile, digest, actual)) logger.debug('Digest verified: %s', digest) def send_request(self, req): """ Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). """ handlers = [] if self.password_handler: handlers.append(self.password_handler) if self.ssl_verifier: handlers.append(self.ssl_verifier) opener = build_opener(*handlers) return opener.open(req) def encode_request(self, fields, files): """ Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. """ # Adapted from packaging, which in turn was adapted from # http://code.activestate.com/recipes/146306 parts = [] boundary = self.boundary for k, values in fields: if not isinstance(values, (list, tuple)): values = [values] for v in values: parts.extend(( b'--' + boundary, ('Content-Disposition: form-data; name="%s"' % k).encode('utf-8'), b'', v.encode('utf-8'))) for key, filename, value in files: parts.extend(( b'--' + boundary, ('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename)).encode('utf-8'), b'', value)) parts.extend((b'--' + boundary + b'--', b'')) body = b'\r\n'.join(parts) ct = b'multipart/form-data; boundary=' + boundary headers = { 'Content-type': ct, 'Content-length': str(len(body)) } return Request(self.url, body, headers) def search(self, terms, operator=None): if isinstance(terms, string_types): terms = {'name': terms} rpc_proxy = ServerProxy(self.url, timeout=3.0) try: return rpc_proxy.search(terms, operator or 'and') finally: rpc_proxy('close')() PKd]x5g99distlib/manifest.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. """ import fnmatch import logging import os import re import sys from . import DistlibException from .compat import fsdecode from .util import convert_path __all__ = ['Manifest'] logger = logging.getLogger(__name__) # a \ followed by some spaces + EOL _COLLAPSE_PATTERN = re.compile('\\\\w*\n', re.M) _COMMENTED_LINE = re.compile('#.*?(?=\n)|\n(?=$)', re.M | re.S) # # Due to the different results returned by fnmatch.translate, we need # to do slightly different processing for Python 2.7 and 3.2 ... this needed # to be brought in for Python 3.6 onwards. # _PYTHON_VERSION = sys.version_info[:2] class Manifest(object): """A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. """ def __init__(self, base=None): """ Initialise an instance. :param base: The base directory to explore under. """ self.base = os.path.abspath(os.path.normpath(base or os.getcwd())) self.prefix = self.base + os.sep self.allfiles = None self.files = set() # # Public API # def findall(self): """Find all files under the base and set ``allfiles`` to the absolute pathnames of files found. """ from stat import S_ISREG, S_ISDIR, S_ISLNK self.allfiles = allfiles = [] root = self.base stack = [root] pop = stack.pop push = stack.append while stack: root = pop() names = os.listdir(root) for name in names: fullname = os.path.join(root, name) # Avoid excess stat calls -- just one will do, thank you! stat = os.stat(fullname) mode = stat.st_mode if S_ISREG(mode): allfiles.append(fsdecode(fullname)) elif S_ISDIR(mode) and not S_ISLNK(mode): push(fullname) def add(self, item): """ Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. """ if not item.startswith(self.prefix): item = os.path.join(self.base, item) self.files.add(os.path.normpath(item)) def add_many(self, items): """ Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. """ for item in items: self.add(item) def sorted(self, wantdirs=False): """ Return sorted files in directory order """ def add_dir(dirs, d): dirs.add(d) logger.debug('add_dir added %s', d) if d != self.base: parent, _ = os.path.split(d) assert parent not in ('', '/') add_dir(dirs, parent) result = set(self.files) # make a copy! if wantdirs: dirs = set() for f in result: add_dir(dirs, os.path.dirname(f)) result |= dirs return [os.path.join(*path_tuple) for path_tuple in sorted(os.path.split(path) for path in result)] def clear(self): """Clear all collected files.""" self.files = set() self.allfiles = [] def process_directive(self, directive): """ Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands """ # Parse the line: split it up, make sure the right number of words # is there, and return the relevant words. 'action' is always # defined: it's the first word of the line. Which of the other # three are defined depends on the action; it'll be either # patterns, (dir and patterns), or (dirpattern). action, patterns, thedir, dirpattern = self._parse_directive(directive) # OK, now we know that the action is valid and we have the # right number of words on the line for that action -- so we # can proceed with minimal error-checking. if action == 'include': for pattern in patterns: if not self._include_pattern(pattern, anchor=True): logger.warning('no files found matching %r', pattern) elif action == 'exclude': for pattern in patterns: found = self._exclude_pattern(pattern, anchor=True) #if not found: # logger.warning('no previously-included files ' # 'found matching %r', pattern) elif action == 'global-include': for pattern in patterns: if not self._include_pattern(pattern, anchor=False): logger.warning('no files found matching %r ' 'anywhere in distribution', pattern) elif action == 'global-exclude': for pattern in patterns: found = self._exclude_pattern(pattern, anchor=False) #if not found: # logger.warning('no previously-included files ' # 'matching %r found anywhere in ' # 'distribution', pattern) elif action == 'recursive-include': for pattern in patterns: if not self._include_pattern(pattern, prefix=thedir): logger.warning('no files found matching %r ' 'under directory %r', pattern, thedir) elif action == 'recursive-exclude': for pattern in patterns: found = self._exclude_pattern(pattern, prefix=thedir) #if not found: # logger.warning('no previously-included files ' # 'matching %r found under directory %r', # pattern, thedir) elif action == 'graft': if not self._include_pattern(None, prefix=dirpattern): logger.warning('no directories found matching %r', dirpattern) elif action == 'prune': if not self._exclude_pattern(None, prefix=dirpattern): logger.warning('no previously-included directories found ' 'matching %r', dirpattern) else: # pragma: no cover # This should never happen, as it should be caught in # _parse_template_line raise DistlibException( 'invalid action %r' % action) # # Private API # def _parse_directive(self, directive): """ Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns """ words = directive.split() if len(words) == 1 and words[0] not in ('include', 'exclude', 'global-include', 'global-exclude', 'recursive-include', 'recursive-exclude', 'graft', 'prune'): # no action given, let's use the default 'include' words.insert(0, 'include') action = words[0] patterns = thedir = dir_pattern = None if action in ('include', 'exclude', 'global-include', 'global-exclude'): if len(words) < 2: raise DistlibException( '%r expects ...' % action) patterns = [convert_path(word) for word in words[1:]] elif action in ('recursive-include', 'recursive-exclude'): if len(words) < 3: raise DistlibException( '%r expects ...' % action) thedir = convert_path(words[1]) patterns = [convert_path(word) for word in words[2:]] elif action in ('graft', 'prune'): if len(words) != 2: raise DistlibException( '%r expects a single ' % action) dir_pattern = convert_path(words[1]) else: raise DistlibException('unknown action %r' % action) return action, patterns, thedir, dir_pattern def _include_pattern(self, pattern, anchor=True, prefix=None, is_regex=False): """Select strings (presumably filenames) from 'self.files' that match 'pattern', a Unix-style wildcard (glob) pattern. Patterns are not quite the same as implemented by the 'fnmatch' module: '*' and '?' match non-special characters, where "special" is platform-dependent: slash on Unix; colon, slash, and backslash on DOS/Windows; and colon on Mac OS. If 'anchor' is true (the default), then the pattern match is more stringent: "*.py" will match "foo.py" but not "foo/bar.py". If 'anchor' is false, both of these will match. If 'prefix' is supplied, then only filenames starting with 'prefix' (itself a pattern) and ending with 'pattern', with anything in between them, will match. 'anchor' is ignored in this case. If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and 'pattern' is assumed to be either a string containing a regex or a regex object -- no translation is done, the regex is just compiled and used as-is. Selected strings will be added to self.files. Return True if files are found. """ # XXX docstring lying about what the special chars are? found = False pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex) # delayed loading of allfiles list if self.allfiles is None: self.findall() for name in self.allfiles: if pattern_re.search(name): self.files.add(name) found = True return found def _exclude_pattern(self, pattern, anchor=True, prefix=None, is_regex=False): """Remove strings (presumably filenames) from 'files' that match 'pattern'. Other parameters are the same as for 'include_pattern()', above. The list 'self.files' is modified in place. Return True if files are found. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions """ found = False pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex) for f in list(self.files): if pattern_re.search(f): self.files.remove(f) found = True return found def _translate_pattern(self, pattern, anchor=True, prefix=None, is_regex=False): """Translate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). """ if is_regex: if isinstance(pattern, str): return re.compile(pattern) else: return pattern if _PYTHON_VERSION > (3, 2): # ditch start and end characters start, _, end = self._glob_to_re('_').partition('_') if pattern: pattern_re = self._glob_to_re(pattern) if _PYTHON_VERSION > (3, 2): assert pattern_re.startswith(start) and pattern_re.endswith(end) else: pattern_re = '' base = re.escape(os.path.join(self.base, '')) if prefix is not None: # ditch end of pattern character if _PYTHON_VERSION <= (3, 2): empty_pattern = self._glob_to_re('') prefix_re = self._glob_to_re(prefix)[:-len(empty_pattern)] else: prefix_re = self._glob_to_re(prefix) assert prefix_re.startswith(start) and prefix_re.endswith(end) prefix_re = prefix_re[len(start): len(prefix_re) - len(end)] sep = os.sep if os.sep == '\\': sep = r'\\' if _PYTHON_VERSION <= (3, 2): pattern_re = '^' + base + sep.join((prefix_re, '.*' + pattern_re)) else: pattern_re = pattern_re[len(start): len(pattern_re) - len(end)] pattern_re = r'%s%s%s%s.*%s%s' % (start, base, prefix_re, sep, pattern_re, end) else: # no prefix -- respect anchor flag if anchor: if _PYTHON_VERSION <= (3, 2): pattern_re = '^' + base + pattern_re else: pattern_re = r'%s%s%s' % (start, base, pattern_re[len(start):]) return re.compile(pattern_re) def _glob_to_re(self, pattern): """Translate a shell-like glob pattern to a regular expression. Return a string containing the regex. Differs from 'fnmatch.translate()' in that '*' does not match "special characters" (which are platform-specific). """ pattern_re = fnmatch.translate(pattern) # '?' and '*' in the glob pattern become '.' and '.*' in the RE, which # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix, # and by extension they shouldn't match such "special characters" under # any OS. So change all non-escaped dots in the RE to match any # character except the special characters (currently: just os.sep). sep = os.sep if os.sep == '\\': # we're using a regex to manipulate a regex, so we need # to escape the backslash twice sep = r'\\\\' escaped = r'\1[^%s]' % sep pattern_re = re.sub(r'((?d2Z?e@ZAe"d3ZBd=d5d6ZCGd7d8d8e@ZDd9ZEd:ZFd;ZGGdzzImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, 1.3/2.1 and 2.2). )unicode_literalsN)message_from_file)DistlibException __version__)StringIO string_types text_type) interpret)extract_by_key get_extras) get_schemePEP440_VERSION_REc@seZdZdZdS)MetadataMissingErrorzA required metadata is missingN__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/metadata.pyrsrc@seZdZdZdS)MetadataConflictErrorz>Attempt to read or write metadata fields that are conflictual.Nrrrrrr src@seZdZdZdS) MetadataUnrecognizedVersionErrorz Unknown metadata version number.Nrrrrrr$src@seZdZdZdS)MetadataInvalidErrorzA metadata value is invalidNrrrrrr(srMetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONutf-81.1z \| ) Metadata-VersionNameVersionPlatformSummary DescriptionKeywords Home-pageAuthor Author-emailLicense)r r!r"r#Supported-Platformr$r%r&r'r(r)r* Classifier Download-URL ObsoletesProvidesRequires)r.r/r0r,r-)r r!r"r#r+r$r%r&r'r(r) MaintainerMaintainer-emailr*r,r-Obsoletes-Dist Project-URL Provides-Dist Requires-DistRequires-PythonRequires-External)r5r6r7r3r8r1r2r4)r r!r"r#r+r$r%r&r'r(r)r1r2r*r,r-r3r4r5r6r7r8Private-Version Obsoleted-BySetup-Requires-Dist ExtensionProvides-Extra)r9r=r:r;r<)Description-Content-Typer0r/r.)r>)Dynamic License-Filez"extra\s*==\s*("([^"]+)"|'([^']+)')cCsl|dkr tS|dkrtS|dkr$tS|dkrBttddtDS|dkrTtdn |d kr`tSt|dS) N1.0r1.2)1.32.1css|]}|tkr|VqdSN) _345_FIELDS).0frrr sz%_version2fieldlist..2.0z+Metadata 2.0 is withdrawn and not supported2.2) _241_FIELDS _314_FIELDSrFtuple _566_FIELDS ValueError _643_FIELDSr)versionrrr_version2fieldlistvs rSc CsBdd}g}|D]"\}}|gddfkr,q||qddddd d g}|D]}|tkrvd|krv|dtd ||tkrd|kr|dtd ||tkrd|kr|dtd ||tkrd|kr|dtd||tkrd |kr|dkr|d td||t krLd |krL|d td|qLt |dkrZ|dSt |dkr|td|t dd|ko||t }d|ko||t }d |ko||t}d |ko||t} t|t|t|t| dkrt d|s |s |s | s t|kr tS|r*dS|r4dS|r>d Sd S)z5Detect the best version depending on the fields used.cSs|D]}||krdSqdS)NTFr)keysmarkersmarkerrrr _has_markersz"_best_version.._has_markerUNKNOWNNrArrBrCrDrKzRemoved 1.0 due to %szRemoved 1.1 due to %szRemoved 1.2 due to %szRemoved 1.3 due to %sr%zRemoved 2.1 due to %szRemoved 2.2 due to %srrz)Out of options - unknown metadata set: %szUnknown metadata setz,You used incompatible 1.1/1.2/2.1/2.2 fields)itemsappendrLremoveloggerdebugrMrFrOrQlenr _314_MARKERS _345_MARKERS _566_MARKERS _643_MARKERSintr) fieldsrWrTkeyvalueZpossible_versionsZis_1_1Zis_1_2Zis_2_1Zis_2_2rrr _best_versions`              & rgcCsi|]}|dd|qS)-_)lowerreplace)rGnamerrr srmcCsi|]\}}||qSrr)rGattrfieldrrrrms)r6r3r5)r7)r")r#r,r.r0r/r3r5r6r8r4r+r;r=r<r@)r4)r&)r(r1r$r%z[^A-Za-z0-9.]+FcCs0|r$td|}td|dd}d||fS)zhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.rh .z%s-%s) _FILESAFEsubrk)rlrRZ for_filenamerrr_get_name_and_versions rtc@s eZdZdZd?ddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZd@ddZddZdd Zd!d"Zd#d$ZdAd%d&ZdBd'd(ZdCd)d*Zd+d,Zefd-d.ZdDd/d0ZdEd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!dS)FLegacyMetadataaoThe legacy metadata of a release. Supports versions 1.0, 1.1, 1.2, 2.0 and 1.3/2.1 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name NdefaultcCsz|||gddkrtdi|_g|_d|_||_|dk rH||n.|dk r\||n|dk rv||| dS)N'path, fileobj and mapping are exclusive) count TypeError_fieldsZrequires_filesZ _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingr|rrr__init__ s   zLegacyMetadata.__init__cCst|j|jd<dSNr )rgr{rrrrrsz#LegacyMetadata.set_metadata_versioncCs|d||fdS)Nz%s: %s )write)rrrlrfrrr _write_fieldszLegacyMetadata._write_fieldcCs ||SrE)getrrlrrr __getitem__szLegacyMetadata.__getitem__cCs |||SrE)set)rrlrfrrr __setitem__"szLegacyMetadata.__setitem__cCs8||}z |j|=Wntk r2t|YnXdSrE) _convert_namer{KeyError)rrl field_namerrr __delitem__%s   zLegacyMetadata.__delitem__cCs||jkp|||jkSrE)r{rrrrr __contains__,s zLegacyMetadata.__contains__cCs(|tkr |S|dd}t||S)Nrhri) _ALL_FIELDSrkrj _ATTR2FIELDrrrrrr0szLegacyMetadata._convert_namecCs|tks|tkrgSdS)NrX) _LISTFIELDS_ELEMENTSFIELDrrrr_default_value6szLegacyMetadata._default_valuecCs&|jdkrtd|Std|SdS)NrAr )metadata_version_LINE_PREFIX_PRE_1_2rs_LINE_PREFIX_1_2rrfrrr_remove_line_prefix;s  z"LegacyMetadata._remove_line_prefixcCs|tkr||St|dSrE)rAttributeErrorrrrr __getattr__AszLegacyMetadata.__getattr__FcCst|d|d|S)zhReturn the distribution name with version. If filesafe is true, return a filename-escaped form.r!r")rt)rZfilesaferrr get_fullnameLszLegacyMetadata.get_fullnamecCs||}|tkS)z+return True if name is a valid metadata key)rrrrrris_fieldRs zLegacyMetadata.is_fieldcCs||}|tkSrE)rrrrrris_multi_fieldWs zLegacyMetadata.is_multi_fieldcCs.tj|ddd}z||W5|XdS)z*Read the metadata values from a file path.rrencodingN)codecsopencloser~)rfilepathfprrrr}[szLegacyMetadata.readcCst|}|d|jd<tD]p}||kr(q|tkrf||}|tkrX|dk rXdd|D}|||q||}|dk r|dkr|||q|}|r|n|d|d<dS)z,Read the metadata values from a file object.zmetadata-versionr NcSsg|]}t|dqS,)rNsplitrGrfrrr psz,LegacyMetadata.read_file..rXr%)rr{rrget_all_LISTTUPLEFIELDSr get_payload)rZfileobmsgrovaluesrfbodyrrrr~cs zLegacyMetadata.read_filecCs0tj|ddd}z|||W5|XdS)z&Write the metadata fields to filepath.wrrN)rrr write_file)rr skip_unknownrrrrrszLegacyMetadata.writecCs|t|dD]}||}|r8|dgdgfkr8q|tkrV|||d|q|tkr|dkr|jdkr~|dd}n |dd}|g}|t krd d |D}|D]}||||qqd S) z0Write the PKG-INFO format data to a file object.r rXrr%rrrz |cSsg|]}d|qSrjoinrrrrrsz-LegacyMetadata.write_file..N) rrSrrrrrrrkr)r fileobjectrrorrfrrrrs$   zLegacyMetadata.write_filec svfdd}|sn@t|dr:|D]}||||q$n|D]\}}|||q>|rr|D]\}}|||q^dS)aSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. cs"|tkr|r||dSrE)rrr)rerfrrr_sets z#LegacyMetadata.update.._setrTN)hasattrrTrY)rotherkwargsrkvrrrrs     zLegacyMetadata.updatecCsh||}|tks|dkrNt|ttfsNt|trHdd|dD}qzg}n,|tkrzt|ttfszt|trv|g}ng}t t j r<|d}t |j }|tkr|dk r|D](}||ddstd |||qnb|tkr |dk r ||s.rr!N;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r%)rr isinstancelistrNrrrr\ isEnabledForloggingWARNINGr r|_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrr{)rrlrf project_namer|rrrrrsV           zLegacyMetadata.setcCs||}||jkr*|tkr&||}|S|tkr@|j|}|S|tkr|j|}|dkr^gSg}|D].}|tkr~||qf||d|dfqf|S|tkr|j|}t |t r| dS|j|S)zGet a metadata field.Nrrr) rr{_MISSINGrrrrrZrrrr)rrlrvrfresvalrrrrs.         zLegacyMetadata.getc s|gg}}dD]}||kr||q|rP|gkrPdd|}t|dD]}||krT||qT|ddkr||fSt|jfdd}t|ftjft j ffD]@\}}|D]2} | | d } | d k r|| s|d | | fqq||fS) zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are provided)r!r"zmissing required metadata: %s, )r'r(r rBcs(|D]}|ddsdSqdS)NrrFT)rr)rfrr|rrare_valid_constraintssz3LegacyMetadata.check..are_valid_constraintsNzWrong value for '%s': %s) rrZrrr r|rrrrrr) rstrictmissingwarningsrnrrrd controllerrorfrrrchecks8         zLegacyMetadata.checkcCsh|t|d}i}|D]F}|r.||jkrt|}|dkrL||||<qdd||D||<q|S)aReturn fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). This is as per https://www.python.org/dev/peps/pep-0566/#id17. r project_urlcSsg|]}d|qSrr)rGurrrrDsz)LegacyMetadata.todict..)rrSr{ _FIELD2ATTR)rZ skip_missingrddatarrerrrtodict1s zLegacyMetadata.todictcCs8|ddkr$dD]}||kr||=q|d|7<dS)Nr r)r.r0r/r6r)r requirementsrorrradd_requirementsHs  zLegacyMetadata.add_requirementscCstt|dSr)rrSrrrrrTSszLegacyMetadata.keysccs|D] }|VqdSrErT)rrerrr__iter__Vs zLegacyMetadata.__iter__csfddDS)Ncsg|] }|qSrrrGrerrrr[sz)LegacyMetadata.values..rrrrrrZszLegacyMetadata.valuescsfddDS)Ncsg|]}||fqSrrrrrrr^sz(LegacyMetadata.items..rrrrrrY]szLegacyMetadata.itemscCsd|jj|j|jfS)Nz <%s %s %s>) __class__rrlrRrrrr__repr__`s zLegacyMetadata.__repr__)NNNrv)F)F)F)N)F)F)"rrrrrrrrrrrrrrrrrrr}r~rrrrrrrrrrTrrrYrrrrrrus@      ,  ,  ruz pydist.jsonz metadata.jsonMETADATAc@seZdZdZedZedejZedejZ e Z edZ dZ deZddd d Zd Zd Zedfed fe d fe d fe d fd ZdZdIddZedZdefZdefZdefdefeeedefeeeedefddd Z[[ddZdJddZdd Ze d!d"Z!e d#d$Z"e"j#d%d$Z"dKd&d'Z$e d(d)Z%e d*d+Z&e&j#d,d+Z&d-d.Z'd/d0Z(d1d2Z)d3d4Z*d5d6d7d8d9d:d;d Z+d?d@Z,dLdCdDZ-dEdFZ.dGdHZ/dS)Mrz The metadata of a release. This implementation uses 2.1 metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. z ^\d+(\.\d+)*$z!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$z^[A-Z]([0-9A-Z-]*[0-9A-Z])?$z .{1,2047}rJz distlib (%s)r)legacy)rlrRsummaryzqname version license summary description author author_email keywords platform home_page classifiers download_urlzwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environments)rrlrRrZdynamic)_legacy_datar|Nrvc Cs0|||gddkrtdd|_d|_||_|dk rzz|||||_Wn*tk rvt||d|_|YnXnd}|rt |d}| }W5QRXn |r| }|dkr|j |j d|_ndt |ts|d}zt||_||j|Wn0tk r*tt||d|_|YnXdS)Nrwrx)rr|rbr generatorr)rr|)ryrzrrr|_validate_mappingrruvalidaterr}METADATA_VERSION GENERATORrr decodejsonloadsrPr)rrrrr|rrHrrrrs@       zMetadata.__init__)rlrRlicensekeywordsrr6r;r=r,)r-N)r N) run_requiresbuild_requires dev_requiresZ test_requires meta_requiresextrasmodules namespacesexportscommands classifiers source_urlrc CsXt|d}t|d}||kr||\}}|jr^|dkrP|dkrHdn|}n |j|}n|dkrjdn|}|dkr|j||}nt}|}|jd} | r |dkr| d|}nP|dkr| d} | r| ||}n,| d } | s|jd } | r | ||}||krT|}n:||kr2t||}n"|jrH|j|}n |j|}|S) N common_keys mapped_keysrrrrr extensionsrpython.commandsrpython.detailspython.exports)object__getattribute__rrr) rrecommonmappedlkmakerresultrfsentineldrrrrsD            zMetadata.__getattribute__cCsH||jkrD|j|\}}|p |j|krD||}|sDtd||fdS)Nz.'%s' is an invalid value for the '%s' property)SYNTAX_VALIDATORSr|matchr)rrerfr|pattern exclusionsmrrr_validate_values  zMetadata._validate_valuecCs*|||t|d}t|d}||kr||\}}|jrV|dkrJt||j|<nf|dkrj||j|<nR|jdi}|dkr||d<n2|dkr|di}|||<n|d i}|||<nh||krt|||nP|d krt|t r| }|r| }ng}|jr||j|<n ||j|<dS) Nrrr r rr rr r r) rrrrNotImplementedErrorr setdefault __setattr__rrrr)rrerfrrrrirrrrrs<               zMetadata.__setattr__cCst|j|jdSNT)rtrlrRrrrrname_and_version7szMetadata.name_and_versioncCsF|jr|jd}n|jdg}d|j|jf}||krB|||S)Nr5providesz%s (%s))rrrrlrRrZ)rrsrrrr";s  zMetadata.providescCs |jr||jd<n ||jd<dS)Nr5r")rrrrrrr"Fs c Cs|jr |}ng}t|pg|j}|D]d}d|kr>d|kr>d}n8d|krLd}n|d|k}|rv|d}|rvt||}|r$||dq$dD]F}d|} | |kr|| |jd|g}||j|||dq|S) a Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. extra environmentTrequires)builddevtestz:%s:z %s_requires)renv) rr rrr extendr[rget_requirements) rreqtsrr*rrincluderVreerrrr,Ms2      zMetadata.get_requirementscCs|jr|S|jSrE)r _from_legacyrrrrr dictionarywszMetadata.dictionarycCs|jr tnt|j|jSdSrE)rrr rDEPENDENCY_KEYSrrrr dependencies}szMetadata.dependenciescCs|jr tn |j|dSrE)rrrrrrrrr3sc Cs|d|jkrtg}|jD]"\}}||kr$||kr$||q$|rbdd|}t||D]\}}||||qjdS)NrzMissing metadata items: %sr) rrrMANDATORY_KEYSrYrZrrr) rrr|rrerrrrrrrrs zMetadata._validate_mappingcCsB|jr.|jd\}}|s|r>td||n||j|jdS)NTz#Metadata: missing: %s, warnings: %s)rrr\rrrr|)rrrrrrrszMetadata.validatecCs(|jr|jdSt|j|j}|SdSr )rrr r INDEX_KEYS)rrrrrrs zMetadata.todictc Cs|jr |jrt|j|jd}|jd}dD]*}||kr.|dkrHd}n|}||||<q.|dg}|dgkrtg}||d<d }|D]*\}}||kr||rd ||ig||<q|j|d <i}i} |S) NrT)rlrRrr description classifierr7rr&r))Z requires_distr)Zsetup_requires_distrr&r")rrAssertionErrorrrrrr") rrZlmdrnkkwrTokauthor maintainerrrrr0s.     zMetadata._from_legacyr!r"r*r$r%r'r(r)r-) rlrR)r r rrr6)r python.projectZ project_urlsZHome)r r?contactsrrl)r r?r@remailr)r r rc Csdd}|jr|jrtt}|j}|jD]v\}}t|tsV||kr||||<q.|}d}|D]4}z ||}Wqbtt fk rd}YqYqbXqb|r.|||<q.||j |j } ||j |j } |jrt|j|d<t| |d<t| |d<|S)NcSst}|D]|}|d}|d}|d}|D]V}|sF|sF||q.d}|rVd|}|rp|rld||f}n|}|d||fq.q |S)Nr$r%r&r8z extra == "%s"z (%s) and %sr)rraddr)entriesr-r/r$r*ZrlistrrVrrrprocess_entriess"   z,Metadata._to_legacy..process_entriesTFr=r6r;)rrr9ruLEGACY_MAPPINGrYrrNr IndexErrorrrrrrsorted) rrDrZnmdr:r<rfoundrr1r2rrr _to_legacys2     zMetadata._to_legacyFTc Cs||gddkrtd||r`|jr4|j}n|}|rP|j||dq|j||dn^|jrp|}n|j}|rt j ||ddddn.t |dd}t j ||ddddW5QRXdS) Nrz)Exactly one of path and fileobj is needed)rTrw) ensure_asciiindent sort_keysrr) ryrPrrrKrrr0rrdumprr)rrrrrZ legacy_mdrrHrrrrs*   zMetadata.writecCs|jr|j|nr|jdg}d}|D]}d|kr*d|kr*|}qHq*|dkrfd|i}|d|n t|dt|B}t||d<dS)Nrr%r$r&r)rrrrinsertrrG)rrralwaysentryZrsetrrrrszMetadata.add_requirementscCs*|jpd}|jpd}d|jj|j||fS)Nz (no name)z no versionz<%s %s %s (%s)>)rlrRrrr)rrlrRrrrr0s  zMetadata.__repr__)NNNrv)N)NN)NNFT)0rrrrrecompileZMETADATA_VERSION_MATCHERIZ NAME_MATCHERZFIELDNAME_MATCHERrZVERSION_MATCHERZSUMMARY_MATCHERrrrr4r5r2r __slots__rrrrZ none_listdictZ none_dictrrrrpropertyr!r"setterr,r1r3rrrr0rErKrrrrrrrrjs   -+ '    *     2 )F)Ir __future__rrrArrrrSr8rrcompatrrr rUr utilr r rRr r getLoggerrr\rrrr__all__rrrTrrrLrMr_rFr`Z _426_FIELDSZ _426_MARKERSrOrarbrQrrrZEXTRA_RErSrgrrYrrrrrrrrrrrrrtruZMETADATA_FILENAMEZWHEEL_METADATA_FILENAMEZLEGACY_METADATA_FILENAMErrrrrs~               P  jPKd]TCTC(distlib/__pycache__/index.cpython-38.pycnu[U ʗRebQ@sddlZddlZddlZddlZddlZddlZzddlmZWn ek r`ddl mZYnXddl m Z ddl m Z mZmZmZmZmZddlmZmZeeZdZdZGd d d eZdS) N)Thread)DistlibException)HTTPBasicAuthHandlerRequestHTTPPasswordMgrurlparse build_opener string_types)zip_dir ServerProxyzhttps://pypi.org/pypipypic@seZdZdZdZd*ddZddZdd Zd d Zd d Z ddZ ddZ d+ddZ d,ddZ d-ddZd.ddZddZd/ddZd0d d!Zd1d"d#Zd$d%Zd&d'Zd2d(d)ZdS)3 PackageIndexzc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc Cs|pt|_|t|j\}}}}}}|s<|s<|s<|dkrJtd|jd|_d|_d|_d|_t t j dR}dD]F} z,t j | dg||d} | dkr| |_WqWqttk rYqtXqtW5QRXdS) z Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. )httphttpszinvalid repository: %sNw)gpgZgpg2z --versionstdoutstderrr) DEFAULT_INDEXurlread_configurationrrpassword_handler ssl_verifierrgpg_homeopenosdevnull subprocess check_callOSError) selfrschemenetlocpathparamsqueryfragZsinksrcr+/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/index.py__init__$s(   zPackageIndex.__init__cCsddlm}|S)zs Get the distutils command for interacting with PyPI configurations. :return: the command. r)_get_pypirc_command)utilr.)r"cmdr+r+r,r.As z PackageIndex._get_pypirc_commandcCsNddlm}||}|d|_|d|_|dd|_|d|j|_dS) z Read the PyPI access configuration as supported by distutils. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. r) _load_pypircusernamepasswordrealmr repositoryN)r/r1getr2r3r4r)r"r1cfgr+r+r,rIs    zPackageIndex.read_configurationcCs |ddlm}||dS)z Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. r) _store_pypircN)check_credentialsr/r8)r"r8r+r+r,save_configurationVs zPackageIndex.save_configurationcCs\|jdks|jdkrtdt}t|j\}}}}}}||j||j|jt||_ dS)zp Check that ``username`` and ``password`` have been set, and raise an exception if not. Nz!username and password must be set) r2r3rrrr add_passwordr4rr)r"Zpm_r$r+r+r,r9_s zPackageIndex.check_credentialscCs\|||}d|d<||g}||}d|d<||g}||S)aq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. verify:actionsubmit)r9validatetodictencode_requestitems send_request)r"metadatadrequestresponser+r+r,registerks  zPackageIndex.registercCsF|}|sq:|d}||td||fq|dS)ar Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. utf-8z%s: %sN)readlinedecoderstripappendloggerdebugclose)r"namestreamZoutbufr)r+r+r,_readers  zPackageIndex._readerc Cs|jdddg}|dkr|j}|r.|d|g|dk rF|dddgt}tj|tj|d }|d d d |d ||gt dd|||fS)a Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. --status-fd2--no-ttyN --homedirz--batchz--passphrase-fd0z.ascz --detach-signz--armorz --local-userz--output invoking: %s ) rrextendtempfilemkdtemprr%joinbasenamerOrP)r"filenamesigner sign_passwordkeystorer0tdZsfr+r+r,get_sign_commands" zPackageIndex.get_sign_commandc Cstjtjd}|dk r tj|d<g}g}tj|f|}t|jd|j|fd}|t|jd|j|fd}||dk r|j ||j | | | |j ||fS)a Run a command in a child process , passing it any input data specified. :param cmd: The command to run. :param input_data: If specified, this must be a byte string containing data to be sent to the child process. :return: A tuple consisting of the subprocess' exit code, a list of lines read from the subprocess' ``stdout``, and a list of lines read from the subprocess' ``stderr``. rNstdinr)targetargsr)rPIPEPopenrrTrstartrrgwriterQwaitr_ returncode) r"r0Z input_datakwargsrrpt1t2r+r+r, run_commands&    zPackageIndex.run_commandc CsD|||||\}}|||d\}}} |dkr@td||S)aR Sign a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The absolute pathname of the file where the signature is stored. rJrz&sign command failed with error code %s)rfrtencoder) r"rarbrcrdr0sig_filer*rrr+r+r, sign_files  zPackageIndex.sign_filesdistsourcec Cs(|tj|s td|||}d} |rZ|jsJt dn| ||||} t |d} | } W5QRXt | } t | } |dd||| | ddtj|| fg}| rt | d} | }W5QRX|d tj| |fttj| |||}||S) a Upload a release file to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the file to be uploaded. :param filename: The pathname of the file to be uploaded. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param filetype: The type of the file being uploaded. This is the distutils command which produced that file, e.g. ``sdist`` or ``bdist_wheel``. :param pyversion: The version of Python which the release relates to. For code compatible with any Python, this would be ``source``, otherwise it would be e.g. ``3.2``. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The HTTP response received from PyPI upon submission of the request. z not found: %sNz)no signing program available - not signedrbZ file_upload1)r>Zprotocol_versionfiletype pyversion md5_digest sha256_digestcontentZ gpg_signature)r9rr%existsrr@rArrOwarningrwrreadhashlibmd5 hexdigestsha256updater`rNshutilrmtreedirnamerBrCrD)r"rErarbrcr|r}rdrFrvfZ file_datar~rfilesZsig_datarGr+r+r, upload_filesD      zPackageIndex.upload_filec Cs|tj|s td|tj|d}tj|sFtd|||j|j }}t | }dd|fd|fg}d||fg}| ||} | | S)a2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. znot a directory: %rz index.htmlz not found: %r)r>Z doc_uploadrRversionr)r9rr%isdirrr_rr@rRrr getvaluerBrD) r"rEZdoc_dirfnrRrzip_datafieldsrrGr+r+r,upload_documentation s        z!PackageIndex.upload_documentationcCsT|jdddg}|dkr|j}|r.|d|g|d||gtdd||S) a| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. rUrVrWNrXz--verifyrZr[)rrr\rOrPr_)r"signature_filename data_filenamerdr0r+r+r,get_verify_command<szPackageIndex.get_verify_commandcCsH|jstd||||}||\}}}|dkr@td||dkS)a6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. z0verification unavailable because gpg unavailable)rrz(verify command failed with error code %sr)rrrrt)r"rrrdr0r*rrr+r+r,verify_signatureTszPackageIndex.verify_signaturec Csl|dkrd}tdn6t|ttfr0|\}}nd}tt|}td|t|d}|t |}z| } d} d} d} d} d | krt | d } |r|| | | | | }|sq| t|7} |||r||| d 7} |r|| | | qW5| XW5QRX| dkr0| | kr0td | | f|rh|}||kr\td ||||ftd|dS)a This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. NzNo digest specifiedrzDigest specified: %swbi rzcontent-lengthzContent-Lengthrz1retrieval incomplete: got only %d out of %d bytesz.%s digest mismatch for %s: expected %s, got %szDigest verified: %s)rOrP isinstancelisttuplegetattrrrrDrrQinfointrlenrmrrr)r"rdestfiledigest reporthookZdigesterZhasherZdfpZsfpheaders blocksizesizerblocknumblockactualr+r+r, download_filems^           zPackageIndex.download_filecCs:g}|jr||j|jr(||jt|}||S)z Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). )rrNrr r)r"reqhandlersopenerr+r+r,rDs  zPackageIndex.send_requestc Csg}|j}|D]L\}}t|ttfs*|g}|D]*}|d|d|dd|dfq.q|D].\}} } |d|d|| fdd| fq`|d|ddfd|} d|} | tt| d} t |j | | S) a& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--z)Content-Disposition: form-data; name="%s"rJz8Content-Disposition: form-data; name="%s"; filename="%s"s smultipart/form-data; boundary=)z Content-typezContent-length) boundaryrrrr\rur_strrrr)r"rrpartsrkvaluesvkeyravaluebodyctrr+r+r,rBsD     zPackageIndex.encode_requestcCsFt|trd|i}t|jdd}z|||p.dWS|dXdS)NrRg@)timeoutrQand)rr r rsearch)r"ZtermsoperatorZ rpc_proxyr+r+r,rs  zPackageIndex.search)N)N)N)N)NNrxryN)N)N)NN)N)__name__ __module__ __qualname____doc__rr-r.rr:r9rIrTrfrtrwrrrrrrDrBrr+r+r+r,rs4      #  9   M+r)rloggingrrrr] threadingr ImportErrorZdummy_threadingrcompatrrrrr r r/r r getLoggerrrOr DEFAULT_REALMobjectrr+r+r+r,s    PKd]h+k+k(distlib/__pycache__/wheel.cpython-38.pycnu[U ʗRez@sddlmZddlZddlZddlZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlmZmZmZm Z dd l!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd l,m-Z-m.Z.e /e0Z1da2e3ed r0d Z4n*ej56d rDdZ4nej5dkrVdZ4ndZ4e7dZ8e8s|dej9ddZ8de8Z:e4e8Z;e+e>re>6dre>nddZ@e@Z>[@e Ade jBe jCBZDe Ade jBe jCBZEe AdZFe Ad ZGd!ZHd"ZIe jJd#kr@d$d%ZKnd&d%ZKej9dd'krbddlLZLndZLddlMZNddlOZNd(d)ZPd*d+ZQGd,d-d-eRZSeSZTGd.d/d/eRZUd0d1ZVd2d3ZWeWZX[Wd6d4d5ZYdS)7)unicode_literalsN)message_from_file) __version__DistlibException) sysconfigZipFilefsdecode text_typefilter)InstalledDistribution)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME) FileOperator convert_path CSVReader CSVWriterCachecached_propertyget_cache_base read_exportstempdir get_platform)NormalizedVersionUnsupportedVersionErrorpypy_version_infoppjavajycliipcppy_version_nodotz%s%spy-_.SOABIzcpython-cCsdtg}tdr|dtdkrtjdd}|dkrtd}|dkrPd}|r^|d|d krtd }|d ks|dkrtjd kr|d d|S)Nr#Py_DEBUGdr%) WITH_PYMALLOCTm)r-r-Py_UNICODE_SIZEiu) VER_SUFFIXrget_config_varappend IMP_PREFIXsys version_info maxunicodejoin)partsviZwpmusr@/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/wheel.py _derive_abi;s       rBzz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ z7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonw/cCs|SNr@or@r@rAerGcCs|tjdS)NrC)replaceosseprEr@r@rArGgrHr-cCs"trddtDStjjSdS)NcSsg|] }|dqS)rr@.0sr@r@rA rsz!_get_suffixes..)impZ get_suffixes importlib machineryEXTENSION_SUFFIXESr@r@r@rA _get_suffixespsrTcCsHtrt||Stj||}tj|}|tj|<|j ||SdSrD) rPZ load_dynamicrQutilspec_from_file_locationmodule_from_specr9modulesloader exec_module)namepathspecmoduler@r@rA _load_dynamicvs    r_c@s6eZdZddZddZddZd dd Zd d ZdS) MountercCsi|_i|_dSrD) impure_wheelslibsselfr@r@rA__init__szMounter.__init__cCs||j|<|j|dSrD)rarbupdate)rdpathname extensionsr@r@rAadds z Mounter.addcCs0|j|}|D]\}}||jkr|j|=qdSrD)rapoprb)rdrgrhkvr@r@rAremoves   zMounter.removeNcCs||jkr|}nd}|SrD)rb)rdfullnamer\resultr@r@rA find_modules zMounter.find_modulecCsh|tjkrtj|}nN||jkr,td|t||j|}||_|dd}t|dkrd|d|_|S)Nzunable to find extension for %sr)rr) r9rXrb ImportErrorr_ __loader__rsplitlen __package__)rdrnror=r@r@rA load_modules       zMounter.load_module)N)__name__ __module__ __qualname__rerirmrprvr@r@r@rAr`s  r`c@seZdZdZdZdZd4ddZedd Zed d Z ed d Z e ddZ ddZ e ddZddZd5ddZddZddZddZd6ddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd7d,d-Zd.d/Zd0d1Zd8d2d3ZdS)9Wheelz@ Class to build and install from Wheel files (PEP 427). )rrsha256NFcCs8||_||_d|_tg|_dg|_dg|_t|_ |dkrRd|_ d|_ |j |_ nt|}|r|d}|d|_ |dd d |_ |d |_|j |_ ntj|\}}t|}|std ||rtj||_ ||_ |d}|d|_ |d|_ |d |_|d d|_|dd|_|dd|_dS)zB Initialise an instance using a (valid) filename. r4noneanyNdummyz0.1nmZvnr(r'ZbnzInvalid name or filename: %rr&r)Zbiar)signZ should_verifybuildverPYVERpyverabiarchrJgetcwddirnamer[versionfilename _filenameNAME_VERSION_REmatch groupdictrIr\split FILENAME_RErabspath)rdrrverifyr0inforr@r@rAresD            zWheel.__init__cCs^|jrd|j}nd}d|j}d|j}d|j}|jdd}d|j|||||fS)zJ Build and return a filename from the various components. r'r4r)r(z%s-%s%s-%s-%s-%s.whl)rr<rrrrrIr[)rdrrrrrr@r@rArs     zWheel.filenamecCstj|j|j}tj|SrD)rJr\r<rrisfile)rdr\r@r@rAexistssz Wheel.existsccs4|jD](}|jD]}|jD]}|||fVqqqdSrD)rrr)rdrrrr@r@rAtagss   z Wheel.tagsc Cstj|j|j}d|j|jf}d|}td}t |d}| |}|d dd}t dd |D}t tg} d} | D]f} zLt|| } || ,} || }t|d } | rW5QRWqW5QRXWq|tk rYq|Xq|| std d | W5QRX| S) N%s-%s %s.dist-infoutf-8r Wheel-Versionr)rcSsg|] }t|qSr@intrMir@r@rArOsz"Wheel.metadata..)fileobjz8Invalid wheel, because metadata is missing: looked in %sz, )rJr\r<rrr[rcodecs getreaderrget_wheel_metadatartuplerr posixpathopenr KeyError ValueError)rdrgname_verinfo_dirwrapperzfwheel_metadatawv file_versionfnsrofnmetadata_filenamebfwfr@r@rAmetadatas2      zWheel.metadatac CsXd|j|jf}d|}t|d}||}td|}t|}W5QRXt|S)NrrWHEELr) r[rrr<rrrrdict)rdrrrrrrmessager@r@rArs  zWheel.get_wheel_metadatac Cs6tj|j|j}t|d}||}W5QRX|S)Nr)rJr\r<rrrr)rdrgrror@r@rArs z Wheel.infoc Cst|}|r||}|d|||d}}d|krBt}nt}t|}|rfd|d}nd}||}||}nT|d}|d} |dks|| krd} n|||dd krd } nd} t| |}|S) Nspythonw rH  rr%s ) SHEBANG_RErendlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind) rddatar0rshebangZdata_after_shebangZshebang_pythonargscrlftermr@r@rAprocess_shebang%s,       zWheel.process_shebangcCsh|dkr|j}ztt|}Wn tk r<td|YnX||}t|d d}||fS)NzUnsupported hash algorithm: %r=ascii) hash_kindgetattrhashlibAttributeErrorrdigestbase64urlsafe_b64encoderstripdecode)rdrrhasherror@r@rAget_hashCs zWheel.get_hashc CsDt|}||ddft|}|D]}||q&W5QRXdS)Nr4)listr7rwriterow)rdrecords record_pathZarchive_record_pathwriterrowr@r@rA write_recordNs  zWheel.write_recordc Csg}|\}}tt|j}|D]P\}} t| d} | } W5QRXd|| } tj| } | || | fqtj |d} t tj |d}| || || || fdS)Nrbz%s=%sRECORD) rrrrreadrrJr\getsizer7r<to_posixr)rdrlibdir archive_pathsrdistinforrappfrrsizer@r@rA write_recordsUs    zWheel.write_recordsc CsFt|dtj.}|D]"\}}td|||||qW5QRXdS)NwzWrote %s to %s in wheel)rzipfile ZIP_DEFLATEDloggerdebugwrite)rdrgrrrrr@r@rA build_zipes zWheel.build_zipc" s|dkr i}ttfdddd}|dkrFd}tg}tg}tg}nd}tg}d g}d g}|d ||_|d ||_|d ||_ |} d|j |j f} d| } d| } g} dD]}|krq|}t j |rt |D]\}}}|D]}tt j ||}t j ||}tt j | ||}| ||f|dkr|dst|d}|}W5QRX||}t|d}||W5QRXqqq| }d}t |D]\}}}||kr t|D]8\}}t|}|drt j ||}||=qq|s td|D]H}t|dr(qt j ||}tt j ||}| ||fqqt |}|D]B}|dkrltt j ||}tt j | |}| ||fqld|p|jdtd|g}|jD] \}}}|d|||fqt j |d}t|d}|d |W5QRXtt j | d}| ||fd!d"} t | | d#} |!|| f| | t j |j"|j#}!|$|!| |!S)$z Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. Ncs|kSrDr@rEpathsr@rArGsrHzWheel.build..)purelibplatlibrrfalsetruer|r}rrrr%s.datar)rheadersscriptsr.exerwb .dist-infoz(.dist-info directory expected, not found)z.pycz.pyo)r INSTALLERZSHAREDrzWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %sz Tag: %s-%s-%srr cSs*|d}|d}d|kr"|d7}||fS)NrrCri')count)trnr@r@rAsorters  zWheel.build..sorter)key)%rr IMPVERABIARCHrgetrrrr[rrJr\isdirwalkr r<relpathrr7endswithrrrr enumerateAssertionErrorlistdir wheel_versionrrsortedrrrr)"rdrrrZlibkeyis_pureZ default_pyverZ default_abiZ default_archrrdata_dirrrrr\rootdirsfilesrrrprrrrrdnrrrrrrgr@rrAbuildks            z Wheel.buildcCs |dS)zl Determine whether an archive entry should be skipped when verifying or installing. )rCz /RECORD.jws)r)rdarcnamer@r@rA skip_entryszWheel.skip_entrycC Ks|j}|d}|dd}|dd}tj|j|j}d|j|jf} d| } d| } t | t } t | d} t | d }t d }t |d }|| }||}t|}W5QRX|d d d}tdd|D}||jkr|r||j||ddkr|d}n|d}i}||8}t|d"}|D]}|d}|||<q8W5QRXW5QRXt | d}t | d}t | dd}t|d}d|_tj } g}!t}"|"|_d|_zz|D]}#|#j}$t|$t r|$}%n |$!d }%|"|%rq||%}|dr4t#|#j$|dkr4t%d|%|dr|ddd\}&}'||$}|&}(W5QRX|'|(|&\})}*|*|'krt%d|$|r|%(||frt)*d |%q|%(|o|%+d! }+|%(|r |%d"d\})},}-tj||,t,|-}.n$|%| |fkrqtj|t,|%}.|+s,||$}|-||.W5QRXtjd#krxt.|.|#j/d$?d%@|!0|.|s|drt|.d&4}|&}(|'|(|&\})}/|/|*krt%d'|.W5QRX| r|.+d(rz|j1|.|d)}0|!0|0Wn$t2k r(t)j3d*dd+YnXnttj4t,|$}1tj|"|1}2||$}|-||2W5QRXtj|.\}3}1|3|_|5|1}4|6|4|!7|4q|rt)*d,d}5ntd}6|j8d }|d-krt | d.}7z||7}t9|}8W5QRXi}6d/D]r}9d0|9}:|:|8kri|6d1|9<};|8|::D]<}?|d6}6|6r|6d7}6W5QRXWn t2k rt)3d8YnX|6r|6d9i}>|6d:i}?|>s0|?r|dd}@tj@|@sRtAd;|@|_|>BD]*\}:}<|5E||}|r|!0||5F|!|d?||5WW.zRoot-Is-Purelibrrrstreamrr4r)dry_runTNr%size mismatch for %s=digest mismatch for %szlib_only: skipping %srrCposixirzdigest mismatch on write for %sz.py)hashed_invalidationzByte-compilation failed)exc_infozlib_only: returning Nonez1.0zentry_points.txt)consoleguiz %s_scriptszwrap_%sz%s:%sz [%s],zAUnable to read legacy script metadata, so cannot generate scriptsrhzpython.commandsz8Unable to read JSON metadata, so cannot generate scriptsZ wrap_consoleZwrap_guizValid script path not specifiedz%s = %sr+libprefixzinstallation failed.)Ir"r rJr\r<rrr[rrrrrrrrrrrrrrecordr9dont_write_bytecodetempfilemkdtemp source_dir target_dirshutilrmtreeinfolist isinstancer rrstr file_sizerrr startswithrrrr copy_streamchmod external_attrr7 byte_compile Exceptionwarningbasenamemakeset_executable_modeextendrrvaluesr.suffixflagsjsonloadr ritemsr rZwrite_shared_locationsZwrite_installed_files exceptionrollback)Crdrmakerkwargsr"rrZbc_hashed_invalidationrgrrr metadata_namewheel_metadata_name record_namerrbwfrrrrrrrreaderrrZdata_pfxZinfo_pfxZ script_pfxfileopbcZoutfilesworkdirzinfor u_arcnamekindvaluerr(rZ is_scriptwhereroutfileZ newdigestZpycrZworknamer filenamesdistcommandsepZepdatarrkr,rlrNconsole_scripts gui_scriptsZ script_dirscriptoptionsr@r@rAinstallsX                                                      z Wheel.installcCs8tdkr4tjttddtjdd}t|atS)Nz dylib-cachez%s.%sr%) cacherJr\r<rr9r9r:r)rdbaser@r@rA_get_dylib_caches zWheel._get_dylib_cachec Cshtj|j|j}d|j|jf}d|}t|d}t d}g}t |d}z| |}||} t | } |} | |} tj| j| } tj| st| | D]\}}tj| t|}tj|sd}n6t|j}tj|}||}tj|j}||k}|r&||| |||fqW5QRXWntk rXYnXW5QRX|S)NrrZ EXTENSIONSrrT)rJr\r<rrr[rrrrrrrIrJri prefix_to_dirrhr makedirsrKrrstatst_mtimedatetime fromtimestampgetinfo date_timeextractr7r)rdrgrrrrrorrrrhrgr.Z cache_baser[r destrrZ file_timerZ wheel_timer@r@rA_get_extensionss>             zWheel._get_extensionscCst|S)zM Determine if a wheel is compatible with the running system. ) is_compatiblercr@r@rAruszWheel.is_compatiblecCsdS)zP Determine if a wheel is asserted as mountable by its metadata. Tr@rcr@r@rA is_mountable szWheel.is_mountablecCstjtj|j|j}|s2d|}t||sJd|}t||t jkrbt d|nN|rtt j |nt j d||}|rtt jkrt j tt||dS)Nz)Wheel %s not compatible with this Python.z$Wheel %s is marked as not mountable.z%s already in pathr)rJr\rr<rrrurrvr9rrr7insertrt_hook meta_pathri)rdr7rgmsgrhr@r@rAmounts"   z Wheel.mountcCsrtjtj|j|j}|tjkr2td|n.r rrC..invalid entry in wheel: %rr%r#r$r%)rJr\r<rrr[rrrrrrrrrrrr7r8r rrrr9r:rr)rdrgrrrrPrQrRrrrSrrrrrrrTrrrXrrYrZr[rr(rr@r@rAr4s\                z Wheel.verifyc Ksdd}dd}tj|j|j}d|j|jf}d|}t|d} t} t |d|} i} | D]h} | j}t |t r|}n | d }|| krqhd |krtd || | | tj| t|}|| |<qhW5QRX|| |\}}|| f|}|r|| |\}}|r$||kr$||||d krNtjd d| d\}}t|n*tj|shtd|tj||j}t| }tj| |}||f}||| |||||d krt||W5QRX|S)a Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. cSsHd}}d|tf}||kr$d|}||kr@||}t|dj}||fS)Nz%s/%sz %s/PKG-INFOr\)rr r)path_maprrr\rr@r@rA get_version}s  z!Wheel.update..get_versioncSsd}z|t|}|d}|dkr*d|}nTdd||dddD}|dd7<d |d|dd d |Df}Wn tk rtd |YnX|rt|d }||_| t }|j ||dtd||dS)Nr'rz%s+1cSsg|] }t|qSr@rrLr@r@rArOsz8Wheel.update..update_version..rr)rz%s+%scss|]}t|VqdSrD)r9rr@r@rA sz7Wheel.update..update_version..z0Cannot update non-compliant (PEP-440) version %rr)r\legacyzVersion updated from %r to %r) rrrr<rrrr rrrr)rr\updatedrlrr=mdrr@r@rAupdate_versions.        z$Wheel.update..update_versionrrrrrr}r~Nz.whlz wheel-update-)rGr.dirzNot a directory: %r)rJr\r<rrr[rrrrr7r8r rrrrrr1mkstempcloser rrKrrr5copyfile)rdmodifierdest_dirrOrrrgrrrRrWrrrXrrYr\Zoriginal_versionr(modifiedcurrent_versionfdnewpathrrrr@r@rArfls\                 z Wheel.update)NFF)N)NN)F)N)rwrxry__doc__rrrepropertyrrrrrrrrrrrrrrrfrirtrurvr{r|rrfr@r@r@rArzs@ )        tn "  8rzcCsZddl}|}g}|ddkrV|ddD]}||rFt|ndq.t|}|S)Nrglibcrr))platformlibc_verrr7isdigitrr)rverrorNr@r@rA_get_glibc_versions rc Cs`tg}td}ttjddddD]}|d|t|gq$g}tD]$}|drL|| dddqL| t dkr| dt |dg}t g}tjd krtd t }|r|\}}}} t|}| g} | d kr| d | d kr| d| dkr| d| dkr,| d| dkr@| d|dkr| D]*} d|||| f} | t krN|| qN|d8}q@|D]} |D]} |dt|df| | f| dkrtjdr| dd} t}t|dkr|dkr|dt|df| d| f|dkrH|dt|df| d| f|dkrt|dt|df| d| f|dt|df| d|d|d| ffqqt|D]L\}}|dt|fddf|dkr|dt|dfddfqt|D]L\}}|dd |fddf|dkr |dd |dfddfq t|S)!zG Return (pyver, abi, arch) tuples compatible with this Python. rrrr4z.abir)r%r|darwinz(\w+)_(\d+)_(\d+)_(\w+)$)i386ppcfat)rrx86_64Zfat3)ppc64rfat64)rrintel)rrrrr universalz %s_%s_%s_%slinuxZlinux_)r%z manylinux1_%s)r% zmanylinux2010_%s)r%zmanylinux2014_%szmanylinux_%s_%s_%sr}r&)r5ranger9r:r7r<r9rTr;rsortrrwr rrerrrr8rIrrtrset)versionsmajorminorabisrGroarchesr0r[rmatchesrrNrr=rrr@r@rAcompatible_tagss                         " "rcCs\t|tst|}d}|dkr"t}|D]0\}}}||jkr&||jkr&||jkr&d}qXq&|S)NFT)r8rzCOMPATIBLE_TAGSrrr)wheelrrorrrr@r@rAru0s ru)N)Z __future__rrrrnemailrrrIloggingrJrrr5r9r1rr4rrcompatrrr r r Zdatabaser rr rrrrUrrrrrrrrrrrrr getLoggerrwrrghasattrr8rr;r6r5r:rrrIr rrrBcompile IGNORECASEVERBOSErrrrrrrKrrPimportlib.machineryrQimportlib.utilrTr_objectr`rxrzrrrrur@r@r@rAs   0              #0 PPKd]~Rǻǻ-distlib/__pycache__/util.cpython-38.opt-1.pycnu[U .e@sddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZz ddlZWnek rdZYnXddlZddlZddlZddlZddlZz ddlZWnek rddlZYnXddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e 1e2Z3e 4dZ5e 4dZ6e 4d Z7e 4d Z8e 4d Z9e 4d Z:e 4d Z;e 4dZddZ?ddZ@ddZAdddZBddZCddZDdd ZEejFd!d"ZGejFd#d$ZHejFdd&d'ZIGd(d)d)eJZKd*d+ZLGd,d-d-eJZMd.d/ZNGd0d1d1eJZOe 4d2e jPZQd3d4ZRdd5d6ZSd7d8ZTd9d:ZUd;d<ZVd=d>ZWd?d@ZXe 4dAe jYZZe 4dBZ[ddCdDZ\e 4dEZ]dFdGZ^dHdIZ_dJdKZ`dLZadMdNZbdOdPZcGdQdRdReJZdGdSdTdTeJZeGdUdVdVeJZfdWZgddYdZZhd[d\Zid]ZjGd^d_d_eJZke 4d`Zle 4daZme 4dbZndcddZdedfZoerddglmpZqmrZrmsZsGdhdidie$jtZtGdjdkdkeqZpGdldmdmepe'ZuejvddnZwewdokrGdpdqdqe$jxZxerGdrdsdse$jyZyGdtdudue%jzZzerBGdvdwdwe%j{Z{Gdxdydye%j|Z|dzd{Z}Gd|d}d}eJZ~Gd~dde~ZGddde~ZGddde(ZGdddeJZddZdS)N)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib splittype HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquoteurlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z ^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)cs6ddfddfddfdd|S) ae Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). cSs.t|}|r,|d}||d}n|s:tdn|d}|dkrVtd|d|d}|dd}|g}|r|d|krqqt|d|kr|||dd}qtt|}|std|||d||d}qtd|}td|||d|}|dd }||fS) Nrzunexpected end of inputz'"zinvalid expression: %srzerror in string literal: %szunterminated string: %s) IDENTIFIERmatchgroupsend SyntaxErrorreplaceappend STRING_CHUNKjoinlstrip) remainingmresultqZoqpartssr,.marker_varcs|rR|ddkrR|dd\}}|ddkr@td||dd}nZ|\}}|rt|}|srq|d}||d}|\}}|||d}q^|}||fS)Nr(r)unterminated parenthesis: %soplhsrhs)r%r MARKER_OPrrr)r&r(r4r'r3r5)markerr.r,r- marker_expres       z!parse_marker..marker_exprcsR|\}}|rJt|}|s qJ||d}|\}}d||d}q ||fS)Nandr2)ANDrrr&r4r'r5)r8r,r- marker_andxs   z parse_marker..marker_andcsR|\}}|rJt|}|s qJ||d}|\}}d||d}q ||fS)Norr2)ORrrr;)r<r,r-r7s   zparse_marker..markerr,)Z marker_stringr,)r7r<r8r.r- parse_marker8s $ r?cCs0|}|r|drdSt|}|s4td||d}||d}d}}}}|r:|ddkr:|dd}|dkrtd||d|} ||dd}g}| r0t| }|std | | |d| |d} | sq0| dd krtd | | dd} q|s:d}|r|dd kr|dd}t |}|sztd ||d}t |} | j r| j std|||d}ndd} |ddkr| |\}}n|dd}|dkrtd||d|} ||dd}t| r@| | \}} nXt| }|s\td| |d} | |d} | rtd| d| fg}|r|ddkrtd||dd}t|\}}|r|ddkrtd||s|}nd|ddd|Df}t||||||dS)z Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. #Nzname expected: %sr[]rzunterminated extra: %szmalformed extra: %s,zcomma expected in extras: %s@zinvalid URI: %szInvalid URL: %scSst|}d}|rg}|d}||d}t|}|sLtd||d}|||f||d}|r|ddkrq|dd}t|}|std|q|sd}||fS)z| Return a list of operator, version tuples if any are specified, else None. Nrzinvalid version: %srCrinvalid constraint: %s) COMPARE_OPrrrVERSION_IDENTIFIERr r"r%)Z ver_remainingr'versionsr3vr,r,r- get_versionss*      z'parse_requirement..get_versionsr/r0r1rEz~=;zinvalid requirement: %szunexpected trailing data: %s%s %s, cSsg|] }d|qS)rLr,).0Zconr,r,r- sz%parse_requirement..)nameextrasZ constraintsr7urlZ requirement)strip startswithrrr rrfindr%r" NON_SPACErschemenetlocrFrGr?r$r)reqr&r'ZdistnamerQZ mark_exprrHuriir+trJ_rIZrsr,r,r-parse_requirements                          r^cCsdd}i}|D]\}}}tj||}t|D]p}tj||} t| D]T} ||| } |dkrn|| dqJ||| } |tjjdd} | d| || <qJq0q|S)z%Find destinations for resources filescSs6|tjjd}|tjjd}|t|ddSN/)r!ospathseplenr%)rootrbr,r,r- get_rel_path sz)get_resources_dests..get_rel_pathNr`)rarbr$rpopr!rcrstrip)Zresources_rootZrulesrfZ destinationsbasesuffixdestprefixZabs_baseZabs_globZabs_pathZ resource_fileZrel_pathZrel_destr,r,r-get_resources_dests s    rmcCs(ttdrd}ntjttdtjk}|S)NZ real_prefixT base_prefix)hasattrsysrlgetattrr(r,r,r-in_venv$s rscCs$tjtj}t|ts t|}|SN)rarbnormcaserp executable isinstancerrrrr,r,r-get_executable.s  rxcCsN|}t|}|}|s|r|}|r|d}||kr6qJ|rd|||f}q|S)Nrz %c: %s %s)r lower)promptZ allowed_charsZ error_promptdefaultpr+cr,r,r-proceed>s r~cCs8t|tr|}i}|D]}||kr||||<q|Srt)rwrsplit)dkeysr(keyr,r,r-extract_by_keyNs rcCs`tjddkrtd|}|}t|}z`t|}|ddd}|D]6\}}|D]$\}}d||f}t |} | ||<q`qP|WSt k r| ddYnXdd } t } z| | |Wn<t jk r|t|}t|}| | |YnXi}| D]D} i|| <}| | D]&\} }d| |f}t |} | || <q0q|S) Nrutf-8 extensionszpython.exportsexportsz%s = %scSs$t|dr||n ||dS)N read_file)rorZreadfp)cpstreamr,r,r- read_streamks  z!read_exports..read_stream)rp version_infocodecs getreaderreadr jsonloaditemsget_export_entry Exceptionseekr ConfigParserZMissingSectionHeaderErrorclosetextwrapdedentZsections)rdataZjdatar(groupentrieskrIr+entryrrrrPvaluer,r,r- read_exportsWs@       rcCstjddkrtd|}t}|D]l\}}|||D]P}|j dkr\|j }nd|j |j f}|j rd|d |j f}| ||j|qFq,||dS)Nrrrz%s:%sz%s [%s]rM)rprr getwriterrrrZ add_sectionvaluesrjrlflagsr$setrPwrite)rrrrrIrr+r,r,r- write_exportss   rc cs$t}z |VW5t|XdSrt)tempfilemkdtemprrmtree)Ztdr,r,r-tempdirs rc cs.t}zt|dVW5t|XdSrt)ragetcwdchdir)rcwdr,r,r-rs   rc cs.t}zt|dVW5t|XdSrt)socketZgetdefaulttimeoutZsetdefaulttimeout)ZsecondsZctor,r,r-socket_timeouts   rc@seZdZddZdddZdS)cached_propertycCs ||_dSrt)func)selfrr,r,r-__init__szcached_property.__init__NcCs,|dkr |S||}t||jj||Srt)robject __setattr____name__)robjclsrr,r,r-__get__s  zcached_property.__get__)N)r __module__ __qualname__rrr,r,r,r-rsrcCs~tjdkr|S|s|S|ddkr.td||ddkrFtd||d}tj|krh|tjqP|srtjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises ValueError on non-Unix-ish systems if 'pathname' either starts or ends with a slash. r`rzpath '%s' cannot be absolutezpath '%s' cannot end with '/')rarc ValueErrorrcurdirremoverbr$)pathnamepathsr,r,r- convert_paths       rc@seZdZd$ddZddZddZdd Zd%d d Zd&ddZddZ ddZ ddZ ddZ ddZ d'ddZddZddZd d!Zd"d#Zd S)( FileOperatorFcCs||_t|_|dSrt)dry_runrensured _init_record)rrr,r,r-rszFileOperator.__init__cCsd|_t|_t|_dSNF)recordr files_written dirs_createdrr,r,r-rszFileOperator._init_recordcCs|jr|j|dSrt)rradd)rrbr,r,r-record_as_writtenszFileOperator.record_as_writtencCsHtj|s tdtj|tj|s0dSt|jt|jkS)aTell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". zfile '%r' does not existT)rarbexistsrabspathstatst_mtime)rsourcetargetr,r,r-newers   zFileOperator.newerTcCs|tj|td|||jsd}|rdtj|rDd|}n tj|rdtj |sdd|}|rtt |dt ||| |dS)z8Copy a file respecting dry-run and force flags. zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten) ensure_dirrarbdirnameloggerinforislinkrisfilerrZcopyfiler)rZinfileoutfilecheckmsgr,r,r- copy_files    zFileOperator.copy_fileNcCst|tj|td|||jsf|dkr:t|d}ntj|d|d}zt ||W5| X| |dS)NzCopying stream %s to %swbwencoding) rrarbrrrropenrrrZ copyfileobjr)rZinstreamrrZ outstreamr,r,r- copy_streams  zFileOperator.copy_streamc Cs\|tj||jsNtj|r.t|t|d}||W5QRX| |dS)Nr) rrarbrrrrrrr)rrbrfr,r,r-write_binary_file!s   zFileOperator.write_binary_filecCs||||dSrt)rencode)rrbrrr,r,r-write_text_file*szFileOperator.write_text_filecCsntjdkstjdkrjtjdkrj|D]F}|jr:td|q"t|j|B|@}td||t||q"dS)Nposixjavazchanging mode of %szchanging mode of %s to %o) rarP_namerrrrst_modechmod)rbitsmaskfilesrmoder,r,r-set_mode-szFileOperator.set_modecCs|dd|S)Nimi)r)r+rr,r,r-9zFileOperator.cCs|tj|}||jkrxtj|sx|j|tj|\}}||t d||j sft ||j rx|j |dS)Nz Creating %s)rarbrrrrrrrrrmkdirrr)rrbrrr,r,r-r;s    zFileOperator.ensure_dirc Cst|| }td|||js||s0|||rJ|s:d}n|t|d}i}|rhttdrhtjj |d<tj |||df|| ||S)NzByte-compiling %s to %sPycInvalidationModeinvalidation_modeT) r rrrrrdro py_compiler CHECKED_HASHcompiler) rrboptimizeforcerlZhashed_invalidationZdpathZdiagpathZcompile_kwargsr,r,r- byte_compileGs   zFileOperator.byte_compilecCstj|rtj|r^tj|s^td||js@t ||j r||j kr|j |nPtj|rpd}nd}td|||jst ||j r||j kr|j |dS)NzRemoving directory tree at %slinkfilezRemoving %s %s)rarbrisdirrrdebugrrrrrrr)rrbr+r,r,r-ensure_removedXs"       zFileOperator.ensure_removedcCsDd}|s@tj|r$t|tj}q@tj|}||kr:q@|}q|Sr)rarbraccessW_OKr)rrbr(parentr,r,r- is_writablems  zFileOperator.is_writablecCs|j|jf}||S)zV Commit recorded changes, turn off recording, return changes. )rrr)rr(r,r,r-commitys zFileOperator.commitcCs|jsxt|jD]}tj|rt|qt|jdd}|D]8}t |}|rltj ||d}t |t |q>| dS)NT)reverser) rlistrrarbrrsortedrlistdirr$rmdirr)rrdirsrflistZsdr,r,r-rollbacks     zFileOperator.rollback)F)T)N)FFNF)rrrrrrrrrrrrZset_executable_moderrrrrrr,r,r,r-rs         rcCs^|tjkrtj|}nt|}|dkr,|}n.|d}t||d}|D]}t||}qJ|S)N.r)rpmodules __import__rrqrg)Z module_nameZ dotted_pathmodr(r*r|r,r,r-resolves    rc@s6eZdZddZeddZddZddZej Z d S) ExportEntrycCs||_||_||_||_dSrtrPrlrjr)rrPrlrjrr,r,r-rszExportEntry.__init__cCst|j|jSrt)rrlrjrr,r,r-rszExportEntry.valuecCsd|j|j|j|jfS)Nzrrr,r,r-__repr__s zExportEntry.__repr__cCsDt|tsd}n0|j|jko>|j|jko>|j|jko>|j|jk}|Sr)rwrrPrlrjr)rotherr(r,r,r-__eq__s     zExportEntry.__eq__N) rrrrrrrrr__hash__r,r,r,r-rs   rz(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P\w+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c Cst|}|s0d}d|ks"d|krtd|n|}|d}|d}|d}|dkrf|d}}n"|dkrztd||d\}}|d } | dkrd|ksd|krtd|g} nd d | d D} t|||| }|S) NrArBzInvalid specification '%s'rPcallable:rrrcSsg|] }|qSr,)rS)rNrr,r,r-rOsz$get_export_entry..rC)ENTRY_REsearchr groupdictcountrr) Z specificationr'r(rrPrbZcolonsrlrjrr,r,r-rs8   rcCs|dkr d}tjdkr.dtjkr.tjd}n tjd}tj|rft|tj}|st d|n|dd\}}d|kr.|}n|dd\}}|rJt|}|rVt|}|||fS)NrDrr)rsplitrr)rXZusernameZpasswordrlr,r,r-parse_credentials$sr1cCstd}t||S)N)raumaskrrr,r,r-get_process_umask3s  r4cCs0d}d}t|D]\}}t|tsd}q,q|S)NTF) enumeraterwr)seqr(r[r+r,r,r-is_string_sequence8s r7z3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)cCsd}d}t|dd}t|}|r@|d}|d|}|rt|t|dkrtt |d|}|r| }|d|||dd|f}|dkrt |}|r|d|d|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None N -rz\br) rr!PYTHON_VERSIONrrstartrdrerescaperPROJECT_NAME_AND_VERSION)filenameZ project_namer(Zpyverr'nr,r,r-split_filenameGs"   rAz-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCs:t|}|std||}|d|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'rPZver)NAME_VERSION_RErrr rSry)r|r'rr,r,r-parse_name_and_versioncs  rCcCst}t|pg}t|pg}d|kr8|d||O}|D]x}|dkrT||q<|dr|dd}||krtd|||kr||q<||krtd|||q<|S)N*r9rzundeclared extra: %s)rrrrTrr()Z requestedZ availabler(rZunwantedr,r,r- get_extrasrs&        rFc Csi}zNt|}|}|d}|ds8td|ntd|}t |}Wn0t k r}zt d||W5d}~XYnX|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %srz&Failed to get external data for %s: %s) r rgetrTrrrrrrr exception)rRr(ZrespZheadersZctreaderer,r,r-_get_external_datas   rKz'https://www.red-dove.com/pypi/projects/cCs*d|d|f}tt|}t|}|S)Nz%s/%s/project.jsonrupperr _external_data_base_urlrK)rPrRr(r,r,r-get_project_datas rOcCs(d|d||f}tt|}t|S)Nz%s/%s/package-%s.jsonrrL)rPversionrRr,r,r-get_package_datas rQc@s(eZdZdZddZddZddZdS) Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsPtj|st|t|jd@dkr6td|tjtj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) rarbrr)rrrr(rnormpathri)rrir,r,r-rs    zCache.__init__cCst|S)zN Converts a resource prefix to a directory name in the cache. )r-)rrlr,r,r- prefix_to_dirszCache.prefix_to_dirc Csg}t|jD]r}tj|j|}z>tj|s>tj|rJt|ntj|r`t |Wqt k r| |YqXq|S)z" Clear the cache. ) rar rirbr$rrrrrrrr")rZ not_removedfnr,r,r-clears  z Cache.clearN)rrr__doc__rrUrWr,r,r,r-rRsrRc@s:eZdZdZddZdddZddZd d Zd d Zd S) EventMixinz1 A very simple publish/subscribe system. cCs i|_dSrt) _subscribersrr,r,r-rszEventMixin.__init__TcCsD|j}||krt|g||<n"||}|r6||n ||dS)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)rZrr" appendleft)revent subscriberr"subsZsqr,r,r-rs  zEventMixin.addcCs,|j}||krtd||||dS)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)rZrr)rr\r]r^r,r,r-rs zEventMixin.removecCst|j|dS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. r,)iterrZrG)rr\r,r,r-get_subscribersszEventMixin.get_subscribersc Oslg}||D]F}z||f||}Wn"tk rHtdd}YnX||qtd|||||S)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)r`rrrHr"r)rr\argskwargsr(r]rr,r,r-publishs    zEventMixin.publishN)T) rrrrXrrrr`rcr,r,r,r-rYs   rYc@s^eZdZddZddZdddZdd Zd d Zd d ZddZ e ddZ e ddZ dS) SequencercCsi|_i|_t|_dSrt)_preds_succsr_nodesrr,r,r-r"szSequencer.__init__cCs|j|dSrt)rgrrnoder,r,r-add_node'szSequencer.add_nodeFcCs||jkr|j||rt|j|dD]}|||q,t|j|dD]}|||qPt|jD]\}}|sp|j|=qpt|jD]\}}|s|j|=qdS)Nr,)rgrrrerGrfr r)rriZedgesr|r+rrIr,r,r- remove_node*s   zSequencer.remove_nodecCs0|j|t||j|t|dSrt)re setdefaultrrrf)rpredsuccr,r,r-r:sz Sequencer.addcCs|z|j|}|j|}Wn tk r8td|YnXz||||Wn$tk rvtd||fYnXdS)Nz%r not a successor of anythingz%r not a successor of %r)rerfKeyErrorrr)rrmrnpredsZsuccsr,r,r-r?s  zSequencer.removecCs||jkp||jkp||jkSrt)rerfrg)rstepr,r,r-is_stepLszSequencer.is_stepcCs||std|g}g}t}|||r|d}||krb||kr||||q.|||||j|d}| |q.t |S)Nz Unknown: %rrr,) rrrrr"rgrrrerGextendreversed)rfinalr(Ztodoseenrqrpr,r,r- get_stepsPs"         zSequencer.get_stepscsRdggiig|jfddD]}|kr8|q8S)Nrcsd|<d|<dd7<|z |}Wntk rVg}YnX|D]J}|kr|t|||<q\|kr\t|||<q\||krg}}||||krqqt|}|dS)Nrr)r"rminrgtuple)riZ successorsZ successorZconnected_componentZ componentZgraphindexZ index_counterZlowlinksr(stack strongconnectr,r-r}ts,      z3Sequencer.strong_connections..strongconnect)rfrhr,rzr-strong_connectionsis" zSequencer.strong_connectionscCsfdg}|jD]*}|j|}|D]}|d||fqq |jD]}|d|q>|dd|S)Nz digraph G {z %s -> %s;z %s;} )rer"rgr$)rr(rnrprmrir,r,r-dots    z Sequencer.dotN)F) rrrrrjrkrrrrrwpropertyr~rr,r,r,r-rd!s   2rd).tar.gz.tar.bz2.tar.zip.tgz.tbz.whlTc sZfdd}tjtd}|dkr|dr>d}nH|drRd}d}n4|drfd }d }n |d rzd }d }n td|z|dkrt|d }|r|}|D] }||qn*t ||}|r| }|D] }||q|dkr*t j ddkr*|D]"} t| jts| jd| _qdd} | |_|W5|rT|XdS)NcsRt|ts|d}tjtj|}|rB|tjkrNt d|dS)Nrzpath outside destination: %r) rwrdecoderarbrr$rTrcr)rbr|dest_dirZplenr,r- check_paths   zunarchive..check_path)rrzip)rrZtgzzr:gz)rrZtbzzr:bz2rZtarrEzUnknown format for %rrrrc SsDzt||WStjk r>}ztt|W5d}~XYnXdS)z:Run tarfile.tar_fillter, but raise the expected ValueErrorN)tarfileZ tar_filterZ FilterErrorrstr)memberrbexcr,r,r-extraction_filtersz$unarchive..extraction_filter)rarbrrdr.rrrZnamelistrrZgetnamesrprZ getmembersrwrPrrrZ extractall) Zarchive_filenamerformatrrarchivernamesrPZtarinforr,rr- unarchivesL           rc Cs~t}t|}t|dZ}t|D]H\}}}|D]8}tj||}||d} tj| |} ||| q4q&W5QRX|S)z*zip a directory tree into a BytesIO objectrN) ioBytesIOrdrrawalkrbr$r) Z directoryr(ZdlenZzfrerrrPZfullZrelrkr,r,r-zip_dirs  r)rKMGTPc@sreZdZdZdddZddZdd Zd d Zd d Ze ddZ e ddZ ddZ e ddZ e ddZdS)ProgressZUNKNOWNrdcCs(||_|_||_d|_d|_d|_dS)NrF)rxcurmaxstartedelapseddone)rZminvalZmaxvalr,r,r-r s  zProgress.__init__cCs0||_t}|jdkr ||_n ||j|_dSrt)rtimerr)rZcurvalZnowr,r,r-updates  zProgress.updatecCs||j|dSrt)rr)rZincrr,r,r- incrementszProgress.incrementcCs||j|Srt)rrxrr,r,r-r;s zProgress.startcCs |jdk r||jd|_dS)NT)rrrrr,r,r-stop#s  z Progress.stopcCs|jdkr|jS|jSrt)runknownrr,r,r-maximum(szProgress.maximumcCsD|jr d}n4|jdkrd}n$d|j|j|j|j}d|}|S)Nz100 %z ?? %gY@z%3d %%)rrrrx)rr(rIr,r,r- percentage,s zProgress.percentagecCs:|dkr|jdks|j|jkr$d}ntdt|}|S)Nrz??:??:??z%H:%M:%S)rrrxrstrftimegmtime)rZdurationr(r,r,r-format_duration7szProgress.format_durationcCs|jrd}|j}n^d}|jdkr&d}nJ|jdks<|j|jkrBd}n.t|j|j}||j|j}|d|j}d|||fS)NZDonezETA rrrz%s: %s)rrrrrxfloatr)rrlr\r,r,r-ETA@s z Progress.ETAcCsL|jdkrd}n|j|j|j}tD]}|dkr6q@|d}q&d||fS)Nrgig@@z%d %sB/s)rrrxUNITS)rr(Zunitr,r,r-speedSs  zProgress.speedN)rr)rrrrrrrr;rrrrrrrr,r,r,r-rs      rz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$cCs<t|rd}t||t|r4d}t||t|S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBrr_CHECK_MISMATCH_SET_iglob) path_globrr,r,r-rhs    rc cst|d}t|dkrT|\}}}|dD]$}td|||fD] }|VqDq,nd|krrt|D] }|Vqdn~|dd\}}|dkrd}|dkrd}n|d}|d}t|D]4\}}} tj |}ttj ||D] } | VqqdS) NrrCrz**rrDr`\) RICH_GLOBrrdrr$ std_iglobr%rarrbrT) rZrich_path_globrlrrjitemrbZradicaldirrrVr,r,r-rss(         r) HTTPSHandlermatch_hostnameCertificateErrorc@seZdZdZdZddZdS)HTTPSConnectionNTcCsRt|j|jf|j}t|ddr0||_|tt dsp|j rHt j }nt j }t j ||j|j|t j|j d|_nxt t j}|jt jO_|jr||j|ji}|j rt j |_|j|j dtt ddr|j|d<|j |f||_|j rN|jrNz$t|j|jtd|jWn0tk rL|jtj|jYnXdS) NZ _tunnel_hostF SSLContext) cert_reqsZ ssl_versionca_certs)ZcafileZHAS_SNIZserver_hostnamezHost verified: %s) rZcreate_connectionhostporttimeoutrqsockZ_tunnelrosslrZ CERT_REQUIREDZ CERT_NONEZ wrap_socketZkey_fileZ cert_fileZPROTOCOL_SSLv23rZoptionsZ OP_NO_SSLv2Zload_cert_chainZ verify_modeZload_verify_locations check_domainrZ getpeercertrrrZshutdownZ SHUT_RDWRr)rrrcontextrbr,r,r-connects@       zHTTPSConnection.connect)rrrrrrr,r,r,r-rsrc@s&eZdZd ddZddZddZdS) rTcCst|||_||_dSrt)BaseHTTPSHandlerrrr)rrrr,r,r-rs zHTTPSHandler.__init__cOs$t||}|jr |j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )rrr)rrarbr(r,r,r- _conn_makers zHTTPSHandler._conn_makerc CsXz||j|WStk rR}z$dt|jkr@td|jnW5d}~XYnXdS)Nzcertificate verify failedz*Unable to verify server certificate for %s)Zdo_openrrrreasonrr)rrYrJr,r,r- https_openszHTTPSHandler.https_openN)T)rrrrrrr,r,r,r-rs rc@seZdZddZdS)HTTPSOnlyHandlercCstd|dS)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rrYr,r,r- http_openszHTTPSOnlyHandler.http_openN)rrrrr,r,r,r-rsrrc@seZdZdddZdS)HTTPrNcKs&|dkr d}||j||f|dSNr_setupZ_connection_classrrrrbr,r,r-rsz HTTP.__init__)rNrrrrr,r,r,r-rsrc@seZdZdddZdS)HTTPSrNcKs&|dkr d}||j||f|dSrrrr,r,r-rszHTTPS.__init__)rNrr,r,r,r-rsrc@seZdZdddZddZdS) TransportrcCs||_tj||dSrt)rrrrrr use_datetimer,r,r-rszTransport.__init__cCs`||\}}}tdkr(t||jd}n4|jr<||jdkrR||_|t|f|_|jd}|S)Nr)rrr) get_host_info _ver_inforr _connection_extra_headersrZHTTPConnection)rrhehZx509r(r,r,r-make_connection s zTransport.make_connectionN)rrrrrrr,r,r,r-rs rc@seZdZdddZddZdS) SafeTransportrcCs||_tj||dSrt)rrrrrr,r,r-rszSafeTransport.__init__cCsx||\}}}|si}|j|d<tdkr:t|df|}n:|jrN||jdkrj||_|tj|df|f|_|jd}|S)Nrrrr)rrrrrrrr)rrrrrbr(r,r,r-rs   zSafeTransport.make_connectionN)rrr,r,r,r-rs rc@seZdZddZdS) ServerProxyc Kst|dd|_}|dk r^t|\}}|dd}|dkr@t}nt}|||d|d<}||_tjj ||f|dS)NrrrZhttps)r transport) rgrrrGrrrrrr) rrZrbrrWr]rZtclsr\r,r,r-r,s  zServerProxy.__init__Nrr,r,r,r-r+srcKs6tjddkr|d7}nd|d<d|d<t||f|S)Nrrbrnewlinerr)rprr)rVrrbr,r,r- _csv_open@s  rc@s4eZdZedededdZddZddZd S) CSVBaserC"r)Z delimiterZ quotecharZlineterminatorcCs|Srtr,rr,r,r- __enter__RszCSVBase.__enter__cGs|jdSrt)rr)rr$r,r,r-__exit__UszCSVBase.__exit__N)rrrrdefaultsrrr,r,r,r-rKs rc@s(eZdZddZddZddZeZdS) CSVReadercKs\d|kr4|d}tjddkr,td|}||_nt|dd|_tj|jf|j|_dS)NrrrrrbrE) rprrrrrcsvrIr)rrbrr,r,r-rZszCSVReader.__init__cCs|Srtr,rr,r,r-__iter__eszCSVReader.__iter__cCsFt|j}tjddkrBt|D] \}}t|ts |d||<q |SNrrr)nextrIrprr5rwrr)rr(r[rr,r,r-rhs   zCSVReader.nextN)rrrrrr__next__r,r,r,r-rYs rc@seZdZddZddZdS) CSVWritercKs$t|d|_tj|jf|j|_dS)Nr)rrrwriterr)rrVrbr,r,r-rss zCSVWriter.__init__cCsNtjddkr>g}|D]"}t|tr.|d}||q|}|j|dSr)rprrwrrr"rwriterow)rrowrErr,r,r-rws   zCSVWriter.writerowN)rrrrrr,r,r,r-rrsrcsHeZdZeejZded<d fdd ZddZdd Zd d Z Z S) Configurator inc_convertZincNcs"tt|||pt|_dSrt)superrrrarri)rconfigri __class__r,r-rszConfigurator.__init__c sfddd}t|s*|}dd}dd}|r\tfdd|D}fd dD}t|}|||}|r|D]\}} t||| q|S) Ncsvt|ttfr*t|fdd|D}nHt|trhd|krH|}qri}|D]}||||<qPn |}|S)Ncsg|] }|qSr,r,)rNr[convertr,r-rOszBConfigurator.configure_custom..convert..())rwr rytypedictconfigure_customr)or(r)rrr,r-rs   z.Configurator.configure_custom..convertrrz[]r,csg|] }|qSr,r,)rNr rr,r-rOsz1Configurator.configure_custom..cs$g|]}t|r||fqSr,)r)rNr)rrr,r-rOs)rgrrryrrsetattr) rrr}Zpropsrarrbr(r@rIr,)rrrr-r s     zConfigurator.configure_customcCs4|j|}t|tr0d|kr0|||j|<}|S)Nr)rrwrr )rrr(r,r,r- __getitem__s zConfigurator.__getitem__c CsFtj|stj|j|}tj|ddd}t|}W5QRX|S)z*Default converter for the inc:// protocol.rErr) rarbisabsr$rirrrr)rrrr(r,r,r-rs  zConfigurator.inc_convert)N) rrrrrZvalue_convertersrr r r __classcell__r,r,rr-rs  rc@s*eZdZdZd ddZddZdd ZdS) SubprocessMixinzC Mixin for running subprocesses and capturing their output FNcCs||_||_dSrt)verboseprogress)rrrr,r,r-rszSubprocessMixin.__init__cCsj|j}|j}|}|sq^|dk r.|||q |s@tjdntj|dtjq |dS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Nrr) rrreadlinerpstderrrrflushr)rrrrrr+r,r,r-rIs  zSubprocessMixin.readercKstj|ftjtjd|}tj|j|jdfd}|tj|j|jdfd}|| | | |j dk r| ddn|j rt jd|S)N)stdoutrr)rrarzdone.mainzdone. ) subprocessPopenPIPE threadingZThreadrIrr;rwaitr$rrrpr)rcmdrbr|t1t2r,r,r- run_commands"   zSubprocessMixin.run_command)FN)rrrrXrrIrr,r,r,r-rs rcCstdd|S)z,Normalize a python package name a la PEP 503z[-_.]+r9)r<subry)rPr,r,r-normalize_namesr!)NN)r)N)N)NT)r collectionsr contextlibrZglobrrrrZloggingrarr<rr ImportErrorrrprrrrZdummy_threadingrrrcompatrrrr r r r r rrrrrrrrrrrrrZ getLoggerrrrrrGrFr6r>r:rVr#r?r^rmrsrxr~rrrcontextmanagerrrrrrrrrrVERBOSErrr+r-r/r1r4r7Ir>r:rArBrCrFrKrNrOrQrRrYrdZARCHIVE_EXTENSIONSrrrrrrrrrrrrrrrrrrrrrrrrrrrr!r,r,r,r-s      \         Yy   /   8 )    ,H  C]    *)   7.PKd]D̎dcdc.distlib/__pycache__/wheel.cpython-38.opt-1.pycnu[U .e@sddlmZddlZddlZddlZddlZddlmZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlm Z m!Z!m"Z"dd l#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,dd l-m.Z.m/Z/e 0e1Z2da3e4ed r8d Z5n*ej67d rLdZ5nej6dkr^dZ5ndZ5e8dZ9e9sdej:ddZ9de9Z;e5e9Zdd>ddZ?e8dZ@e@re@7dre@>ddZ@nddZAeAZ@[AeBdejCejDBZEeBdejCejDBZFeBdZGeBd ZHd!ZId"ZJe jKd#krBd$d%ZLnd&d%ZLGd'd(d(eMZNeNZOGd)d*d*eMZPd+d,ZQeQZR[Qd/d-d.ZSdS)0)unicode_literalsN)message_from_file) __version__DistlibException) sysconfigZipFilefsdecode text_typefilter)InstalledDistribution)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAME) FileOperator convert_path CSVReader CSVWriterCachecached_propertyget_cache_base read_exportstempdir)NormalizedVersionUnsupportedVersionErrorZpypy_version_infoZppjavaZjyZcliZipcpZpy_version_nodotz%s%spy-_.ZSOABIzcpython-cCsRdtg}tdr|dtdr0|dtddkrH|dd |S) NrZPy_DEBUGdZ WITH_PYMALLOCmZPy_UNICODE_SIZEu) VER_SUFFIXrget_config_varappendjoin)partsr,=/usr/lib/python3.8/site-packages/pip/_vendor/distlib/wheel.py _derive_abi;s     r.zz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ z7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonw/cCs|SNr,or,r,r-]r3cCs|tjdS)Nr/)replaceossepr1r,r,r-r3_r4c@s6eZdZddZddZddZd dd Zd d ZdS) MountercCsi|_i|_dSr0) impure_wheelslibsselfr,r,r-__init__cszMounter.__init__cCs||j|<|j|dSr0)r9r:update)r<pathname extensionsr,r,r-addgs z Mounter.addcCs0|j|}|D]\}}||jkr|j|=qdSr0)r9popr:)r<r?r@kvr,r,r-removeks   zMounter.removeNcCs||jkr|}nd}|Sr0)r:)r<fullnamepathresultr,r,r- find_moduleqs zMounter.find_modulecCsj|tjkrtj|}nP||jkr,td|t||j|}||_|dd}t|dkrf|d|_ |S)Nzunable to find extension for %sr!rr) sysmodulesr: ImportErrorimpZ load_dynamic __loader__rsplitlen __package__)r<rFrHr+r,r,r- load_modulexs       zMounter.load_module)N)__name__ __module__ __qualname__r=rArErIrRr,r,r,r-r8bs  r8c@seZdZdZdZdZd4ddZedd Zed d Z ed d Z e ddZ ddZ e ddZddZd5ddZddZddZddZd6ddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd7d,d-Zd.d/Zd0d1Zd8d2d3ZdS)9Wheelz@ Class to build and install from Wheel files (PEP 427). rrZsha256NFcCs8||_||_d|_tg|_dg|_dg|_t|_ |dkrRd|_ d|_ |j |_ nt|}|r|d}|d|_ |dd d |_ |d |_|j |_ ntj|\}}t|}|std ||rtj||_ ||_ |d}|d|_ |d|_ |d |_|d d|_|dd|_|dd|_dS)zB Initialise an instance using a (valid) filename. r&noneanyNZdummyz0.1ZnmZvnr rZbnzInvalid name or filename: %rrr!ZbiZar)signZ should_verifybuildverPYVERpyverabiarchr6getcwddirnamenameversionfilenameZ _filenameNAME_VERSION_REmatch groupdictr5rGsplit FILENAME_RErabspath)r<rdrZverifyr#inforar,r,r-r=sD            zWheel.__init__cCs^|jrd|j}nd}d|j}d|j}d|j}|jdd}d|j|||||fS)zJ Build and return a filename from the various components. rr&r!r z%s-%s%s-%s-%s-%s.whl)r[r*r]r^r_rcr5rb)r<r[r]r^r_rcr,r,r-rds     zWheel.filenamecCstj|j|j}tj|Sr0)r6rGr*rardisfile)r<rGr,r,r-existssz Wheel.existsccs4|jD](}|jD]}|jD]}|||fVqqqdSr0)r]r^r_)r<r]r^r_r,r,r-tagss   z Wheel.tagsc Cstj|j|j}d|j|jf}d|}td}t |d}| |}|d dd}t dd |D}|d krt td g} nt tg} d} | D]f} zLt|| } || ,} || }t|d } | rW5QRWqW5QRXWqtk rYqXq| std d| W5QRX| S)N%s-%s %s.dist-infoutf-8r Wheel-Versionr!rcSsg|] }t|qSr,int.0ir,r,r- sz"Wheel.metadata..rWZMETADATA)Zfileobjz8Invalid wheel, because metadata is missing: looked in %sz, )r6rGr*rardrbrccodecs getreaderrget_wheel_metadatarhtuplerr posixpathopenr KeyError ValueError)r<r?name_verinfo_dirwrapperzfwheel_metadatawv file_versionZfnsrHfnmetadata_filenamebfwfr,r,r-metadatas6       zWheel.metadatac CsXd|j|jf}d|}t|d}||}td|}t|}W5QRXt|S)NrprqWHEELrr) rbrcrr*rr{r|rdict)r<rrrrrrmessager,r,r-r}s  zWheel.get_wheel_metadatac Cs6tj|j|j}t|d}||}W5QRX|S)Nrs)r6rGr*rardrr})r<r?rrHr,r,r-rls z Wheel.infoc Cst|}|r||}|d|||d}}d|krBt}nt}t|}|rfd|d}nd}||}||}nT|d}|d} |dks|| krd} n|||dd krd } nd} t| |}|S) Nspythonw r4  rrs ) SHEBANG_RErfendlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind) r<datar#rZshebangZdata_after_shebangZshebang_pythonargsZcrZlfZtermr,r,r-process_shebangs,       zWheel.process_shebangcCsh|dkr|j}ztt|}Wn tk r<td|YnX||}t|d d}||fS)NzUnsupported hash algorithm: %r=ascii) hash_kindgetattrhashlibAttributeErrorrdigestbase64Zurlsafe_b64encoderstripdecode)r<rrhasherrHr,r,r-get_hash"s zWheel.get_hashc Cs^t|}ttj||}||ddf|t|}|D]}||q@W5QRXdS)Nr&) listto_posixr6rGrelpathr)sortrZwriterow)r<recordsZ record_pathbasepwriterrowr,r,r- write_record-s zWheel.write_recordc Csg}|\}}tt|j}|D]P\}} t| d} | } W5QRXd|| } tj| } | || | fqtj |d} | || |t tj |d}| || fdS)Nrbz%s=%sRECORD) rrrrreadrr6rGgetsizer)r*rr)r<rllibdir archive_pathsrdistinforraprfrrsizer,r,r- write_records6s    zWheel.write_recordsc CsFt|dtj.}|D]"\}}td|||||qW5QRXdS)NwzWrote %s to %s in wheel)rzipfileZ ZIP_DEFLATEDloggerdebugwrite)r<r?rrrrr,r,r- build_zipFs zWheel.build_zipc! sp|dkr i}ttfdddd}|dkrFd}tg}tg}tg}nd}tg}d g}d g}|d ||_|d ||_|d ||_ |} d|j |j f} d| } d| } g} dD]}|krq|}t j |rt |D]\}}}|D]}tt j ||}t j ||}tt j | ||}| ||f|dkr|dst|d}|}W5QRX||}t|d}||W5QRXqqq| }d}t |D]\}}}||krt|D]8\}}t|}|drt j ||}||=qq|D]H}t|drqt j ||}tt j ||}| ||fqqt |}|D]B}|dkr^tt j ||}tt j | |}| ||fq^d|p|jdtd|g}|jD] \}}}|d|||fqt j |d}t|d}|d|W5QRXtt j | d}| ||f||| f| | t j |j |j!} |"| | | S) z Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. Ncs|kSr0r,r1pathsr,r-r3Tr4zWheel.build..)purelibplatlibrrZfalsetruerXrYr]r^r_rp%s.datarq)rZheadersscriptsr.exerwbz .dist-info)z.pycz.pyo)rZ INSTALLERZSHAREDrzWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %sz Tag: %s-%s-%srr )#rr IMPVERABIARCHr\getr]r^r_rbrcr6rGisdirwalkr r*rrr)endswithrrrr enumeratelistdir wheel_versionrrorrardr)!r<rrorZlibkeyZis_pureZ default_pyverZ default_abiZ default_archrrdata_dirrrkeyrGrootdirsfilesrrrprrrrrydnrr]r^r_r?r,rr-buildLs           z Wheel.buildcCs |dS)zl Determine whether an archive entry should be skipped when verifying or installing. )r/z /RECORD.jws)r)r<arcnamer,r,r- skip_entryszWheel.skip_entrycC Ksf|j}|d}|dd}|dd}tj|j|j}d|j|jf} d| } d| } t | t } t | d} t | d }t d }t |d }|| }||}t|}W5QRX|d d d}tdd|D}||jkr|r||j||ddkr|d}n|d}i}||8}t|d"}|D]}|d}|||<q8W5QRXW5QRXt | d}t | d}t | dd}t|d}d|_tj } g}!t}"|"|_d|_zz\|D]}#|#j}$t|$t r|$}%n |$!d }%|"|%rq||%}|dr4t#|#j$|dkr4t%d|%|dr|ddd\}&}'||$}|&}(W5QRX|'|(|&\})}*|*|'krt%d|$|r|%(||frt)*d |%q|%(|o|%+d! }+|%(|r |%d"d\})},}-tj||,t,|-}.n$|%| |fkrqtj|t,|%}.|+s ||$}|-||.W5QRX|!.|.|s|drt|.d#4}|&}(|'|(|&\})}/|/|*krt%d$|.W5QRX| r~|.+d%r~z|j/|.|d&}0|!.|0Wn$t0k rt)j1d'dd(YnXnttj2t,|$}1tj|"|1}2||$}|-||2W5QRXtj|.\}3}1|3|_|3|1}4|4|4|!5|4q|rt)*d)d}5nnd}6|j6d }|d*krzt | d+}7z||7}t7|}8W5QRXi}6d,D]l}9d-|9}:|:|8kri|6d.|9<};|8|:8D]6}|6d6i}?|>s|?r|dd}@tj>|@s*t?d7|@|_|>@D]*\}:}.zRoot-Is-Purelibrrrstreamrr&r)dry_runTNrsize mismatch for %s=digest mismatch for %szlib_only: skipping %srr/rzdigest mismatch on write for %sz.py)Zhashed_invalidationzByte-compilation failed)exc_infozlib_only: returning Nonez1.0zentry_points.txt)Zconsoleguiz %s_scriptszwrap_%sz%s:%sz %szAUnable to read legacy script metadata, so cannot generate scriptsr@zpython.commandsz8Unable to read JSON metadata, so cannot generate scriptsZ wrap_consoleZwrap_guizValid script path not specifiedz%s = %srlibprefixzinstallation failed.)Grrr6rGr*rardrbrcrrr{r|rrrrhr~rrrrecordrJdont_write_bytecodetempfileZmkdtempZ source_dirZ target_dirshutilZrmtreeinfolist isinstancer rrstr file_sizerrr startswithrrrrZ copy_streamr)Z byte_compile ExceptionZwarningbasenameZmakeZset_executable_modeextendrlrvaluesrsuffixflagsjsonloadrritemsr rZwrite_shared_locationsZwrite_installed_filesZ exceptionZrollback)Cr<rZmakerkwargsrrrZbc_hashed_invalidationr?rrr metadata_namewheel_metadata_name record_namerrbwfrrrrrrrreaderrrZdata_pfxZinfo_pfxZ script_pfxZfileopZbcZoutfilesworkdirzinfor u_arcnamekindvaluerr rZ is_scriptwhererZoutfileZ newdigestZpycrZworknamer filenamesZdistZcommandsZepZepdatarrCr"rDsZconsole_scriptsZ gui_scriptsZ script_dirZscriptZoptionsr,r,r-installsT                                                     z Wheel.installcCs4tdkr0tjttdtjdd}t|atS)Nz dylib-cache) cacher6rGr*rrrJrcr)r<rr,r,r-_get_dylib_caches  zWheel._get_dylib_cachec Cshtj|j|j}d|j|jf}d|}t|d}t d}g}t |d}z| |}||} t | } |} | |} tj| j| } tj| st| | D]\}}tj| t|}tj|sd}n6t|j}tj|}||}tj|j}||k}|r&||| |||fqW5QRXWntk rXYnXW5QRX|S)NrprqZ EXTENSIONSrrrsT)r6rGr*rardrbrcrr{r|rrrrrZ prefix_to_dirrrmakedirsrrrnstatst_mtimedatetimeZ fromtimestampZgetinfoZ date_timeextractr)r)r<r?rrrrrHrrrr@rrZ cache_baserbrdestrZ file_timerlZ wheel_timer,r,r-_get_extensionss>             zWheel._get_extensionscCst|S)zM Determine if a wheel is compatible with the running system. ) is_compatibler;r,r,r-rszWheel.is_compatiblecCsdS)zP Determine if a wheel is asserted as mountable by its metadata. Tr,r;r,r,r- is_mountableszWheel.is_mountablecCstjtj|j|j}|s2d|}t||sJd|}t||t jkrbt d|nN|rtt j |nt j d||}|rtt jkrt j tt||dS)Nz)Wheel %s not compatible with this Python.z$Wheel %s is marked as not mountable.z%s already in pathr)r6rGrjr*rardrrrrJrrr)insertr_hook meta_pathrA)r<r)r?msgr@r,r,r-mounts"   z Wheel.mountcCsrtjtj|j|j}|tjkr2td|n.rrr/..invalid entry in wheel: %rrrrr)r6rGr*rardrbrcrrr{r|rrrrhr~rrrr rrrrrrr)r<r?rrrrrrrrrrrrrrrr rrr rr r rrr rr,r,r-rks\                z Wheel.verifyc Ksdd}dd}tj|j|j}d|j|jf}d|}t|d} t} t |d|} i} | D]h} | j}t |t r|}n | d }|| krqhd |krtd || | | tj| t|}|| |<qhW5QRX|| |\}}|| f|}|r|| |\}}|r$||kr$||||d krNtjd d| d\}}t|n*tj|shtd|tj||j}t| }tj| |}||f}||| |||||d krt||W5QRX|S)a Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. cSsHd}}d|tf}||kr$d|}||kr@||}t|dj}||fS)Nz%s/%sz %s/PKG-INFOrG)rr rc)path_maprrcrGrr,r,r- get_versionKs  z!Wheel.update..get_versioncSsd}z|t|}|d}|dkr*d|}nTdd||dddD}|dd7<d |d|dd d |Df}Wn tk rtd |YnX|rt|d }||_| t  }|j ||dtd||dS)Nrrz%s+1cSsg|] }t|qSr,ru)rxrr,r,r-rz]sz8Wheel.update..update_version..rr!rz%s+%scss|]}t|VqdSr0)rrwr,r,r- `sz7Wheel.update..update_version..z0Cannot update non-compliant (PEP-440) version %rr')rGlegacyzVersion updated from %r to %r) rrrhr*rrrr rcrrr)rcrGupdatedrDryr+Zmdr+r,r,r-update_versionUs.        z$Wheel.update..update_versionrprqrrsrrr%r&Nz.whlz wheel-update-)rrdirzNot a directory: %r)r6rGr*rardrbrcrrrrrr rrrrrZmkstempcloserrrrrrZcopyfile)r<ZmodifierZdest_dirrr)r-r?rrrr rr(r rr rGZoriginal_versionr ZmodifiedZcurrent_versionfdnewpathrrrlr,r,r-r>:s\                 z Wheel.update)NFF)N)NN)F)N)rSrTrU__doc__rrr=propertyrdrnrorrr}rlrrrrrrrrrrrrr#r$rkr>r,r,r,r-rVs@ )         hg "  8rVc Csxtg}td}ttjddddD]}|d|t|gq$g}tD]*\}}}| drN|| dddqN| t dkr| dt |dg}tg}tjd krtd t}|r|\} }}} t|}| g} | d kr| d | d kr | d| dkr | d| dkr4| d| dkrH| d|dkr| D]*} d| ||| f} | tkrV|| qV|d8}qH|D]0}|D]$} |dt|df|| fqqt|D]L\}}|dt|fddf|dkr|dt|dfddfqt|D]L\}}|dd|fddf|dkr"|dd|dfddfq"t|S)zG Return (pyver, abi, arch) tuples compatible with this Python. rrrr&z.abir!rrXdarwinz(\w+)_(\d+)_(\d+)_(\w+)$)i386ppcZfat)r5r6x86_64Zfat3)ppc64r7Zfat64)r5r7intel)r5r7r9r6r8Z universalz %s_%s_%s_%srYr)r'rangerJ version_infor)r*rrMZ get_suffixesrrhrrrrplatformrerfrrv IMP_PREFIXrset)ZversionsmajorminorZabisrr rHZarchesr#rbr_Zmatchesrfrr^ryrcr,r,r-compatible_tagss`                 & " "rBcCs\t|tst|}d}|dkr"t}|D]0\}}}||jkr&||jkr&||jkr&d}qXq&|S)NFT)rrVCOMPATIBLE_TAGSr]r^r_)ZwheelrorHZverr^r_r,r,r-rs r)N)TZ __future__rrr{rZdistutils.utilZ distutilsZemailrrrMrZloggingr6rr=rrJrrr&rrcompatrrr r r Zdatabaser rr rrutilrrrrrrrrrrcrrZ getLoggerrSrrhasattrr>r<rr(r'r;r\rZ get_platformr5rrr.compile IGNORECASEVERBOSErirerrrrr7robjectr8r rVrBrCrr,r,r,r-s   ,             #>PKd]q~~e'e'1distlib/__pycache__/manifest.cpython-38.opt-1.pycnu[U .e9@sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ e eZedejZed ejejBZejdd ZGd ddeZdS) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode convert_pathManifestz\\w* z#.*?(?= )| (?=$)c@szeZdZdZdddZddZddZd d Zdd d ZddZ ddZ ddZ dddZ d ddZ d!ddZddZdS)"rz~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. NcCs>tjtj|pt|_|jtj|_d|_t |_ dS)zd Initialise an instance. :param base: The base directory to explore under. N) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfrr@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/manifest.py__init__*szManifest.__init__cCsddlm}m}m}g|_}|j}|g}|j}|j}|r|}t |} | D]R} tj || } t| } | j } || r|t | qN|| rN|| sN|| qNq6dS)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrrpopappendr listdirr joinst_moder)rrrrrrootstackrpushnamesnamefullnamermoderrrfindall9s"   zManifest.findallcCs4||jstj|j|}|jtj|dS)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) startswithrr r rrraddr )ritemrrrr*Ts z Manifest.addcCs|D]}||qdS)z Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r*)ritemsr+rrradd_many^szManifest.add_manyFcsbfddtj}|rFt}|D]}|tj|q&||O}ddtdd|DDS)z8 Return sorted files in directory order cs>||td||jkr:tj|\}}||dS)Nzadd_dir added %s)r*loggerdebugrr r split)dirsdparent_add_dirrrrr6ls    z Manifest.sorted..add_dircSsg|]}tjj|qSr)r r r).0Z path_tuplerrr zsz#Manifest.sorted..css|]}tj|VqdS)N)r r r0)r7r rrr {sz"Manifest.sorted..)rrr r dirnamesorted)rZwantdirsresultr1frr5rr;gs zManifest.sortedcCst|_g|_dS)zClear all collected files.N)rrr)rrrrclear}szManifest.clearcCsj||\}}}}|dkrB|D]}|j|ddstd|qn$|dkrf|D]}|j|dd}qNn|dkr|D]}|j|ddsrtd|qrn|d kr|D]}|j|dd}qn|d kr|D] }|j||d std ||qn|d kr |D]}|j||d }qn\|dkr2|jd|d sftd|n4|dkrZ|jd|d sftd|n td|dS)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands includeT)anchorzno files found matching %rexcludeglobal-includeFz3no files found matching %r anywhere in distributionglobal-excluderecursive-include)rz-no files found matching %r under directory %rrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr.Zwarning_exclude_patternr)r directiveactionpatternsthedirZ dirpatternpatternfoundrrrprocess_directivesP   zManifest.process_directivecCs|}t|dkr,|ddkr,|dd|d}d}}}|dkrxt|dkr`td|d d |ddD}n~|d krt|d krtd |t|d}dd |ddD}n:|dkrt|dkrtd|t|d}n td|||||fS)z Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rr)r?rArBrCrDrErFrGr?N)r?rArBrCrz$%r expects ...cSsg|] }t|qSrrr7Zwordrrrr8sz-Manifest._parse_directive..)rDrEz*%r expects ...cSsg|] }t|qSrrrRrrrr8s)rFrGz!%r expects a single zunknown action %r)r0leninsertrr)rrKZwordsrLrMrNZ dir_patternrrrrHs4       zManifest._parse_directiveTcCsPd}|||||}|jdkr&||jD]}||r,|j|d}q,|S)aSelect strings (presumably filenames) from 'self.files' that match 'pattern', a Unix-style wildcard (glob) pattern. Patterns are not quite the same as implemented by the 'fnmatch' module: '*' and '?' match non-special characters, where "special" is platform-dependent: slash on Unix; colon, slash, and backslash on DOS/Windows; and colon on Mac OS. If 'anchor' is true (the default), then the pattern match is more stringent: "*.py" will match "foo.py" but not "foo/bar.py". If 'anchor' is false, both of these will match. If 'prefix' is supplied, then only filenames starting with 'prefix' (itself a pattern) and ending with 'pattern', with anything in between them, will match. 'anchor' is ignored in this case. If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and 'pattern' is assumed to be either a string containing a regex or a regex object -- no translation is done, the regex is just compiled and used as-is. Selected strings will be added to self.files. Return True if files are found. FNT)_translate_patternrr(searchrr*)rrOr@ris_regexrP pattern_rer%rrrrIs    zManifest._include_patterncCsBd}|||||}t|jD]}||r|j|d}q|S)atRemove strings (presumably filenames) from 'files' that match 'pattern'. Other parameters are the same as for 'include_pattern()', above. The list 'self.files' is modified in place. Return True if files are found. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions FT)rVlistrrWremove)rrOr@rrXrPrYr=rrrrJ)s   zManifest._exclude_patternc Csv|rt|trt|S|Stdkr:|dd\}}}|rR||}tdkrVnd}ttj |j d} |dk r4tdkr|d} ||dt |  } n&||} | t |t | t |} tj } tj dkrd} tdkrd| | | d|f}n0|t |t |t |}d || | | ||f}n8|rltdkrRd| |}nd || |t |df}t|S) aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). )rSrr4N\z\\^z.*z%s%s%s%s.*%s%sz%s%s%s) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionescaper r rrrTr) rrOr@rrXstartr4endrYrZ empty_patternZ prefix_rerrrrrV=sF             zManifest._translate_patterncCs8t|}tj}tjdkrd}d|}td||}|S)zTranslate a shell-like glob pattern to a regular expression. Return a string containing the regex. Differs from 'fnmatch.translate()' in that '*' does not match "special characters" (which are platform-specific). r]z\\\\z\1[^%s]z((?rQrHrIrJrVrdrrrrr%s&   O/ )  7)roriZloggingr rasysr\rcompatrutilr__all__Z getLoggerrlr.rbMZ_COLLAPSE_PATTERNSZ_COMMENTED_LINE version_inforcobjectrrrrrs    PKd]JE**0distlib/__pycache__/scripts.cpython-38.opt-1.pycnu[U .e?@sddlmZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z ddl mZmZmZmZmZeeZdZedZd Zd d ZGd d d eZdS))BytesION) sysconfigdetect_encodingZipFile)finder) FileOperatorget_export_entry convert_pathget_executablein_venva s^#!.*pythonw?[0-9.]*([ ].*)?$z# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) cCsXd|krT|drB|dd\}}d|krT|dsTd||f}n|dsTd|}|S)N z /usr/bin/env r"z%s "%s"z"%s") startswithsplit) executableenvZ _executabler?/usr/lib/python3.8/site-packages/pip/_vendor/distlib/scripts.py_enquote_executable3s  rc@seZdZdZeZdZd'ddZddZe j d rBd d Z d d Z ddZd(ddZddZeZddZddZd)ddZddZeddZejddZejd ksejd krejd krd!d"Zd*d#d$Zd+d%d&ZdS), ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. NTFcCsz||_||_||_d|_d|_tjdkp:tjdko:tjdk|_t d|_ |pRt ||_ tjdkprtjdkortjdk|_ dS)NFposixjava)X.Ynt) source_dir target_dir add_launchersforceclobberosname_nameset_modesetvariantsr_fileop_is_nt)selfrrrdry_runZfileoprrr__init__Ls  zScriptMaker.__init__cCs@|ddr<|jr %srspythonwr|rd)!r!r/r1rr rr`rr'Znewerr:ror6r9r*readliner;Zget_command_name FIRST_LINE_REmatchr0groupcloseZ copy_filer$rprqinforseekrUryr7)r)rrsZadjustrvfZ first_linerrIrSlinesrTrtrwrrr _copy_script)sX        zScriptMaker._copy_scriptcCs|jjSr_r'r*)r)rrrr*]szScriptMaker.dry_runcCs ||j_dSr_r)r)valuerrrr*asrcCsHtddkrd}nd}d||f}tddd}t||j}|S) NPZ64Z32z%s%s.exerVrr)structcalcsize__name__rsplitrfindbytes)r)Zkindbitsr"Zdistlib_packagerJrrrrhis zScriptMaker._get_launchercCs6g}t|}|dkr"|||n|j|||d|S)a Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. Nrz)r rr)r) specificationr2rsr]rrrmakews zScriptMaker.makecCs$g}|D]}||||q|S)z Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, )extendr)r)Zspecificationsr2rsrrrr make_multipleszScriptMaker.make_multiple)TFN)rLN)N)N)N) r __module__ __qualname____doc__SCRIPT_TEMPLATErYrr+r4rGrHrr=r@rKrUr^_DEFAULT_MANIFESTrarcryrrpropertyr*setterr!r"r#rhrrrrrrrCs6     84 4   r)iorZloggingr!rerrGcompatrrrZ resourcesrutilrr r r r Z getLoggerrr:striprcompilerrrobjectrrrrrs     PKd]ON)II+distlib/__pycache__/__init__.cpython-38.pycnu[U ʗReE@snddlZdZGdddeZzddlmZWn&ek rRGdddejZYnXeeZ e edS)Nz0.3.5c@s eZdZdS)DistlibExceptionN)__name__ __module__ __qualname__rr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/__init__.pyr sr) NullHandlerc@s$eZdZddZddZddZdS)rcCsdSNrselfrecordrrrhandlezNullHandler.handlecCsdSr rr rrremitrzNullHandler.emitcCs d|_dSr )lock)r rrr createLockrzNullHandler.createLockN)rrrr rrrrrrrsr) logging __version__ Exceptionrr ImportErrorHandler getLoggerrlogger addHandlerrrrrs PKd]*zHH0distlib/__pycache__/markers.cpython-38.opt-1.pycnu[U .e#@sdZddlZddlZddlZddlZddlmZmZmZddl m Z m Z dgZ ddZ Gd d d eZd d ZeZ[eZdd dZdS)zG Parser for the environment markers micro-language defined in PEP 508. N)python_implementationurlparse string_types)in_venv parse_marker interpretcCst|tr|sdS|ddkS)NFr'") isinstancer)or ?/usr/lib/python3.8/site-packages/pip/_vendor/distlib/markers.py _is_literalsrc @sfeZdZdZddddddddddddd dd dd dd dd dddd ZddZdS) Evaluatorz; This class is used to evaluate marker expessions. cCs||kSNr xyr r r $zEvaluator.cCs||kSrr rr r r r%rcCs||kp||kSrr rr r r r&rcCs||kSrr rr r r r'rcCs||kSrr rr r r r(rcCs||kp||kSrr rr r r r)rcCs||kSrr rr r r r*rcCs||kp||kSrr rr r r r+rcCs|o|Srr rr r r r,rcCs|p|Srr rr r r r-rcCs||kSrr rr r r r.rcCs||kSrr rr r r r/r) z==z===z~=z!=z>=andorinznot inc Cst|trB|ddkr$|dd}q||kr8td|||}n|d}||jkr`td||d}|d }t|drt|d rtd |||f|||}|||}|j|||}|S) z Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rr rzunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison: %s %s %s)r r SyntaxError operationsNotImplementedErrorrevaluate) selfexprcontextresultrZelhsZerhsrrr r r r"2s"        zEvaluator.evaluateN)__name__ __module__ __qualname____doc__r r"r r r r rsrc Csdd}ttdr(|tjj}tjj}nd}d}||tjttt t tt t t t ddtjd }|S)NcSs<d|j|j|jf}|j}|dkr8||dt|j7}|S)Nz%s.%s.%sfinalr)majorminormicro releaselevelstrserial)infoversionZkindr r r format_full_versionNs z,default_context..format_full_versionimplementation0) implementation_nameimplementation_versionZos_nameZplatform_machineZplatform_python_implementationZplatform_releaseZplatform_systemZplatform_versionZplatform_in_venvZpython_full_versionpython_versionZ sys_platform)hasattrsysr5r3nameosplatformmachinerreleasesystemr0rr;)r4r:r9r&r r r default_contextMs(   rDc Cszt|\}}Wn2tk rB}ztd||fW5d}~XYnX|rd|ddkrdtd||ftt}|rz||t||S)z Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping z)Unable to interpret marker syntax: %s: %sNr#z*unexpected trailing data in marker: %s: %s)r ExceptionrdictDEFAULT_CONTEXTupdate evaluatorr")ZmarkerZexecution_contextr$rester%r r r rqs " )N)r*r?r=r@recompatrrrutilrr__all__robjectrrDrHrJrr r r r s/PKd]AS)O)O0distlib/__pycache__/version.cpython-38.opt-1.pycnu[U .e_[ @sfdZddlZddlZddlmZddlmZdddd d d d d gZee Z Gdd d e Z Gddde ZGddde ZedZddZeZGdddeZddZGdddeZeddfeddfeddfedd fed!d"fed#d"fed$d%fed&d'fed(d)fed*d+ff Zed,dfed-dfed.d%fed$d%fed/dffZed0Zd1d2Zd3d4Zed5ejZd6d6d7d6d8ddd9Zd:d;ZGdejZ"d?d@Z#dAdBZ$GdCd d eZ%GdDd d eZ&GdEdFdFe Z'e'eeee'ee!dGdHe'e$e&edIZ(e(dJe(dK<dLd Z)dS)Mz~ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. N) string_typesparse_requirementNormalizedVersionNormalizedMatcher LegacyVersion LegacyMatcherSemanticVersionSemanticMatcherUnsupportedVersionError get_schemec@seZdZdZdS)r zThis is an unsupported version.N)__name__ __module__ __qualname____doc__rr?/usr/lib/python3.8/site-packages/pip/_vendor/distlib/version.pyr sc@sxeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZeddZdS)VersioncCs"||_}|||_}dSN)strip_stringparse_parts)selfspartsrrr__init__szVersion.__init__cCs tddS)Nzplease implement in a subclassNotImplementedErrorrrrrrr%sz Version.parsecCs$t|t|kr td||fdS)Nzcannot compare %r and %r)type TypeErrorrotherrrr_check_compatible(szVersion._check_compatiblecCs|||j|jkSrr%rr#rrr__eq__,s zVersion.__eq__cCs || Srr'r#rrr__ne__0szVersion.__ne__cCs|||j|jkSrr&r#rrr__lt__3s zVersion.__lt__cCs||p|| Srr*r'r#rrr__gt__7szVersion.__gt__cCs||p||Srr+r#rrr__le__:szVersion.__le__cCs||p||Sr)r,r'r#rrr__ge__=szVersion.__ge__cCs t|jSr)hashrrrrr__hash__AszVersion.__hash__cCsd|jj|jfS)Nz%s('%s') __class__rrr0rrr__repr__DszVersion.__repr__cCs|jSrrr0rrr__str__GszVersion.__str__cCs tddS)NzPlease implement in subclasses.rr0rrr is_prereleaseJszVersion.is_prereleaseN)rrrrrr%r'r)r*r,r-r.r1r4r6propertyr7rrrrrsrc @seZdZdZddddddddddddd dd dd Zd d ZddZddZeddZ ddZ ddZ ddZ ddZ ddZddZdS) MatcherNcCs||kSrrvcprrrTzMatcher.cCs||kSrrr:rrrr>Ur?cCs||kp||kSrrr:rrrr>Vr?cCs||kp||kSrrr:rrrr>Wr?cCs||kSrrr:rrrr>Xr?cCs||kSrrr:rrrr>Yr?cCs||kp||kSrrr:rrrr>[r?cCs||kSrrr:rrrr>\r?)<><=>======~=!=cCst|Srrr rrrraszMatcher.parse_requirementcCs|jdkrtd||_}||}|s:td||j|_|j|_g}|jr|jD]d\}}| dr|dkrtd||ddd}}||n||d}}| |||fq^t ||_ dS) NzPlease specify a version classz Not valid: %rz.*)rDrGz#'.*' not allowed for %r constraintsTF) version_class ValueErrorrrrnamelowerkeyZ constraintsendswithappendtupler)rrrZclistopZvnprefixrrrrds*      zMatcher.__init__cCsxt|tr||}|jD]X\}}}|j|}t|trDt||}|s`d||jjf}t |||||sdSqdS)z Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. z%r not implemented for %sFT) isinstancerrIr _operatorsgetgetattrr3rr)rversionoperator constraintrSfmsgrrrmatchs       z Matcher.matchcCs6d}t|jdkr2|jdddkr2|jdd}|S)Nrr)rDrE)lenr)rresultrrr exact_versions zMatcher.exact_versioncCs0t|t|ks|j|jkr,td||fdS)Nzcannot compare %s and %s)r!rKr"r#rrrr%szMatcher._check_compatiblecCs"|||j|jko |j|jkSr)r%rMrr#rrrr's zMatcher.__eq__cCs || Srr(r#rrrr)szMatcher.__ne__cCst|jt|jSr)r/rMrr0rrrr1szMatcher.__hash__cCsd|jj|jfS)Nz%s(%r)r2r0rrrr4szMatcher.__repr__cCs|jSrr5r0rrrr6szMatcher.__str__)rrrrIrUrrr]r8r`r%r'r)r1r4r6rrrrr9Os* r9zk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c Cs|}t|}|s"td||}tdd|ddD}t|dkrl|ddkrl|dd}qF|dszd}n t|d}|dd }|d d }|d d }|d}|dkrd}n|dt|df}|dkrd}n|dt|df}|dkrd}n|dt|df}|dkr*d}nHg} |dD]0} | rTdt| f} nd| f} | | q8t| }|s|s|rd}nd}|sd}|sd}||||||fS)NzNot a valid version: %scss|]}t|VqdSrint.0r;rrr sz_pep_440_key..r.r )NNr)arg)z)_)final) rPEP440_VERSION_REr]r groupsrPsplitr^rbisdigitrO) rmrtZnumsZepochpreZpostdevZlocalrpartrrr _pep_440_keysT          r{c@s6eZdZdZddZedddddgZed d Zd S) raIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b cCs<t|}t|}|}tdd|ddD|_|S)Ncss|]}t|VqdSrrarcrrrresz*NormalizedVersion.parse..rrf)_normalized_keyrsr]rtrPru_release_clause)rrr_rwrtrrrr s  zNormalizedVersion.parserobr<rcrycstfddjDS)Nc3s |]}|r|djkVqdS)rN) PREREL_TAGS)rdtr0rrresz2NormalizedVersion.is_prerelease..)anyrr0rr0rr7szNormalizedVersion.is_prereleaseN) rrrrrsetrr8r7rrrrrs  cCs>t|}t|}||krdS||s*dSt|}||dkS)NTFrf)str startswithr^)xynrrr _match_prefixs rc @sneZdZeZddddddddd Zd d Zd d ZddZddZ ddZ ddZ ddZ ddZ ddZdS)r_match_compatible _match_lt _match_gt _match_le _match_ge _match_eq_match_arbitrary _match_ne)rFr@rArBrCrDrErGcCsV|rd|ko|jd}n|jd o,|jd}|rN|jddd}||}||fS)N+rgrr)rrrurI)rrXrZrSZ strip_localrrrr _adjust_local6s zNormalizedMatcher._adjust_localcCsD||||\}}||krdS|j}ddd|D}t|| S)NFrfcSsg|] }t|qSrrrdirrr Isz/NormalizedMatcher._match_lt..rr}joinrrrXrZrSZrelease_clauseZpfxrrrrDs zNormalizedMatcher._match_ltcCsD||||\}}||krdS|j}ddd|D}t|| S)NFrfcSsg|] }t|qSrrrrrrrQsz/NormalizedMatcher._match_gt..rrrrrrLs zNormalizedMatcher._match_gtcCs||||\}}||kSrrrrXrZrSrrrrTszNormalizedMatcher._match_lecCs||||\}}||kSrrrrrrrXszNormalizedMatcher._match_gecCs.||||\}}|s ||k}n t||}|SrrrrrXrZrSr_rrrr\s   zNormalizedMatcher._match_eqcCst|t|kSrrrrrrrdsz"NormalizedMatcher._match_arbitrarycCs0||||\}}|s ||k}n t|| }|Srrrrrrrgs   zNormalizedMatcher._match_necCsf||||\}}||krdS||kr*dS|j}t|dkrH|dd}ddd|D}t||S)NTFrrgrfcSsg|] }t|qSrrrrrrrzsz7NormalizedMatcher._match_compatible..)rr}r^rrrrrrros  z#NormalizedMatcher._match_compatibleN)rrrrrIrUrrrrrrrrrrrrrr's& z[.+-]$z^[.](\d)z0.\1z^[.-]z ^\((.*)\)$\1z^v(ersion)?\s*(\d+)z\2z^r(ev)?\s*(\d+)z[.]{2,}rfz\b(alfa|apha)\balphaz\b(pre-alpha|prealpha)\bz pre.alphaz \(beta\)$betaz ^[:~._+-]+z [,*")([\]]z[~:+_ -]z\.$z (\d+(\.\d+)*)cCsL|}tD]\}}|||}q|s.d}t|}|sFd}|}n|dd}dd|D}t|dkr~| dqft|dkr|| d}n8d dd|ddD|| d}|dd}d d d|D}|}|rt D]\}}|||}q|s|}nd |kr*d nd }|||}t |sHd}|S) z Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. z0.0.0rrfcSsg|] }t|qSrrarrrrrsz-_suggest_semantic_version..NcSsg|] }t|qSrrrrrrrscSsg|] }t|qSrrrrrrrsry-r)rrL _REPLACEMENTSsub_NUMERIC_PREFIXr]rtrur^rOendr_SUFFIX_REPLACEMENTS is_semver)rr_ZpatreplrwrSsuffixseprrr_suggest_semantic_versions:      ,    rcCshzt||WStk r"YnX|}dD]\}}|||}q0tdd|}tdd|}tdd|}tdd |}td d |}|d r|d d}tdd |}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd |}z t|Wntk rbd}YnX|S)!aSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. ))z-alpharo)z-betar~)rro)rr~)rr<)z-finalr)z-prer<)z-releaser)z.releaser)z-stabler)rrf)rqrf) r)z.finalr)rrrzpre$Zpre0zdev$Zdev0z([abc]|rc)[\-\.](\d+)$z\1\2z[\-\.](dev)[\-\.]?r?(\d+)$z.\1\2z[.~]?([abc])\.?rr;rNz\b0+(\d+)(?!\d)z (\d+[abc])$z\g<1>0z\.?(dev-r|dev\.r)\.?(\d+)$z.dev\2z-(a|b|c)(\d+)$z[\.\-](dev|devel)$z.dev0z(?![\.\-])dev$z(final|stable)$rz\.?(r|-|-r)\.?(\d+)$z.post\2z\.?(dev|git|bzr)\.?(\d+)$z\.?(pre|preview|-c)(\d+)$zc\g<2>zp(\d+)$z.post\1)r|r rLreplacererr)rZrsZorigrrrr_suggest_normalized_versions>      rz([a-z]+|\d+|[\.-])r<zfinal-@)rxZpreviewrrryrrfcCsrdd}g}||D]T}|dr^|dkrD|rD|ddkrD|q*|r^|ddkr^|qD||qt|S)NcSstg}t|D]R}t||}|rd|ddkrBdkrRnn |d}nd|}||q|d|S)N0r9**final) _VERSION_PARTrurL_VERSION_REPLACErVzfillrO)rr_r=rrr get_partsCs     z_legacy_key..get_partsrrrgz*final-Z00000000)rpoprOrP)rrr_r=rrr _legacy_keyBs      rc@s eZdZddZeddZdS)rcCst|Sr)rr rrrr]szLegacyVersion.parsecCs8d}|jD](}t|tr |dr |dkr d}q4q |S)NFrrT)rrTrr)rr_rrrrr7`s zLegacyVersion.is_prereleaseNrrrrr8r7rrrrr\sc@s4eZdZeZeejZded<e dZ ddZ dS)r rrFz^(\d+(\.\d+)*)cCs`||kr dS|jt|}|s2td||dS|d}d|krV|ddd}t||S)NFzACannot compute compatible match for version %s and constraint %sTrrfr) numeric_rer]rloggerZwarningrtrsplitr)rrXrZrSrwrrrrrss zLegacyMatcher._match_compatibleN) rrrrrIdictr9rUrcompilerrrrrrr ks   zN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$cCs t|Sr) _SEMVER_REr])rrrrrsrc Csndd}t|}|st||}dd|ddD\}}}||dd||dd}}|||f||fS) NcSs8|dkr|f}n$|ddd}tdd|D}|S)NrrfcSs"g|]}|r|dn|qS)r)rvr)rdr=rrrrsz5_semantic_key..make_tuple..)rurP)rZabsentr_rrrr make_tuples z!_semantic_key..make_tuplecSsg|] }t|qSrrarrrrrsz!_semantic_key..r|r)rr rt) rrrwrtmajorminorZpatchrxZbuildrrr _semantic_keys rc@s eZdZddZeddZdS)r cCst|Sr)rr rrrrszSemanticVersion.parsecCs|jdddkS)Nrrr)rr0rrrr7szSemanticVersion.is_prereleaseNrrrrrr sc@seZdZeZdS)r N)rrrr rIrrrrr sc@s6eZdZd ddZddZddZdd Zd d ZdS) VersionSchemeNcCs||_||_||_dSr)rMmatcher suggester)rrMrrrrrrszVersionScheme.__init__cCs2z|j|d}Wntk r,d}YnX|SNTF)rrIr rrr_rrris_valid_versions   zVersionScheme.is_valid_versioncCs0z||d}Wntk r*d}YnX|Sr)rr rrrris_valid_matchers   zVersionScheme.is_valid_matchercCs|d|S)z: Used for processing some metadata fields zdummy_name (%s))rr rrris_valid_constraint_listsz&VersionScheme.is_valid_constraint_listcCs|jdkrd}n ||}|Sr)rrrrrsuggests  zVersionScheme.suggest)N)rrrrrrrrrrrrrs  rcCs|Srrr rrrr>r?r>) normalizedlegacyZsemanticrdefaultcCs|tkrtd|t|S)Nzunknown scheme name: %r)_SCHEMESrJ)rKrrrr s )*rZloggingrcompatrutilr__all__Z getLoggerrrrJr objectrr9rrsr{r|rrrrrrrrIrrrrr rrrr r rrr rrrrs   1d =$ W               .r  $ PKd]?8L ( (+distlib/__pycache__/manifest.cpython-38.pycnu[U ʗRe9@sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ e eZedejZed ejejBZejdd ZGd ddeZdS) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode convert_pathManifestz\\w* z#.*?(?= )| (?=$)c@szeZdZdZdddZddZddZd d Zdd d ZddZ ddZ ddZ dddZ d ddZ d!ddZddZdS)"rz~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. NcCs>tjtj|pt|_|jtj|_d|_t |_ dS)zd Initialise an instance. :param base: The base directory to explore under. N) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/manifest.py__init__*szManifest.__init__cCsddlm}m}m}g|_}|j}|g}|j}|j}|r|}t |} | D]R} tj || } t| } | j } || r|t | qN|| rN|| sN|| qNq6dS)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrrpopappendr listdirr joinst_moder)rrrrrrootstackrpushnamesnamefullnamermoderrrfindall9s"   zManifest.findallcCs4||jstj|j|}|jtj|dS)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) startswithrr r rrraddr )ritemrrrr*Ts z Manifest.addcCs|D]}||qdS)z Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r*)ritemsr+rrradd_many^szManifest.add_manyFcsbfddtj}|rFt}|D]}|tj|q&||O}ddtdd|DDS)z8 Return sorted files in directory order csJ||td||jkrFtj|\}}|dks.add_dircSsg|]}tjj|qSr)r r r).0Z path_tuplerrr zsz#Manifest.sorted..css|]}tj|VqdS)N)r r r2)r:r rrr {sz"Manifest.sorted..)rrr r dirnamesorted)rZwantdirsresultr4frr8rr>gs zManifest.sortedcCst|_g|_dS)zClear all collected files.N)rrr)rrrrclear}szManifest.clearcCsj||\}}}}|dkrB|D]}|j|ddstd|qn$|dkrf|D]}|j|dd}qNn|dkr|D]}|j|ddsrtd|qrn|d kr|D]}|j|dd}qn|d kr|D] }|j||d std ||qn|d kr |D]}|j||d }qn\|dkr2|jd|d sftd|n4|dkrZ|jd|d sftd|n td|dS)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands includeT)anchorzno files found matching %rexcludeglobal-includeFz3no files found matching %r anywhere in distributionglobal-excluderecursive-include)rz-no files found matching %r under directory %rrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr0warning_exclude_patternr)r directiveactionpatternsthedirZ dirpatternpatternfoundrrrprocess_directivesP   zManifest.process_directivecCs|}t|dkr,|ddkr,|dd|d}d}}}|dkrxt|dkr`td|d d |ddD}n~|d krt|d krtd |t|d}dd |ddD}n:|dkrt|dkrtd|t|d}n td|||||fS)z Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rr)rBrDrErFrGrHrIrJrBN)rBrDrErFrz$%r expects ...cSsg|] }t|qSrrr:wordrrrr;sz-Manifest._parse_directive..)rGrHz*%r expects ...cSsg|] }t|qSrrrVrrrr;s)rIrJz!%r expects a single zunknown action %r)r2leninsertrr)rrOwordsrPrQrRZ dir_patternrrrrKs4       zManifest._parse_directiveTcCsPd}|||||}|jdkr&||jD]}||r,|j|d}q,|S)aSelect strings (presumably filenames) from 'self.files' that match 'pattern', a Unix-style wildcard (glob) pattern. Patterns are not quite the same as implemented by the 'fnmatch' module: '*' and '?' match non-special characters, where "special" is platform-dependent: slash on Unix; colon, slash, and backslash on DOS/Windows; and colon on Mac OS. If 'anchor' is true (the default), then the pattern match is more stringent: "*.py" will match "foo.py" but not "foo/bar.py". If 'anchor' is false, both of these will match. If 'prefix' is supplied, then only filenames starting with 'prefix' (itself a pattern) and ending with 'pattern', with anything in between them, will match. 'anchor' is ignored in this case. If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and 'pattern' is assumed to be either a string containing a regex or a regex object -- no translation is done, the regex is just compiled and used as-is. Selected strings will be added to self.files. Return True if files are found. FNT)_translate_patternrr(searchrr*)rrSrCris_regexrT pattern_rer%rrrrLs    zManifest._include_patterncCsBd}|||||}t|jD]}||r|j|d}q|S)atRemove strings (presumably filenames) from 'files' that match 'pattern'. Other parameters are the same as for 'include_pattern()', above. The list 'self.files' is modified in place. Return True if files are found. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions FT)r\listrr]remove)rrSrCrr^rTr_r@rrrrN)s   zManifest._exclude_patternc Cs|rt|trt|S|Stdkr:|dd\}}}|rj||}tdkrn||rd||snt nd}t t j |jd} |dk rftdkr|d} ||dt|  } n>||} | |r| |st | t|t| t|} t j} t jdkrd} tdkr4d| | | d|f}n0|t|t|t|}d || | | ||f}n8|rtdkrd| |}nd || |t|df}t|S) aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). )rXrr7r.N\z\\^z.*z%s%s%s%s.*%s%sz%s%s%s) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionr)endswithr3escaper r rrrYr) rrSrCrr^startr7endr_rZ empty_patternZ prefix_rerrrrr\=sH             zManifest._translate_patterncCs8t|}tj}tjdkrd}d|}td||}|S)zTranslate a shell-like glob pattern to a regular expression. Return a string containing the regex. Differs from 'fnmatch.translate()' in that '*' does not match "special characters" (which are platform-specific). rbz\\\\z\1[^%s]z((?rArUrKrLrNr\rirrrrr%s&   O/ )  7)rvrologgingr rfsysr.rcompatrutilr__all__ getLoggerrsr0rgMZ_COLLAPSE_PATTERNSZ_COMMENTED_LINE version_inforhobjectrrrrrs    PKd]+Zgg1distlib/__pycache__/metadata.cpython-38.opt-1.pycnu[U .e*@sdZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZeeZGd d d e ZGd dde ZGddde ZGddde ZdddgZdZ dZ!e"dZ#e"dZ$dZ%dZ&dZ'dZ(dZ)dZ*d Z+e*d!Z,d"Z-e.Z/e/0e%e/0e&e/0e(e/0e*e/0e,e"d#Z1d$d%Z2d&d'Z3d(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFZ4dGZ5dHZ6dIZ7dJZ8dKZ9dLZ:dMZ;e<Z=e"dNZ>dXdPdQZ?GdRdSdSe<Z@dTZAdUZBdVZCGdWdde<ZDdS)YzImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). )unicode_literalsN)message_from_file)DistlibException __version__)StringIO string_types text_type) interpret)extract_by_key get_extras) get_schemePEP440_VERSION_REc@seZdZdZdS)MetadataMissingErrorzA required metadata is missingN__name__ __module__ __qualname____doc__rr@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/metadata.pyrsrc@seZdZdZdS)MetadataConflictErrorz>Attempt to read or write metadata fields that are conflictual.Nrrrrrr src@seZdZdZdS) MetadataUnrecognizedVersionErrorz Unknown metadata version number.Nrrrrrr$src@seZdZdZdS)MetadataInvalidErrorzA metadata value is invalidNrrrrrr(srMetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONutf-81.1z \| ) Metadata-VersionNameVersionPlatformSummary DescriptionKeywords Home-pageAuthor Author-emailLicense)r r!r"r#Supported-Platformr$r%r&r'r(r)r* Classifier Download-URL ObsoletesProvidesRequires)r.r/r0r,r-)r r!r"r#r+r$r%r&r'r(r) MaintainerMaintainer-emailr*r,r-Obsoletes-Dist Project-URL Provides-Dist Requires-DistRequires-PythonRequires-External)r5r6r7r3r8r1r2r4)r r!r"r#r+r$r%r&r'r(r)r1r2r*r,r-r3r4r5r6r7r8Private-Version Obsoleted-BySetup-Requires-Dist ExtensionProvides-Extra)r9r=r:r;r<)Description-Content-Typer0r/)r>z"extra\s*==\s*("([^"]+)"|'([^']+)')cCsL|dkr tS|dkrtS|dkr$tS|dkr4ttS|dkr@tSt|dS)N1.0r1.2)1.32.12.0) _241_FIELDS _314_FIELDS _345_FIELDS _566_FIELDS _426_FIELDSr)versionrrr_version2fieldlistpsrJc CsBdd}g}|D]"\}}|gddfkr,q||qddddd d g}|D]}|tkrvd|krv|dtd ||tkrd|kr|dtd ||tkrd|kr|dtd ||tkrd|kr|dtd||tkrd |kr|dkr|d td||t krLd |krL|d td|qLt |dkrZ|dSt |dkr|td|t dd|ko||t }d|ko||t }d |ko||t}d |ko||t} t|t|t|t| dkrt d|s |s |s | s t|kr tS|r*dS|r4dS|r>d Sd S)z5Detect the best version depending on the fields used.cSs|D]}||krdSqdS)NTFr)keysmarkersmarkerrrr _has_markersz"_best_version.._has_markerUNKNOWNNr?rr@rArCrBzRemoved 1.0 due to %szRemoved 1.1 due to %szRemoved 1.2 due to %szRemoved 1.3 due to %sr%zRemoved 2.1 due to %szRemoved 2.0 due to %srrz)Out of options - unknown metadata set: %szUnknown metadata setz,You used incompatible 1.1/1.2/2.0/2.1 fields)itemsappendrDremoveloggerdebugrErFrGrHlenr _314_MARKERS _345_MARKERS _566_MARKERS _426_MARKERSintr) fieldsrNrKkeyvalueZpossible_versionsZis_1_1Zis_1_2Zis_2_1Zis_2_0rrr _best_version~s`              & r^r r!r"r#r+r$r%r&r'r(r)r1r2r*r,r-r3r5r6r;r7r8r0r/r.r4r9r:r<r=)metadata_versionnamerIplatformZsupported_platformsummary descriptionkeywords home_pageauthor author_email maintainermaintainer_emaillicense classifier download_urlobsoletes_dist provides_dist requires_distsetup_requires_distrequires_pythonrequires_externalrequiresprovides obsoletes project_urlZprivate_versionZ obsoleted_by extensionZprovides_extra)r6r3r5)r7)r")r#r,r.r0r/r3r5r6r8r4r+r;r=r<)r4)r&)r(r1r$r%z[^A-Za-z0-9.]+FcCs0|r$td|}td|dd}d||fS)zhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.- .z%s-%s) _FILESAFEsubreplace)r`rIZ for_filenamerrr_get_name_and_versions r~c@s eZdZdZd?ddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZd@ddZddZdd Zd!d"Zd#d$ZdAd%d&ZdBd'd(ZdCd)d*Zd+d,Zefd-d.ZdDd/d0ZdEd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!dS)FLegacyMetadataaaThe legacy metadata of a release. Supports versions 1.0, 1.1 and 1.2 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name NdefaultcCsz|||gddkrtdi|_g|_d|_||_|dk rH||n.|dk r\||n|dk rv||| dS)N'path, fileobj and mapping are exclusive) count TypeError_fieldsZrequires_filesZ _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingrrrr__init__s   zLegacyMetadata.__init__cCst|j|jd<dSNr )r^rrrrrr"sz#LegacyMetadata.set_metadata_versioncCs|d||fdS)Nz%s: %s )write)rrr`r]rrr _write_field%szLegacyMetadata._write_fieldcCs ||SN)getrr`rrr __getitem__(szLegacyMetadata.__getitem__cCs |||Sr)set)rr`r]rrr __setitem__+szLegacyMetadata.__setitem__cCs8||}z |j|=Wntk r2t|YnXdSr) _convert_namerKeyError)rr` field_namerrr __delitem__.s   zLegacyMetadata.__delitem__cCs||jkp|||jkSr)rrrrrr __contains__5s zLegacyMetadata.__contains__cCs(|tkr |S|dd}t||S)Nrx_) _ALL_FIELDSr}lower _ATTR2FIELDrrrrrr9szLegacyMetadata._convert_namecCs|tks|tkrgSdS)NrO) _LISTFIELDS_ELEMENTSFIELDrrrr_default_value?szLegacyMetadata._default_valuecCs&|jdkrtd|Std|SdS)Nr?r )r__LINE_PREFIX_PRE_1_2r|_LINE_PREFIX_1_2rr]rrr_remove_line_prefixDs  z"LegacyMetadata._remove_line_prefixcCs|tkr||St|dSr)rAttributeErrorrrrr __getattr__JszLegacyMetadata.__getattr__FcCst|d|d|S)zhReturn the distribution name with version. If filesafe is true, return a filename-escaped form.r!r")r~)rZfilesaferrr get_fullnameUszLegacyMetadata.get_fullnamecCs||}|tkS)z+return True if name is a valid metadata key)rrrrrris_field[s zLegacyMetadata.is_fieldcCs||}|tkSr)rrrrrris_multi_field`s zLegacyMetadata.is_multi_fieldcCs.tj|ddd}z||W5|XdS)z*Read the metadata values from a file path.rrencodingN)codecsopencloser)rfilepathfprrrrdszLegacyMetadata.readcCst|}|d|jd<tD]p}||kr(q|tkrf||}|tkrX|dk rXdd|D}|||q||}|dk r|dkr|||qdS)z,Read the metadata values from a file object.zmetadata-versionr NcSsg|]}t|dqS,)tuplesplit.0r]rrr ysz,LegacyMetadata.read_file..rO)rrrrZget_all_LISTTUPLEFIELDSr)rZfileobmsgfieldvaluesr]rrrrls zLegacyMetadata.read_filecCs0tj|ddd}z|||W5|XdS)z&Write the metadata fields to filepath.wrrN)rrr write_file)rr skip_unknownrrrrrszLegacyMetadata.writecCs|t|dD]}||}|r8|dgdgfkr8q|tkrV|||d|q|tkr|dkr|jdkr~|dd}n |dd}|g}|t krd d |D}|D]}||||qqd S) z0Write the PKG-INFO format data to a file object.r rOrr%rrrz |cSsg|]}d|qSrjoinrrrrrsz-LegacyMetadata.write_file..N) rrJrrrrrr_r}r)rZ fileobjectrrrr]rrrrs$   zLegacyMetadata.write_filec svfdd}|sn@t|dr:|D]}||||q$n|D]\}}|||q>|rr|D]\}}|||q^dS)aSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. cs"|tkr|r||dSr)rrr)r\r]rrr_sets z#LegacyMetadata.update.._setrKN)hasattrrKrP)rotherkwargsrkvrrrrs     zLegacyMetadata.updatecCsh||}|tks|dkrNt|ttfsNt|trHdd|dD}qzg}n,|tkrzt|ttfszt|trv|g}ng}t t j r<|d}t |j }|tkr|dk r|D](}||ddstd |||qnb|tkr |dk r ||s.rr!N;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r%)rr isinstancelistrrrrrSZ isEnabledForloggingZWARNINGr r_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrr)rr`r]Z project_namerrrrrrsV           zLegacyMetadata.setcCs||}||jkr*|tkr&||}|S|tkr@|j|}|S|tkr|j|}|dkr^gSg}|D].}|tkr~||qf||d|dfqf|S|tkr|j|}t |t r| dS|j|S)zGet a metadata field.Nrrr) rr_MISSINGrrrrrQrrrr)rr`rr]resvalrrrrs.         zLegacyMetadata.getc s|gg}}dD]}||kr||q|rP|gkrPdd|}t|dD]}||krT||qT|ddkr||fSt|jfdd}t|ftjft j ffD]@\}}|D]2} | | d } | d k r|| s|d | | fqq||fS) zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are provided)r!r"zmissing required metadata: %s, )r'r(r r@cs(|D]}|ddsdSqdS)NrrFT)rr)r]rrrrare_valid_constraints#sz3LegacyMetadata.check..are_valid_constraintsNzWrong value for '%s': %s) rrQrrr rrrrrrr) rstrictmissingwarningsattrrrr[Z controllerrr]rrrcheck s8         zLegacyMetadata.checkcCs|d}i}|D]"\}}|r*||jkr||||<q|ddkrd}|D]B\}}|rb||jkrL|dkrx||||<qLdd||D||<qLn8|ddkrd }|D]"\}}|r||jkr||||<q|S) zReturn fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). ) )r_r )r`r!)rIr")rbr$)rer')rfr()rgr))rjr*)rcr%)rdr&)rar#) classifiersr,)rlr-r r@))ror6)rqr7)rrr8)rnr5)rmr3)rvr4)rhr1)rir2rvcSsg|]}d|qSrr)rurrrrbsz)LegacyMetadata.todict..r))rtr/)rsr0)rur.)rr)rZ skip_missingZ mapping_1_0datar\rZ mapping_1_2Z mapping_1_1rrrtodict5s&     zLegacyMetadata.todictcCs8|ddkr$dD]}||kr||=q|d|7<dS)Nr r)r.r0r/r6r)r requirementsrrrradd_requirementsps  zLegacyMetadata.add_requirementscCstt|dSr)rrJrrrrrK{szLegacyMetadata.keysccs|D] }|VqdSrrK)rr\rrr__iter__~s zLegacyMetadata.__iter__csfddDS)Ncsg|] }|qSrrrr\rrrrsz)LegacyMetadata.values..rrrrrrszLegacyMetadata.valuescsfddDS)Ncsg|]}||fqSrrrrrrrsz(LegacyMetadata.items..rrrrrrPszLegacyMetadata.itemscCsd|jj|j|jfS)Nz <%s %s %s>) __class__rr`rIrrrr__repr__s zLegacyMetadata.__repr__)NNNr)F)F)F)N)F)F)"rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrKrrrPrrrrrrs@      ,  , ; rz pydist.jsonz metadata.jsonZMETADATAc@seZdZdZedZedejZe Z edZ dZ de Zdddd Zd Zd Zedfedfe dfe dfd Zd ZdDddZedZdefZdefZdefdefeeedefeeeedefddd Z[[ddZdEddZddZed d!Z ed"d#Z!e!j"d$d#Z!dFd%d&Z#ed'd(Z$ed)d*Z%e%j"d+d*Z%d,d-Z&d.d/Z'd0d1Z(d2d3Z)d4d5d6d7d8dd9Z*d:d;Z+dGd>d?Z,d@dAZ-dBdCZ.dS)Hrz The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. z ^\d+(\.\d+)*$z!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$z .{1,2047}rCz distlib (%s)r)legacy)r`rIrbzqname version license summary description author author_email keywords platform home_page classifiers download_urlzwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environments)r_r`rIrb)_legacy_datarNrc Cs0|||gddkrtdd|_d|_||_|dk rzz|||||_Wn*tk rvt||d|_|YnXnd}|rt |d}| }W5QRXn |r| }|dkr|j |j d|_ndt |ts|d}zt||_||j|Wn0tk r*tt||d|_|YnXdS)Nrr)rrrbr_ generatorr)rr)rrrrr_validate_mappingrrvalidaterrMETADATA_VERSION GENERATORrr decodejsonloads ValueErrorr)rrrrrrfrrrrs@       zMetadata.__init__)r`rIrjrdrbr6r;r=r,)r-N)r N) run_requiresbuild_requires dev_requiresZ test_requires meta_requiresextrasmodules namespacesexportscommandsrZ source_urlr_c CsXt|d}t|d}||kr||\}}|jr^|dkrP|dkrHdn|}n |j|}n|dkrjdn|}|dkr|j||}nt}|}|jd} | r |dkr| d|}nP|dkr| d} | r| ||}n,| d } | s|jd } | r | ||}||krT|}n:||kr2t||}n"|jrH|j|}n |j|}|S) N common_keys mapped_keysr rrrr extensionsr python.commandsrpython.detailspython.exports)object__getattribute__rrr) rr\commonmappedlkZmakerresultr]sentineldrrrrsD            zMetadata.__getattribute__cCsH||jkrD|j|\}}|p |j|krD||}|sDtd||fdS)Nz.'%s' is an invalid value for the '%s' property)SYNTAX_VALIDATORSrmatchr)rr\r]rpattern exclusionsmrrr_validate_value+s  zMetadata._validate_valuecCs*|||t|d}t|d}||kr||\}}|jrV|dkrJt||j|<nf|dkrj||j|<nR|jdi}|dkr||d<n2|dkr|di}|||<n|d i}|||<nh||krt|||nP|d krt|t r| }|r| }ng}|jr||j|<n ||j|<dS) Nr r r r r rrrrrd) rrrrNotImplementedErrorr setdefault __setattr__rrrr)rr\r]rrrrrrrrr!5s<               zMetadata.__setattr__cCst|j|jdSNT)r~r`rIrrrrname_and_version\szMetadata.name_and_versioncCsF|jr|jd}n|jdg}d|j|jf}||krB|||S)Nr5rtz%s (%s))rrr r`rIrQ)rrsrrrrt`s  zMetadata.providescCs |jr||jd<n ||jd<dS)Nr5rt)rrrrrrrtks c Cs|jr |}ng}t|pg|j}|D]d}d|kr>d|kr>d}n8d|krLd}n|d|k}|rv|d}|rvt||}|r$||dq$dD]F}d|} | |kr|| |jd|g}||j|||dq|S) a Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. extra environmentTrs)ZbuildZdevZtestz:%s:z %s_requires)renv) rr rrr extendrRrget_requirements) rreqtsrr'rrZincluderMr\errrr)rs2      zMetadata.get_requirementscCs|jr|S|jSr)r _from_legacyrrrrr dictionaryszMetadata.dictionarycCs|jr tnt|j|jSdSr)rrr rDEPENDENCY_KEYSrrrr dependenciesszMetadata.dependenciescCs|jr tn |j|dSr)rrrrrrrrr/sc Cs|d|jkrtg}|jD]"\}}||kr$||kr$||q$|rbdd|}t||D]\}}||||qjdS)Nr_zMissing metadata items: %sr) rrrMANDATORY_KEYSrPrQrrr) rrrrr\rrrrrrrrs zMetadata._validate_mappingcCsB|jr.|jd\}}|s|r>td||n||j|jdS)NTz#Metadata: missing: %s, warnings: %s)rrrSrrrr)rrrrrrrszMetadata.validatecCs(|jr|jdSt|j|j}|SdSr")rrr r INDEX_KEYS)rrrrrrs zMetadata.todictc Cs|j|jd}|jd}dD]*}||kr|dkr8d}n|}||||<q|dg}|dgkrdg}||d<d }|D]*\}}||krt||rtd ||ig||<qt|j|d <i}i} |S) NrT)r`rIrjrbrcrkrkrr&rd))ror)rprrsrt)rrrrrrt) rrZlmdrnkkwrKokrfrhrrrr,s,     zMetadata._from_legacyr!r"r*r$r%)r`rIrjrbrcrcCsdd}t}|j}|jD]\}}||kr||||<q||j|j}||j|j}|jrpt |j|d<t ||d<t ||d<|S)NcSst}|D]|}|d}|d}|d}|D]V}|sF|sF||q.d}|rVd|}|rp|rld||f}n|}|d||fq.q |S)Nr%r&rsr2z extra == "%s"z (%s) and %sr)rraddr)entriesr*r+r%r'ZrlistrrMrrrprocess_entriess"   z,Metadata._to_legacy..process_entriesr=r6r;) rrLEGACY_MAPPINGrPrrrrrsorted)rr8rZnmdr3r5Zr1Zr2rrr _to_legacys  zMetadata._to_legacyFTc Cs||gddkrtd||r`|jr4|j}n|}|rP|j||dq|j||dn^|jrp|}n|j}|rt j ||ddddn.t |dd}t j ||ddddW5QRXdS) Nrz)Exactly one of path and fileobj is needed)rTr)Z ensure_asciiindentZ sort_keysrr) rrrrr;rrr,rrdumprr)rrrrrZ legacy_mdrrrrrrs*   zMetadata.writecCs|jr|j|nr|jdg}d}|D]}d|kr*d|kr*|}qHq*|dkrfd|i}|d|n t|dt|B}t||d<dS)Nrr&r%rsr)rrrr insertrr:)rrralwaysentryZrsetrrrr3szMetadata.add_requirementscCs*|jpd}|jpd}d|jj|j||fS)Nz (no name)z no versionz<%s %s %s (%s)>)r`rIrrr_)rr`rIrrrrDs  zMetadata.__repr__)NNNr)N)NN)NNFT)/rrrrrecompileZMETADATA_VERSION_MATCHERIZ NAME_MATCHERrZVERSION_MATCHERZSUMMARY_MATCHERrrrr0r1r.r __slots__rrr rZ none_listdictZ none_dictr rrr!propertyr#rtsetterr)r-r/rrrr,r9r;rrrrrrrrs   -+ '    *     % )F)ErZ __future__rrZemailrrrrAr2rrcompatrrr rLr utilr r rIr rZ getLoggerrrSrrrr__all__rrrBrrrDrErVrFrWrHrYrGrXrrrZEXTRA_RErJr^rrrrrrrrrrr{r~rZMETADATA_FILENAMEZWHEEL_METADATA_FILENAMEZLEGACY_METADATA_FILENAMErrrrrs              H!   PKd],p++,distlib/__pycache__/resources.cpython-38.pycnu[U ʗReD* @sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZmZeeZdaGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZedee jeiZzPz ddlZWne k rddl!ZYnXeeej"<eeej#<eeej$<[Wne e%fk rVYnXddZ&iZ'ddZ(e)e*dZ+ddZ,dS))unicode_literalsN)DistlibException)cached_propertyget_cache_baseCachecs.eZdZdfdd ZddZddZZS) ResourceCacheNcs0|dkrtjttd}tt||dS)Nzresource-cache)ospathjoinrstrsuperr__init__)selfbase __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/resources.pyrszResourceCache.__init__cCsdS)z Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. Trrresourcer rrris_stale"s zResourceCache.is_stalec Cs|j|\}}|dkr|}n~tj|j|||}tj|}tj|sXt |tj |sjd}n | ||}|rt |d}| |jW5QRX|S)z Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. NTwb)finderget_cache_infor r r r prefix_to_dirdirnameisdirmakedirsexistsropenwritebytes)rrprefixr resultrstalefrrrget-s      zResourceCache.get)N)__name__ __module__ __qualname__rrr' __classcell__rrrrrs rc@seZdZddZdS) ResourceBasecCs||_||_dSN)rname)rrr.rrrrHszResourceBase.__init__N)r(r)r*rrrrrr,Gsr,c@s@eZdZdZdZddZeddZeddZed d Z d S) Resourcez A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. FcCs |j|S)z Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. )r get_streamrrrr as_streamUszResource.as_streamcCstdkrtat|Sr-)cacherr'r1rrr file_path^szResource.file_pathcCs |j|Sr-)r get_bytesr1rrrr"eszResource.bytescCs |j|Sr-)rget_sizer1rrrsizeisz Resource.sizeN) r(r)r*__doc__ is_containerr2rr4r"r7rrrrr/Ms   r/c@seZdZdZeddZdS)ResourceContainerTcCs |j|Sr-)r get_resourcesr1rrr resourcesqszResourceContainer.resourcesN)r(r)r*r9rr<rrrrr:nsr:c@seZdZdZejdrdZndZddZddZ d d Z d d Z d dZ ddZ ddZddZddZddZddZeejjZddZdS)ResourceFinderz4 Resource finder for file system resources. java).pyc.pyoz.class)r?r@cCs.||_t|dd|_tjt|dd|_dS)N __loader____file__)modulegetattrloaderr r rr)rrDrrrrszResourceFinder.__init__cCs tj|Sr-)r r realpathrr rrr _adjust_pathszResourceFinder._adjust_pathcCsBt|trd}nd}||}|d|jtjj|}||S)N//r) isinstancer"splitinsertrr r r rI)r resource_nameseppartsr$rrr _make_paths   zResourceFinder._make_pathcCs tj|Sr-)r r rrHrrr_findszResourceFinder._findcCs d|jfSr-)r rrrrrrszResourceFinder.get_cache_infocCsD||}||sd}n&||r0t||}n t||}||_|Sr-)rRrS _is_directoryr:r/r )rrOr r$rrrfinds     zResourceFinder.findcCs t|jdSNrb)r r rTrrrr0szResourceFinder.get_streamc Cs,t|jd}|W5QRSQRXdSrW)r r read)rrr&rrrr5szResourceFinder.get_bytescCstj|jSr-)r r getsizerTrrrr6szResourceFinder.get_sizecs*fddtfddt|jDS)Ncs|dko|j S)N __pycache__)endswithskipped_extensions)r&r1rralloweds z-ResourceFinder.get_resources..allowedcsg|]}|r|qSrr).0r&)r^rr sz0ResourceFinder.get_resources..)setr listdirr rTr)r^rrr;s zResourceFinder.get_resourcescCs ||jSr-)rUr rTrrrr9szResourceFinder.is_containerccs||}|dk r|g}|r|d}|V|jr|j}|jD]>}|sL|}nd||g}||}|jrv||q>|Vq>qdS)NrrK)rVpopr9r.r<r append)rrOrtodornamer.new_namechildrrriterators      zResourceFinder.iteratorN)r(r)r*r8sysplatform startswithr]rrIrRrSrrVr0r5r6r;r9 staticmethodr r rrUrirrrrr=vs"    r=cs`eZdZdZfddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ Z S)ZipResourceFinderz6 Resource finder for resources in .zip files. csZtt|||jj}dt||_t|jdr>|jj|_n t j ||_t |j|_ dS)Nr_files) r rnrrFarchivelen prefix_lenhasattrro zipimport_zip_directory_cachesortedindex)rrDrprrrrs   zZipResourceFinder.__init__cCs|Sr-rrHrrrrIszZipResourceFinder._adjust_pathcCs||jd}||jkrd}nX|r:|dtjkr:|tj}t|j|}z|j||}Wntk rtd}YnX|st d||j j nt d||j j |S)NTFz_find failed: %r %rz_find worked: %r %r) rrror rPbisectrwrl IndexErrorloggerdebugrFr#)rr r$irrrrSs   zZipResourceFinder._findcCs&|jj}|jdt|d}||fS)Nr)rFrpr rq)rrr#r rrrrsz ZipResourceFinder.get_cache_infocCs|j|jSr-)rFget_datar rTrrrr5szZipResourceFinder.get_bytescCst||Sr-)ioBytesIOr5rTrrrr0szZipResourceFinder.get_streamcCs|j|jd}|j|dS)N)r rrrorrrrr6szZipResourceFinder.get_sizecCs|j|jd}|r,|dtjkr,|tj7}t|}t}t|j|}|t|jkr|j||shq|j||d}| | tjdd|d7}qH|S)Nrxrr) r rrr rPrqraryrwrladdrM)rrr plenr$r}srrrr;s  zZipResourceFinder.get_resourcescCsj||jd}|r*|dtjkr*|tj7}t|j|}z|j||}Wntk rdd}YnX|S)NrxF)rrr rPryrwrlrz)rr r}r$rrrrUs  zZipResourceFinder._is_directory)r(r)r*r8rrIrSrr5r0r6r;rUr+rrrrrns rncCs|tt|<dSr-)_finder_registrytype)rF finder_makerrrrregister_finder2srcCs|tkrt|}nv|tjkr$t|tj|}t|dd}|dkrJtdt|dd}tt|}|dkrxtd|||}|t|<|S)z Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. __path__Nz8You cannot get a finder for a module, only for a packagerAzUnable to locate finder for %r) _finder_cacherjmodules __import__rErrr'r)packager$rDr rFrrrrr9s      r __dummy__cCsRd}t|tj|}tt|}|rNt}tj |d|_ ||_ ||}|S)z Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. NrC) pkgutil get_importerrjpath_importer_cacher'rr _dummy_moduler r r rBrA)r r$rFrrDrrrfinder_for_pathUs  r)- __future__rryrloggingr rrjtypesrtrCrutilrrr getLoggerr(r{r3robjectr,r/r:r=rnr zipimporterr_frozen_importlib_externalZ_fi ImportError_frozen_importlibSourceFileLoader FileFinderSourcelessFileLoaderAttributeErrorrrr ModuleTyper rrrrrrsN   ,!ZO    PKd]"xCC.distlib/__pycache__/index.cpython-38.opt-1.pycnu[U .eJR@sddlZddlZddlZddlZddlZddlZzddlmZWn ek r`ddl mZYnXddl m Z ddl m Z mZmZmZmZmZddlmZmZmZeeZdZdZGd d d eZdS) N)Thread)DistlibException)HTTPBasicAuthHandlerRequestHTTPPasswordMgrurlparse build_opener string_types)cached_propertyzip_dir ServerProxyzhttps://pypi.org/pypipypic@seZdZdZdZd*ddZddZdd Zd d Zd d Z ddZ ddZ d+ddZ d,ddZ d-ddZd.ddZddZd/ddZd0d d!Zd1d"d#Zd$d%Zd&d'Zd2d(d)ZdS)3 PackageIndexzc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc Cs|pt|_|t|j\}}}}}}|s<|s<|s<|dkrJtd|jd|_d|_d|_d|_t t j dR}dD]F} z,t j | dg||d} | dkr| |_WqWqttk rYqtXqtW5QRXdS) z Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. )ZhttpZhttpszinvalid repository: %sNw)gpgZgpg2z --versionstdoutstderrr) DEFAULT_INDEXurlread_configurationrrpassword_handler ssl_verifierrgpg_homeopenosdevnull subprocessZ check_callOSError) selfrZschemenetlocpathZparamsZqueryZfragZsinksrcr%=/usr/lib/python3.8/site-packages/pip/_vendor/distlib/index.py__init__$s(   zPackageIndex.__init__cCs&ddlm}ddlm}|}||S)zs Get the distutils command for interacting with PyPI configurations. :return: the command. r) Distribution) PyPIRCCommand)Zdistutils.corer(Zdistutils.configr))r r(r)dr%r%r&_get_pypirc_commandAs  z PackageIndex._get_pypirc_commandcCsR|}|j|_|}|d|_|d|_|dd|_|d|j|_dS)z Read the PyPI access configuration as supported by distutils, getting PyPI to do the actual work. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. usernamepasswordrealmr repositoryN)r+rr/Z _read_pypircgetr,r-r.)r cZcfgr%r%r&rKs  zPackageIndex.read_configurationcCs$||}||j|jdS)z Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. Again, distutils is used to do the actual work. N)check_credentialsr+Z _store_pypircr,r-)r r1r%r%r&save_configurationZszPackageIndex.save_configurationcCs\|jdks|jdkrtdt}t|j\}}}}}}||j||j|jt||_ dS)zp Check that ``username`` and ``password`` have been set, and raise an exception if not. Nz!username and password must be set) r,r-rrrrZ add_passwordr.rr)r Zpm_r!r%r%r&r2fs zPackageIndex.check_credentialscCs\|||}d|d<||g}||}d|d<||g}||S)aq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. Zverify:actionZsubmit)r2validatetodictencode_requestitems send_request)r metadatar*requestZresponser%r%r&registerrs  zPackageIndex.registercCsF|}|sq:|d}||td||fq|dS)ar Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. utf-8z%s: %sN)readlinedecoderstripappendloggerdebugclose)r namestreamZoutbufr#r%r%r&_readers  zPackageIndex._readerc Cs|jdddg}|dkr|j}|r.|d|g|dk rF|dddgt}tj|tj|d }|d d d |d ||gt dd|||fS)a Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. --status-fd2--no-ttyN --homedirz--batchz--passphrase-fd0z.ascz --detach-signz--armorz --local-userz--output invoking: %s ) rrextendtempfileZmkdtemprr"joinbasenamerCrD)r filenamesigner sign_passwordkeystorecmdZtdZsfr%r%r&get_sign_commands" zPackageIndex.get_sign_commandc Cstjtjd}|dk r tj|d<g}g}tj|f|}t|jd|j|fd}|t|jd|j|fd}||dk r|j ||j | | | |j ||fS)a Run a command in a child process , passing it any input data specified. :param cmd: The command to run. :param input_data: If specified, this must be a byte string containing data to be sent to the child process. :return: A tuple consisting of the subprocess' exit code, a list of lines read from the subprocess' ``stdout``, and a list of lines read from the subprocess' ``stderr``. rNstdinr)targetargsr)rPIPEPopenrrHrstartrrZwriterEwaitrR returncode) r rXZ input_datakwargsrrpt1t2r%r%r& run_commands&    zPackageIndex.run_commandc CsD|||||\}}|||d\}}} |dkr@td||S)aR Sign a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The absolute pathname of the file where the signature is stored. r>rz&sign command failed with error code %s)rYrgencoder) r rTrUrVrWrXsig_filer$rrr%r%r& sign_files  zPackageIndex.sign_filesdistsourcec Cs(|tj|s td|||}d} |rZ|jsJt dn| ||||} t |d} | } W5QRXt | } t | } |dd||| | ddtj|| fg}| rt | d} | }W5QRX|d tj| |fttj| |||}||S) a Upload a release file to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the file to be uploaded. :param filename: The pathname of the file to be uploaded. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param filetype: The type of the file being uploaded. This is the distutils command which produced that file, e.g. ``sdist`` or ``bdist_wheel``. :param pyversion: The version of Python which the release relates to. For code compatible with any Python, this would be ``source``, otherwise it would be e.g. ``3.2``. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The HTTP response received from PyPI upon submission of the request. z not found: %sNz)no signing program available - not signedrbZ file_upload1)r5Zprotocol_versionfiletype pyversion md5_digest sha256_digestcontentZ gpg_signature)r2rr"existsrr6r7rrCZwarningrjrreadhashlibmd5 hexdigestZsha256updaterSrBshutilZrmtreedirnamer8r9r:)r r;rTrUrVrorprWr*rifZ file_datarqrrfilesZsig_datar<r%r%r& upload_filesD      zPackageIndex.upload_filec Cs|tj|s td|tj|d}tj|sFtd|||j|j }}t | }dd|fd|fg}d||fg}| ||} | | S)a2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. znot a directory: %rz index.htmlz not found: %r)r5Z doc_uploadrFversionrs)r2rr"isdirrrRrtr6rFrr getvaluer8r:) r r;Zdoc_dirfnrFrZzip_datafieldsr}r<r%r%r&upload_documentation(s        z!PackageIndex.upload_documentationcCsT|jdddg}|dkr|j}|r.|d|g|d||gtdd||S) a| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. rIrJrKNrLz--verifyrNrO)rrrPrCrDrR)r signature_filename data_filenamerWrXr%r%r&get_verify_commandDszPackageIndex.get_verify_commandcCsH|jstd||||}||\}}}|dkr@td||dkS)a6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. z0verification unavailable because gpg unavailable)rrz(verify command failed with error code %sr)rrrrg)r rrrWrXr$rrr%r%r&verify_signature\szPackageIndex.verify_signaturec Csl|dkrd}tdn6t|ttfr0|\}}nd}tt|}td|t|d}|t |}z| } d} d} d} d} d | krt | d } |r|| | | | | }|sq| t|7} |||r||| d 7} |r|| | | qW5| XW5QRX| dkr0| | kr0td | | f|rh|}||kr\td ||||ftd|dS)a This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. NzNo digest specifiedrwzDigest specified: %swbi rzcontent-lengthzContent-Lengthrz1retrieval incomplete: got only %d out of %d bytesz.%s digest mismatch for %s: expected %s, got %szDigest verified: %s)rCrD isinstancelisttuplegetattrrvrr:rrEinfointrulenr`ryrrx)r rZdestfileZdigestZ reporthookZdigesterZhasherZdfpZsfpheadersZ blocksizesizeruZblocknumblockactualr%r%r& download_fileus^           zPackageIndex.download_filecCs:g}|jr||j|jr(||jt|}||S)z Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). )rrBrr r)r ZreqZhandlersZopenerr%r%r&r:s  zPackageIndex.send_requestc Csg}|j}|D]L\}}t|ttfs*|g}|D]*}|d|d|dd|dfq.q|D].\}} } |d|d|| fdd| fq`|d|ddfd|} d|} | tt| d} t |j | | S) a& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--z)Content-Disposition: form-data; name="%s"r>z8Content-Disposition: form-data; name="%s"; filename="%s"s smultipart/form-data; boundary=)z Content-typezContent-length) boundaryrrrrPrhrRstrrrr)r rr}partsrkvaluesvkeyrTvalueZbodyZctrr%r%r&r8sD     zPackageIndex.encode_requestcCsFt|trd|i}t|jdd}z|||p.dWS|dXdS)NrFg@)ZtimeoutrEand)rr r rsearch)r ZtermsoperatorZ rpc_proxyr%r%r&rs  zPackageIndex.search)N)N)N)N)NNrkrlN)N)N)NN)N)__name__ __module__ __qualname____doc__rr'r+rr3r2r=rHrYrgrjr~rrrrr:r8rr%r%r%r&rs6      #  9   M+r)rvZloggingrrzrrQZ threadingr ImportErrorZdummy_threadingrcompatrrrrr r utilr r r Z getLoggerrrCrZ DEFAULT_REALMobjectrr%r%r%r&s    PKd]FaX}}/distlib/__pycache__/compat.cpython-38.opt-1.pycnu[U .e @sBddlmZddlZddlZddlZz ddlZWnek rHdZYnXejddkr~ddlmZe fZ e Z ddl mZddlZddlZddlmZddlmZmZmZmZmZdd lmZmZmZm Z m!Z!m"Z"m#Z#d d Zddl$Z$dd l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-er&dd l$m.Z.ddl/Z/ddl0Z0ddl1Z2ddl3m3Z3ddl4Z4e5Z5ddl6m7Z8ddl6m9Z:da;ddZ<nddl=mZe>fZ e>Z ddl=m?ZddlZddlZddlZddl@mZmZmZmd?Zod@dAZiYnXzddBlpmqZqWn"ek rddBlrmqZqYnXejddCdDkr:e3jsZsn ddElpmsZszddFl`mtZtWndek rddGl`muZuzddHlvmwZxWn ek rdedJdKZxYnXGdLdMdMeuZtYnXzddNlymzZzWnHek rzddNl{mzZzWn ek rdfdOdPZzYnXYnXzddQl`m|Z|Wnek rzddRl}m~ZWn"ek rjddRlm~ZYnXzddSlmZmZmZWnek rYnXGdTdUdUeZ|YnXzddVlmZmZWnvek r<emdWejZdXdYZGdZd[d[eZdgd\d]ZGd^d_d_eZGd`dadaeZGdbdcdceQZYnXdS)h)absolute_importN)StringIO)FileType)shutil)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecCst|tr|d}t|S)Nutf-8) isinstanceunicodeencode_quote)sr>/usr/lib/python3.8/site-packages/pip/_vendor/distlib/compat.pyrs  r) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalsecCs<tdkrddl}|dat|}|r4|ddSd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nrz ^(.*)@(.*)$r) _userprogrecompilematchgroup)Zhostr+r-rrr splituser4s   r/) TextIOWrapper) rr r r/rrr r r) rr rrrr r!r"r#r$)rrr) filterfalse)match_hostnameCertificateErrorc@s eZdZdS)r3N)__name__ __module__ __qualname__rrrrr3^sr3c Csg}|s dS|d}|d|dd}}|d}||krNtdt||sb||kS|dkrv|dn>|d s|d r|t|n|t| d d |D]}|t|qt d d |dtj } | |S)zpMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 F.rrN*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr3reprlowerappend startswithr+escapereplacer,join IGNORECASEr-) ZdnhostnameZ max_wildcardsZpatspartsZleftmostZ remainderZ wildcardsfragZpatrrr_dnsname_matchbs*    rFcCs|s tdg}|dd}|D]*\}}|dkr t||r@dS||q |s|ddD]6}|D],\}}|dkrdt||rdS||qdq\t|dkrtd |d tt|fn*t|dkrtd ||d fntd dS)a=Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDZsubjectAltNamerZDNSNZsubjectZ commonNamerz&hostname %r doesn't match either of %s, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrFr=lenr3rAmapr;)ZcertrCZdnsnamesZsankeyvaluesubrrrr2s2         r2)SimpleNamespacec@seZdZdZddZdS) ContainerzR A generic container for when multiple values need to be returned cKs|j|dSN__dict__update)selfkwargsrrr__init__szContainer.__init__N)r4r5r6__doc__rWrrrrrPsrP)whichc s"dd}tjr&||r"SdS|dkr>tjdtj}|sFdS|tj}tj dkrtj |krt| dtj tjddtj}t fd d |Drg}q‡fd d |D}ng}t }|D]P}tj|}||kr|||D](} tj|| } || |r| SqqdS) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. cSs&tj|o$t||o$tj| SrQ)ospathexistsaccessisdir)fnmoderrr _access_checks zwhich.._access_checkNPATHZwin32rZPATHEXTc3s |]}|VqdSrQ)r<endswith.0extcmdrr szwhich..csg|] }|qSrrrerhrr szwhich..)rZr[dirnameenvironrIdefpathr9pathsepsysplatformcurdirinsertanysetnormcaseaddrA) rir`r[raZpathextfilesseendirZnormdirZthefilenamerrhrrYs8         rY)ZipFile __enter__) ZipExtFilec@s$eZdZddZddZddZdS)r~cCs|j|jdSrQrR)rUbaserrrrWszZipExtFile.__init__cCs|SrQrrUrrrr}szZipExtFile.__enter__cGs |dSrQcloserUexc_inforrr__exit__szZipExtFile.__exit__N)r4r5r6rWr}rrrrrr~sr~c@s$eZdZddZddZddZdS)r|cCs|SrQrrrrrr}"szZipFile.__enter__cGs |dSrQrrrrrr%szZipFile.__exit__cOstj|f||}t|SrQ) BaseZipFileopenr~)rUargsrVrrrrr)sz ZipFile.openN)r4r5r6r}rrrrrrr|!sr|)python_implementationcCs0dtjkrdStjdkrdStjdr,dSdS)z6Return a string identifying the Python implementation.ZPyPyjavaZJythonZ IronPythonZCPython)rpversionrZr{r>rrrrr0s   r) sysconfig)CallablecCs t|tSrQ)rr)objrrrcallableDsrrmbcsstrictsurrogateescapecCs:t|tr|St|tr$|ttStdt|jdSNzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper4filenamerrrfsencodeXs   rcCs:t|tr|St|tr$|ttStdt|jdSr) rrrdecoderrrrr4rrrrfsdecodeas   r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)cCsH|dddd}|dks*|dr.dS|dks@|drDd S|S) z(Imitates get_normal_name in tokenizer.c.N _-rzutf-8-)zlatin-1 iso-8859-1z iso-latin-1)zlatin-1-z iso-8859-1-z iso-latin-1-r)r<r@r>)orig_encencrrr_get_normal_namersrcsz jjWntk r$dYnXdd}d}fdd}fdd}|}|trpd|d d}d }|s||gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFrcs$zWStk rYdSXdS)N) StopIterationr)readlinerr read_or_stopsz%detect_encoding..read_or_stopcsz|d}Wn4tk rBd}dk r6d|}t|YnXt|}|sVdSt|d}z t|}Wn:tk rdkrd|}n d|}t|YnXr|j dkr؈dkrd}n d}t||d 7}|S) Nrz'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorr{)line line_stringmsgZmatchesencodingcodec) bom_foundrrr find_cookies8       z$detect_encoding..find_cookieTrz utf-8-sig)__self__r{AttributeErrorr>r)rrdefaultrrfirstsecondr)rrrrr}s4   &     r)r?r))r)unescape)ChainMap)MutableMapping)recursive_repr...csfdd}|S)zm Decorator to make a repr function return fillvalue for a recursive call csLtfdd}td|_td|_td|_tdi|_|S)Nc sBt|tf}|krS|z |}W5|X|SrQ)id get_identrwdiscard)rUrLresult) fillvalue repr_running user_functionrrwrappers   z=_recursive_repr..decorating_function..wrapperr5rXr4__annotations__)rugetattrr5rXr4r)rrr)rrrdecorating_functions   z,_recursive_repr..decorating_functionr)rrrrr_recursive_reprs rc@seZdZdZddZddZddZd'd d Zd d Zd dZ ddZ ddZ e ddZ eddZddZeZddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS)(ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cGst|p ig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)rUrrrrrWszChainMap.__init__cCs t|dSrQ)KeyErrorrUrLrrr __missing__szChainMap.__missing__c Cs:|jD](}z||WStk r,YqXq||SrQ)rrr)rUrLmappingrrr __getitem__s  zChainMap.__getitem__NcCs||kr||S|SrQrrUrLrrrrrI%sz ChainMap.getcCsttj|jSrQ)rJruunionrrrrr__len__(szChainMap.__len__cCsttj|jSrQ)iterrurrrrrr__iter__+szChainMap.__iter__cstfdd|jDS)Nc3s|]}|kVqdSrQr)rfmrLrrrj/sz(ChainMap.__contains__..rtrrrrr __contains__.szChainMap.__contains__cCs t|jSrQrrrrr__bool__1szChainMap.__bool__cCsd|dtt|jS)Nz{0.__class__.__name__}({1})rG)rrArKr;rrrrr__repr__4szChainMap.__repr__cGs|tj|f|S)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablerrrrr9szChainMap.fromkeyscCs$|j|jdf|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN) __class__rcopyrrrrr>sz ChainMap.copycCs|jif|jS)z;New ChainMap with a new dict followed by all previous maps.rrrrrr new_childDszChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].rNrrrrrparentsHszChainMap.parentscCs||jd|<dS)Nr)r)rUrLrMrrr __setitem__MszChainMap.__setitem__cCs8z|jd|=Wn"tk r2td|YnXdS)Nr(Key not found in the first mapping: {!r})rrrrrrr __delitem__PszChainMap.__delitem__cCs2z|jdWStk r,tdYnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.N)rpopitemrrrrrrVszChainMap.popitemcGs@z|jdj|f|WStk r:td|YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rrN)rpoprr)rUrLrrrrr]sz ChainMap.popcCs|jddS)z'Clear maps[0], leaving maps[1:] intact.rN)rclearrrrrrdszChainMap.clear)N)r4r5r6rXrWrrrIrrrrrr classmethodrr__copy__rpropertyrrrrrrrrrrrs.     r)cache_from_sourcecCs"|dkr d}|rd}nd}||S)NFcor)r[debug_overridesuffixrrrrns r) OrderedDict)r)KeysView ValuesView ItemsViewc@seZdZdZddZejfddZejfddZdd Zd d Z d d Z d6ddZ ddZ ddZ ddZddZddZddZddZeZeZefdd Zd7d"d#Zd8d$d%Zd&d'Zd(d)Zed9d*d+Zd,d-Zd.d/Zd0d1Zd2d3Z d4d5Z!d!S):rz)Dictionary that remembers insertion ordercOsnt|dkrtdt|z |jWn6tk r\g|_}||dg|dd<i|_YnX|j||dS)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. rz$expected at most 1 arguments, got %dN)rJr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)rUrkwdsrootrrrrWs    zOrderedDict.__init__cCsF||kr6|j}|d}|||g|d<|d<|j|<||||dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)rr)rUrLrMZ dict_setitemrlastrrrrs  zOrderedDict.__setitem__cCs0||||j|\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)rr)rUrLZ dict_delitem link_prev link_nextrrrrs zOrderedDict.__delitem__ccs.|j}|d}||k r*|dV|d}qdS)zod.__iter__() <==> iter(od)rr)NrrUrZcurrrrrrs  zOrderedDict.__iter__ccs.|j}|d}||k r*|dV|d}qdS)z#od.__reversed__() <==> reversed(od)rr)Nrrrrr __reversed__s  zOrderedDict.__reversed__cCsdz@|jD]}|dd=q |j}||dg|dd<|jWntk rTYnXt|dS)z.od.clear() -> None. Remove all items from od.N)r itervaluesrrrr)rUZnoderrrrrs zOrderedDict.clearTcCs||s td|j}|r8|d}|d}||d<||d<n |d}|d}||d<||d<|d}|j|=t||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrrr))rrrrr)rUrrlinkrrrLrMrrrrs   zOrderedDict.popitemcCst|S)zod.keys() -> list of keys in od)rrrrrkeysszOrderedDict.keyscsfddDS)z#od.values() -> list of values in odcsg|] }|qSrrrfrLrrrrksz&OrderedDict.values..rrrrrvaluesszOrderedDict.valuescsfddDS)z.od.items() -> list of (key, value) pairs in odcsg|]}||fqSrrr rrrrksz%OrderedDict.items..rrrrritemsszOrderedDict.itemscCst|S)z0od.iterkeys() -> an iterator over the keys in od)rrrrriterkeysszOrderedDict.iterkeysccs|D]}||VqdS)z2od.itervalues -> an iterator over the values in odNrrUkrrrr szOrderedDict.itervaluesccs|D]}|||fVqdS)z=od.iteritems -> an iterator over the (key, value) items in odNrrrrr iteritemsszOrderedDict.iteritemscOst|dkr tdt|fn |s,td|d}d}t|dkrL|d}t|trn|D]}||||<qZn None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v r)z8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rrrr N)rJrrrhasattrr r)rrrUotherrLrMrrrrTs(       zOrderedDict.updatecCs0||kr||}||=|S||jkr,t||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr)rUrLrrrrrr*s zOrderedDict.popNcCs||kr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odrrrrr setdefault7szOrderedDict.setdefaultcCsf|si}t|tf}||kr"dSd||<z.|sBd|jjfWSd|jj|fWS||=XdS)zod.__repr__() <==> repr(od)rrz%s()z%s(%r)N)r _get_identrr4r)rUZ _repr_runningZcall_keyrrrr>szOrderedDict.__repr__csXfddD}t}ttD]}||dq(|rLj|f|fSj|ffS)z%Return state information for picklingcsg|]}||gqSrrrfrrrrrkNsz*OrderedDict.__reduce__..N)varsrrrr)rUrZ inst_dictrrrr __reduce__Ls zOrderedDict.__reduce__cCs ||S)z!od.copy() -> a shallow copy of od)rrrrrrVszOrderedDict.copycCs|}|D] }|||<q |S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r)rrrMdrLrrrrZs zOrderedDict.fromkeyscCs6t|tr*t|t|ko(||kSt||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rrrJrr__eq__rUrrrrres  zOrderedDict.__eq__cCs ||k SrQrrrrr__ne__nszOrderedDict.__ne__cCst|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)rrrrrviewkeyssszOrderedDict.viewkeyscCst|S)z an object providing a view on od's values)rrrrr viewvalueswszOrderedDict.viewvaluescCst|S)zBod.viewitems() -> a set-like object providing a view on od's items)rrrrr viewitems{szOrderedDict.viewitems)T)N)N)N)"r4r5r6rXrWrrrrr rrr rrrr rrTrobjectrrrrrrrrrrr r!r"rrrrrs:         r)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cCst|}|std|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERr-rH)rrrrrr%s  r%c@s"eZdZdZddZdddZdS)ConvertingDictz A converting dictionary wrapper.cCsJt||}|j|}||k rF|||<t|tttfkrF||_||_ |SrQ) rr configuratorconvertrr'ConvertingListConvertingTupleparentrLrUrLrMrrrrrs   zConvertingDict.__getitem__NcCsLt|||}|j|}||k rH|||<t|tttfkrH||_||_ |SrQ) rrIr(r)rr'r*r+r,rLrUrLrrMrrrrrIs  zConvertingDict.get)N)r4r5r6rXrrIrrrrr's r'cCsDt|||}|j|}||k r@t|tttfkr@||_||_ |SrQ) rrr(r)rr'r*r+r,rLr.rrrrs  rc@s"eZdZdZddZdddZdS) r*zA converting list wrapper.cCsJt||}|j|}||k rF|||<t|tttfkrF||_||_ |SrQ) rrr(r)rr'r*r+r,rLr-rrrrs   zConvertingList.__getitem__cCs<t||}|j|}||k r8t|tttfkr8||_|SrQ) rrr(r)rr'r*r+r,)rUidxrMrrrrrs   zConvertingList.popN)r/)r4r5r6rXrrrrrrr*s r*c@seZdZdZddZdS)r+zA converting tuple wrapper.cCsBt||}|j|}||k r>t|tttfkr>||_||_ |SrQ) tuplerr(r)rr'r*r+r,rLr-rrrrs   zConvertingTuple.__getitem__N)r4r5r6rXrrrrrr+sr+c@seZdZdZedZedZedZedZ edZ ddd Z e e Zd d Zd d ZddZddZddZddZddZdS)r$zQ The configurator base class which defines some useful defaults. z%^(?P[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)rgZcfgcCst||_||j_dSrQ)r'configr()rUr4rrrrWs zBaseConfigurator.__init__c Cs|d}|d}z^||}|D]H}|d|7}zt||}Wq$tk rj||t||}Yq$Xq$|WStk rtdd\}}td||f}|||_ |_ |YnXdS)zl Resolve strings to objects using standard import and attribute syntax. r7rrNzCannot resolve %r: %s) r9rimporterrr ImportErrorrprrH __cause__ __traceback__) rUrr{ZusedfoundrEetbvrrrresolves"     zBaseConfigurator.resolvecCs ||S)z*Default converter for the ext:// protocol.)r=rUrMrrrr2 szBaseConfigurator.ext_convertcCs|}|j|}|dkr&td|n||d}|j|d}|r|j|}|rn||d}nd|j|}|r|d}|j|s||}n2zt |}||}Wnt k r||}YnX|r||d}qHtd||fqH|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) WORD_PATTERNr-rHendr4groups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNintr)rUrMrestrrr0nrrrr3s4       zBaseConfigurator.cfg_convertcCst|ts$t|tr$t|}||_nt|tsHt|trHt|}||_nzt|tslt|trlt|}||_nVt|tr|j |}|r| }|d}|j |d}|r|d}t||}||}|S)z Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. prefixNr)rr'rr(r*rr+r1 string_typesCONVERT_PATTERNr- groupdictvalue_convertersrIr)rUrMrrrHZ converterrrrrr)2s,    zBaseConfigurator.convertcsnd}t|s||}dd}tfddD}|f|}|rj|D]\}}t|||qT|S)z1Configure an object with a user-supplied factory.z()r7Ncs g|]}t|r||fqSr)r%rr4rrrkUsz5BaseConfigurator.configure_custom..)rrr=rrsetattr)rUr4rZpropsrVrr{rMrrMrconfigure_customNs    z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)rrr1r>rrras_tuple\s zBaseConfigurator.as_tupleN)r4r5r6rXr+r,rJr?rBrCrDrL staticmethod __import__r5rWr=r2r3r)rOrPrrrrr$s"     "r$)r)r)N)N)Z __future__rrZr+rpZsslr6 version_inforZ basestringrIrrtypesrZ file_typeZ __builtin__builtinsZ ConfigParserZ configparserZ _backportrrr r r r Zurllibr rrrrrrrZurllib2rrrrr r!r"r#r$r%ZhttplibZ xmlrpclibZQueueZqueuer&ZhtmlentitydefsZ raw_input itertoolsr'filterr(r1r*r/iostrr0Z urllib.parseZurllib.requestZ urllib.errorZ http.clientZclientZrequestZ xmlrpc.clientZ html.parserZ html.entitiesZentitiesinputr2r3rHrFrOrPr#rYF_OKX_OKZzipfiler|rrr~ZBaseZipExtFilerqrrr NameError collectionsrrrrgetfilesystemencodingrrtokenizercodecsrrr,rrZhtmlr?Zcgirrrreprlibrrimportlib.utilrZimprthreadrrZ dummy_threadZ_abcollrrrrZlogging.configr$r%Ir&r'rrr*r1r+rrrrs,      $,      ,0        2+A              [   b w  PKd]1ZOO*distlib/__pycache__/version.cpython-38.pycnu[U ʗRe[ @sfdZddlZddlZddlmZddlmZdddd d d d d gZee Z Gdd d e Z Gddde ZGddde ZedZddZeZGdddeZddZGdddeZeddfeddfeddfedd fed!d"fed#d"fed$d%fed&d'fed(d)fed*d+ff Zed,dfed-dfed.d%fed$d%fed/dffZed0Zd1d2Zd3d4Zed5ejZd6d6d7d6d8ddd9Zd:d;ZGdejZ"d?d@Z#dAdBZ$GdCd d eZ%GdDd d eZ&GdEdFdFe Z'e'eeee'ee!dGdHe'e$e&edIZ(e(dJe(dK<dLd Z)dS)Mz~ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. N) string_typesparse_requirementNormalizedVersionNormalizedMatcher LegacyVersion LegacyMatcherSemanticVersionSemanticMatcherUnsupportedVersionError get_schemec@seZdZdZdS)r zThis is an unsupported version.N)__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/version.pyr sc@sxeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZeddZdS)VersioncCs@||_}|||_}t|ts,tt|dksTzMatcher.cCs||kSr)rr>rrrrBUrCcCs||kp||kSr)rr>rrrrBVrCcCs||kp||kSr)rr>rrrrBWrCcCs||kSr)rr>rrrrBXrCcCs||kSr)rr>rrrrBYrCcCs||kp||kSr)rr>rrrrB[rCcCs||kSr)rr>rrrrB\rC)<><=>======~=!=cCst|Sr)rr#rrrraszMatcher.parse_requirementcCs|jdkrtd||_}||}|s:td||j|_|j|_g}|jr|jD]d\}}| dr|dkrtd||ddd}}||n||d}}| |||fq^t ||_ dS) NzPlease specify a version classz Not valid: %rz.*)rHrKz#'.*' not allowed for %r constraintsTF) version_class ValueErrorrrrnamelowerkey constraintsendswithappendrr)rrrZclistopZvnprefixrrrr ds*      zMatcher.__init__cCsxt|tr||}|jD]X\}}}|j|}t|trDt||}|s`d||jjf}t |||||sdSqdS)z Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. z%r not implemented for %sFT) rrrMr _operatorsgetgetattrr7rr")rversionoperator constraintrWfmsgrrrmatchs       z Matcher.matchcCs6d}t|jdkr2|jdddkr2|jdd}|S)Nrr)rHrI)rr)rresultrrr exact_versions zMatcher.exact_versioncCs0t|t|ks|j|jkr,td||fdS)Nzcannot compare %s and %s)r$rOr%r&rrrr(szMatcher._check_compatiblecCs"|||j|jko |j|jkSr))r(rQrr&rrrr+s zMatcher.__eq__cCs || Sr)r,r&rrrr-szMatcher.__ne__cCst|jt|jSr))r3rQrr4rrrr5szMatcher.__hash__cCsd|jj|jfS)Nz%s(%r)r6r4rrrr8szMatcher.__repr__cCs|jSr)r9r4rrrr:szMatcher.__str__)rrrrMrXrr r`r<rbr(r+r-r5r8r:rrrrr=Os* r=zk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c Cs|}t|}|s"td||}tdd|ddD}t|dkrl|ddkrl|dd}qF|dszd}nt|ddd}|dd }|d d }|d d }|d}|dkrd}n|dt|df}|dkrd}n|dt|df}|dkrd}n|dt|df}|dkr2d}nHg} |dD]0} | r\dt| f} nd| f} | | q@t| }|s|s|rd}nd}|sd}|sd}||||||fS)NzNot a valid version: %scss|]}t|VqdSr)int.0r?rrr sz_pep_440_key..r.r )NNr)ari)z)_)final) rPEP440_VERSION_REr`r groupsrsplitrrdisdigitrT) rmrvnumsepochprepostdevlocalrpartrrr _pep_440_keysT         rc@s6eZdZdZddZedddddgZed d Zd S) raIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b cCs<t|}t|}|}tdd|ddD|_|S)Ncss|]}t|VqdSr)rcrerrrrgsz*NormalizedVersion.parse..rrh)_normalized_keyrur`rvrrw_release_clause)rrraryrvrrrr s  zNormalizedVersion.parserqbr@rcr~cstfddjDS)Nc3s |]}|r|djkVqdS)rN) PREREL_TAGS)rftr4rrrgsz2NormalizedVersion.is_prerelease..)anyrr4rr4rr;szNormalizedVersion.is_prereleaseN) rrrrrsetrr<r;rrrrrs  cCs>t|}t|}||krdS||s*dSt|}||dkS)NTFrh)str startswithr)xynrrr _match_prefixs rc @sneZdZeZddddddddd Zd d Zd d ZddZddZ ddZ ddZ ddZ ddZ ddZdS)r_match_compatible _match_lt _match_gt _match_le _match_ge _match_eq_match_arbitrary _match_ne)rJrDrErFrGrHrIrKcCsV|rd|ko|jd}n|jd o,|jd}|rN|jddd}||}||fS)N+rirr)rrrwrM)rr[r]rWZ strip_localrrrr _adjust_local6s zNormalizedMatcher._adjust_localcCsD||||\}}||krdS|j}ddd|D}t|| S)NFrhcSsg|] }t|qSrrrfirrr Isz/NormalizedMatcher._match_lt..rrjoinrrr[r]rWZrelease_clausepfxrrrrDs zNormalizedMatcher._match_ltcCsD||||\}}||krdS|j}ddd|D}t|| S)NFrhcSsg|] }t|qSrrrrrrrQsz/NormalizedMatcher._match_gt..rrrrrrLs zNormalizedMatcher._match_gtcCs||||\}}||kSr)rrr[r]rWrrrrTszNormalizedMatcher._match_lecCs||||\}}||kSr)rrrrrrXszNormalizedMatcher._match_gecCs.||||\}}|s ||k}n t||}|Sr)rrrr[r]rWrarrrr\s   zNormalizedMatcher._match_eqcCst|t|kSr)rrrrrrdsz"NormalizedMatcher._match_arbitrarycCs0||||\}}|s ||k}n t|| }|Sr)rrrrrrgs   zNormalizedMatcher._match_necCsf||||\}}||krdS||kr*dS|j}t|dkrH|dd}ddd|D}t||S)NTFrrirhcSsg|] }t|qSrrrrrrrzsz7NormalizedMatcher._match_compatible..)rrrrrrrrrros  z#NormalizedMatcher._match_compatibleN)rrrrrMrXrrrrrrrrrrrrrr's& z[.+-]$z^[.](\d)z0.\1z^[.-]z ^\((.*)\)$\1z^v(ersion)?\s*(\d+)z\2z^r(ev)?\s*(\d+)z[.]{2,}rhz\b(alfa|apha)\balphaz\b(pre-alpha|prealpha)\bz pre.alphaz \(beta\)$betaz ^[:~._+-]+z [,*")([\]]z[~:+_ -]z\.$z (\d+(\.\d+)*)cCsL|}tD]\}}|||}q|s.d}t|}|sFd}|}n|dd}dd|D}t|dkr~| dqft|dkr|| d}n8d dd|ddD|| d}|dd}d d d|D}|}|rt D]\}}|||}q|s|}nd |kr*d nd }|||}t |sHd}|S) z Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. z0.0.0rrhcSsg|] }t|qSrrcrrrrrsz-_suggest_semantic_version..NcSsg|] }t|qSrrrrrrrscSsg|] }t|qSrrrrrrrsr~-r)rrP _REPLACEMENTSsub_NUMERIC_PREFIXr`rvrwrrTendr_SUFFIX_REPLACEMENTS is_semver)rrapatreplryrWsuffixseprrr_suggest_semantic_versions:      ,    rcCshzt||WStk r"YnX|}dD]\}}|||}q0tdd|}tdd|}tdd|}tdd |}td d |}|d r|d d}tdd |}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd |}z t|Wntk rbd}YnX|S)!aSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. ))z-alpharq)z-betar)rrq)rr)rr@)z-finalr)z-prer@)z-releaser)z.releaser)z-stabler)rrh)rsrh) r)z.finalr)rtrzpre$Zpre0zdev$Zdev0z([abc]|rc)[\-\.](\d+)$z\1\2z[\-\.](dev)[\-\.]?r?(\d+)$z.\1\2z[.~]?([abc])\.?rr?rNz\b0+(\d+)(?!\d)z (\d+[abc])$z\g<1>0z\.?(dev-r|dev\.r)\.?(\d+)$z.dev\2z-(a|b|c)(\d+)$z[\.\-](dev|devel)$z.dev0z(?![\.\-])dev$z(final|stable)$rz\.?(r|-|-r)\.?(\d+)$z.post\2z\.?(dev|git|bzr)\.?(\d+)$z\.?(pre|preview|-c)(\d+)$zc\g<2>zp(\d+)$z.post\1)rr rPreplacererr)rrsorigrrrr_suggest_normalized_versions>      rz([a-z]+|\d+|[\.-])r@zfinal-@)r|previewrrr~rrhcCsrdd}g}||D]T}|dr^|dkrD|rD|ddkrD|q*|r^|ddkr^|qD||qt|S)NcSstg}t|D]R}t||}|rd|ddkrBdkrRnn |d}nd|}||q|d|S)N0r9**final) _VERSION_PARTrwrP_VERSION_REPLACErYzfillrT)rrarArrr get_partsCs     z_legacy_key..get_partsrrriz*final-00000000)rpoprTr)rrrarArrr _legacy_keyBs      rc@s eZdZddZeddZdS)rcCst|Sr))rr#rrrr]szLegacyVersion.parsecCs8d}|jD](}t|tr |dr |dkr d}q4q |S)NFrrT)rrrr)rrarrrrr;`s zLegacyVersion.is_prereleaseNrrrrr<r;rrrrr\sc@s4eZdZeZeejZded<e dZ ddZ dS)r rrJz^(\d+(\.\d+)*)cCs`||kr dS|jt|}|s2td||dS|d}d|krV|ddd}t||S)NFzACannot compute compatible match for version %s and constraint %sTrrhr) numeric_rer`rloggerwarningrvrsplitr)rr[r]rWryrrrrrss zLegacyMatcher._match_compatibleN) rrrrrMdictr=rXrcompilerrrrrrr ks   zN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$cCs t|Sr)) _SEMVER_REr`)rrrrrsrc Csndd}t|}|st||}dd|ddD\}}}||dd||dd}}|||f||fS) NcSs8|dkr|f}n$|ddd}tdd|D}|S)NrrhcSs"g|]}|r|dn|qS)r)rxr)rfrArrrrsz5_semantic_key..make_tuple..)rwr)rZabsentrarrrr make_tuples z!_semantic_key..make_tuplecSsg|] }t|qSrrcrrrrrsz!_semantic_key..r|r)rr rv) rrryrvmajorminorpatchr|buildrrr _semantic_keys rc@s eZdZddZeddZdS)r cCst|Sr))rr#rrrrszSemanticVersion.parsecCs|jdddkS)Nrrr)rr4rrrr;szSemanticVersion.is_prereleaseNrrrrrr sc@seZdZeZdS)r N)rrrr rMrrrrr sc@s6eZdZd ddZddZddZdd Zd d ZdS) VersionSchemeNcCs||_||_||_dSr))rQmatcher suggester)rrQrrrrrr szVersionScheme.__init__cCs2z|j|d}Wntk r,d}YnX|SNTF)rrMr rrrarrris_valid_versions   zVersionScheme.is_valid_versioncCs0z||d}Wntk r*d}YnX|Sr)rr rrrris_valid_matchers   zVersionScheme.is_valid_matchercCs$|dr|dd}|d|S)z: Used for processing some metadata fields ,Nrizdummy_name (%s))rSrr#rrris_valid_constraint_lists  z&VersionScheme.is_valid_constraint_listcCs|jdkrd}n ||}|Sr))rrrrrsuggests  zVersionScheme.suggest)N)rrrr rrrrrrrrrs   rcCs|Sr)rr#rrrrBrCrB) normalizedlegacyZsemanticrdefaultcCs|tkrtd|t|S)Nzunknown scheme name: %r)_SCHEMESrN)rOrrrr s )*rloggingrcompatrutilr__all__ getLoggerrrrNr objectrr=rrurrrrrrrrrrIrrrrr rrrr r rrr rrrrs   1d =$ W               .r  ' PKd]R,,*distlib/__pycache__/scripts.cpython-38.pycnu[U ʗReF@sddlmZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z m Z ddlmZddlmZmZmZmZmZmZeeZdZed Zd Zd d ZeZ Gd dde!Z"dS))BytesION)ZipInfo) sysconfigdetect_encodingZipFile)finder) FileOperatorget_export_entry convert_pathget_executable get_platformin_venva s^#!.*pythonw?[0-9.]*([ ].*)?$z# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) cCsXd|krT|drB|dd\}}d|krT|dsTd||f}n|dsTd|}|S)N z /usr/bin/env r"z%s "%s"z"%s") startswithsplit) executableenv _executabler/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/scripts.pyenquote_executable5s  rc@seZdZdZeZdZd*ddZddZe j d rBd d Z d d Z ddZd+ddZddZeZddZddZdZddZd,ddZddZed d!Zejd"d!Zejd#ksejd krejd#krd$d%Zd-d&d'Z d.d(d)Z!dS)/ ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. NTFcCs||_||_||_d|_d|_tjdkp:tjdko:tjdk|_t d|_ |pRt ||_ tjdkprtjdkortjdk|_ tj|_dS)NFposixjava)X.Ynt) source_dir target_dir add_launchersforceclobberosname_nameset_modesetvariantsr _fileop_is_ntsys version_info)selfrr r!dry_runfileoprrr__init__Ps  zScriptMaker.__init__cCs@|ddr<|jr %srspythonwrr}) r$r6r8rr r rxr"r*newerrBrr>rAr/readlinerC FIRST_LINE_REmatchr7groupclose copy_filer'rrinforseekrlrr?)r.rradjustrf first_linerrTrilinesrkrrrrr _copy_scriptGsR         zScriptMaker._copy_scriptcCs|jjSrwr*r/)r.rrrr/zszScriptMaker.dry_runcCs ||j_dSrwr)r.valuerrrr/~srcCsttddkrd}nd}tdkr&dnd}d|||f}td d d }t||}|snd ||f}t||jS) NPZ64Z32z win-arm64z-armrz %s%s%s.exermrrz(Unable to find resource %s in package %s) structcalcsizer __name__rsplitrfindrhbytes)r.kindbitsZplatform_suffixr%Zdistlib_packageresourcemsgrrrrszScriptMaker._get_launchercCs6g}t|}|dkr"|||n|j|||d|S)a Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. Nr)r rr)r. specificationr9rrurrrmakes zScriptMaker.makecCs$g}|D]}||||q|S)z Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, )extendr)r.specificationsr9rrrrr make_multipleszScriptMaker.make_multiple)TFN)rZN)N)N)N)"r __module__ __qualname____doc__SCRIPT_TEMPLATErqrr1r<r,rSrrErLrYrlrv_DEFAULT_MANIFESTryr|rrrrrpropertyr/setterr$r%r&rrrrrrrrGs:     E: 3   r)#iorloggingr$rerr,rzipfilercompatrrr resourcesrutilr r r r r r getLoggerrrBstriprcompilerrr_enquote_executableobjectrrrrrs"       PKd]56|6|)distlib/__pycache__/compat.cpython-38.pycnu[U ʗRe+ @sddlmZddlZddlZddlZz ddlZWnek rHdZYnXejddkrfddlmZe fZ e Z ddl mZddlZddlZddlmZmZmZmZmZddlmZmZmZmZmZm Z m!Z!dd Zddl"Z"dd l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+erdd l"m,Z,ddl-Z-ddl.Z.ddl/Z0dd l1m1Z1ddl2Z2e3Z3dd l4m5Z6ddl4m7Z8nddl9mZe:fZ e:Z ddl9m;ZddlZddlZddlm$Z$mZm#Z#mZmZm'Z'm(Z(m)Z)m*Z*m+Z+er dd l>m,Z,ddl?m&Z&m%Z%m Z ddl@mAZ-ddl>mBZ"ddlCmAZ.ddl0Z0dd lDm1Z1ddlEmFZ2eGZ3ddl4m8Z8e6Z6zddlmHZHmIZIWn8ek rGdddeJZId`ddZKddZHYnXzddl mLZMWn&ek rGdddeNZMYnXzddllmmnZnWn"ek rdd>lomnZnYnXejdd?d@kre1jpZpn ddAlmmpZpzddBlqmrZrWndek r~ddClqmsZszddDltmuZvWn ek rhdadFdGZvYnXGdHdIdIesZrYnXzddJlwmxZxWn ek rdbdKdLZxYnXzddMlqmyZyWnek rLzddNlzm{Z|Wn"ek rddNl}m{Z|YnXzddOl~mZmZmZWnek r6YnXGdPdQdQeZyYnXzddRlmZmZWnvek rejdSejZdTdUZGdVdWdWeZdcdXdYZGdZd[d[eZGd\d]d]eZGd^d_d_eNZYnXdS)d)absolute_importN)StringIO)FileType)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecCst|tr|d}t|S)Nutf-8) isinstanceunicodeencode_quote)sr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/compat.pyr s  r ) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalse) TextIOWrapper)rrrr r r r r) rr rrrrrr r!r")rrr) filterfalse)match_hostnameCertificateErrorc@s eZdZdS)r*N)__name__ __module__ __qualname__rrrrr*_sr*c Csg}|s dS|d}|d|dd}}|d}||krNtdt||sb||kS|dkrv|dn>|d s|d r|t|n|t| d d |D]}|t|qt d d |dtj } | |S)zpMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 F.rr.N*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr*reprlowerappend startswithreescapereplacecompilejoin IGNORECASEmatch) dnhostname max_wildcardspatspartsleftmost remainder wildcardsfragpatrrr_dnsname_matchcs*    rHcCs|s tdg}|dd}|D]*\}}|dkr t||r@dS||q |s|ddD]6}|D],\}}|dkrdt||rdS||qdq\t|dkrtd |d tt|fn*t|dkrtd ||d fntd dS)a=Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDsubjectAltNamerDNSNsubject commonNamer.z&hostname %r doesn't match either of %s, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrHr5lenr*r;mapr3)certr?dnsnamessankeyvaluesubrrrr)s2         r))SimpleNamespacec@seZdZdZddZdS) ContainerzR A generic container for when multiple values need to be returned cKs|j|dSN__dict__update)selfkwargsrrr__init__szContainer.__init__N)r+r,r-__doc__r`rrrrrYsrY)whichc s"dd}tjr&||r"SdS|dkr>tjdtj}|sFdS|tj}tj dkrtj |krt| dtj tjddtj}t fd d |Drg}q‡fd d |D}ng}t }|D]P}tj|}||kr|||D](} tj|| } || |r| SqqdS) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. cSs&tj|o$t||o$tj| SrZ)ospathexistsaccessisdir)fnmoderrr _access_checks zwhich.._access_checkNPATHwin32rPATHEXTc3s |]}|VqdSrZ)r4endswith.0extcmdrr szwhich..csg|] }|qSrrrprsrr szwhich..)rcrddirnameenvironrOdefpathr1pathsepsysplatformcurdirinsertanysetnormcaseaddr;) rtrirdrjpathextfilesseendirnormdirthefilenamerrsrrbs8         rb)ZipFile __enter__) ZipExtFilec@s$eZdZddZddZddZdS)rcCs|j|jdSrZr[)r^baserrrr`szZipExtFile.__init__cCs|SrZrr^rrrrszZipExtFile.__enter__cGs |dSrZcloser^exc_inforrr__exit__szZipExtFile.__exit__N)r+r,r-r`rrrrrrrsrc@s$eZdZddZddZddZdS)rcCs|SrZrrrrrr#szZipFile.__enter__cGs |dSrZrrrrrr&szZipFile.__exit__cOstj|f||}t|SrZ) BaseZipFileopenr)r^argsr_rrrrr*sz ZipFile.openN)r+r,r-rrrrrrrr"sr)python_implementationcCs0dtjkrdStjdkrdStjdr,dSdS)z6Return a string identifying the Python implementation.PyPyjavaJython IronPythonCPython)r{versionrcrr6rrrrr1s   r)CallablecCs t|tSrZ)rr)objrrrcallableCsrrmbcsstrictsurrogateescapecCs:t|tr|St|tr$|ttStdt|jdSNzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper+filenamerrrfsencodeWs   rcCs:t|tr|St|tr$|ttStdt|jdSr) rrrdecoderrrrr+rrrrfsdecode`s   r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)cCsH|dddd}|dks*|dr.dS|dks@|drDd S|S) z(Imitates get_normal_name in tokenizer.c.N _-rzutf-8-)zlatin-1 iso-8859-1z iso-latin-1)zlatin-1-z iso-8859-1-z iso-latin-1-r)r4r9r6)orig_encencrrr_get_normal_nameqsrcsz jjWntk r$dYnXdd}d}fdd}fdd}|}|trpd|d d}d }|s||gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFrcs$zWStk rYdSXdS)N) StopIterationr)readlinerr read_or_stopsz%detect_encoding..read_or_stopcsz|d}Wn4tk rBd}dk r6d|}t|YnXt|}|sVdSt|d}z t|}Wn:tk rdkrd|}n d|}t|YnXr|j dkr؈dkrd}n d}t||d 7}|S) Nrz'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorr)line line_stringmsgmatchesencodingcodec) bom_foundrrr find_cookies8       z$detect_encoding..find_cookieTrz utf-8-sig)__self__rAttributeErrorr6r)rrdefaultrrfirstsecondr)rrrrr|s4   &     r)r8)r)unescape)ChainMap)MutableMapping)recursive_repr...csfdd}|S)zm Decorator to make a repr function return fillvalue for a recursive call csLtfdd}td|_td|_td|_tdi|_|S)Nc sBt|tf}|krS|z |}W5|X|SrZ)id get_identrdiscard)r^rUresult) fillvalue repr_running user_functionrrwrappers   z=_recursive_repr..decorating_function..wrapperr,rar+__annotations__)rgetattrr,rar+r)rrr)rrrdecorating_functions   z,_recursive_repr..decorating_functionr)rrrrr_recursive_reprs rc@seZdZdZddZddZddZd'd d Zd d Zd dZ ddZ ddZ e ddZ eddZddZeZddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS)(ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cGst|p ig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)r^rrrrr`szChainMap.__init__cCs t|dSrZ)KeyErrorr^rUrrr __missing__szChainMap.__missing__c Cs:|jD](}z||WStk r,YqXq||SrZ)rrr)r^rUmappingrrr __getitem__s  zChainMap.__getitem__NcCs||kr||S|SrZrr^rUrrrrrO$sz ChainMap.getcCsttj|jSrZ)rPrunionrrrrr__len__'szChainMap.__len__cCsttj|jSrZ)iterrrrrrrr__iter__*szChainMap.__iter__cstfdd|jDS)Nc3s|]}|kVqdSrZr)rqmrUrrru.sz(ChainMap.__contains__..rrrrrr __contains__-szChainMap.__contains__cCs t|jSrZrrrrr__bool__0szChainMap.__bool__cCsd|dtt|jS)Nz{0.__class__.__name__}({1})rM)rr;rQr3rrrrr__repr__3szChainMap.__repr__cGs|tj|f|S)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablerrrrr8szChainMap.fromkeyscCs$|j|jdf|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rr.N) __class__rcopyrrrrr=sz ChainMap.copycCs|jif|jS)z;New ChainMap with a new dict followed by all previous maps.rrrrrr new_childCszChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].r.NrrrrrparentsGszChainMap.parentscCs||jd|<dS)Nr)r)r^rUrVrrr __setitem__LszChainMap.__setitem__cCs8z|jd|=Wn"tk r2td|YnXdS)Nr(Key not found in the first mapping: {!r})rrrrrrr __delitem__OszChainMap.__delitem__cCs2z|jdWStk r,tdYnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.N)rpopitemrrrrrrUszChainMap.popitemcGs@z|jdj|f|WStk r:td|YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rrN)rpoprr)r^rUrrrrr\sz ChainMap.popcCs|jddS)z'Clear maps[0], leaving maps[1:] intact.rN)rclearrrrrrcszChainMap.clear)N)r+r,r-rar`rrrOrrrrrr classmethodrr__copy__rpropertyrrrrrrrrrrrs.     r)cache_from_sourcecCs0|dst|dkrd}|r$d}nd}||S)Nz.pyTco)roAssertionError)rddebug_overridesuffixrrrr jsr ) OrderedDict)r)KeysView ValuesView ItemsViewc@seZdZdZddZejfddZejfddZdd Zd d Z d d Z d6ddZ ddZ ddZ ddZddZddZddZddZeZeZefdd Zd7d"d#Zd8d$d%Zd&d'Zd(d)Zed9d*d+Zd,d-Zd.d/Zd0d1Zd2d3Z d4d5Z!d!S):rz)Dictionary that remembers insertion ordercOsnt|dkrtdt|z |jWn6tk r\g|_}||dg|dd<i|_YnX|j||dS)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. r.z$expected at most 1 arguments, got %dN)rPr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)r^rkwdsrootrrrr`s    zOrderedDict.__init__cCsF||kr6|j}|d}|||g|d<|d<|j|<||||dS)z!od.__setitem__(i, y) <==> od[i]=yrr.N)rr)r^rUrVZ dict_setitemrlastrrrrs  zOrderedDict.__setitem__cCs0||||j|\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]r.rN)rr)r^rUZ dict_delitem link_prev link_nextrrrrs zOrderedDict.__delitem__ccs.|j}|d}||k r*|dV|d}qdS)zod.__iter__() <==> iter(od)r.rNrr^rcurrrrrrs  zOrderedDict.__iter__ccs.|j}|d}||k r*|dV|d}qdS)z#od.__reversed__() <==> reversed(od)rrNrrrrr __reversed__s  zOrderedDict.__reversed__cCsdz@|jD]}|dd=q |j}||dg|dd<|jWntk rTYnXt|dS)z.od.clear() -> None. Remove all items from od.N)r itervaluesrrrr)r^noderrrrrs zOrderedDict.clearTcCs||s td|j}|r8|d}|d}||d<||d<n |d}|d}||d<||d<|d}|j|=t||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrr.r)rrrrr)r^rrlinkrrrUrVrrrrs   zOrderedDict.popitemcCst|S)zod.keys() -> list of keys in od)rrrrrkeysszOrderedDict.keyscsfddDS)z#od.values() -> list of values in odcsg|] }|qSrrrqrUrrrrvsz&OrderedDict.values..rrrrrvaluesszOrderedDict.valuescsfddDS)z.od.items() -> list of (key, value) pairs in odcsg|]}||fqSrrr#rrrrvsz%OrderedDict.items..rrrrritemsszOrderedDict.itemscCst|S)z0od.iterkeys() -> an iterator over the keys in od)rrrrriterkeysszOrderedDict.iterkeysccs|D]}||VqdS)z2od.itervalues -> an iterator over the values in odNrr^krrrrszOrderedDict.itervaluesccs|D]}|||fVqdS)z=od.iteritems -> an iterator over the (key, value) items in odNrr'rrr iteritemsszOrderedDict.iteritemscOst|dkr tdt|fn |s,td|d}d}t|dkrL|d}t|trn|D]}||||<qZn None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v rz8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rrr.r"N)rPrrrhasattrr"r%)rrr^otherrUrVrrrr]s(       zOrderedDict.updatecCs0||kr||}||=|S||jkr,t||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr)r^rUrrrrrr&s zOrderedDict.popNcCs||kr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odrrrrr setdefault3szOrderedDict.setdefaultcCsf|si}t|tf}||kr"dSd||<z.|sBd|jjfWSd|jj|fWS||=XdS)zod.__repr__() <==> repr(od)rr.z%s()z%s(%r)N)r _get_identrr+r%)r^ _repr_runningZcall_keyrrrr:szOrderedDict.__repr__csXfddD}t}ttD]}||dq(|rLj|f|fSj|ffS)z%Return state information for picklingcsg|]}||gqSrrrqr(rrrrvJsz*OrderedDict.__reduce__..N)varsrrrr)r^r% inst_dictr(rrr __reduce__Hs zOrderedDict.__reduce__cCs ||S)z!od.copy() -> a shallow copy of od)rrrrrrRszOrderedDict.copycCs|}|D] }|||<q |S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r)rrrVdrUrrrrVs zOrderedDict.fromkeyscCs6t|tr*t|t|ko(||kSt||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rrrPr%r__eq__r^r+rrrr5as  zOrderedDict.__eq__cCs ||k SrZrr6rrr__ne__jszOrderedDict.__ne__cCst|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)rrrrrviewkeysoszOrderedDict.viewkeyscCst|S)z an object providing a view on od's values)rrrrr viewvaluessszOrderedDict.viewvaluescCst|S)zBod.viewitems() -> a set-like object providing a view on od's items)rrrrr viewitemswszOrderedDict.viewitems)T)N)N)N)"r+r,r-rar`rrrrrrrr"r$r%r&rr)r]robjectr,rr-rr3rrrr5r7r8r9r:rrrrrs:         r)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cCst|}|std|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERr=rN)rrrrrr=s  r=c@s"eZdZdZddZdddZdS)ConvertingDictz A converting dictionary wrapper.cCsJt||}|j|}||k rF|||<t|tttfkrF||_||_ |SrZ) rr configuratorconvertrr?ConvertingListConvertingTupleparentrUr^rUrVrrrrrs   zConvertingDict.__getitem__NcCsLt|||}|j|}||k rH|||<t|tttfkrH||_||_ |SrZ) rrOr@rArr?rBrCrDrUr^rUrrVrrrrrOs  zConvertingDict.get)N)r+r,r-rarrOrrrrr?s r?cCsDt|||}|j|}||k r@t|tttfkr@||_||_ |SrZ) rrr@rArr?rBrCrDrUrFrrrrs  rc@s"eZdZdZddZdddZdS) rBzA converting list wrapper.cCsJt||}|j|}||k rF|||<t|tttfkrF||_||_ |SrZ) rrr@rArr?rBrCrDrUrErrrrs   zConvertingList.__getitem__cCs<t||}|j|}||k r8t|tttfkr8||_|SrZ) rrr@rArr?rBrCrD)r^idxrVrrrrrs   zConvertingList.popN)rG)r+r,r-rarrrrrrrBs rBc@seZdZdZddZdS)rCzA converting tuple wrapper.cCsBt||}|j|}||k r>t|tttfkr>||_||_ |SrZ) tuplerr@rArr?rBrCrDrUrErrrrs   zConvertingTuple.__getitem__N)r+r,r-rarrrrrrCsrCc@seZdZdZedZedZedZedZ edZ ddd Z e e Zd d Zd d ZddZddZddZddZddZdS)r<zQ The configurator base class which defines some useful defaults. z%^(?P[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)rrcfgcCst||_||j_dSrZ)r?configr@)r^rMrrrr`s zBaseConfigurator.__init__c Cs|d}|d}z^||}|D]H}|d|7}zt||}Wq$tk rj||t||}Yq$Xq$|WStk rtdd\}}td||f}|||_ |_ |YnXdS)zl Resolve strings to objects using standard import and attribute syntax. r/rr.NzCannot resolve %r: %s) r1rimporterrr ImportErrorr{rrN __cause__ __traceback__) r^rrusedfoundrFetbvrrrresolves"     zBaseConfigurator.resolvecCs ||S)z*Default converter for the ext:// protocol.)rWr^rVrrrrJszBaseConfigurator.ext_convertcCs|}|j|}|dkr&td|n||d}|j|d}|r|j|}|rn||d}nd|j|}|r|d}|j|s||}n2zt |}||}Wnt k r||}YnX|r||d}qHtd||fqH|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) WORD_PATTERNr=rNendrMgroups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNintr)r^rVrestrr4rHnrrrrK s4       zBaseConfigurator.cfg_convertcCst|ts$t|tr$t|}||_nt|tsHt|trHt|}||_nzt|tslt|trlt|}||_nVt|tr|j |}|r| }|d}|j |d}|r|d}t||}||}|S)z Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. prefixNr)rr?rr@rBrrCrI string_typesCONVERT_PATTERNr= groupdictvalue_convertersrOr)r^rVrr4rb converterrrrrrA.s,    zBaseConfigurator.convertcsnd}t|s||}dd}tfddD}|f|}|rj|D]\}}t|||qT|S)z1Configure an object with a user-supplied factory.z()r/Ncs g|]}t|r||fqSr)r=r0rMrrrvQsz5BaseConfigurator.configure_custom..)rrrWrr%setattr)r^rMr propsr_rrrVrrhrconfigure_customJs    z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)rrrIrXrrras_tupleXs zBaseConfigurator.as_tupleN)r+r,r-rar7r:rdrYr\r]r^rf staticmethod __import__rNr`rWrJrKrArkrlrrrrr<s"     "r<)r.)r)N)N) __future__rrcr7r{sslrO version_infor basestringrcrrtypesr file_type __builtin__builtins ConfigParser configparserrrrr r urllibr r rr rrrrurllib2rrrrrrr r!r"r#httplib xmlrpclibQueuequeuer$htmlentitydefs raw_input itertoolsr%filterr&r(iostrr'shutil urllib.parseurllib.request urllib.error http.clientclientrequest xmlrpc.client html.parser html.entitiesentitiesinputr)r*rNrHrXrYr;rbF_OKX_OKzipfilerrr*rZBaseZipExtFiler|r sysconfigr NameErrorcollections.abcrrrrgetfilesystemencodingrrtokenizercodecsrrr:rrhtmlr8cgir collectionsrrreprlibrrimportlib.utilr rthreadrr. dummy_thread_abcollrrrrlogging.configr<r=Ir>r?rrrBrIrCrrrrs     $,     (0        2+A             [   b w  PKd]99+distlib/__pycache__/locators.cpython-38.pycnu[U ʗRe@s.ddlZddlmZddlZddlZddlZddlZddlZz ddlZWne k rdddl ZYnXddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlmZm Z m!Z!ddl"m#Z#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-dd l.m/Z/m0Z0dd l1m2Z2m3Z3e4e5Z6e7d Z8e7d ej9Z:e7d Z;dZGddde?Z@Gddde@ZAGddde@ZBGddde?ZCGddde@ZDGddde@ZEGdd d e@ZFGd!d"d"e@ZGGd#d$d$e@ZHeHeDd%d&d'd(d)ZIeIjJZJGd*d+d+e?ZKdS)-N)BytesIO)DistlibException)urljoinurlparse urlunparse url2pathname pathname2urlqueuequoteunescape build_openerHTTPRedirectHandler text_typeRequest HTTPErrorURLError) DistributionDistributionPath make_dist)MetadataMetadataInvalidError)cached_property ensure_slashsplit_filenameget_project_dataparse_requirementparse_name_and_version ServerProxynormalize_name) get_schemeUnsupportedVersionError)Wheel is_compatiblez^(\w+)=([a-f0-9]+)z;\s*charset\s*=\s*(.*)\s*$ztext/html|application/x(ht)?mlzhttps://pypi.org/pypicCs6|dkr t}t|dd}z |WS|dXdS)z Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. N@timeoutclose) DEFAULT_INDEXr list_packages)urlclientr,/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/locators.pyget_all_distribution_names)s   r.c@s$eZdZdZddZeZZZdS)RedirectHandlerzE A class to work around a bug in some Python 3.2.x releases. c Csd}dD]}||kr||}q"q|dkr.dSt|}|jdkrnt||}t|drf|||n|||<t||||||S)N)locationurireplace_header)rschemer get_full_urlhasattrr3BaseRedirectHandlerhttp_error_302) selfreqfpcodemsgheadersnewurlkeyurlpartsr,r,r-r8@s   zRedirectHandler.http_error_302N)__name__ __module__ __qualname____doc__r8http_error_301http_error_303http_error_307r,r,r,r-r/7sr/c@seZdZdZdZdZdZdZedZd)dd Z d d Z d d Z ddZ ddZ ddZee eZddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd*d'd(ZdS)+LocatorzG A base class for locators - things that locate distributions. )z.tar.gzz.tar.bz2z.tarz.zipz.tgzz.tbz)z.eggz.exe.whl)z.pdfN)rJdefaultcCs,i|_||_tt|_d|_t|_dS)a^ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. N) _cacher4r r/openermatcherr Queueerrors)r9r4r,r,r-__init__fs  zLocator.__init__cCsVg}|jsRz|jd}||Wn|jjk rDYqYnX|jq|S)z8 Return any errors which have occurred. F)rPemptygetappendEmpty task_done)r9resulter,r,r- get_errorsys    zLocator.get_errorscCs |dS)z> Clear any errors which may have been logged. N)rYr9r,r,r- clear_errorsszLocator.clear_errorscCs|jdSN)rLclearrZr,r,r- clear_cacheszLocator.clear_cachecCs|jSr\_schemerZr,r,r- _get_schemeszLocator._get_schemecCs ||_dSr\r_)r9valuer,r,r- _set_schemeszLocator._set_schemecCs tddS)a= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. Please implement in the subclassNNotImplementedError)r9namer,r,r- _get_projects zLocator._get_projectcCs tddS)J Return all the distribution names known to this locator. rdNrerZr,r,r-get_distribution_namesszLocator.get_distribution_namescCsL|jdkr||}n2||jkr,|j|}n|||}||j|<|S)z For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. N)rLrhr[)r9rgrWr,r,r- get_projects      zLocator.get_projectcCs^t|}t|j}d}|d}||j}|rBtt||j}|j dkd|j k||||fS)zu Give an url a score which can be used to choose preferred URLs for a given project release. TrJhttpszpypi.org) r posixpathbasenamepathendswithdownloadable_extensionsr#r" wheel_tagsr4netloc)r9r*trn compatibleis_wheelZis_downloadabler,r,r- score_urls   zLocator.score_urlcCsR|}|rN||}||}||kr(|}||kr@td||ntd|||S)a{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. zNot replacing %r with %rzReplacing %r with %r)rwloggerdebug)r9url1url2rWs1s2r,r,r- prefer_urls   zLocator.prefer_urlcCs t||S)zZ Attempt to split a filename in project name, version and Python version. )r)r9filename project_namer,r,r-rszLocator.split_filenamec Csdd}d}t|\}}}}} } | drz~t |}t ||j std |nX|dkrd }n ||j |}|r|j |j |jt||||| d fd dd|jDd}Wn0tk r:}ztd|W5d}~XYnXn||jsZtd|nt|}}|jD]}||rn|dt| }|||}|std|nH|\}}}|r|||r|||t||||| d fd}|r||d<qqn|r| r| |d| <|S)a See if a URL is a candidate for a download URL for a project (the URL has typically been scraped from an HTML page). If it is, a dictionary is returned with keys "name", "version", "filename" and "url"; otherwise, None is returned. cSst|t|kSr\)r)Zname1Zname2r,r,r- same_projectsz:Locator.convert_url_to_download_info..same_projectNzegg=z %s: version hint in fragment: %r)NN/rJzWheel not compatible: %sTr2z, cSs"g|]}dt|ddqS).N)joinlist).0vr,r,r- sz8Locator.convert_url_to_download_info..)rgversionrr*python-versionzinvalid path for wheel: %szNot downloadable: %sz No match for project/version: %s)rgrrr*r %s_digest)rlower startswithrxry HASHER_HASHmatchgroupsrpr"r#rrrgrrrrpyver Exceptionwarningrqrmrnlenr)r9r*rrrWr4rsroparamsqueryfragmalgodigestZorigpathwheelincluderXrextrtrgrrr,r,r-convert_url_to_download_infos              z$Locator.convert_url_to_download_infocCshd}d|kr6|d}dD]}||kr|||f}q6q|sddD]$}d|}||kr>|||f}qdq>|S)z Get a digest from a dictionary by looking at a "digests" dictionary or keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5. Ndigests)sha256md5rr,)r9inforWrrr@r,r,r- _get_digest1s  zLocator._get_digestc Cs|d}|d}||kr,||}|j}nt|||jd}|j}|||_}|d}||d|<|j|dkr||j||_|d|t  |||_ |||<dS)z Update a result dictionary (the final result from _get_project) with a dictionary for a specific version, which typically holds information gleaned from a filename or URL for an archive for the distribution. rgrr4r*rurlsN) popmetadatarr4rr source_urlr~ setdefaultsetaddlocator) r9rWrrgrdistmdrr*r,r,r-_update_version_dataHs   zLocator._update_version_dataFc Csd}t|}|dkr td|t|j}||j|_}td|t|j | |j }t |dkrg}|j } |D]Z} | dkrqxz(|| sn|s| | js|| Wqxtk rtd|| YqxXqxt |dkrt||jd}|rtd ||d } || }|rx|jr&|j|_|d i| t|_i} |d i} |jD]}|| krT| || |<qT| |_d|_|S) a Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. NzNot a valid requirement: %rzmatcher: %s (%s)rrrzerror matching %s with %rr)r@zsorted list: %srrr)rrr r4rN requirementrxrytyperBrkrgrZ version_classr is_prereleaserTrrsortedr@extrasrSr download_urlsr)r9r prereleasesrWrr4rNversionsslistZvclskrdsdr*r,r,r-locate_sP          zLocator.locate)rK)F)rBrCrDrEsource_extensionsbinary_extensionsexcluded_extensionsrrrqrQrYr[r^rarcpropertyr4rhrjrkrwr~rrrrrr,r,r,r-rIVs.   JrIcs0eZdZdZfddZddZddZZS)PyPIRPCLocatorz This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). c s*tt|jf|||_t|dd|_dS)z Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. r$r%N)superrrQbase_urlrr+r9r*kwargs __class__r,r-rQszPyPIRPCLocator.__init__cCst|jSri)rr+r)rZr,r,r-rjsz%PyPIRPCLocator.get_distribution_namesc Csiid}|j|d}|D]}|j||}|j||}t|jd}|d|_|d|_|d|_ |dg|_ |d|_ t |}|r|d } | d |_ || |_||_|||<|D]:} | d } || } |d |t| | |d | <qq|S) NrTrrgrlicensekeywordssummaryrr*rr)r+Zpackage_releasesZ release_urlsZ release_datarr4rgrrSrrrrrrrrrrr) r9rgrWrrrdatarrrr*rr,r,r-rhs0         zPyPIRPCLocator._get_projectrBrCrDrErQrjrh __classcell__r,r,rr-rs rcs0eZdZdZfddZddZddZZS)PyPIJSONLocatorzw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. c s tt|jf|t||_dSr\)rrrQrrrrr,r-rQszPyPIJSONLocator.__init__cCs tddSrizNot available from this locatorNrerZr,r,r-rjsz&PyPIJSONLocator.get_distribution_namesc Cs iid}t|jdt|}z|j|}|}t|}t |j d}|d}|d|_ |d|_ | d|_| dg|_| d |_t|}||_|d } |||j <|d D]T} | d }|j||| |j|<|d |j t||| |d |<q|d D]\} } | |j kr4qt |j d} |j | _ | | _ t| }||_||| <| D]T} | d }|j||| |j|<|d | t||| |d |<qhqWn@tk r}z |jt|td|W5d}~XYnX|S)Nrz%s/jsonrrrgrrrrrr*rZreleaseszJSON fetch failed: %s) rrr rMopenreaddecodejsonloadsrr4rgrrSrrrrrrrrrrritemsrrPputrrx exception)r9rgrWr*resprrrrrrrinfosZomdodistrXr,r,r-rhsT                zPyPIJSONLocator._get_projectrr,r,rr-rs rc@s`eZdZdZedejejBejBZ edejejBZ ddZ edejZ e ddZd S) Pagez4 This class represents a scraped HTML page. z (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? z!]+)cCs4||_||_|_|j|j}|r0|d|_dS)zk Initialise an instance with the Unicode page contents and the URL they came from. rN)rrr*_basesearchgroup)r9rr*rr,r,r-rQ s  z Page.__init__z[^a-z0-9$&+,/:;=?@.#%_\\|-]cCsdd}t}|j|jD]}|d}|dpX|dpX|dpX|dpX|dpX|d }|d pp|d pp|d }t|j|}t|}|j d d|}| ||fqt |dddd}|S)z Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cSs,t|\}}}}}}t||t||||fS)zTidy up an URL.)rrr )r*r4rsrorrrr,r,r-clean4s  zPage.links..cleanr2Zrel1Zrel2Zrel3Zrel4Zrel5Zrel6rzr{Zurl3cSsdt|dS)Nz%%%2xr)ordr)rr,r,r-BzPage.links..cSs|dS)Nrr,)rtr,r,r-rFrT)r@reverse) r_hreffinditerr groupdictrrr _clean_resubrr)r9rrWrrrelr*r,r,r-links-s$  z Page.linksN)rBrCrDrErecompileISXrrrQrrrr,r,r,r-rs rcseZdZdZejdddddZdfdd Zd d Zd d Z ddZ e de j ZddZddZddZddZddZe dZddZZS)SimpleScrapingLocatorz A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. cCstjt|dS)N)fileobj)gzipGzipFilerrbr,r,r-rTrzSimpleScrapingLocator.cCs|Sr\r,rr,r,r-rUr)deflaternoneN c sltt|jf|t||_||_i|_t|_t |_ t|_ d|_ ||_t|_t|_d|_dS)a Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. FN)rrrQrrr& _page_cacher_seenr rO _to_fetch _bad_hostsskip_externals num_workers threadingRLock_lock_gplockplatform_check)r9r*r&rrrr,r-rQXs     zSimpleScrapingLocator.__init__cCsBg|_t|jD],}tj|jd}d|_||j|qdS)z Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). )targetTN) _threadsrangerrThread_fetchdaemonstartrT)r9irtr,r,r-_prepare_threadsss z&SimpleScrapingLocator._prepare_threadscCs6|jD]}|jdq|jD] }|qg|_dS)zu Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N)r rrr)r9rtr,r,r- _wait_threadss    z#SimpleScrapingLocator._wait_threadsc Csiid}|jx||_||_t|jdt|}|j|j| z&t d||j ||j W5| X|`W5QRX|S)Nrz%s/z Queueing %s)rrWrrrr rr]rrrrxryrrr)r9rgrWr*r,r,r-rhs      z"SimpleScrapingLocator._get_projectz<\b(linux_(i\d86|x86_64|arm\w+)|win(32|_amd64)|macosx_?\d+)\bcCs |j|S)zD Does an URL refer to a platform-specific download? )platform_dependentr)r9r*r,r,r-_is_platform_dependentsz,SimpleScrapingLocator._is_platform_dependentc CsZ|jr||rd}n|||j}td|||rV|j||j|W5QRX|S)a% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. Nzprocess_download: %s -> %s) rrrrrxryrrrW)r9r*rr,r,r-_process_downloads z'SimpleScrapingLocator._process_downloadc Cst|\}}}}}}||j|j|jr2d}n||jrJ||jsJd}nd||js\d}nR|dkrjd}nD|dkrxd}n6||rd}n&| ddd} | dkrd}nd}t d |||||S) z Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. F)Zhomepagedownload)httprlftp:rr localhostTz#should_queue: %s (%s) from %s -> %s) rrprrrrrrrsplitrrxry) r9linkZreferrerrr4rsro_rWhostr,r,r- _should_queues0    z#SimpleScrapingLocator._should_queuec Cs|j}zz|r||}|dkr,WWq|jD]j\}}||jkr2zB|j|||s||||rt d|||j |Wq2t k rYq2Xq2Wn2t k r}z|j t|W5d}~XYnXW5|jX|sqqdS)z Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. NzQueueing %s from %s)rrSrVget_pagerrrrrrxryrrrrPr)r9r*pagerrrXr,r,r-r s,       & zSimpleScrapingLocator._fetchc CsXt|\}}}}}}|dkr:tjt|r:tt|d}||jkr`|j|}t d||n| ddd}d}||j krt d||nt |d d id }zzt d ||j j||jd } t d|| } | dd} t| r| } | } | d}|r"|j|}|| } d}t| }|r@|d}z| |} Wn tk rn| d} YnXt| | }||j| <Wntk r}z|jdkrtd||W5d}~XYnt k r}z0td|||j!|j "|W5QRXW5d}~XYn2t#k rB}ztd||W5d}~XYnXW5||j|<X|S)a Get the HTML for an URL, possibly from an in-memory cache. XXX TODO Note: this cache is never actually cleared. It's assumed that the data won't get stale over the lifetime of a locator instance (not necessarily true for the default_locator). filez index.htmlzReturning %s from cache: %srrrNzSkipping %s due to bad host %szAccept-encodingidentity)r>z Fetching %sr%z Fetched %sz Content-Typer2zContent-Encodingzutf-8zlatin-1izFetch failed: %s: %s)$rosroisdirrrrrrxryrrrrMrr&rrSHTML_CONTENT_TYPErgeturlrdecodersCHARSETrrr UnicodeErrorrrr<rrrrr)r9r*r4rsrorrWrr:rr> content_typeZ final_urlrencodingdecoderrrXr,r,r-r sZ              &$ zSimpleScrapingLocator.get_pagez]*>([^<]+)= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. Z cantreplaceFT) reqtsrr]rrr frozensetr[rrX) r9r^otherproblemsZrlist unmatchedrZrNrWr,r,r-try_to_replaces$       zDependencyFinder.try_to_replaceFcCsi|_i|_i|_i|_t|p g}d|krH|d|tdddgO}t|trh|}}t d|n4|j j ||d}}|dkrt d|t d |d |_ t}t|g}t|g}|r|}|j} | |jkr||n"|j| } | |kr||| ||j|jB} |j} t} |r`||kr`d D]*}d |}||kr4| t|d |O} q4| | B| B}|D].}||}|sFt d||j j ||d}|dkr|s|j j |d d}|dkrt d||d|fn^|j|j}}||f|jkr|||||| krF||krF||t d|j|D]R}|j} | |jkrx|j|t|n"|j| } | |krJ||| |qJqpqt|j}|D]&}||k|_|jrt d|jqt d|||fS)a Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. z:*:z:test:z:build:z:dev:zpassed %s as requirement)rNzUnable to locate %rz located %sT)testbuilddevz:%s:z %s_requireszNo providers found for %rzCannot satisfy %rZ unsatisfiedzAdding %s to install_distsz#%s is a build-time dependency only.zfind done for %s)rVrTrSr`rrYrDrrxryrrr requestedrr@rXreZ run_requiresZ meta_requiresZbuild_requiresgetattrr_rrZname_and_versionrvaluesZbuild_time_dependency)r9rZ meta_extrasrrrrctodoZ install_distsrgrbZireqtsZsreqtsZereqtsr@rXZ all_reqtsr providersr^nrrWrTr,r,r-finds                            zDependencyFinder.find)N)NF) rBrCrDrErQrXr[r]r_reror,r,r,r-rQ*s (rQ)N)Lriorrloggingr$rmrr ImportErrorZdummy_threadingr/r2rcompatrrrrr r r r r rr7rrrrZdatabaserrrrrrutilrrrrrrrrrr r!rr"r# getLoggerrBrxrrrr)r&r(r.r/objectrIrrrrr1r<rCrHrRrrQr,r,r,r-sZ   @(    G0E:zA&[PKd]2FTT1distlib/__pycache__/database.cpython-38.opt-1.pycnu[U .eU@sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZmZdd lmZmZmZmZmZmZm Z d d d d dgZ!e"e#Z$dZ%dZ&deddde%dfZ'dZ(Gddde)Z*Gddde)Z+Gdd d e)Z,Gdd d e,Z-Gdd d e-Z.Gdd d e-Z/e.Z0e/Z1Gddde)Z2d)d!d"Z3d#d$Z4d%d&Z5d'd(Z6dS)*zPEP 376 implementation.)unicode_literalsN)DistlibException resources)StringIO) get_schemeUnsupportedVersionError)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME)parse_requirementcached_propertyparse_name_and_version read_exports write_exports CSVReader CSVWriter DistributionBaseInstalledDistributionInstalledDistributionEggInfoDistributionDistributionPathzpydist-exports.jsonzpydist-commands.jsonZ INSTALLERRECORD REQUESTED RESOURCESSHAREDz .dist-infoc@s(eZdZdZddZddZddZdS) _CachezL A simple cache mapping names and .dist-info paths to distributions cCsi|_i|_d|_dS)zZ Initialise an instance. There is normally one for each DistributionPath. FN)namepath generatedselfr#@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/database.py__init__1sz_Cache.__init__cCs|j|jd|_dS)zC Clear the cache, setting it to its initial state. FN)rclearrr r!r#r#r$r&9s  z _Cache.clearcCs2|j|jkr.||j|j<|j|jg|dS)z` Add a distribution to the cache. :param dist: The distribution to add. N)rr setdefaultkeyappendr"distr#r#r$addAs  z _Cache.addN)__name__ __module__ __qualname____doc__r%r&r,r#r#r#r$r-src@seZdZdZdddZddZdd ZeeeZd d Z d d Z ddZ e ddZ ddZddZdddZddZdddZdS)rzU Represents a set of distributions installed on a path (typically sys.path). NFcCsD|dkrtj}||_d|_||_t|_t|_d|_td|_ dS)a Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. NTdefault) sysr _include_dist _include_eggr_cache _cache_egg_cache_enabledr_scheme)r"rZ include_eggr#r#r$r%Os zDistributionPath.__init__cCs|jSNr7r!r#r#r$_get_cache_enabledcsz#DistributionPath._get_cache_enabledcCs ||_dSr9r:)r"valuer#r#r$_set_cache_enabledfsz#DistributionPath._set_cache_enabledcCs|j|jdS)z, Clears the internal cache. N)r5r&r6r!r#r#r$ clear_cacheks zDistributionPath.clear_cachec csDt}|jD]0}t|}|dkr&q |d}|r |js||jjD] }|Vq0|jrZ|jjD] }|VqNdS)a5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N)r7r\r^r5rvaluesr4r6r*r#r#r$get_distributionss   z"DistributionPath.get_distributionscCsd}|}|js4|D]}|j|kr|}q|qnH|||jjkrZ|jj|d}n"|jr|||jjkr||jj|d}|S)a= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` Nr) lowerr7r\r(r^r5rr4r6)r"rresultr+r#r#r$get_distributions    z!DistributionPath.get_distributionc csd}|dk rJz|jd||f}Wn$tk rHtd||fYnX|D]p}t|dsntd|qR|j}|D]H}t |\}}|dkr||kr|VqRqx||krx| |rx|VqRqxqRdS)a Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string N%s (%s)zinvalid name or version: %r, %rprovideszNo "provides": %s) r8matcher ValueErrorrrfhasattrrSrTrkrmatch) r"rrcrlr+providedpp_namep_verr#r#r$provides_distributions*    z&DistributionPath.provides_distributioncCs(||}|dkrtd|||S)z5 Return the path to a resource file. Nzno distribution named %r found)ri LookupErrorget_resource_path)r"r relative_pathr+r#r#r$ get_file_path!s  zDistributionPath.get_file_pathccsX|D]J}|j}||kr||}|dk r>||krR||Vq|D] }|VqFqdS)z Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N)rfexportsre)r"categoryrr+rYdvr#r#r$get_exported_entries*s   z%DistributionPath.get_exported_entries)NF)N)N)r-r.r/r0r%r;r=propertyZ cache_enabledr>r\r^ classmethodrdrfrirtrxr}r#r#r#r$rKs  ,  ) c@seZdZdZdZdZddZeddZeZ eddZ ed d Z d d Z ed dZ eddZeddZeddZeddZddZddZddZddZdS) rz A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. FcCsL||_|j|_|j|_|j|_d|_d|_d|_d|_t |_ i|_ dS)z Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N) rDrrgr(rcZlocatordigestextrascontextrHZ download_urlsZdigests)r"rDr#r#r$r%Os zDistribution.__init__cCs|jjS)zH The source archive download URL for this distribution. )rD source_urlr!r#r#r$r`szDistribution.source_urlcCsd|j|jfS)zX A utility property which displays the name and version in parentheses. rjrrcr!r#r#r$name_and_versioniszDistribution.name_and_versioncCs.|jj}d|j|jf}||kr*|||S)z A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. rj)rDrkrrcr))r"Zplistsr#r#r$rkps  zDistribution.providescCs8|j}td|t||}t|j||j|jdS)Nz%Getting requirements from metadata %r)rrE) rDrSrTZtodictgetattrrHZget_requirementsrr)r"Zreq_attrmdZreqtsr#r#r$_get_requirements|s   zDistribution._get_requirementscCs |dS)N run_requiresrr!r#r#r$rszDistribution.run_requirescCs |dS)N meta_requiresrr!r#r#r$rszDistribution.meta_requirescCs |dS)Nbuild_requiresrr!r#r#r$rszDistribution.build_requirescCs |dS)N test_requiresrr!r#r#r$rszDistribution.test_requirescCs |dS)N dev_requiresrr!r#r#r$rszDistribution.dev_requiresc Cst|}t|jj}z||j}Wn6tk rZtd|| d}||}YnX|j }d}|j D]D}t |\}} ||krqlz| | }WqWqltk rYqlXql|S)z Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. +could not read version %r - using name onlyrF)r rrDrCrl requirementrrSwarningsplitr(rkrro) r"reqrYrCrlrrhrqrrrsr#r#r$matches_requirements,       z Distribution.matches_requirementcCs(|jrd|j}nd}d|j|j|fS)zC Return a textual representation of this instance, z [%s]r?z)rrrc)r"suffixr#r#r$__repr__s zDistribution.__repr__cCs>t|t|k rd}n$|j|jko8|j|jko8|j|jk}|S)a< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. F)typerrcr)r"otherrhr#r#r$__eq__s   zDistribution.__eq__cCst|jt|jt|jS)zH Compute hash in a way which matches the equality test. )hashrrcrr!r#r#r$__hash__szDistribution.__hash__N)r-r.r/r0Zbuild_time_dependency requestedr%r~rZ download_urlrrkrrrrrrrrrrr#r#r#r$r=s4        " cs0eZdZdZdZdfdd ZdddZZS) rz] This is the base class for installed distributions (whether PEP 376 or legacy). Ncs tt||||_||_dS)a Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N)superrr%r dist_path)r"rDrrE __class__r#r$r%s z"BaseInstalledDistribution.__init__cCsd|dkr|j}|dkr"tj}d}ntt|}d|j}||}t|dd}d||fS)a Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str Nr?z%s==ascii%s%s) hasherhashlibmd5rrbase64Zurlsafe_b64encoderstripdecode)r"datarprefixrr#r#r$get_hashs   z"BaseInstalledDistribution.get_hash)N)N)r-r.r/r0rr%r __classcell__r#r#rr$rscseZdZdZdZd'fdd ZddZdd Zd d Ze d d Z ddZ ddZ ddZ ddZd(ddZddZe ddZd)ddZdd Zd!d"Zd#d$Zd%d&ZejZZS)*ra  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). Zsha256Nc sJg|_t||_}|dkr*td||rP|jrP||jjkrP|jj|j}nt|dkr| t }|dkrt| t }|dkr| d}|dkrtdt |ft |}t|dd}W5QRXtt|||||r|jr|j|| d}|dk |_tj|d}tj|rFt|d}|} W5QRX| |_dS) Nzfinder unavailable for %sZMETADATAzno %s found in %sr@rAr top_level.txtrb)modulesrrIrXrmr7r5rrDrJr r rPrQrRr rrr%r,rosrOexistsopenread splitlines) r"rrDrErXrYr[rqfrrr#r$r%s8         zInstalledDistribution.__init__cCsd|j|j|jfS)Nz#rrcrr!r#r#r$r=s zInstalledDistribution.__repr__cCsd|j|jfSNz%s %srr!r#r#r$__str__AszInstalledDistribution.__str__c Csg}|d}t|\}t|dF}|D]:}ddtt|dD}||\}}} |||| fq.W5QRXW5QRX|S)a" Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). rr[cSsg|]}dqSr9r#).0ir#r#r$ Ssz6InstalledDistribution._get_records..)get_distinfo_resourcerPrQrRrrangelenr)) r"resultsrYr[Z record_readerrowmissingrchecksumsizer#r#r$ _get_recordsDs  &z"InstalledDistribution._get_recordscCsi}|t}|r|}|S)a Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. )rEXPORTS_FILENAMEr)r"rhrYr#r#r$ry[s  zInstalledDistribution.exportsc Cs8i}|t}|r4t|}t|}W5QRX|S)z Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. )rrrPrQrRr)r"rhrYr[r#r#r$ris  z"InstalledDistribution.read_exportsc Cs.|t}t|d}t||W5QRXdS)a Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. wN)get_distinfo_filerrr)r"ryZrfrr#r#r$rxs  z#InstalledDistribution.write_exportsc Cs|d}t|R}t|d<}|D]0\}}||kr*|W5QRW5QRSq*W5QRXW5QRXtd|dS)aW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. rrz3no resource file with relative path %r is installedN)rrPrQrRrKeyError)r"rwrYr[Zresources_readerrelativeZ destinationr#r#r$rvs   6z'InstalledDistribution.get_resource_pathccs|D] }|VqdS)z Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N)r)r"rhr#r#r$list_installed_filess z*InstalledDistribution.list_installed_filesFc Cs(tj|d}tj|j}||}tj|d}|d}td||rRdSt|}|D]}tj |sz| drd} } n4dtj |} t |d} | | } W5QRX||s|r||rtj||}||| | fq`||r tj||}||ddfW5QRX|S)z Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. r?r creating %sNz.pycz.pyoz%dr)rrrOdirname startswithrrSinforisdirrLgetsizerrrrelpathZwriterow) r"pathsrdry_runbaseZbase_under_prefix record_pathwriterr hash_valuerfpr#r#r$write_installed_filess0       z+InstalledDistribution.write_installed_filesc Csg}tj|j}|d}|D]\}}}tj|sHtj||}||krRq$tj|sr||dddfq$tj |r$t tj |}|r||kr||d||fq$|r$d|kr| ddd}nd }t |d 2} || |} | |kr||d || fW5QRXq$|S)  Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. rrTFr=rrNrr)rrrrrisabsrOrr)isfilestrrrrrr) r" mismatchesrrrrrZ actual_sizerrZ actual_hashr#r#r$check_installed_filess.        z+InstalledDistribution.check_installed_filesc Csi}tj|jd}tj|rtj|ddd}|}W5QRX|D]8}|dd\}}|dkr|| |g |qL|||<qL|S)a A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. rrYutf-8encodingrr namespace) rrrOrcodecsrrrrr'r))r"rh shared_pathrlinesliner(r<r#r#r$shared_locationss  z&InstalledDistribution.shared_locationsc Cstj|jd}td||r$dSg}dD].}||}tj||r,|d||fq,|ddD]}|d|qhtj |d d d }| d |W5QRX|S) aa Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. rrN)rlibZheadersZscriptsrz%s=%srr#z namespace=%srrr ) rrrOrSrrr)getrrwrite) r"rrrrr(rnsrr#r#r$write_shared_locationss  z,InstalledDistribution.write_shared_locationscCsF|tkrtd||jft|j}|dkr.set_name_and_version) rrr7r6rDrrc _get_metadatar,rrr%)r"rrErrDrr#r$r%bs   zEggInfoDistribution.__init__c sd}ddfdd}d}}|drtj|rtj|d}tj|d}t|dd }tj|d } tj|d }|| }npt|} t| d  d } t| dd}z,| d} | d d}| d}Wnt k rd}YnXnf|drPtj|rBtj|d } || }tj|d}tj|d }t|dd }n t d||rl| ||dkr|dk rtj|rt|d} |  d}W5QRX|sg}n|}||_|S)NcSsg}|}|D]}|}|dr6td|qt|}|sPtd|q|jr`td|jst||j qd dd|jD}|d|j |fq|S) zCreate a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. [z.Unexpected line: quitting requirement scan: %rz#Not recognised as a requirement: %rz4extra requirements in requires.txt are not supportedz, css|]}d|VqdS)rNr#)rcr#r#r$ szQEggInfoDistribution._get_metadata..parse_requires_data..rj) rstriprrSrr rZ constraintsr)rrO)rreqsrrrYZconsr#r#r$parse_requires_datazs(   z>EggInfoDistribution._get_metadata..parse_requires_datac sHg}z*t|dd}|}W5QRXWntk rBYnX|S)zCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. rYr)rrrIOError)req_pathrrrr#r$parse_requires_pathsz>EggInfoDistribution._get_metadata..parse_requires_pathrGzEGG-INFOzPKG-INFOr@)rrCz requires.txtrzEGG-INFO/PKG-INFOutf8rAzEGG-INFO/requires.txtzEGG-INFO/top_level.txtrrFz,path must end with .egg-info or .egg, got %rr)rLrrrrOr zipimport zipimporterrget_datarrrZadd_requirementsrrrrr)r"rrequiresr Ztl_pathZtl_datarq meta_pathrDrZzipfrBrrr#rr$rwsX             z!EggInfoDistribution._get_metadatacCsd|j|j|jfS)Nz!rr!r#r#r$rs zEggInfoDistribution.__repr__cCsd|j|jfSrrr!r#r#r$rszEggInfoDistribution.__str__cCs`g}tj|jd}tj|r\|D]2\}}}||kr._md5cSs t|jSr9)rstatst_size)rr#r#r$_sizesz7EggInfoDistribution.list_installed_files.._sizerrYrrzNon-existent file: %srN) rrrOrrrrnormpathrSrrLrr))r"rrrrhrrrqr#r#r$rs"     $z(EggInfoDistribution.list_installed_filesFc cstj|jd}tj|rd}tj|ddd`}|D]T}|}|dkrPd}q6|s6tjtj|j|}||jr6|r|Vq6|Vq6W5QRXdS) a  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths rTrYrrz./FN) rrrOrrrrrr)r"Zabsoluterskiprrrqr#r#r$rs   z'EggInfoDistribution.list_distinfo_filescCst|to|j|jkSr9)r]rrrr#r#r$r.s  zEggInfoDistribution.__eq__)N)F)r-r.r/r0rrr%rrrrrrrrrrr#r#rr$rYsZ& c@s^eZdZdZddZddZdddZd d Zd d ZdddZ dddZ ddZ ddZ dS)DependencyGrapha Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. cCsi|_i|_i|_dSr9)adjacency_list reverse_listrr!r#r#r$r%IszDependencyGraph.__init__cCsg|j|<g|j|<dS)zAdd the *distribution* to the graph. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` N)rr)r" distributionr#r#r$add_distributionNs z DependencyGraph.add_distributionNcCs6|j|||f||j|kr2|j||dS)aAdd an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type label: ``str`` or ``None`` N)rr)r)r"xylabelr#r#r$add_edgeXs zDependencyGraph.add_edgecCs&td|||j|g|dS)a Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str`` z %s missing %rN)rSrTrr'r))r"rrr#r#r$ add_missinggszDependencyGraph.add_missingcCsd|j|jfSrrr*r#r#r$ _repr_distrszDependencyGraph._repr_distrcCs||g}|j|D]h\}}||}|dk r|d|j|jfq>q|st|dkr|d|d|d|D]}|d |j|d q|d |d dS) a9Writes a DOT output for the graph to the provided file *f*. If *skip_disconnected* is set to ``True``, then all distributions that are not dependent on any other distribution are skipped. :type f: has to support ``file``-like operations :type skip_disconnected: ``bool`` zdigraph dependencies { rNz"%s" -> "%s" [label="%s"] z "%s" -> "%s" zsubgraph disconnected { zlabel = "Disconnected" zbgcolor = red z"%s"rz} )rritemsrr)r)r"rZskip_disconnectedZ disconnectedr+adjsrrr#r#r$to_dots(          zDependencyGraph.to_dotcsg}i}|jD]\}}|dd||<qgt|ddD]\}}|sD|||=qDshq|D]\}}fdd|D||<qptdddD|q,|t|fS)aa Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. Ncs g|]\}}|kr||fqSr#r#)rr{rYZ to_remover#r$rsz4DependencyGraph.topological_sort..zMoving to result: %scSsg|]}d|j|jfqS)rjr)rr{r#r#r$rs)rr'listr)rSrTr$keys)r"rhZalistkr|r#r*r$topological_sorts$   z DependencyGraph.topological_sortcCs2g}|jD]\}}|||qd|S)zRepresentation of the graphr)rr'r)r#rO)r"r&r+r(r#r#r$rszDependencyGraph.__repr__)N)r)T) r-r.r/r0r%rr r!r"r#r)r.rr#r#r#r$r9s   rr1c CsVt|}t}i}|D]L}|||jD]6}t|\}}td|||||g||fq*q|D]}|j |j B|j B|j B}|D]} z| | } Wn6tk rtd| | d}| |} YnX| j}d} ||kr>||D]N\}} z| |} Wntk rd} YnX| r||| | d} q>q| s||| qqh|S)a6Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance zAdd to provided: %s, %s, %srrFT)rrrrkrrSrTr'r)rrrrrlrrrr(ror r!)distsrCgraphrpr+rqrrcrrrlZmatchedZproviderror#r#r$ make_graphsN       r1cCsv||krtd|jt|}|g}|j|}|rh|}|||j|D]}||krN||qNq.|d|S)zRecursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested 1given distribution %r is not a member of the listr)rrr1rpopr))r/r+r0Zdeptodor{Zsuccr#r#r$get_dependent_distss   r5cCsn||krtd|jt|}g}|j|}|rj|d}|||j|D]}||krP||qPq,|S)zRecursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested r2r)rrr1rr3r))r/r+r0rr4r{Zpredr#r#r$get_required_distss   r6cKs4|dd}tf|}||_||_|p(d|_t|S)zO A convenience method for making a dist given just a name and version. summaryzPlaceholder for summary)r3r rrcr7r)rrckwargsr7rr#r#r$ make_dist2s    r9)r1)7r0Z __future__rrrrPrZloggingrrNr2r r?rrcompatrrcrrrDr r r r utilr rrrrrr__all__Z getLoggerr-rSrZCOMMANDS_FILENAMErrMrrrrrrrrUrVrr1r5r6r9r#r#r#r$s`  $ s7J] 6PKd]m[d'distlib/__pycache__/util.cpython-38.pycnu[U ʗRe@sddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZz ddlZWnek rdZYnXddlZddlZddlZddlZddlZz ddlZWnek rddlZYnXddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e 1e2Z3e 4dZ5e 4dZ6e 4d Z7e 4d Z8e 4d Z9e 4d Z:e 4d Z;e 4dZddZ?ddZ@ddZAdddZBddZCddZDdd ZEejFd!d"ZGejFd#d$ZHejFdd&d'ZIGd(d)d)eJZKd*d+ZLGd,d-d-eJZMd.d/ZNGd0d1d1eJZOe 4d2e jPZQd3d4ZRdd5d6ZSd7d8ZTd9d:ZUd;d<ZVd=d>ZWd?d@ZXe 4dAe jYZZe 4dBZ[ddCdDZ\e 4dEZ]dFdGZ^dHdIZ_dJdKZ`dLZadMdNZbdOdPZcGdQdRdReJZdGdSdTdTeJZeGdUdVdVeJZfdWZgddYdZZhd[d\Zid]ZjGd^d_d_eJZke 4d`Zle 4daZme 4dbZndcddZdedfZoerddglmpZqmrZrmsZsGdhdidie$jtZtGdjdkdkeqZpGdldmdmepe'ZuGdndodoe%jvZverGdpdqdqe%jwZwGdrdsdse%jxZxdtduZyGdvdwdweJZzGdxdydyezZ{Gdzd{d{ezZ|Gd|d}d}e(Z}Gd~ddeJZ~ddZGdddeJZddZddZddZddddZddZdS)N)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib splittype HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquoteurlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z ^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)cs6ddfddfddfdd|S) ae Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). cSs.t|}|r,|d}||d}n|s:tdn|d}|dkrVtd|d|d}|dd}|g}|r|d|krqqt|d|kr|||dd}qtt|}|std|||d||d}qtd|}td|||d|}|dd }||fS) Nrzunexpected end of inputz'"zinvalid expression: %srzerror in string literal: %szunterminated string: %s) IDENTIFIERmatchgroupsend SyntaxErrorreplaceappend STRING_CHUNKjoinlstrip) remainingmresultqoqpartssr-/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/util.py marker_varAs:               z parse_marker..marker_varcs|rR|ddkrR|dd\}}|ddkr@td||dd}nZ|\}}|rt|}|srq|d}||d}|\}}|||d}q^|}||fS)Nr(r)unterminated parenthesis: %soplhsrhs)r%r MARKER_OPrrr)r&r(r5r'r4r6)markerr/r-r. marker_expres       z!parse_marker..marker_exprcsR|\}}|rJt|}|s qJ||d}|\}}d||d}q ||fS)Nandr3)ANDrrr&r5r'r6)r9r-r. marker_andxs   z parse_marker..marker_andcsR|\}}|rJt|}|s qJ||d}|\}}d||d}q ||fS)Norr3)ORrrr<)r=r-r.r8s   zparse_marker..markerr-) marker_stringr-)r8r=r9r/r. parse_marker8s $ rAcCs0|}|r|drdSt|}|s4td||d}||d}d}}}}|r:|ddkr:|dd}|dkrtd||d|} ||dd}g}| r0t| }|std | | |d| |d} | sq0| dd krtd | | dd} q|s:d}|r|dd kr|dd}t |}|sztd ||d}t |} | j r| j std|||d}ndd} |ddkr| |\}}n|dd}|dkrtd||d|} ||dd}t| r@| | \}} nXt| }|s\td| |d} | |d} | rtd| d| fg}|r|ddkrtd||dd}t|\}}|r|ddkrtd||s|}nd|ddd|Df}t||||||dS)z Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. #Nzname expected: %sr[]rzunterminated extra: %szmalformed extra: %s,zcomma expected in extras: %s@zinvalid URI: %szInvalid URL: %scSst|}d}|rg}|d}||d}t|}|sLtd||d}|||f||d}|r|ddkrq|dd}|sqt|}|std|q|sd}||fS)z| Return a list of operator, version tuples if any are specified, else None. Nrzinvalid version: %srErinvalid constraint: %s) COMPARE_OPrrrVERSION_IDENTIFIERr r"r%) ver_remainingr'versionsr4vr-r-r. get_versionss.      z'parse_requirement..get_versionsr0r1r2rGz~=;zinvalid requirement: %szunexpected trailing data: %s%s %s, cSsg|] }d|qS)rOr-).0conr-r-r. sz%parse_requirement..)nameextras constraintsr8url requirement)strip startswithrrr rrfindr%r" NON_SPACErschemenetlocrHrIrAr$r)reqr&r'distnamerU mark_exprrKuriir,trM_rLrsr-r-r.parse_requirements                           rgcCsdd}i}|D]\}}}tj||}t|D]p}tj||} t| D]T} ||| } |dkrn|| dqJ||| } |tjjdd} | d| || <qJq0q|S)z%Find destinations for resources filescSsD|tjjd}|tjjd}||s.t|t|ddSN/)r!ospathseprZAssertionErrorlenr%)rootrkr-r-r. get_rel_pathsz)get_resources_dests..get_rel_pathNri)rjrkr$rpopr!rlrstrip)resources_rootrulesrp destinationsbasesuffixdestprefixabs_baseabs_globabs_path resource_filerel_pathrel_destr-r-r.get_resources_destss    rcCs(ttdrd}ntjttdtjk}|S)N real_prefixT base_prefix)hasattrsysrygetattrr(r-r-r.in_venv(s rcCstj}t|tst|}|SN)r executable isinstancerrrr-r-r.get_executable2s  rcCsN|}t|}|}|s|r|}|r|d}||kr6qJ|rd|||f}q|S)Nrz %c: %s %s)r lower)prompt allowed_chars error_promptdefaultpr,cr-r-r.proceedDs rcCs8t|tr|}i}|D]}||kr||||<q|Sr)rrsplit)dkeysr(keyr-r-r.extract_by_keyTs rcCsztjddkrtd|}|}t|}zlt|}|ddd}|D]B\}}|D]0\}}d||f}t |} | dk st | ||<q`qP|WSt k r| ddYnXdd } t } z| | |Wn<t jk r|t|}t|}| | |YnXi}| D]R} i|| <}| | D]4\} }d| |f}t |} | dk sft | || <q<q"|S) Nrutf-8 extensionszpython.exportsexportsz%s = %scSs$t|dr||n ||dS)N read_file)rrreadfp)cpstreamr-r-r. read_streamqs  z!read_exports..read_stream)r version_infocodecs getreaderreadr jsonloaditemsget_export_entryrm Exceptionseekr ConfigParserMissingSectionHeaderErrorclosetextwrapdedentsections)rdatajdatar(groupentrieskrLr,entryrrrrTvaluer-r-r. read_exports]sD        rcCstjddkrtd|}t}|D]l\}}|||D]P}|j dkr\|j }nd|j |j f}|j rd|d |j f}| ||j|qFq,||dS)Nrrrz%s:%sz%s [%s]rP)rrr getwriterrrr add_sectionvaluesrwryflagsr$setrTwrite)rrrrrLrr,r-r-r. write_exportss   rc cs$t}z |VW5t|XdSr)tempfilemkdtemprrmtree)tdr-r-r.tempdirs rc cs.t}zt|dVW5t|XdSr)rjgetcwdchdir)rcwdr-r-r.rs   rc cs.t}zt|dVW5t|XdSr)socketgetdefaulttimeoutsetdefaulttimeout)secondsctor-r-r.socket_timeouts   rc@seZdZddZdddZdS)cached_propertycCs ||_dSr)func)selfrr-r-r.__init__szcached_property.__init__NcCs,|dkr |S||}t||jj||Sr)robject __setattr____name__)robjclsrr-r-r.__get__s  zcached_property.__get__)N)r __module__ __qualname__rrr-r-r-r.rsrcCs~tjdkr|S|s|S|ddkr.td||ddkrFtd||d}tj|krh|tjqP|srtjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises ValueError on non-Unix-ish systems if 'pathname' either starts or ends with a slash. rirzpath '%s' cannot be absolutezpath '%s' cannot end with '/')rjrl ValueErrorrcurdirremoverkr$)pathnamepathsr-r-r. convert_paths       rc@seZdZd$ddZddZddZdd Zd%d d Zd&ddZddZ ddZ ddZ ddZ ddZ d'ddZddZddZd d!Zd"d#Zd S)( FileOperatorFcCs||_t|_|dSr)dry_runrensured _init_record)rrr-r-r.rszFileOperator.__init__cCsd|_t|_t|_dSNF)recordr files_written dirs_createdrr-r-r.rszFileOperator._init_recordcCs|jr|j|dSr)rradd)rrkr-r-r.record_as_writtenszFileOperator.record_as_writtencCsHtj|s tdtj|tj|s0dSt|jt|jkS)aTell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". zfile '%r' does not existT)rjrkexistsrabspathstatst_mtime)rsourcetargetr-r-r.newers   zFileOperator.newerTcCs|tj|td|||jsd}|rdtj|rDd|}n tj|rdtj |sdd|}|rtt |dt ||| |dS)z8Copy a file respecting dry-run and force flags. zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten) ensure_dirrjrkdirnameloggerinforislinkrisfilerrcopyfiler)rinfileoutfilecheckmsgr-r-r. copy_files    zFileOperator.copy_fileNcCstj|rt|tj|td|||jsv|dkrJt |d}nt j |d|d}zt ||W5| X||dS)NzCopying stream %s to %swbwencoding)rjrkisdirrmrrrrropenrrr copyfileobjr)rinstreamrr outstreamr-r-r. copy_streams  zFileOperator.copy_streamc Cs\|tj||jsNtj|r.t|t|d}||W5QRX| |dS)Nr) rrjrkrrrrrrr)rrkrfr-r-r.write_binary_file's   zFileOperator.write_binary_filecCs||||dSr)r encode)rrkrrr-r-r.write_text_file0szFileOperator.write_text_filecCsntjdkstjdkrjtjdkrj|D]F}|jr:td|q"t|j|B|@}td||t||q"dS)Nposixjavazchanging mode of %szchanging mode of %s to %o) rjrT_namerrrrst_modechmod)rbitsmaskfilesr moder-r-r.set_mode3szFileOperator.set_modecCs|dd|S)Nimi)r)r,r r-r-r.?zFileOperator.cCs|tj|}||jkrxtj|sx|j|tj|\}}||t d||j sft ||j rx|j |dS)Nz Creating %s)rjrkrrrrrrrrrmkdirrr)rrkrr r-r-r.rAs    zFileOperator.ensure_dirc Cst|| }td|||js|s0|||rX|s:d}n||sHt|t|d}i}|rvtt drvt j j |d<t j |||df|| ||S)NzByte-compiling %s to %sPycInvalidationModeinvalidation_modeT)r rrrrrZrmrnr py_compiler CHECKED_HASHcompiler) rrkoptimizeforceryhashed_invalidationdpathdiagpathcompile_kwargsr-r-r. byte_compileMs   zFileOperator.byte_compilecCstj|rtj|r^tj|s^td||js@t ||j r||j kr|j |nPtj|rpd}nd}td|||jst ||j r||j kr|j |dS)NzRemoving directory tree at %slinkfilezRemoving %s %s)rjrkrrrrdebugrrrrrrr)rrkr,r-r-r.ensure_removed^s"       zFileOperator.ensure_removedcCsDd}|s@tj|r$t|tj}q@tj|}||kr:q@|}q|Sr)rjrkraccessW_OKr)rrkr(parentr-r-r. is_writabless  zFileOperator.is_writablecCs"|js t|j|jf}||S)zV Commit recorded changes, turn off recording, return changes. )rrmrrr)rr(r-r-r.commits  zFileOperator.commitcCs|jst|jD]}tj|rt|qt|jdd}|D]F}t |}|rz|dgks^t tj ||d}t |t |q>| dS)NT)reverse __pycache__r)rlistrrjrkrrsortedrlistdirrmr$rmdirr)rr dirsrflistsdr-r-r.rollbacks     zFileOperator.rollback)F)T)N)FFNF)rrrrrrrrr r rrset_executable_moderr'r+r/r0r:r-r-r-r.rs         rcCs^|tjkrtj|}nt|}|dkr,|}n.|d}t||d}|D]}t||}qJ|S)N.r)rmodules __import__rrrq) module_name dotted_pathmodr(r+rr-r-r.resolves    rBc@s6eZdZddZeddZddZddZej Z d S) ExportEntrycCs||_||_||_||_dSrrTryrwr)rrTryrwrr-r-r.rszExportEntry.__init__cCst|j|jSr)rBryrwrr-r-r.rszExportEntry.valuecCsd|j|j|j|jfS)NzrDrr-r-r.__repr__s zExportEntry.__repr__cCsDt|tsd}n0|j|jko>|j|jko>|j|jko>|j|jk}|Sr)rrCrTryrwr)rotherr(r-r-r.__eq__s     zExportEntry.__eq__N) rrrrrrrErGr__hash__r-r-r-r.rCs   rCz(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c Cst|}|s0d}d|ks"d|krtd|n|}|d}|d}|d}|dkrf|d}}n"|dkrztd||d\}}|d } | dkrd|ksd|krtd|g} nd d | d D} t|||| }|S) NrCrDzInvalid specification '%s'rTcallable:rrrcSsg|] }|qSr-rY)rQr r-r-r.rSsz$get_export_entry..rE)ENTRY_REsearchr groupdictcountrrC) specificationr'r(rrTrkcolonsryrwrr-r-r.rs8   rcCs|dkr d}tjdkr.dtjkr.tjd}n tjd}tj|rft|tj}|st d|n|dd\}}d|kr.|}n|dd\}}|rJt|}|rVt|}|||fS)NrFrrJ)rsplitrr)r^usernamepasswordryr-r-r.parse_credentials*srecCstd}t||S)N)rjumaskrr-r-r.get_process_umask9s  rhcCs<d}d}t|D]\}}t|tsd}q,q|dk s8t|S)NTF) enumeraterrrm)seqr(rcr,r-r-r.is_string_sequence>s  rkz3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)cCsd}d}t|dd}t|}|r@|d}|d|}|rt|t|dkrtt |d|}|r| }|d|||dd|f}|dkrt |}|r|d|d|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None N -rz\br) rr!PYTHON_VERSIONrMrstartrnrerescaperPROJECT_NAME_AND_VERSION)filename project_namer(pyverr'nr-r-r.split_filenameMs"   rwz-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCs:t|}|std||}|d|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'rTver)NAME_VERSION_RErrrNrYr)rr'rr-r-r.parse_name_and_versionis  rzcCst}t|pg}t|pg}d|kr8|d||O}|D]x}|dkrT||q<|dr|dd}||krtd|||kr||q<||krtd|||q<|S)N*rmrzundeclared extra: %s)rrrrZrrY) requested availabler(runwantedr-r-r. get_extrasxs&        rc Csi}zNt|}|}|d}|ds8td|ntd|}t |}Wn0t k r}zt d||W5d}~XYnX|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %srz&Failed to get external data for %s: %s) r rgetrZrr*rrrrr exception)rWr(respheadersctreaderer-r-r._get_external_datas   rz'https://www.red-dove.com/pypi/projects/cCs*d|d|f}tt|}t|}|S)Nz%s/%s/project.jsonrupperr _external_data_base_urlr)rTrWr(r-r-r.get_project_datas rcCs(d|d||f}tt|}t|S)Nz%s/%s/package-%s.jsonrr)rTversionrWr-r-r.get_package_datas rc@s(eZdZdZddZddZddZdS) Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsPtj|st|t|jd@dkr6td|tjtj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) rjrkrrZrrrrYrnormpathrv)rrvr-r-r.rs    zCache.__init__cCst|S)zN Converts a resource prefix to a directory name in the cache. )r_)rryr-r-r. prefix_to_dirszCache.prefix_to_dirc Csg}t|jD]r}tj|j|}z>tj|s>tj|rJt|ntj|r`t |Wqt k r| |YqXq|S)z" Clear the cache. ) rjr5rvrkr$rrrrrrrr")r not_removedfnr-r-r.clears  z Cache.clearN)rrr__doc__rrrr-r-r-r.rsrc@s:eZdZdZddZdddZddZd d Zd d Zd S) EventMixinz1 A very simple publish/subscribe system. cCs i|_dSr) _subscribersrr-r-r.rszEventMixin.__init__TcCsD|j}||krt|g||<n"||}|r6||n ||dS)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)rrr" appendleft)revent subscriberr"subssqr-r-r.rs  zEventMixin.addcCs,|j}||krtd||||dS)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)rrr)rrrrr-r-r.rs zEventMixin.removecCst|j|dS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. r-)iterrr)rrr-r-r.get_subscribersszEventMixin.get_subscribersc Oslg}||D]F}z||f||}Wn"tk rHtdd}YnX||qtd|||||S)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)rrrrr"r*)rrargskwargsr(rrr-r-r.publish s    zEventMixin.publishN)T) rrrrrrrrrr-r-r-r.rs   rc@s^eZdZddZddZdddZdd Zd d Zd d ZddZ e ddZ e ddZ dS) SequencercCsi|_i|_t|_dSr)_preds_succsr_nodesrr-r-r.r(szSequencer.__init__cCs|j|dSr)rrrnoder-r-r.add_node-szSequencer.add_nodeFcCs||jkr|j||rt|j|dD]}|||q,t|j|dD]}|||qPt|jD]\}}|sp|j|=qpt|jD]\}}|s|j|=qdS)Nr-)rrrrrrr3r)rredgesrr,rrLr-r-r. remove_node0s   zSequencer.remove_nodecCs<||ks t|j|t||j|t|dSr)rmr setdefaultrrr)rpredsuccr-r-r.r@s z Sequencer.addcCs||ks tz|j|}|j|}Wn tk rDtd|YnXz||||Wn$tk rtd||fYnXdS)Nz%r not a successor of anythingz%r not a successor of %r)rmrrKeyErrorrr)rrrpredssuccsr-r-r.rEs   zSequencer.removecCs||jkp||jkp||jkSr)rrr)rstepr-r-r.is_stepRszSequencer.is_stepcCs||std|g}g}t}|||r|d}||krb||kr||||q.|||||j|d}| |q.t |S)Nz Unknown: %rrr-) rrrr"rqrrrrextendreversed)rfinalr(todoseenrrr-r-r. get_stepsVs"         zSequencer.get_stepscsRdggiig|jfddD]}|kr8|q8S)Nrcsd|<d|<dd7<|z |}Wntk rVg}YnX|D]J}|kr|t|||<q\|kr\t|||<q\||krg}}||||krqqt|}|dSNrr)r"rminrqtuple)r successors successorconnected_component componentgraphindex index_counterlowlinksr(stack strongconnectr-r.rzs,      z3Sequencer.strong_connections..strongconnect)rrr-rr.strong_connectionsos" zSequencer.strong_connectionscCsfdg}|jD]*}|j|}|D]}|d||fqq |jD]}|d|q>|dd|S)Nz digraph G {z %s -> %s;z %s;} )rr"rr$)rr(rrrrr-r-r.dots    z Sequencer.dotN)F) rrrrrrrrrrpropertyrrr-r-r-r.r's   2r).tar.gz.tar.bz2.tar.zip.tgz.tbz.whlTc sLfdd}tjtd}|dkr|dr>d}nH|drRd}d}n4|drfd }d }n |d rzd }d }n td|z|dkrt|d }|r|}|D] }||qn*t ||}|r| }|D] }||q|dkr*t j ddkr*|D]"} t| jts| jd| _q|W5|rF|XdS)NcsRt|ts|d}tjtj|}|rB|tjkrNt d|dS)Nrzpath outside destination: %r) rrdecoderjrkrr$rZrlr)rkrdest_dirplenr-r. check_paths   zunarchive..check_path)rrzip)rrtgzzr:gz)rrtbzzr:bz2rtarr~zUnknown format for %rrrr)rjrkrrnr`rrrnamelisttarfilergetnamesrr getmembersrrTrr extractall) archive_filenamerformatrrarchivernamesrTtarinfor-rr. unarchivesH           rc Cs~t}t|}t|dZ}t|D]H\}}}|D]8}tj||}||d} tj| |} ||| q4q&W5QRX|S)z*zip a directory tree into a BytesIO objectrN) ioBytesIOrnrrjwalkrkr$r) directoryr(dlenzfror7rrTfullrelrxr-r-r.zip_dirs  r)rKMGTPc@sreZdZdZdddZddZdd Zd d Zd d Ze ddZ e ddZ ddZ e ddZ e ddZdS)ProgressUNKNOWNrdcCs<|dks||kst||_|_||_d|_d|_d|_dS)NrF)rmrcurmaxstartedelapseddone)rminvalmaxvalr-r-r.rs  zProgress.__init__cCsV|j|kst|jdks&||jks&t||_t}|jdkrF||_n ||j|_dSr)rrmrrtimerr)rcurvalnowr-r-r.update s zProgress.updatecCs |dks t||j|dS)Nr)rmrr)rincrr-r-r. increments zProgress.incrementcCs||j|Sr)rrrr-r-r.ros zProgress.startcCs |jdk r||jd|_dS)NT)rrrrr-r-r.stops  z Progress.stopcCs|jdkr|jS|jSr)runknownrr-r-r.maximum!szProgress.maximumcCsD|jr d}n4|jdkrd}n$d|j|j|j|j}d|}|S)Nz100 %z ?? %gY@z%3d %%)rrrr)rr(rLr-r-r. percentage%s zProgress.percentagecCs:|dkr|jdks|j|jkr$d}ntdt|}|S)Nrz??:??:??z%H:%M:%S)rrrrstrftimegmtime)rdurationr(r-r-r.format_duration0szProgress.format_durationcCs|jrd}|j}n^d}|jdkr&d}nJ|jdks<|j|jkrBd}n.t|j|j}||j|j}|d|j}d|||fS)NDonezETA rrrz%s: %s)rrrrrfloatr )rryrdr-r-r.ETA9s z Progress.ETAcCsL|jdkrd}n|j|j|j}tD]}|dkr6q@|d}q&d||fS)Nrgig@@z%d %sB/s)rrrUNITS)rr(unitr-r-r.speedLs  zProgress.speedN)rr)rrrrrrrrorrrr r rrr-r-r-r.rs      rz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$cCs<t|rd}t||t|r4d}t||t|S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBrMr_CHECK_MISMATCH_SET_iglob) path_globrr-r-r.ras    rc cst|d}t|dkrht|dks,t||\}}}|dD]$}td|||fD] }|VqXq@nd|krt|D] }|Vqxn~|dd\}}|dkrd}|dkrd}n|d}|d }t |D]4\}}} tj |}ttj ||D] } | VqqdS) NrrrErz**r<r{ri\) RICH_GLOBrrnrmrr$ std_iglobr%rjrrkr) rrich_path_globryrrwitemrkradicaldirrrr-r-r.rls*         r) HTTPSHandlermatch_hostnameCertificateErrorc@seZdZdZdZddZdS)HTTPSConnectionNTcCst|j|jf|j}t|ddr0||_|t tj }t tdrV|j tj O_ |jrl||j|ji}|jrtj|_|j|jdttddr|j|d<|j|f||_|jr|jrz$t|j|jtd|jWn0tk r|jtj|jYnXdS)N _tunnel_hostF OP_NO_SSLv2)cafileHAS_SNIserver_hostnamezHost verified: %s)rcreate_connectionhostporttimeoutrsock_tunnelssl SSLContextPROTOCOL_SSLv23roptionsr$ cert_fileload_cert_chainkey_fileca_certs CERT_REQUIRED verify_modeload_verify_locations wrap_socket check_domainr  getpeercertrr*r!shutdown SHUT_RDWRr)rr,contextrr-r-r.connects0      zHTTPSConnection.connect)rrrr5r:r?r-r-r-r.r"sr"c@s&eZdZd ddZddZddZdS) rTcCst|||_||_dSr)BaseHTTPSHandlerrr5r:)rr5r:r-r-r.rs zHTTPSHandler.__init__cOs$t||}|jr |j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )r"r5r:)rrrr(r-r-r. _conn_makers zHTTPSHandler._conn_makerc CsXz||j|WStk rR}z$dt|jkr@td|jnW5d}~XYnXdS)Nzcertificate verify failedz*Unable to verify server certificate for %s)do_openrArstrreasonr!r))rr_rr-r-r. https_openszHTTPSHandler.https_openN)T)rrrrrArEr-r-r-r.rs rc@seZdZddZdS)HTTPSOnlyHandlercCstd|dS)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rr_r-r-r. http_openszHTTPSOnlyHandler.http_openN)rrrrGr-r-r-r.rFsrFc@seZdZdddZddZdS) TransportrcCs||_tj||dSr)r+rrHrrr+ use_datetimer-r-r.rszTransport.__init__cCsD||\}}}|jr$||jdkr:||_|t|f|_|jdSr) get_host_info _connection_extra_headersrHTTPConnection)rr)hehx509r-r-r.make_connections zTransport.make_connectionN)rrrrrrRr-r-r-r.rHs rHc@seZdZdddZddZdS) SafeTransportrcCs||_tj||dSr)r+rrTrrIr-r-r.rszSafeTransport.__init__cCs\||\}}}|si}|j|d<|jr6||jdkrR||_|tj|df|f|_|jdS)Nr+rr)rKr+rLrMrr")rr)rOrPrr-r-r.rRs  zSafeTransport.make_connectionN)rrSr-r-r-r.rTs rTc@seZdZddZdS) ServerProxycKst|dd|_}|dk r^t|d}|dd}|dkr@t}nt}|||d|d<}||_tjj ||f|dS)Nr+rrJhttps)rJ transport) rqr+rrrTrHrWrrUr)rrbrr+r]rJtclsrdr-r-r.rs  zServerProxy.__init__N)rrrrr-r-r-r.rUsrUcKs6tjddkr|d7}nd|d<d|d<t||f|S)Nrrbrnewlinerr)rrr)rrrr-r-r. _csv_opens  r[c@s4eZdZedededdZddZddZd S) CSVBaserE"r) delimiter quotecharlineterminatorcCs|Srr-rr-r-r. __enter__(szCSVBase.__enter__cGs|jdSr)rr)rrUr-r-r.__exit__+szCSVBase.__exit__N)rrrrCdefaultsrarbr-r-r-r.r\!s r\c@s(eZdZddZddZddZeZdS) CSVReadercKs\d|kr4|d}tjddkr,td|}||_nt|dd|_tj|jf|j|_dS)Nrrrrrkr~) rrrrrr[csvrrc)rrrr-r-r.r0szCSVReader.__init__cCs|Srr-rr-r-r.__iter__;szCSVReader.__iter__cCsFt|j}tjddkrBt|D] \}}t|ts |d||<q |SNrrr)nextrrrrirrr)rr(rcrr-r-r.rh>s   zCSVReader.nextN)rrrrrfrh__next__r-r-r-r.rd/s rdc@seZdZddZddZdS) CSVWritercKs$t|d|_tj|jf|j|_dS)Nr)r[rrewriterrc)rrrr-r-r.rIs zCSVWriter.__init__cCsNtjddkr>g}|D]"}t|tr.|d}||q|}|j|dSrg)rrrrr r"rkwriterow)rrowr~rr-r-r.rlMs   zCSVWriter.writerowN)rrrrrlr-r-r-r.rjHsrjcsHeZdZeejZded<d fdd ZddZdd Zd d Z Z S) Configurator inc_convertincNcs"tt|||pt|_dSr)superrnrrjrrv)rconfigrv __class__r-r.r`szConfigurator.__init__c sfddd}t|s*|}dd}dd}|r\tfdd|D}fd dD}t|}|||}|r|D]\}} t||| q|S) Ncsvt|ttfr*t|fdd|D}nHt|trhd|krH|}qri}|D]}||||<qPn |}|S)Ncsg|] }|qSr-r-)rQrcconvertr-r.rSgszBConfigurator.configure_custom..convert..())rr3rtypedictconfigure_customrv)or(r)rvrr-r.rves   z.Configurator.configure_custom..convertrwr<z[]r-csg|] }|qSr-r-)rQr{rur-r.rSzsz1Configurator.configure_custom..cs$g|]}t|r||fqSr-)r)rQr)rrrvr-r.rS{s)rqrIrBrryrsetattr) rrrrpropsrrrr(rvrLr-)rrrvrr.rzds     zConfigurator.configure_customcCs4|j|}t|tr0d|kr0|||j|<}|S)Nrw)rrrryrz)rrr(r-r-r. __getitem__s zConfigurator.__getitem__c CsFtj|stj|j|}tj|ddd}t|}W5QRX|S)z*Default converter for the inc:// protocol.r~rr) rjrkisabsr$rvrrrr)rrr r(r-r-r.ros  zConfigurator.inc_convert)N) rrrryrvalue_convertersrrzr~ro __classcell__r-r-rsr.rn[s  rnc@s*eZdZdZd ddZddZdd ZdS) SubprocessMixinzC Mixin for running subprocesses and capturing their output FNcCs||_||_dSr)verboseprogress)rrrr-r-r.rszSubprocessMixin.__init__cCsj|j}|j}|}|sq^|dk r.|||q |s@tjdntj|dtjq |dS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Nr<r) rrreadlinerstderrrrflushr)rrr>rrr,r-r-r.rs  zSubprocessMixin.readercKstj|ftjtjd|}tj|j|jdfd}|tj|j|jdfd}|| | | |j dk r| ddn|j rt jd|S)N)stdoutrr)rrrzdone.mainzdone. ) subprocessPopenPIPE threadingThreadrrrorwaitr$rrrr)rcmdrrt1t2r-r-r. run_commands"   zSubprocessMixin.run_command)FN)rrrrrrrr-r-r-r.rs rcCstdd|S)z,Normalize a python package name a la PEP 503z[-_.]+rm)rpsubr)rTr-r-r.normalize_namesrc@s.eZdZdZdZd ddZddZdd ZdS) PyPIRCFilezhttps://upload.pypi.org/legacy/pypiNcCs.|dkrtjtjdd}||_||_dS)NrTz.pypirc)rjrkr$rXrsrW)rrrWr-r-r.rszPyPIRCFile.__init__c Csi}tj|jr||jp|j}t}||j| }d|kr*| dd}dd| dD}|gkr~d|kr|dg}n|D]}d|i}| |d|d<d |jfd |j fd fD].\}} | ||r| ||||<q| ||<q|dkr ||jdfkr |j|d <q|d|kr|d |kri}qnRd |kr|d }| |d rT| |d }n|j}| |d| |d |||j d}|S)N distutilsz index-serverscSs g|]}|dkr|qS)rrK)rQserverr-r-r.rSs z#PyPIRCFile.read..rrrrc repositoryrealm)rdNz server-loginrd)rcrdrrr)rjrkrrsrWDEFAULT_REPOSITORYrRawConfigParserrrrr DEFAULT_REALM has_option) rr(rrrr index_servers_serversrrrr-r-r.rsX               zPyPIRCFile.readc Cslt}|j}|||ds,|d|dd||dd|t|d}||W5QRXdS)Nrrcrdr) rrrsr has_sectionrrrr)rrcrdrrrr r-r-r.rs    zPyPIRCFile.update)NN)rrrrrrrrr-r-r-r.rs  :rcCst|jdS)zG Read the PyPI access configuration as supported by distutils. )rW)rrWrrr-r-r. _load_pypirc srcCst|j|jdSr)rrrcrdrr-r-r. _store_pypirc&src CstjdkrFdtjkrdSdtjkr.dSdtjkr@dStjSdtjkrZtjdStjd ksnttd sttjSt\}}}}}| d d }| d d d d}|dddkrd||fS|dddkr(|ddkrd}dt |dd|ddf}ddd}|d|tj 7}n|dddkrLdd l m }|S|dd!d"krd"}td#tj}||}|r|}n>|dd!d$krddl} ddl} | | j|||\}}}d%|||fS)&aReturn a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. on Linux, the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rRamd64 win-amd64z(arm) win-arm32z(arm64)z win-arm64_PYTHON_HOST_PLATFORMrunamerirrlrermNlinuxz%s-%ssunosr5solarisz%d.%sr32bit64bit)ilz.%saix) aix_platformcygwinz[\d.]+darwinz%s-%s-%s)rjrTrrrplatformrVrrr!intmaxsize _aix_supportrrpr ASCIIrr _osx_supportdistutils.sysconfigget_platform_osx sysconfigget_config_vars) osnamer)releasermachinebitnessrrel_rer'rrr-r-r.get_host_platform.sR          rwin32rr)x86x64armcCs2tjdkrtStjd}|tkr*tSt|S)NrRVSCMD_ARG_TGT_ARCH)rjrTrrVr_TARGET_TO_PLAT)cross_compilation_targetr-r-r. get_platforms   r)NN)r)N)N)NT)r collectionsr contextlibreglobrrrrloggingrjrrprr. ImportErrorrrrrrrZdummy_threadingrrrcompatrrrr r r r r rrrrrrrrrrrrr getLoggerrrr rrIrHr7r?r;r\r#rArgrrrrrrrcontextmanagerrrrrrrrrBrCVERBOSErLrr]r_rarerhrkIrrrnrwryrzrrrrrrrrARCHIVE_EXTENSIONSrrrrrrrrrr@r r!r"rFrHrTrUr[r\rdrjrnrrrrrrrrr-r-r-r.s      \         Y}   /   8 )    ,H  6]    !)  7.QRPKd] ĦĦ+distlib/__pycache__/database.cpython-38.pycnu[U ʗRe@sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZmZdd lmZmZmZmZmZmZm Z d d d d dgZ!e"e#Z$dZ%dZ&deddde%dfZ'dZ(Gddde)Z*Gddde)Z+Gdd d e)Z,Gdd d e,Z-Gdd d e-Z.Gdd d e-Z/e.Z0e/Z1Gddde)Z2d)d!d"Z3d#d$Z4d%d&Z5d'd(Z6dS)*zPEP 376 implementation.)unicode_literalsN)DistlibException resources)StringIO) get_schemeUnsupportedVersionError)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME)parse_requirementcached_propertyparse_name_and_version read_exports write_exports CSVReader CSVWriter DistributionBaseInstalledDistributionInstalledDistributionEggInfoDistributionDistributionPathzpydist-exports.jsonzpydist-commands.json INSTALLERRECORD REQUESTED RESOURCESSHAREDz .dist-infoc@s(eZdZdZddZddZddZdS) _CachezL A simple cache mapping names and .dist-info paths to distributions cCsi|_i|_d|_dS)zZ Initialise an instance. There is normally one for each DistributionPath. FN)namepath generatedselfr$/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/database.py__init__1sz_Cache.__init__cCs|j|jd|_dS)zC Clear the cache, setting it to its initial state. FN)rclearr r!r"r$r$r%r'9s  z _Cache.clearcCs2|j|jkr.||j|j<|j|jg|dS)z` Add a distribution to the cache. :param dist: The distribution to add. N)r r setdefaultkeyappendr#distr$r$r%addAs  z _Cache.addN)__name__ __module__ __qualname____doc__r&r'r-r$r$r$r%r-src@seZdZdZdddZddZdd ZeeeZd d Z d d Z ddZ e ddZ ddZddZdddZddZdddZdS)rzU Represents a set of distributions installed on a path (typically sys.path). NFcCsD|dkrtj}||_d|_||_t|_t|_d|_td|_ dS)a Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. NTdefault) sysr _include_dist _include_eggr_cache _cache_egg_cache_enabledr_scheme)r#r Z include_eggr$r$r%r&Os zDistributionPath.__init__cCs|jSNr8r"r$r$r%_get_cache_enabledcsz#DistributionPath._get_cache_enabledcCs ||_dSr:r;)r#valuer$r$r%_set_cache_enabledfsz#DistributionPath._set_cache_enabledcCs|j|jdS)z, Clears the internal cache. N)r6r'r7r"r$r$r% clear_cacheks zDistributionPath.clear_cachec cst}|jD]}t|}|dkr&q |d}|r |js||jjD] }|Vq0|jrZ|jjD] }|VqNdS)a5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N)r8rfrhr6r valuesr5r7r+r$r$r%get_distributionss   z"DistributionPath.get_distributionscCsd}|}|js4|D]}|j|kr|}q|qnH|||jjkrZ|jj|d}n"|jr|||jjkr||jj|d}|S)a= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` Nr) lowerr8rfr)rhr6rr5r7)r#rresultr,r$r$r%get_distributions    z!DistributionPath.get_distributionc csd}|dk rJz|jd||f}Wn$tk rHtd||fYnX|D]p}t|dsntd|qR|j}|D]H}t |\}}|dkr||kr|VqRqx||krx| |rx|VqRqxqRdS)a Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string N%s (%s)zinvalid name or version: %r, %rprovideszNo "provides": %s) r9matcher ValueErrorrrphasattrrWrXrurmatch) r#rrmrvr,providedpp_namep_verr$r$r%provides_distributions*    z&DistributionPath.provides_distributioncCs(||}|dkrtd|||S)z5 Return the path to a resource file. Nzno distribution named %r found)rs LookupErrorget_resource_path)r#r relative_pathr,r$r$r% get_file_path's  zDistributionPath.get_file_pathccsX|D]J}|j}||kr||}|dk r>||krR||Vq|D] }|VqFqdS)z Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N)rpexportsro)r#categoryrr,radvr$r$r%get_exported_entries0s   z%DistributionPath.get_exported_entries)NF)N)N)r.r/r0r1r&r<r>propertyZ cache_enabledr?rfrh classmethodrnrprsr~rrr$r$r$r%rKs  2  ) c@seZdZdZdZdZddZeddZeZ eddZ ed d Z d d Z ed dZ eddZeddZeddZeddZddZddZddZddZdS) rz A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. FcCsL||_|j|_|j|_|j|_d|_d|_d|_d|_t |_ i|_ dS)z Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N) rErrqr)rmlocatordigestextrascontextrKZ download_urlsdigests)r#rEr$r$r%r&Us zDistribution.__init__cCs|jjS)zH The source archive download URL for this distribution. )rE source_urlr"r$r$r%rfszDistribution.source_urlcCsd|j|jfS)zX A utility property which displays the name and version in parentheses. rtrrmr"r$r$r%name_and_versionoszDistribution.name_and_versioncCs.|jj}d|j|jf}||kr*|||S)z A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. rt)rErurrmr*)r#plistsr$r$r%ruvs  zDistribution.providescCs:|j}t||}td|j||t|j||j|jdS)Nz)%s: got requirements %r from metadata: %r)rrF) rEgetattrrWrXrrKget_requirementsrr)r#Zreq_attrmdZreqtsr$r$r%_get_requirementss   zDistribution._get_requirementscCs |dS)N run_requiresrr"r$r$r%rszDistribution.run_requirescCs |dS)N meta_requiresrr"r$r$r%rszDistribution.meta_requirescCs |dS)Nbuild_requiresrr"r$r$r%rszDistribution.build_requirescCs |dS)N test_requiresrr"r$r$r%rszDistribution.test_requirescCs |dS)N dev_requiresrr"r$r$r%rszDistribution.dev_requiresc Cst|}t|jj}z||j}Wn6tk rZtd|| d}||}YnX|j }d}|j D]D}t |\}} ||krqlz| | }WqWqltk rYqlXql|S)z Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. +could not read version %r - using name onlyrF)r rrErDrv requirementrrWr\splitr)rurry) r#reqrarDrvrrrr{r|r}r$r$r%matches_requirements,       z Distribution.matches_requirementcCs(|jrd|j}nd}d|j|j|fS)zC Return a textual representation of this instance, z [%s]r@z)rrrm)r#suffixr$r$r%__repr__s zDistribution.__repr__cCs>t|t|k rd}n$|j|jko8|j|jko8|j|jk}|S)a< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. F)typerrmr)r#otherrrr$r$r%__eq__s   zDistribution.__eq__cCst|jt|jt|jS)zH Compute hash in a way which matches the equality test. )hashrrmrr"r$r$r%__hash__szDistribution.__hash__N)r.r/r0r1Zbuild_time_dependency requestedr&rr download_urlrrurrrrrrrrrrr$r$r$r%rCs4        " cs0eZdZdZdZdfdd ZdddZZS) rz] This is the base class for installed distributions (whether PEP 376 or legacy). Ncs tt||||_||_dS)a Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N)superrr&r dist_path)r#rEr rF __class__r$r%r&s z"BaseInstalledDistribution.__init__cCsd|dkr|j}|dkr"tj}d}ntt|}d|j}||}t|dd}d||fS)a Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str Nr@z%s==ascii%s%s) hasherhashlibmd5rrbase64urlsafe_b64encoderstripdecode)r#datarprefixrr$r$r%get_hashs   z"BaseInstalledDistribution.get_hash)N)N)r.r/r0r1rr&r __classcell__r$r$rr%rscseZdZdZdZd'fdd ZddZdd Zd d Ze d d Z ddZ ddZ ddZ ddZd(ddZddZe ddZd)ddZdd Zd!d"Zd#d$Zd%d&ZejZZS)*ra  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). sha256Nc sPg|_t||_}|dkr*td||rP|jrP||jjkrP|jj|j}nt|dkr| t }|dkrt| t }|dkr| t }|dkrtdt |ft |}t|dd}W5QRXtt|||||r|jr|j|| d}|dk |_tj|d}tj|rLt|d}|d} W5QRX| |_dS) Nzfinder unavailable for %szno %s found in %srArBr top_level.txtrbutf-8)modulesrrLr`rwr8r6r rErMr r r rTrUrVr rrr&r-rosrSexistsopenreadr splitlines) r#r rErFr`rarcr{frrr$r%r&"s8         zInstalledDistribution.__init__cCsd|j|j|jfS)Nz#rrmr r"r$r$r%rDs zInstalledDistribution.__repr__cCsd|j|jfSNz%s %srr"r$r$r%__str__HszInstalledDistribution.__str__c Csg}|d}t|\}t|dF}|D]:}ddtt|dD}||\}}} |||| fq.W5QRXW5QRX|S)a" Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). rrccSsg|]}dqSr:r$).0ir$r$r% Zsz6InstalledDistribution._get_records..)get_distinfo_resourcerTrUrVrrangelenr*) r#resultsrarcZ record_readerrowmissingr checksumsizer$r$r% _get_recordsKs  &z"InstalledDistribution._get_recordscCsi}|t}|r|}|S)a Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. )rEXPORTS_FILENAMEr)r#rrrar$r$r%rbs  zInstalledDistribution.exportsc Cs8i}|t}|r4t|}t|}W5QRX|S)z Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. )rrrTrUrVr)r#rrrarcr$r$r%rps  z"InstalledDistribution.read_exportsc Cs.|t}t|d}t||W5QRXdS)a Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. wN)get_distinfo_filerrr)r#rrfrr$r$r%rs  z#InstalledDistribution.write_exportsc Cs|d}t|R}t|d<}|D]0\}}||kr*|W5QRW5QRSq*W5QRXW5QRXtd|dS)aW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. rrz3no resource file with relative path %r is installedN)rrTrUrVrKeyError)r#rrarcZresources_readerrelative destinationr$r$r%rs   6z'InstalledDistribution.get_resource_pathccs|D] }|VqdS)z Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N)r)r#rrr$r$r%list_installed_filess z*InstalledDistribution.list_installed_filesFc Cs(tj|d}tj|j}||}tj|d}|d}td||rRdSt|}|D]}tj |sz| drd} } n4dtj |} t |d} | | } W5QRX||s|r||rtj||}||| | fq`||r tj||}||ddfW5QRX|S)z Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. r@r creating %sNz.pycz.pyoz%dr)rr rSdirname startswithrrWinforisdirrPgetsizerrrrelpathwriterow) r#pathsrdry_runbaseZbase_under_prefix record_pathwriterr hash_valuerfpr$r$r%write_installed_filess0       z+InstalledDistribution.write_installed_filesc Csg}tj|j}|d}|D]\}}}tj|sHtj||}||krRq$tj|sr||dddfq$tj |r$t tj |}|r||kr||d||fq$|r$d|kr| ddd}nd }t |d 2} || |} | |kr||d || fW5QRXq$|S)  Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. rrTFr=rrNrr)rr rrrisabsrSrr*isfilestrrrrrr) r# mismatchesrrr rrZ actual_sizerrZ actual_hashr$r$r%check_installed_filess.        z+InstalledDistribution.check_installed_filesc Csi}tj|jd}tj|rtj|ddd}|}W5QRX|D]8}|dd\}}|dkr|| |g |qL|||<qL|S)a A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. rrarencodingrr namespace) rr rSrcodecsrrrrr(r*)r#rr shared_pathrlinesliner)r=r$r$r%shared_locationss  z&InstalledDistribution.shared_locationsc Cstj|jd}td||r$dSg}dD].}||}tj||r,|d||fq,|ddD]}|d|qhtj |d d d }| d |W5QRX|S) aa Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. rrN)rlibheadersscriptsrz%s=%srr$z namespace=%srrr ) rr rSrWrrr*getrrwrite) r#rrrrr)r nsrr$r$r%write_shared_locations s  z,InstalledDistribution.write_shared_locationscCsF|tkrtd||jft|j}|dkr.set_name_and_version) r rr8r7rErrm _get_metadatar-rrr&)r#r rFrrErr$r%r&is   zEggInfoDistribution.__init__c sd}ddfdd}d}}|drtj|rtj|d}tj|d}t|dd }tj|d } tj|d }|| }npt|} t| d  d } t| dd}z,| d} | d d}| d}Wnt k rd}YnXnf|drPtj|rBtj|d } || }tj|d}tj|d }t|dd }n t d||rl| ||dkr|dk rtj|rt|d} |  d}W5QRX|sg}n|}||_|S)NcSsg}|}|D]}|}|dr6td|qt|}|sPtd|q|jr`td|jst||j qd dd|jD}|d|j |fq|S) zCreate a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. [z.Unexpected line: quitting requirement scan: %rz#Not recognised as a requirement: %rz4extra requirements in requires.txt are not supportedz, css|]}d|VqdS)rNr$)rcr$r$r% szQEggInfoDistribution._get_metadata..parse_requires_data..rt) rstriprrWr\r r constraintsr*rrS)rreqsrrraZconsr$r$r%parse_requires_datas(   z>EggInfoDistribution._get_metadata..parse_requires_datac sHg}z*t|dd}|}W5QRXWntk rBYnX|S)zCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. rar)rrrIOError)req_pathrrrr$r%parse_requires_pathsz>EggInfoDistribution._get_metadata..parse_requires_pathrHzEGG-INFOzPKG-INFOrA)r rDz requires.txtrzEGG-INFO/PKG-INFOutf8rBzEGG-INFO/requires.txtzEGG-INFO/top_level.txtrrGz,path must end with .egg-info or .egg, got %rr)rPrr rrSr zipimport zipimporterrget_datarrrZadd_requirementsrrrrr)r#r requiresrZtl_pathZtl_datar{ meta_pathrErZzipfrCrrr$rr%r~sX             z!EggInfoDistribution._get_metadatacCsd|j|j|jfS)Nz!rr"r$r$r%rs zEggInfoDistribution.__repr__cCsd|j|jfSrrr"r$r$r%rszEggInfoDistribution.__str__cCs`g}tj|jd}tj|r\|D]2\}}}||kr._md5cSs t|jSr:)rstatst_size)r r$r$r%_sizesz7EggInfoDistribution.list_installed_files.._sizer&rarrzNon-existent file: %srN) rr rSrrrrnormpathrWr\rPrr*)r#r*r-rrrrrr{r$r$r%rs"     $z(EggInfoDistribution.list_installed_filesFc cstj|jd}tj|rd}tj|ddd`}|D]T}|}|dkrPd}q6|s6tjtj|j|}||jr6|r|Vq6|Vq6W5QRXdS) a  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths r&Trarrz./FN) rr rSrrrrr.r)r#absoluterskiprrr{r$r$r%rs   z'EggInfoDistribution.list_distinfo_filescCst|to|j|jkSr:)rgrr rr$r$r%r5s  zEggInfoDistribution.__eq__)N)F)r.r/r0r1rrr&rrrrrrrrrrr$r$rr%r`sZ& c@s^eZdZdZddZddZdddZd d Zd d ZdddZ dddZ ddZ ddZ dS)DependencyGrapha Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. cCsi|_i|_i|_dSr:)adjacency_list reverse_listrr"r$r$r%r&PszDependencyGraph.__init__cCsg|j|<g|j|<dS)zAdd the *distribution* to the graph. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` N)r2r3)r# distributionr$r$r%add_distributionUs z DependencyGraph.add_distributionNcCs6|j|||f||j|kr2|j||dS)aAdd an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type label: ``str`` or ``None`` N)r2r*r3)r#xylabelr$r$r%add_edge_s zDependencyGraph.add_edgecCs&td|||j|g|dS)a Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str`` z %s missing %rN)rWrXrr(r*)r#r4rr$r$r% add_missingnszDependencyGraph.add_missingcCsd|j|jfSrrr+r$r$r% _repr_distyszDependencyGraph._repr_distrcCs||g}|j|D]h\}}||}|dk r|d|j|jfq>q|st|dkr|d|d|d|D]}|d |j|d q|d |d dS) a9Writes a DOT output for the graph to the provided file *f*. If *skip_disconnected* is set to ``True``, then all distributions that are not dependent on any other distribution are skipped. :type f: has to support ``file``-like operations :type skip_disconnected: ``bool`` zdigraph dependencies { rNz"%s" -> "%s" [label="%s"] z "%s" -> "%s" zsubgraph disconnected { zlabel = "Disconnected" zbgcolor = red z"%s"rz} )rr2itemsrr*r)r#rZskip_disconnected disconnectedr,adjsrr8r$r$r%to_dots(          zDependencyGraph.to_dotcsg}i}|jD]\}}|dd||<qgt|ddD]\}}|sD|||=qDshq|D]\}}fdd|D||<qptdddD|q,|t|fS)aa Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. Ncs g|]\}}|kr||fqSr$r$)rrraZ to_remover$r%rsz4DependencyGraph.topological_sort..zMoving to result: %scSsg|]}d|j|jfqS)rtr)rrr$r$r%rs)r2rAlistr*rWrXr=keys)r#rralistkrr$rEr%topological_sorts$   z DependencyGraph.topological_sortcCs2g}|jD]\}}|||qd|S)zRepresentation of the graphr)r2rAr*r<rS)r#r?r,rCr$r$r%rszDependencyGraph.__repr__)N)r)T) r.r/r0r1r&r5r9r:r;r<rDrJrr$r$r$r%r1@s   r1r2c CsVt|}t}i}|D]L}|||jD]6}t|\}}td|||||g||fq*q|D]}|j |j B|j B|j B}|D]} z| | } Wn6tk rtd| | d}| |} YnX| j}d} ||kr>||D]N\}} z| |} Wntk rd} YnX| r||| | d} q>q| s||| qqh|S)a6Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance zAdd to provided: %s, %s, %srrFT)rr1r5rurrWrXr(r*rrrrrvrr\rr)ryr9r:)distsrDgraphrzr,r{rrmr$rrvZmatchedproviderryr$r$r% make_graphsN       rNcCsv||krtd|jt|}|g}|j|}|rh|}|||j|D]}||krN||qNq.|d|S)zRecursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested 1given distribution %r is not a member of the listr)rrrNr3popr*)rKr,rLdeptodorsuccr$r$r%get_dependent_distss   rTc Cs||krtd|jt|}t}|j|}tdd|D}|r|d}|||j|}|D]0}|d}||krh||krh||||qhq@|S)aRecursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested in finding the dependencies. rOcss|]}|dVqdS)rNr$)rtr$r$r%r/sz%get_required_dists..r)rrrNrKr2rPr-r*) rKr,rLrrRr_rZ pred_listpredr$r$r%get_required_dists s$     rWcKs4|dd}tf|}||_||_|p(d|_t|S)zO A convenience method for making a dist given just a name and version. summaryzPlaceholder for summary)rPr rrmrXr)rrmkwargsrXrr$r$r% make_dist=s    rZ)r2)7r1 __future__rrrrTrloggingrrRr3r!r@rrcompatrrmrrrEr r r r utilr rrrrrr__all__ getLoggerr.rWrZCOMMANDS_FILENAMEr rQrrrrrrrrYrZr1rNrTrWrZr$r$r$r%s`  $ y7J] 6PKd]C*distlib/__pycache__/markers.cpython-38.pycnu[U ʗRe@sdZddlZddlZddlZddlZddlmZddlmZm Z ddl m Z dgZ edZd d Zd d ZGd ddeZedZddZeZ[eZdddZdS)zG Parser for the environment markers micro-language defined in PEP 508. N) string_types)in_venv parse_marker)NormalizedVersion interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")cCst|tr|sdS|ddkS)NFr'") isinstancer)or /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/markers.py _is_literalsr cCs2g}t|D]}|t|dqt|S)Nr)_VERSION_PATTERNfinditerappendNVgroupsset)sresultmr r r _get_versions!src @sfeZdZdZddddddddddddd dd dd dd dd dddd ZddZdS) Evaluatorz; This class is used to evaluate marker expessions. cCs||kSNr xyr r r -zEvaluator.cCs||kSrr rr r r r.rcCs||kp||kSrr rr r r r/rcCs||kSrr rr r r r0rcCs||kSrr rr r r r1rcCs||kp||kSrr rr r r r2rcCs||kSrr rr r r r3rcCs||kp||kSrr rr r r r4rcCs|o|Srr rr r r r5rcCs|p|Srr rr r r r6rcCs||kSrr rr r r r7rcCs||kSrr rr r r r8r) =====~=!=<<=>>=andorinnot inc Cs"t|trB|ddkr$|dd}n||kr8td|||}nt|tsPt|d}||jkrntd||d}|d }t|drt|d rtd |||f|||}|||}|d ks|d kr|d krt |}t |}n$|d kr|d krt |}t |}|j|||}|S)z Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rrrzunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison: %s %s %spython_version)r#r$r%r&r rr"r!)r)r*) r r SyntaxErrordictAssertionError operationsNotImplementedErrorr evaluaterr) selfexprcontextrr,ZelhsZerhsr-r.r r r r5;s4         zEvaluator.evaluateN)__name__ __module__ __qualname____doc__r3r5r r r r r'srz\d+\.\d+c Csdd}ttdr(|tjj}tjj}nd}d}t}t|}| d}||t jt t t tttt||tjd }|S)NcSs<d|j|j|jf}|j}|dkr8||dt|j7}|S)Nz%s.%s.%sfinalr)majorminormicro releaselevelstrserial)infoversionkindr r r format_full_version`s z,default_context..format_full_versionimplementation0r) implementation_nameimplementation_versionos_nameplatform_machineplatform_python_implementationplatform_releaseplatform_systemplatform_versionZplatform_in_venvpython_full_versionr/ sys_platform)hasattrsysrHrEnameplatformr/_DIGITSmatchgrouposmachinepython_implementationreleasesystemrBr)rGrLrKZppvrpvrr r r default_context_s.     rbc Cszt|\}}Wn2tk rB}ztd||fW5d}~XYnX|rd|ddkrdtd||ftt}|rz||t||S)z Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping z)Unable to interpret marker syntax: %s: %sNr#z*unexpected trailing data in marker: %s: %s)r Exceptionr0r1DEFAULT_CONTEXTupdate evaluatorr5)markerZexecution_contextr7rester8r r r rs " )N)r<r\rerVrXcompatrutilrrrErr__all__compilerr robjectrrYrbrergrr r r r s$   6 "PKd]E] WW1distlib/__pycache__/locators.cpython-38.opt-1.pycnu[U .e_@sDddlZddlmZddlZddlZddlZddlZddlZz ddlZWne k rdddl ZYnXddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"ddl#m$Z$m%Z%ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/dd l0m1Z1m2Z2dd l3m4Z4m5Z5e6e7Z8e9d Z:e9d ej;Zd-ddZ?GdddeZ@GdddeAZBGdddeBZCGdddeBZDGdddeAZEGdddeBZFGdddeBZGGdd d eBZHGd!d"d"eBZIGd#d$d$eBZJeJeHeFd%d&d'd(d)ZKeKjLZLe9d*ZMGd+d,d,eAZNdS).N)BytesIO)DistlibException)urljoinurlparse urlunparse url2pathname pathname2urlqueuequoteunescape string_types build_openerHTTPRedirectHandler text_typeRequest HTTPErrorURLError) DistributionDistributionPath make_dist)MetadataMetadataInvalidError) cached_propertyparse_credentials ensure_slashsplit_filenameget_project_dataparse_requirementparse_name_and_version ServerProxynormalize_name) get_schemeUnsupportedVersionError)Wheel is_compatiblez^(\w+)=([a-f0-9]+)z;\s*charset\s*=\s*(.*)\s*$ztext/html|application/x(ht)?mlzhttps://pypi.org/pypicCs6|dkr t}t|dd}z |WS|dXdS)z Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. N@timeoutclose) DEFAULT_INDEXr list_packages)urlclientr.@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/locators.pyget_all_distribution_names)s   r0c@s$eZdZdZddZeZZZdS)RedirectHandlerzE A class to work around a bug in some Python 3.2.x releases. c Csd}dD]}||kr||}q"q|dkr.dSt|}|jdkrnt||}t|drf|||n|||<t||||||S)N)locationZurireplace_header)rschemerZ get_full_urlhasattrr4BaseRedirectHandlerhttp_error_302) selfreqfpcodemsgheadersZnewurlkeyZurlpartsr.r.r/r8@s   zRedirectHandler.http_error_302N)__name__ __module__ __qualname____doc__r8Zhttp_error_301Zhttp_error_303Zhttp_error_307r.r.r.r/r17sr1c@seZdZdZdZdZdZdZedZd)dd Z d d Z d d Z ddZ ddZ ddZee eZddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd*d'd(ZdS)+LocatorzG A base class for locators - things that locate distributions. )z.tar.gzz.tar.bz2z.tarz.zipz.tgzz.tbz)z.eggz.exe.whl)z.pdfN)rEdefaultcCs,i|_||_tt|_d|_t|_dS)a^ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. N) _cacher5rr1openermatcherr Queueerrors)r9r5r.r.r/__init__fs  zLocator.__init__cCsVg}|jsRz|jd}||Wn|jjk rDYqYnX|jq|S)z8 Return any errors which have occurred. F)rKemptygetappendZEmpty task_done)r9resulter.r.r/ get_errorsys    zLocator.get_errorscCs |dS)z> Clear any errors which may have been logged. N)rSr9r.r.r/ clear_errorsszLocator.clear_errorscCs|jdSN)rGclearrTr.r.r/ clear_cacheszLocator.clear_cachecCs|jSrV_schemerTr.r.r/ _get_schemeszLocator._get_schemecCs ||_dSrVrY)r9valuer.r.r/ _set_schemeszLocator._set_schemecCs tddS)a= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. Please implement in the subclassNNotImplementedError)r9namer.r.r/ _get_projects zLocator._get_projectcCs tddS)J Return all the distribution names known to this locator. r^Nr_rTr.r.r/get_distribution_namesszLocator.get_distribution_namescCsL|jdkr||}n2||jkr,|j|}n|||}||j|<|S)z For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. N)rGrbrU)r9rarQr.r.r/ get_projects      zLocator.get_projectcCs^t|}t|j}d}|d}||j}|rBtt||j}|j dkd|j k||||fS)zu Give an url a score which can be used to choose preferred URLs for a given project release. TrEhttpszpypi.org) r posixpathbasenamepathendswithdownloadable_extensionsr%r$ wheel_tagsr5netloc)r9r,trhZ compatibleZis_wheelZis_downloadabler.r.r/ score_urls   zLocator.score_urlcCsR|}|rN||}||}||kr(|}||kr@td||ntd|||S)a{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. zNot replacing %r with %rzReplacing %r with %r)rologgerdebug)r9url1url2rQs1s2r.r.r/ prefer_urls   zLocator.prefer_urlcCs t||S)zZ Attempt to split a filename in project name, version and Python version. )r)r9filename project_namer.r.r/rszLocator.split_filenamec Csdd}d}t|\}}}}} } | drz~t |}t ||j std |nX|dkrd }n ||j |}|r|j |j |jt||||| d fd dd|jDd}Wn0tk r:}ztd|W5d}~XYnXn||jsZtd|nt|}}|jD]}||rn|dt| }|||}|std|nH|\}}}|r|||r|||t||||| d fd}|r||d<qqn|r| r| |d| <|S)a See if a URL is a candidate for a download URL for a project (the URL has typically been scraped from an HTML page). If it is, a dictionary is returned with keys "name", "version", "filename" and "url"; otherwise, None is returned. cSst|t|kSrV)r!)Zname1Zname2r.r.r/ same_projectsz:Locator.convert_url_to_download_info..same_projectNzegg=z %s: version hint in fragment: %r)NN/rEzWheel not compatible: %sTr3z, cSs"g|]}dt|ddqS).N)joinlist).0vr.r.r/ sz8Locator.convert_url_to_download_info..)raversionrwr,python-versionzinvalid path for wheel: %szNot downloadable: %sz No match for project/version: %s)rarrwr,r %s_digest)rlower startswithrprq HASHER_HASHmatchgroupsrjr$r%rlrarrwrr~pyver Exceptionwarningrkrgrhlenr)r9r,rxryrQr5rmriparamsqueryfragmalgodigestZorigpathwheelZincluderRrwZextrnrarrr.r.r/convert_url_to_download_infos              z$Locator.convert_url_to_download_infocCs2d}dD]$}d|}||kr|||f}q.q|S)z Get a digest from a dictionary by looking at keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5. N)Zsha256md5rr.)r9inforQrr?r.r.r/ _get_digest1s zLocator._get_digestc Cs|d}|d}||kr,||}|j}nt|||jd}|j}|||_}|d}||d|<|j|dkr||j||_|d|t  |||_ |||<dS)z Update a result dictionary (the final result from _get_project) with a dictionary for a specific version, which typically holds information gleaned from a filename or URL for an archive for the distribution. rarr5r,digestsurlsN) popmetadatarr5rr source_urlrv setdefaultsetaddlocator) r9rQrrardistmdrr,r.r.r/_update_version_dataAs   zLocator._update_version_dataFc Csd}t|}|dkr td|t|j}||j|_}td|t|j | |j }t |dkr2g}|j } |D]z} | dkrqxzH|| std|| n*|s| | js|| ntd| |j Wqxtk rtd|| YqxXqxt |d krt||jd }|r2td ||d } || }|r|jrH|j|_|d i| t|_i} |di} |jD]}|| krv| || |<qv| |_d|_|S)a Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. NzNot a valid requirement: %rzmatcher: %s (%s)r}rrz%s did not match %rz%skipping pre-release version %s of %szerror matching %s with %rr)r?zsorted list: %srzrr)rrr"r5rI requirementrprqtyper@rerarZ version_classrZ is_prereleaserOrrsortedr?ZextrasrNr download_urlsr)r9r prereleasesrQrr5rIversionsZslistZvclskrdZsdr,r.r.r/locateXsX          zLocator.locate)rF)F)r@rArBrCsource_extensionsbinary_extensionsexcluded_extensionsrlrkrLrSrUrXr[r]propertyr5rbrdrerorvrrrrrr.r.r.r/rDVs.   JrDcs0eZdZdZfddZddZddZZS)PyPIRPCLocatorz This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). c s*tt|jf|||_t|dd|_dS)z Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. r&r'N)superrrLbase_urlr r-r9r,kwargs __class__r.r/rLszPyPIRPCLocator.__init__cCst|jSrc)rr-r+rTr.r.r/rdsz%PyPIRPCLocator.get_distribution_namesc Csiid}|j|d}|D]}|j||}|j||}t|jd}|d|_|d|_|d|_ |dg|_ |d|_ t |}|r|d } | d |_ || |_||_|||<|D]:} | d } || } |d |t| | |d | <qq|S) NrTrrarlicensekeywordssummaryrr,rr)r-Zpackage_releasesZ release_urlsZ release_datarr5rarrNrrrrrrrrrrr) r9rarQrrrdatarrrr,rr.r.r/rbs0         zPyPIRPCLocator._get_projectr@rArBrCrLrdrb __classcell__r.r.rr/rs rcs0eZdZdZfddZddZddZZS)PyPIJSONLocatorzw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. c s tt|jf|t||_dSrV)rrrLrrrrr.r/rLszPyPIJSONLocator.__init__cCs tddSrczNot available from this locatorNr_rTr.r.r/rdsz&PyPIJSONLocator.get_distribution_namesc Cs iid}t|jdt|}z|j|}|}t|}t |j d}|d}|d|_ |d|_ | d|_| dg|_| d |_t|}||_|d } |||j <|d D]T} | d }|j||| |j|<|d |j t||| |d |<q|d D]\} } | |j kr4qt |j d} |j | _ | | _ t| }||_||| <| D]T} | d }|j||| |j|<|d | t||| |d |<qhqWn@tk r}z |jt|td|W5d}~XYnX|S)Nrz%s/jsonrrrarrrrrr,rZreleaseszJSON fetch failed: %s) rrr rHopenreaddecodejsonloadsrr5rarrNrrrrrrrrrrritemsrrKputrrp exception)r9rarQr,resprrrrrrrZinfosZomdodistrRr.r.r/rbsT                zPyPIJSONLocator._get_projectrr.r.rr/rs rc@s`eZdZdZedejejBejBZ edejejBZ ddZ edejZ e ddZd S) Pagez4 This class represents a scraped HTML page. z (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? z!]+)cCs4||_||_|_|j|j}|r0|d|_dS)zk Initialise an instance with the Unicode page contents and the URL they came from. rN)rrr,_basesearchgroup)r9rr,rr.r.r/rLs  z Page.__init__z[^a-z0-9$&+,/:;=?@.#%_\\|-]cCsdd}t}|j|jD]}|d}|dpX|dpX|dpX|dpX|dpX|d }|d pp|d pp|d }t|j|}t|}|j d d|}| ||fqt |dddd}|S)z Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cSs,t|\}}}}}}t||t||||fS)zTidy up an URL.)rrr )r,r5rmrirrrr.r.r/clean-s  zPage.links..cleanr3Zrel1Zrel2Zrel3Zrel4Zrel5Zrel6rrrsZurl3cSsdt|dS)Nz%%%2xr)ordr)rr.r.r/;zPage.links..cSs|dS)Nrr.)rnr.r.r/r?rT)r?reverse) r_hreffinditerr groupdictrrr _clean_resubrr)r9rrQrrrelr,r.r.r/links&s$  z Page.linksN)r@rArBrCrecompileISXrrrLrrrr.r.r.r/r s rcseZdZdZejdddddZdfdd Zd d Zd d Z ddZ e de j ZddZddZddZddZddZe dZddZZS)SimpleScrapingLocatorz A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. cCstjttdS)N)Zfileobj)gzipZGzipFilerrrbr.r.r/rMrzSimpleScrapingLocator.cCs|SrVr.rr.r.r/rNr)ZdeflaterZnoneN c sltt|jf|t||_||_i|_t|_t |_ t|_ d|_ ||_t|_t|_d|_dS)a Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. FN)rrrLrrr( _page_cacher_seenr rJ _to_fetch _bad_hostsskip_externals num_workers threadingRLock_lock_gplockplatform_check)r9r,r(rrrr.r/rLQs     zSimpleScrapingLocator.__init__cCsFg|_t|jD]0}tj|jd}|d||j|qdS)z Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). )targetTN) _threadsrangerrZThread_fetchZ setDaemonstartrO)r9irnr.r.r/_prepare_threadsls  z&SimpleScrapingLocator._prepare_threadscCs6|jD]}|jdq|jD] }|qg|_dS)zu Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N)rrrr~)r9rnr.r.r/ _wait_threadsys    z#SimpleScrapingLocator._wait_threadsc Csiid}|jx||_||_t|jdt|}|j|j| z&t d||j ||j W5| X|`W5QRX|S)Nrz%s/z Queueing %s)rrQrxrrr rrWrrrrprqrrr~)r9rarQr,r.r.r/rbs      z"SimpleScrapingLocator._get_projectz<\b(linux_(i\d86|x86_64|arm\w+)|win(32|_amd64)|macosx_?\d+)\bcCs |j|S)zD Does an URL refer to a platform-specific download? )platform_dependentr)r9r,r.r.r/_is_platform_dependentsz,SimpleScrapingLocator._is_platform_dependentc CsZ|jr||rd}n|||j}td|||rV|j||j|W5QRX|S)a% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. Nzprocess_download: %s -> %s) rrrrxrprqrrrQ)r9r,rr.r.r/_process_downloads z'SimpleScrapingLocator._process_downloadc Cst|\}}}}}}||j|j|jr2d}n||jrJ||jsJd}nd||js\d}nR|dkrjd}nD|dkrxd}n6||rd}n&| ddd} | dkrd}nd}t d |||||S) z Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. F)ZhomepageZdownload)ZhttprfZftp:rrZ localhostTz#should_queue: %s (%s) from %s -> %s) rrjrrrrrrrsplitrrprq) r9linkZreferrerrr5rmri_rQhostr.r.r/ _should_queues0    z#SimpleScrapingLocator._should_queuec Cs|j}zz|r||}|dkr,WWq|jD]j\}}||jkr2zB|j|||s||||rt d|||j |Wq2t k rYq2Xq2Wn2t k r}z|j t|W5d}~XYnXW5|jX|sqqdS)z Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. NzQueueing %s from %s)rrNrPget_pagerrrrrrprqrrrrKr)r9r,pagerrrRr.r.r/rs,       & zSimpleScrapingLocator._fetchc CsXt|\}}}}}}|dkr:tjt|r:tt|d}||jkr`|j|}t d||n| ddd}d}||j krt d||nt |d d id }zzt d ||j j||jd } t d|| } | dd} t| r| } | } | d}|r"|j|}|| } d}t| }|r@|d}z| |} Wn tk rn| d} YnXt| | }||j| <Wntk r}z|jdkrtd||W5d}~XYnt k r}z0td|||j!|j "|W5QRXW5d}~XYn2t#k rB}ztd||W5d}~XYnXW5||j|<X|S)a Get the HTML for an URL, possibly from an in-memory cache. XXX TODO Note: this cache is never actually cleared. It's assumed that the data won't get stale over the lifetime of a locator instance (not necessarily true for the default_locator). filez index.htmlzReturning %s from cache: %srrrNzSkipping %s due to bad host %szAccept-encodingZidentity)r>z Fetching %sr'z Fetched %sz Content-Typer3zContent-Encodingzutf-8zlatin-1izFetch failed: %s: %s)$rosriisdirrrrrrprqrrrrHrr(rrNHTML_CONTENT_TYPErZgeturlrdecodersCHARSETrrr UnicodeErrorrrr<rrrrr)r9r,r5rmrirrQrr:rr>Z content_typeZ final_urlrencodingdecoderrrRr.r.r/rsZ              &$ zSimpleScrapingLocator.get_pagez]*>([^<]+)[\w-]+)\s*\(\s*(==\s*)?(?P[^)]+)\)$c@sLeZdZdZdddZddZddZd d Zd d Zd dZ dddZ dS)DependencyFinderz0 Locate dependencies for distributions. NcCs|pt|_t|jj|_dS)zf Initialise an instance, using the specified locator to locate distributions. N)default_locatorrr"r5r'r.r.r/rL*s zDependencyFinder.__init__cCsrtd||j}||j|<||j||jf<|jD]:}t|\}}td||||j |t  ||fq2dS)z Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add. zadding distribution %szAdd to provided: %s, %s, %sN) rprqr? dists_by_namedistsrprovidesrprovidedrrr)r9rraprr.r.r/add_distribution2s    z!DependencyFinder.add_distributioncCsxtd||j}|j|=|j||jf=|jD]D}t|\}}td||||j|}| ||f|s.|j|=q.dS)z Remove a distribution from the finder. This will update internal information about who provides what. :param dist: The distribution to remove. zremoving distribution %sz Remove from provided: %s, %s, %sN) rprqr?r.r/rr0rr1remove)r9rrar2rsr.r.r/remove_distributionAs    z$DependencyFinder.remove_distributioncCsBz|j|}Wn,tk r<|d}|j|}YnX|S)z Get a version matcher for a requirement. :param reqt: The requirement :type reqt: str :return: A version matcher (an instance of :class:`distlib.version.Matcher`). r)r5rIr#r)r9reqtrIrar.r.r/ get_matcherSs  zDependencyFinder.get_matcherc Cst||}|j}t}|j}||krp||D]B\}}z||}Wntk rZd}YnX|r,||qpq,|S)z Find the distributions which can fulfill a requirement. :param reqt: The requirement. :type reqt: str :return: A set of distribution which can fulfill the requirement. F)r8r?rr1rr#r) r9r7rIrarQr1rproviderrr.r.r/find_providerscs   zDependencyFinder.find_providersc Cs|j|}t}|D]$}||}||js||q|rZ|d||t|fd}n@|||j|=|D]}|j|t|qp| |d}|S)a Attempt to replace one provider with another. This is typically used when resolving dependencies from multiple sources, e.g. A requires (B >= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. Z cantreplaceFT) reqtsrr8rrr frozensetr6rr3) r9r9otherproblemsZrlistZ unmatchedr5rIrQr.r.r/try_to_replace{s$       zDependencyFinder.try_to_replaceFcCsi|_i|_i|_i|_t|p g}d|krH|d|tdddgO}t|trh|}}t d|n4|j j ||d}}|dkrt d|t d |d |_ t}t|g}t|g}|r|}|j} | |jkr||n"|j| } | |kr||| ||j|jB} |j} t} |r`||kr`d D]*}d |}||kr4| t|d |O} q4| | B| B}|D].}||}|sFt d||j j ||d}|dkr|s|j j |d d}|dkrt d||d|fn^|j|j}}||f|jkr|||||| krF||krF||t d|j|D]R}|j} | |jkrx|j|t|n"|j| } | |krJ||| |qJqpqt|j}|D]&}||k|_|jrt d|jqt d|||fS)a Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. z:*:z:test:z:build:z:dev:zpassed %s as requirement)rNzUnable to locate %rz located %sT)ZtestZbuildZdevz:%s:z %s_requireszNo providers found for %rzCannot satisfy %rZ unsatisfiedzAdding %s to install_distsz#%s is a build-time dependency only.zfind done for %s)r1r/r.r;rr4 isinstancerrprqrrrZ requestedrr?r3r?Z run_requiresZ meta_requiresZbuild_requiresgetattrr:rrZname_and_versionrvaluesZbuild_time_dependency)r9rZ meta_extrasrrrr>ZtodoZ install_distsrar=ZireqtsZsreqtsZereqtsr?rRZ all_reqtsrZ providersr9nrr2r/r.r.r/finds                            zDependencyFinder.find)N)NF) r@rArBrCrLr3r6r8r:r?rDr.r.r.r/r,%s (r,)N)OriorrZloggingr rgrr ImportErrorZdummy_threadingrr3rcompatrrrrr r r r r rrr7rrrrZdatabaserrrrrrutilrrrrrrrr r!rr"r#rr$r%Z getLoggerr@rprrrr r r*r0r1objectrDrrrrrrr"r$r-rZNAME_VERSION_REr,r.r.r.r/s^   D,    @0E:zA&[ PKd]**2distlib/__pycache__/resources.cpython-38.opt-1.pycnu[U .e* @sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZmZmZeeZdaGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZedee jeiZzFz ddl Z!Wne"k r$ddl#Z!YnXeee!j$<eee!j%<[!Wne"e&fk rXYnXddZ'iZ(ddZ)e *e+dZ,ddZ-dS))unicode_literalsN)DistlibException)cached_propertyget_cache_basepath_to_cache_dirCachecs.eZdZdfdd ZddZddZZS) ResourceCacheNcs0|dkrtjttd}tt||dS)Nzresource-cache)ospathjoinrstrsuperr __init__)selfbase __class__A/usr/lib/python3.8/site-packages/pip/_vendor/distlib/resources.pyrszResourceCache.__init__cCsdS)z Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. Trrresourcer rrris_stale#s zResourceCache.is_stalec Cs|j|\}}|dkr|}n~tj|j|||}tj|}tj|sXt |tj |sjd}n | ||}|rt |d}| |jW5QRX|S)z Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. NTwb)finderget_cache_infor r r rZ prefix_to_dirdirnameisdirmakedirsexistsropenwritebytes)rrprefixr resultrZstalefrrrget.s      zResourceCache.get)N)__name__ __module__ __qualname__rrr& __classcell__rrrrr s r c@seZdZddZdS) ResourceBasecCs||_||_dSN)rname)rrr-rrrrIszResourceBase.__init__N)r'r(r)rrrrrr+Hsr+c@s@eZdZdZdZddZeddZeddZed d Z d S) Resourcez A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. FcCs |j|S)z Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. )r get_streamrrrr as_streamVszResource.as_streamcCstdkrtat|Sr,)cacher r&r0rrr file_path_szResource.file_pathcCs |j|Sr,)r get_bytesr0rrrr"fszResource.bytescCs |j|Sr,)rget_sizer0rrrsizejsz Resource.sizeN) r'r(r)__doc__ is_containerr1rr3r"r6rrrrr.Ns   r.c@seZdZdZeddZdS)ResourceContainerTcCs |j|Sr,)r get_resourcesr0rrr resourcesrszResourceContainer.resourcesN)r'r(r)r8rr;rrrrr9osr9c@seZdZdZejdrdZndZddZddZ d d Z d d Z d dZ ddZ ddZddZddZddZddZeejjZddZdS)ResourceFinderz4 Resource finder for file system resources. java).pyc.pyoz.class)r>r?cCs.||_t|dd|_tjt|dd|_dS)N __loader____file__)modulegetattrloaderr r rr)rrCrrrrszResourceFinder.__init__cCs tj|Sr,)r r realpathrr rrr _adjust_pathszResourceFinder._adjust_pathcCsBt|trd}nd}||}|d|jtjj|}||S)N//r) isinstancer"splitinsertrr r r rH)r resource_nameseppartsr$rrr _make_paths   zResourceFinder._make_pathcCs tj|Sr,)r r rrGrrr_findszResourceFinder._findcCs d|jfSr,)r rrrrrrszResourceFinder.get_cache_infocCsD||}||sd}n&||r0t||}n t||}||_|Sr,)rQrR _is_directoryr9r.r )rrNr r$rrrfinds     zResourceFinder.findcCs t|jdSNrb)r r rSrrrr/szResourceFinder.get_streamc Cs,t|jd}|W5QRSQRXdSrV)r r read)rrr%rrrr4szResourceFinder.get_bytescCstj|jSr,)r r getsizerSrrrr5szResourceFinder.get_sizecs*fddtfddt|jDS)Ncs|dko|j S)N __pycache__)endswithskipped_extensions)r%r0rralloweds z-ResourceFinder.get_resources..allowedcsg|]}|r|qSrr).0r%)r]rr sz0ResourceFinder.get_resources..)setr listdirr rSr)r]rrr:s zResourceFinder.get_resourcescCs ||jSr,)rTr rSrrrr8szResourceFinder.is_containerccs||}|dk r|g}|r|d}|V|jr|j}|jD]>}|sL|}nd||g}||}|jrv||q>|Vq>qdS)NrrJ)rUpopr8r-r;r append)rrNrZtodoZrnamer-new_nameZchildrrriterators      zResourceFinder.iteratorN)r'r(r)r7sysplatform startswithr\rrHrQrRrrUr/r4r5r:r8 staticmethodr r rrTrerrrrr<ws"    r<cs`eZdZdZfddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ Z S)ZipResourceFinderz6 Resource finder for resources in .zip files. csZtt|||jj}dt||_t|jdr>|jj|_n t j ||_t |j|_ dS)Nr_files) rrjrrEarchivelen prefix_lenhasattrrk zipimport_zip_directory_cachesortedindex)rrCrlrrrrs   zZipResourceFinder.__init__cCs|Sr,rrGrrrrHszZipResourceFinder._adjust_pathcCs||jd}||jkrd}nX|r:|dtjkr:|tj}t|j|}z|j||}Wntk rtd}YnX|st d||j j nt d||j j |S)NTFz_find failed: %r %rz_find worked: %r %r) rnrkr rObisectrsrh IndexErrorloggerdebugrEr#)rr r$irrrrRs   zZipResourceFinder._findcCs&|jj}|jdt|d}||fS)Nr)rErlr rm)rrr#r rrrrsz ZipResourceFinder.get_cache_infocCs|j|jSr,)rEget_datar rSrrrr4szZipResourceFinder.get_bytescCst||Sr,)ioBytesIOr4rSrrrr/szZipResourceFinder.get_streamcCs|j|jd}|j|dS)N)r rnrkrrrrr5szZipResourceFinder.get_sizecCs|j|jd}|r,|dtjkr,|tj7}t|}t}t|j|}|t|jkr|j||shq|j||d}| | tjdd|d7}qH|S)Nrtrr) r rnr rOrmr`rursrhaddrL)rrr Zplenr$rysrrrr:s  zZipResourceFinder.get_resourcescCsj||jd}|r*|dtjkr*|tj7}t|j|}z|j||}Wntk rdd}YnX|S)NrtF)rnr rOrursrhrv)rr ryr$rrrrTs  zZipResourceFinder._is_directory)r'r(r)r7rrHrRrr4r/r5r:rTr*rrrrrjs rjcCs|tt|<dSr,)_finder_registrytype)rE finder_makerrrrregister_finder0srcCs|tkrt|}nv|tjkr$t|tj|}t|dd}|dkrJtdt|dd}tt|}|dkrxtd|||}|t|<|S)z Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. __path__Nz8You cannot get a finder for a module, only for a packager@zUnable to locate finder for %r) _finder_cacherfmodules __import__rDrrr&r)packager$rCr rErrrrr6s      rZ __dummy__cCsRd}t|tj|}tt|}|rNt}tj |d|_ ||_ ||}|S)z Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. NrB) pkgutilZ get_importerrfpath_importer_cacher&rr _dummy_moduler r r rAr@)r r$rErrCrrrfinder_for_pathRs  r).Z __future__rrur{Zloggingr rZshutilrftypesrprBrutilrrrrZ getLoggerr'rwr2r objectr+r.r9r<rjr zipimporterr_frozen_importlib_externalZ_fi ImportError_frozen_importlibSourceFileLoader FileFinderAttributeErrorrrr ModuleTyper rrrrrrsN   ,!ZN   PKd]#1distlib/__pycache__/__init__.cpython-38.opt-1.pycnu[U .eK@snddlZdZGdddeZzddlmZWn&ek rRGdddejZYnXeeZ e edS)Nz 0.2.9.post0c@s eZdZdS)DistlibExceptionN)__name__ __module__ __qualname__rr@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/__init__.pyr sr) NullHandlerc@s$eZdZddZddZddZdS)rcCsdSNrselfrecordrrrhandlezNullHandler.handlecCsdSr rr rrremitrzNullHandler.emitcCs d|_dSr )lock)r rrr createLockrzNullHandler.createLockN)rrrr rrrrrrrsr) Zlogging __version__ Exceptionrr ImportErrorZHandlerZ getLoggerrZloggerZ addHandlerrrrrs PKd]yhhdistlib/_backport/sysconfig.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import ConfigParser as configparser __all__ = [ 'get_config_h_filename', 'get_config_var', 'get_config_vars', 'get_makefile_filename', 'get_path', 'get_path_names', 'get_paths', 'get_platform', 'get_python_version', 'get_scheme_names', 'parse_config_h', ] def _safe_realpath(path): try: return realpath(path) except OSError: return path if sys.executable: _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable)) else: # sys.executable can be empty if argv[0] has been changed and Python is # unable to retrieve the real program name _PROJECT_BASE = _safe_realpath(os.getcwd()) if os.name == "nt" and "pcbuild" in _PROJECT_BASE[-8:].lower(): _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir)) # PC/VS7.1 if os.name == "nt" and "\\pc\\v" in _PROJECT_BASE[-10:].lower(): _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir)) # PC/AMD64 if os.name == "nt" and "\\pcbuild\\amd64" in _PROJECT_BASE[-14:].lower(): _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir)) def is_python_build(): for fn in ("Setup.dist", "Setup.local"): if os.path.isfile(os.path.join(_PROJECT_BASE, "Modules", fn)): return True return False _PYTHON_BUILD = is_python_build() _cfg_read = False def _ensure_cfg_read(): global _cfg_read if not _cfg_read: from ..resources import finder backport_package = __name__.rsplit('.', 1)[0] _finder = finder(backport_package) _cfgfile = _finder.find('sysconfig.cfg') assert _cfgfile, 'sysconfig.cfg exists' with _cfgfile.as_stream() as s: _SCHEMES.readfp(s) if _PYTHON_BUILD: for scheme in ('posix_prefix', 'posix_home'): _SCHEMES.set(scheme, 'include', '{srcdir}/Include') _SCHEMES.set(scheme, 'platinclude', '{projectbase}/.') _cfg_read = True _SCHEMES = configparser.RawConfigParser() _VAR_REPL = re.compile(r'\{([^{]*?)\}') def _expand_globals(config): _ensure_cfg_read() if config.has_section('globals'): globals = config.items('globals') else: globals = tuple() sections = config.sections() for section in sections: if section == 'globals': continue for option, value in globals: if config.has_option(section, option): continue config.set(section, option, value) config.remove_section('globals') # now expanding local variables defined in the cfg file # for section in config.sections(): variables = dict(config.items(section)) def _replacer(matchobj): name = matchobj.group(1) if name in variables: return variables[name] return matchobj.group(0) for option, value in config.items(section): config.set(section, option, _VAR_REPL.sub(_replacer, value)) #_expand_globals(_SCHEMES) _PY_VERSION = '%s.%s.%s' % sys.version_info[:3] _PY_VERSION_SHORT = '%s.%s' % sys.version_info[:2] _PY_VERSION_SHORT_NO_DOT = '%s%s' % sys.version_info[:2] _PREFIX = os.path.normpath(sys.prefix) _EXEC_PREFIX = os.path.normpath(sys.exec_prefix) _CONFIG_VARS = None _USER_BASE = None def _subst_vars(path, local_vars): """In the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. """ def _replacer(matchobj): name = matchobj.group(1) if name in local_vars: return local_vars[name] elif name in os.environ: return os.environ[name] return matchobj.group(0) return _VAR_REPL.sub(_replacer, path) def _extend_dict(target_dict, other_dict): target_keys = target_dict.keys() for key, value in other_dict.items(): if key in target_keys: continue target_dict[key] = value def _expand_vars(scheme, vars): res = {} if vars is None: vars = {} _extend_dict(vars, get_config_vars()) for key, value in _SCHEMES.items(scheme): if os.name in ('posix', 'nt'): value = os.path.expanduser(value) res[key] = os.path.normpath(_subst_vars(value, vars)) return res def format_value(value, vars): def _replacer(matchobj): name = matchobj.group(1) if name in vars: return vars[name] return matchobj.group(0) return _VAR_REPL.sub(_replacer, value) def _get_default_scheme(): if os.name == 'posix': # the default scheme for posix is posix_prefix return 'posix_prefix' return os.name def _getuserbase(): env_base = os.environ.get("PYTHONUSERBASE", None) def joinuser(*args): return os.path.expanduser(os.path.join(*args)) # what about 'os2emx', 'riscos' ? if os.name == "nt": base = os.environ.get("APPDATA") or "~" if env_base: return env_base else: return joinuser(base, "Python") if sys.platform == "darwin": framework = get_config_var("PYTHONFRAMEWORK") if framework: if env_base: return env_base else: return joinuser("~", "Library", framework, "%d.%d" % sys.version_info[:2]) if env_base: return env_base else: return joinuser("~", ".local") def _parse_makefile(filename, vars=None): """Parse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. """ # Regexes needed for parsing Makefile (and similar syntaxes, # like old-style Setup files). _variable_rx = re.compile(r"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)") _findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)") _findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}") if vars is None: vars = {} done = {} notdone = {} with codecs.open(filename, encoding='utf-8', errors="surrogateescape") as f: lines = f.readlines() for line in lines: if line.startswith('#') or line.strip() == '': continue m = _variable_rx.match(line) if m: n, v = m.group(1, 2) v = v.strip() # `$$' is a literal `$' in make tmpv = v.replace('$$', '') if "$" in tmpv: notdone[n] = v else: try: v = int(v) except ValueError: # insert literal `$' done[n] = v.replace('$$', '$') else: done[n] = v # do variable interpolation here variables = list(notdone.keys()) # Variables with a 'PY_' prefix in the makefile. These need to # be made available without that prefix through sysconfig. # Special care is needed to ensure that variable expansion works, even # if the expansion uses the name without a prefix. renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS') while len(variables) > 0: for name in tuple(variables): value = notdone[name] m = _findvar1_rx.search(value) or _findvar2_rx.search(value) if m is not None: n = m.group(1) found = True if n in done: item = str(done[n]) elif n in notdone: # get it on a subsequent round found = False elif n in os.environ: # do it like make: fall back to environment item = os.environ[n] elif n in renamed_variables: if (name.startswith('PY_') and name[3:] in renamed_variables): item = "" elif 'PY_' + n in notdone: found = False else: item = str(done['PY_' + n]) else: done[n] = item = "" if found: after = value[m.end():] value = value[:m.start()] + item + after if "$" in after: notdone[name] = value else: try: value = int(value) except ValueError: done[name] = value.strip() else: done[name] = value variables.remove(name) if (name.startswith('PY_') and name[3:] in renamed_variables): name = name[3:] if name not in done: done[name] = value else: # bogus variable reference (e.g. "prefix=$/opt/python"); # just drop it since we can't deal done[name] = value variables.remove(name) # strip spurious spaces for k, v in done.items(): if isinstance(v, str): done[k] = v.strip() # save the results in the global dictionary vars.update(done) return vars def get_makefile_filename(): """Return the path of the Makefile.""" if _PYTHON_BUILD: return os.path.join(_PROJECT_BASE, "Makefile") if hasattr(sys, 'abiflags'): config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags) else: config_dir_name = 'config' return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile') def _init_posix(vars): """Initialize the module as appropriate for POSIX systems.""" # load the installed Makefile: makefile = get_makefile_filename() try: _parse_makefile(makefile, vars) except IOError as e: msg = "invalid Python installation: unable to open %s" % makefile if hasattr(e, "strerror"): msg = msg + " (%s)" % e.strerror raise IOError(msg) # load the installed pyconfig.h: config_h = get_config_h_filename() try: with open(config_h) as f: parse_config_h(f, vars) except IOError as e: msg = "invalid Python installation: unable to open %s" % config_h if hasattr(e, "strerror"): msg = msg + " (%s)" % e.strerror raise IOError(msg) # On AIX, there are wrong paths to the linker scripts in the Makefile # -- these paths are relative to the Python source, but when installed # the scripts are in another directory. if _PYTHON_BUILD: vars['LDSHARED'] = vars['BLDSHARED'] def _init_non_posix(vars): """Initialize the module as appropriate for NT""" # set basic install directories vars['LIBDEST'] = get_path('stdlib') vars['BINLIBDEST'] = get_path('platstdlib') vars['INCLUDEPY'] = get_path('include') vars['SO'] = '.pyd' vars['EXE'] = '.exe' vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable)) # # public APIs # def parse_config_h(fp, vars=None): """Parse a config.h-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. """ if vars is None: vars = {} define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n") undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n") while True: line = fp.readline() if not line: break m = define_rx.match(line) if m: n, v = m.group(1, 2) try: v = int(v) except ValueError: pass vars[n] = v else: m = undef_rx.match(line) if m: vars[m.group(1)] = 0 return vars def get_config_h_filename(): """Return the path of pyconfig.h.""" if _PYTHON_BUILD: if os.name == "nt": inc_dir = os.path.join(_PROJECT_BASE, "PC") else: inc_dir = _PROJECT_BASE else: inc_dir = get_path('platinclude') return os.path.join(inc_dir, 'pyconfig.h') def get_scheme_names(): """Return a tuple containing the schemes names.""" return tuple(sorted(_SCHEMES.sections())) def get_path_names(): """Return a tuple containing the paths names.""" # xxx see if we want a static list return _SCHEMES.options('posix_prefix') def get_paths(scheme=_get_default_scheme(), vars=None, expand=True): """Return a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. """ _ensure_cfg_read() if expand: return _expand_vars(scheme, vars) else: return dict(_SCHEMES.items(scheme)) def get_path(name, scheme=_get_default_scheme(), vars=None, expand=True): """Return a path corresponding to the scheme. ``scheme`` is the install scheme name. """ return get_paths(scheme, vars, expand)[name] def get_config_vars(*args): """With no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary. """ global _CONFIG_VARS if _CONFIG_VARS is None: _CONFIG_VARS = {} # Normalized versions of prefix and exec_prefix are handy to have; # in fact, these are the standard versions used most places in the # distutils2 module. _CONFIG_VARS['prefix'] = _PREFIX _CONFIG_VARS['exec_prefix'] = _EXEC_PREFIX _CONFIG_VARS['py_version'] = _PY_VERSION _CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT _CONFIG_VARS['py_version_nodot'] = _PY_VERSION[0] + _PY_VERSION[2] _CONFIG_VARS['base'] = _PREFIX _CONFIG_VARS['platbase'] = _EXEC_PREFIX _CONFIG_VARS['projectbase'] = _PROJECT_BASE try: _CONFIG_VARS['abiflags'] = sys.abiflags except AttributeError: # sys.abiflags may not be defined on all platforms. _CONFIG_VARS['abiflags'] = '' if os.name in ('nt', 'os2'): _init_non_posix(_CONFIG_VARS) if os.name == 'posix': _init_posix(_CONFIG_VARS) # Setting 'userbase' is done below the call to the # init function to enable using 'get_config_var' in # the init-function. if sys.version >= '2.6': _CONFIG_VARS['userbase'] = _getuserbase() if 'srcdir' not in _CONFIG_VARS: _CONFIG_VARS['srcdir'] = _PROJECT_BASE else: _CONFIG_VARS['srcdir'] = _safe_realpath(_CONFIG_VARS['srcdir']) # Convert srcdir into an absolute path if it appears necessary. # Normally it is relative to the build directory. However, during # testing, for example, we might be running a non-installed python # from a different directory. if _PYTHON_BUILD and os.name == "posix": base = _PROJECT_BASE try: cwd = os.getcwd() except OSError: cwd = None if (not os.path.isabs(_CONFIG_VARS['srcdir']) and base != cwd): # srcdir is relative and we are not in the same directory # as the executable. Assume executable is in the build # directory and make srcdir absolute. srcdir = os.path.join(base, _CONFIG_VARS['srcdir']) _CONFIG_VARS['srcdir'] = os.path.normpath(srcdir) if sys.platform == 'darwin': kernel_version = os.uname()[2] # Kernel version (8.4.3) major_version = int(kernel_version.split('.')[0]) if major_version < 8: # On Mac OS X before 10.4, check if -arch and -isysroot # are in CFLAGS or LDFLAGS and remove them if they are. # This is needed when building extensions on a 10.3 system # using a universal build of python. for key in ('LDFLAGS', 'BASECFLAGS', # a number of derived variables. These need to be # patched up as well. 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _CONFIG_VARS[key] flags = re.sub(r'-arch\s+\w+\s', ' ', flags) flags = re.sub('-isysroot [^ \t]*', ' ', flags) _CONFIG_VARS[key] = flags else: # Allow the user to override the architecture flags using # an environment variable. # NOTE: This name was introduced by Apple in OSX 10.5 and # is used by several scripting languages distributed with # that OS release. if 'ARCHFLAGS' in os.environ: arch = os.environ['ARCHFLAGS'] for key in ('LDFLAGS', 'BASECFLAGS', # a number of derived variables. These need to be # patched up as well. 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _CONFIG_VARS[key] flags = re.sub(r'-arch\s+\w+\s', ' ', flags) flags = flags + ' ' + arch _CONFIG_VARS[key] = flags # If we're on OSX 10.5 or later and the user tries to # compiles an extension using an SDK that is not present # on the current machine it is better to not use an SDK # than to fail. # # The major usecase for this is users using a Python.org # binary installer on OSX 10.6: that installer uses # the 10.4u SDK, but that SDK is not installed by default # when you install Xcode. # CFLAGS = _CONFIG_VARS.get('CFLAGS', '') m = re.search(r'-isysroot\s+(\S+)', CFLAGS) if m is not None: sdk = m.group(1) if not os.path.exists(sdk): for key in ('LDFLAGS', 'BASECFLAGS', # a number of derived variables. These need to be # patched up as well. 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _CONFIG_VARS[key] flags = re.sub(r'-isysroot\s+\S+(\s|$)', ' ', flags) _CONFIG_VARS[key] = flags if args: vals = [] for name in args: vals.append(_CONFIG_VARS.get(name)) return vals else: return _CONFIG_VARS def get_config_var(name): """Return the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) """ return get_config_vars().get(name) def get_platform(): """Return a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. """ if os.name == 'nt': # sniff sys.version for architecture. prefix = " bit (" i = sys.version.find(prefix) if i == -1: return sys.platform j = sys.version.find(")", i) look = sys.version[i+len(prefix):j].lower() if look == 'amd64': return 'win-amd64' if look == 'itanium': return 'win-ia64' return sys.platform if os.name != "posix" or not hasattr(os, 'uname'): # XXX what about the architecture? NT is Intel or Alpha, # Mac OS is M68k or PPC, etc. return sys.platform # Try to distinguish various flavours of Unix osname, host, release, version, machine = os.uname() # Convert the OS name to lowercase, remove '/' characters # (to accommodate BSD/OS), and translate spaces (for "Power Macintosh") osname = osname.lower().replace('/', '') machine = machine.replace(' ', '_') machine = machine.replace('/', '-') if osname[:5] == "linux": # At least on Linux/Intel, 'machine' is the processor -- # i386, etc. # XXX what about Alpha, SPARC, etc? return "%s-%s" % (osname, machine) elif osname[:5] == "sunos": if release[0] >= "5": # SunOS 5 == Solaris 2 osname = "solaris" release = "%d.%s" % (int(release[0]) - 3, release[2:]) # fall through to standard osname-release-machine representation elif osname[:4] == "irix": # could be "irix64"! return "%s-%s" % (osname, release) elif osname[:3] == "aix": return "%s-%s.%s" % (osname, version, release) elif osname[:6] == "cygwin": osname = "cygwin" rel_re = re.compile(r'[\d.]+') m = rel_re.match(release) if m: release = m.group() elif osname[:6] == "darwin": # # For our purposes, we'll assume that the system version from # distutils' perspective is what MACOSX_DEPLOYMENT_TARGET is set # to. This makes the compatibility story a bit more sane because the # machine is going to compile and link as if it were # MACOSX_DEPLOYMENT_TARGET. cfgvars = get_config_vars() macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET') if True: # Always calculate the release of the running machine, # needed to determine if we can build fat binaries or not. macrelease = macver # Get the system version. Reading this plist is a documented # way to get the system version (see the documentation for # the Gestalt Manager) try: f = open('/System/Library/CoreServices/SystemVersion.plist') except IOError: # We're on a plain darwin box, fall back to the default # behaviour. pass else: try: m = re.search(r'ProductUserVisibleVersion\s*' r'(.*?)', f.read()) finally: f.close() if m is not None: macrelease = '.'.join(m.group(1).split('.')[:2]) # else: fall back to the default behaviour if not macver: macver = macrelease if macver: release = macver osname = "macosx" if ((macrelease + '.') >= '10.4.' and '-arch' in get_config_vars().get('CFLAGS', '').strip()): # The universal build will build fat binaries, but not on # systems before 10.4 # # Try to detect 4-way universal builds, those have machine-type # 'universal' instead of 'fat'. machine = 'fat' cflags = get_config_vars().get('CFLAGS') archs = re.findall(r'-arch\s+(\S+)', cflags) archs = tuple(sorted(set(archs))) if len(archs) == 1: machine = archs[0] elif archs == ('i386', 'ppc'): machine = 'fat' elif archs == ('i386', 'x86_64'): machine = 'intel' elif archs == ('i386', 'ppc', 'x86_64'): machine = 'fat3' elif archs == ('ppc64', 'x86_64'): machine = 'fat64' elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'): machine = 'universal' else: raise ValueError( "Don't know machine value for archs=%r" % (archs,)) elif machine == 'i386': # On OSX the machine type returned by uname is always the # 32-bit variant, even if the executable architecture is # the 64-bit variant if sys.maxsize >= 2**32: machine = 'x86_64' elif machine in ('PowerPC', 'Power_Macintosh'): # Pick a sane name for the PPC architecture. # See 'i386' case if sys.maxsize >= 2**32: machine = 'ppc64' else: machine = 'ppc' return "%s-%s-%s" % (osname, release, machine) def get_python_version(): return _PY_VERSION_SHORT def _print_dict(title, data): for index, (key, value) in enumerate(sorted(data.items())): if index == 0: print('%s: ' % (title)) print('\t%s = "%s"' % (key, value)) def _main(): """Display all information sysconfig detains.""" print('Platform: "%s"' % get_platform()) print('Python version: "%s"' % get_python_version()) print('Current installation scheme: "%s"' % _get_default_scheme()) print() _print_dict('Paths', get_paths()) print() _print_dict('Variables', get_config_vars()) if __name__ == '__main__': _main() PKd]""1distlib/_backport/__pycache__/misc.cpython-38.pycnu[U .e@sdZddlZddlZdddgZzddlmZWnek rLd ddZYnXzeZWn(ek r~dd l m Z d dZYnXz ej Z Wne k rd dZ YnXdS) z/Backports for individual classes and functions.Ncache_from_sourcecallablefsencode)rTcCs|rdp d}||S)Nco)Zpy_filedebugZextrrF/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/misc.pyrs )CallablecCs t|tS)N) isinstancer )objrrr rscCs<t|tr|St|tr&|tStdt|jdS)Nzexpect bytes or str, not %s) r bytesstrencodesysgetfilesystemencoding TypeErrortype__name__)filenamerrr r"s  )T) __doc__osr__all__Zimpr ImportErrorr NameError collectionsr rAttributeErrorrrrr s    PKd]ɩ""7distlib/_backport/__pycache__/misc.cpython-38.opt-1.pycnu[U .e@sdZddlZddlZdddgZzddlmZWnek rLd ddZYnXzeZWn(ek r~dd l m Z d dZYnXz ej Z Wne k rd dZ YnXdS) z/Backports for individual classes and functions.Ncache_from_sourcecallablefsencode)rFcCs|rdp d}||S)Nco)Zpy_filedebugZextrrF/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/misc.pyrs )CallablecCs t|tS)N) isinstancer )objrrr rscCs<t|tr|St|tr&|tStdt|jdS)Nzexpect bytes or str, not %s) r bytesstrencodesysgetfilesystemencoding TypeErrortype__name__)filenamerrr r"s  )F) __doc__osr__all__Zimpr ImportErrorr NameError collectionsr rAttributeErrorrrrr s    PKd]߿5distlib/_backport/__pycache__/__init__.cpython-38.pycnu[U .e@sdZdS)a Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N)__doc__rrJ/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/__init__.pyPKd]`==6distlib/_backport/__pycache__/sysconfig.cpython-38.pycnu[U .eTi @sdZddlZddlZddlZddlZddlmZmZz ddlZWne k r\ddl ZYnXdddddd d d d d dg Z ddZ ej reje ej Zn e eZejdkrdeddkre ejeeZejdkr deddkr e ejeeeZejdkrBdeddkrBe ejeeeZddZeZdaddZeZedZddZejdZ ejdd Z!e de d!Z"ej#ej$Z%ej#ej&Z'da(dZ)d"d#Z*d$d%Z+d&d'Z,d(d)Z-d*d+Z.d,d-Z/dEd.d/Z0d0dZ1d1d2Z2d3d4Z3dFd5dZ4d6dZ5d7d Z6d8d Z7e.dd9fd:d Z8e.dd9fd;dZ9dd ZdBdCZ?e@dDkre?dS)Gz-Access to Python's configuration information.N)pardirrealpathget_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hcCs(z t|WStk r"|YSXdSN)rOSError)pathrK/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/sysconfig.py_safe_realpath"s rntZpcbuildiz\pc\viz\pcbuild\amd64icCs,dD]"}tjtjtd|rdSqdS)N)z Setup.distz Setup.localZModulesTF)osrisfilejoin _PROJECT_BASE)fnrrris_python_build:srFc Cstsddlm}tddd}||}|d}|s>td|}t |W5QRXt rdD] }t |d d t |d d qdd adS)N)finder.rz sysconfig.cfgzsysconfig.cfg exists) posix_prefixZ posix_homeincludez{srcdir}/Include platincludez{projectbase}/.T) _cfg_readZ resourcesr__name__rsplitfindAssertionErrorZ as_stream_SCHEMESZreadfp _PYTHON_BUILDset)rZbackport_packageZ_finderZ_cfgfilesschemerrr_ensure_cfg_readDs    r-z \{([^{]*?)\}c st|dr|d}nt}|}|D]8}|dkr._replacer) r-Z has_sectionitemstuplesectionsZ has_optionr*Zremove_sectiondict _VAR_REPLsub)configr.r9ZsectionZoptionvaluer6rr4r_expand_globalsYs$       r?rcsfdd}t||S)zIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. cs8|d}|kr|S|tjkr.tj|S|dSr/)r1renvironr2 local_varsrrr6s    z_subst_vars.._replacerr;r<)rrCr6rrBr _subst_varss rEcCs0|}|D]\}}||kr"q|||<qdSr)keysr7)Z target_dictZ other_dictZ target_keyskeyr>rrr _extend_dicts rHcCs`i}|dkri}t|tt|D]4\}}tjdkrDtj|}tjt ||||<q&|S)N)posixr) rHrr(r7rr3r expandusernormpathrE)r,varsresrGr>rrr _expand_varss   rNcsfdd}t||S)Ncs$|d}|kr|S|dSr/r0r2rLrrr6s zformat_value.._replacerrD)r>rLr6rrOr format_values rPcCstjdkrdStjS)NrIr )rr3rrrr_get_default_schemes rQcCstjdd}dd}tjdkrBtjdp.d}|r8|S||dStjdkr|td }|r||r`|S|dd |d tjdd S|r|S|dd SdS)NPYTHONUSERBASEcWstjtjj|Sr)rrrJr)argsrrrjoinusersz_getuserbase..joinuserrAPPDATA~PythondarwinZPYTHONFRAMEWORKLibraryz%d.%drz.local)rrAgetr3sysplatformr version_info)env_baserTbaseZ frameworkrrr _getuserbases$     r`c Cstd}td}td}|dkr*i}i}i}tj|ddd}|}W5QRX|D]} | dsZ| d krvqZ|| } | rZ| d d \} } | } | d d } d | kr| || <qZz t | } Wn$t k r| d d || <YqZX| || <qZt | }d}t|dkrt|D]}||}||p>||} | dk r| d } d}| |krpt|| }n| |krd}nx| tjkrtj| }n`| |kr|dr|dd|krd }n$d| |krd}nt|d| }n d || <}|r|| d}|d| ||}d |kr:|||<n~z t |}Wn"t k rh|||<Yn X|||<|||dr|dd|kr|dd}||kr|||<n|||<||qq|D]"\}} t| tr| ||<q|||S)zParse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. z"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}Nzutf-8surrogateescape)encodingerrors#rrz$$$)CFLAGSLDFLAGSZCPPFLAGSrTFZPY_r@)recompilecodecsopen readlines startswithstripmatchr1replaceint ValueErrorlistrFlenr8searchstrrrAendstartremover7 isinstanceupdate)filenamerLZ _variable_rxZ _findvar1_rxZ _findvar2_rxZdoneZnotdoneflineslinemnvZtmpvr5Zrenamed_variablesr3r>founditemZafterkrrr_parse_makefiles                            rcCsDtrtjtdSttdr,dttjf}nd}tjt d|dS)z Return the path of the Makefile.ZMakefileabiflagsz config-%s%sr=stdlib) r)rrrrhasattrr[_PY_VERSION_SHORTrr)Zconfig_dir_namerrrrMs  c Cst}zt||WnJtk r^}z,d|}t|drF|d|j}t|W5d}~XYnXt}z"t|}t||W5QRXWnJtk r}z,d|}t|dr|d|j}t|W5d}~XYnXtr|d|d<dS)z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sstrerrorz (%s)N BLDSHAREDZLDSHARED) rrIOErrorrrrrlrr))rLZmakefileemsgZconfig_hr~rrr _init_posixXs&   rcCsVtd|d<td|d<td|d<d|d<d |d <t|d <tjttj|d <d S)z+Initialize the module as appropriate for NTrZLIBDESTZ platstdlibZ BINLIBDESTr!Z INCLUDEPYz.pydZSOz.exeZEXEZVERSIONZBINDIRN)r_PY_VERSION_SHORT_NO_DOTrrdirnamerr[ executablerOrrr_init_non_posixts   rcCs|dkr i}td}td}|}|s.q||}|rx|dd\}}z t|}Wntk rlYnX|||<q ||}|r d||d<q |S)zParse a config.h-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. Nz"#define ([A-Z][A-Za-z0-9_]+) (.*) z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/ rrr)rirjreadlinerpr1rrrs)fprLZ define_rxZundef_rxrrrrrrrrs&      cCs:tr$tjdkrtjtd}q,t}ntd}tj|dS)zReturn the path of pyconfig.h.rZPCr"z pyconfig.h)r)rr3rrrr)Zinc_dirrrrrs  cCstttS)z,Return a tuple containing the schemes names.)r8sortedr(r9rrrrr scCs tdS)z*Return a tuple containing the paths names.r )r(Zoptionsrrrrr sTcCs&t|rt||Stt|SdS)zReturn a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. N)r-rNr:r(r7)r,rLexpandrrrr s cCst||||S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r3r,rLrrrrrscGstdkrziattd<ttd<ttd<ttd<tdtdtd<ttd <ttd <ttd <ztjtd <Wntk rd td <YnXt j dkrt tt j dkrt ttj dkrttd<dtkrttd<nttdtd<tr\t j dkr\t}z t }Wntk rd}YnXt jtds\||kr\t j|td}t j|td<tjdkrzt d}t|dd}|dkrdD]2}t|}tdd|}tdd|}|t|<qndt jkrt jd}dD]0}t|}tdd|}|d|}|t|<qtdd } td| } | dk rz| d} t j!| szdD]$}t|}tdd|}|t|<qT|rg} |D]} | "t| q| StSdS)ayWith no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary. Nprefix exec_prefixZ py_versionZpy_version_shortrrZpy_version_nodotr_ZplatbaseZ projectbaserre)rZos2rIz2.6userbasesrcdirrXr)rhZ BASECFLAGSrgZ PY_CFLAGSrz -arch\s+\w+\s z-isysroot [^ ]*Z ARCHFLAGSrgz-isysroot\s+(\S+)rz-isysroot\s+\S+(\s|$))# _CONFIG_VARS_PREFIX _EXEC_PREFIX _PY_VERSIONrrr[rAttributeErrorrr3rrversionr`rr)getcwdrrisabsrrKr\unamerrsplitrir<rArZrvr1existsappend)rSr_cwdrZkernel_versionZ major_versionrGflagsZarchrgrZsdkZvalsr3rrrrs                   cCs t|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) )rrZ)r3rrrrRscCs^tjdkrnd}tj|}|dkr(tjStjd|}tj|t||}|dkr\dS|dkrhdStjStjd ksttd stjSt \}}}}}| d d }| d d}| d d}|dddkrd||fS|dddkr&|ddkrPd}dt |dd|ddf}n*|dddkrDd||fS|dddkrdd|||fS|ddd krd }t d!} | |} | rP| }n|ddd"krPt} | d#} | } z td$}Wntk rYnJXzt d%|} W5|X| dk r2d&| d'd&dd} | s<| } | rP| }d(}| d&d)krd*td+d krd,}td+}t d-|}ttt|}t|d'kr|d}n^|d.krd,}nN|d/krd0}n>|d1krd2}n.|d3krd4}n|d5krd6}ntd7|fn<|d8kr0tjd9krPd:}n |d;krPtjd9krLd<}nd=}d>|||fS)?aReturn a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rz bit ()Zamd64z win-amd64Zitaniumzwin-ia64rIr/rer_-NZlinuxz%s-%sZsunosr5Zsolarisz%d.%sr@rZirixZaixz%s-%s.%scygwinz[\d.]+rXZMACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?)rrZmacosxz10.4.z-archrgZfatz -arch\s+(\S+))i386ppc)rx86_64Zintel)rrrZfat3)ppc64rZfat64)rrrrZ universalz%Don't know machine value for archs=%rrlr)ZPowerPCZPower_Macintoshrrz%s-%s-%s) rr3r[rr&r\rulowerrrrqrrrirjrpr1rrZrlrcloservreadrrrofindallr8rr*rsmaxsize)rijZlookZosnameZhostreleasermachineZrel_rerZcfgvarsZmacverZ macreleaser~ZcflagsZarchsrrrr [s     $                    cCstSr)rrrrrr scCsFtt|D]0\}\}}|dkr0td|td||fqdS)Nrz%s: z %s = "%s") enumeraterr7print)titledataindexrGr>rrr _print_dicts rcCsRtdttdttdtttdtttdtdS)z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ VariablesN)rr r rQrr rrrrr_mains r__main__)N)N)A__doc__rkrrir[Zos.pathrrZ configparser ImportErrorZ ConfigParser__all__rrrrrrr3rrrr)r#r-ZRawConfigParserr(rjr;r?rrrrrrKrrrrrZ _USER_BASErErHrNrPrQr`rrrrrrr r r rrrr r rrr$rrrrs  "" #   v     # PKd]߿;distlib/_backport/__pycache__/__init__.cpython-38.opt-1.pycnu[U .e@sdZdS)a Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N)__doc__rrJ/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/__init__.pyPKd]=a==<distlib/_backport/__pycache__/sysconfig.cpython-38.opt-1.pycnu[U .eTi @sdZddlZddlZddlZddlZddlmZmZz ddlZWne k r\ddl ZYnXdddddd d d d d dg Z ddZ ej reje ej Zn e eZejdkrdeddkre ejeeZejdkr deddkr e ejeeeZejdkrBdeddkrBe ejeeeZddZeZdaddZeZedZddZejdZ ejdd Z!e de d!Z"ej#ej$Z%ej#ej&Z'da(dZ)d"d#Z*d$d%Z+d&d'Z,d(d)Z-d*d+Z.d,d-Z/dEd.d/Z0d0dZ1d1d2Z2d3d4Z3dFd5dZ4d6dZ5d7d Z6d8d Z7e.dd9fd:d Z8e.dd9fd;dZ9dd ZdBdCZ?e@dDkre?dS)Gz-Access to Python's configuration information.N)pardirrealpathget_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hcCs(z t|WStk r"|YSXdSN)rOSError)pathrK/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/sysconfig.py_safe_realpath"s rntZpcbuildiz\pc\viz\pcbuild\amd64icCs,dD]"}tjtjtd|rdSqdS)N)z Setup.distz Setup.localZModulesTF)osrisfilejoin _PROJECT_BASE)fnrrris_python_build:srFc Csts~ddlm}tddd}||}|d}|}t|W5QRXt rzdD] }t |dd t |d d qXd adS) N)finder.rz sysconfig.cfg) posix_prefixZ posix_homeincludez{srcdir}/Include platincludez{projectbase}/.T) _cfg_readZ resourcesr__name__rsplitfindZ as_stream_SCHEMESZreadfp _PYTHON_BUILDset)rZbackport_packageZ_finderZ_cfgfilesschemerrr_ensure_cfg_readDs   r,z \{([^{]*?)\}c st|dr|d}nt}|}|D]8}|dkr._replacer) r,Z has_sectionitemstuplesectionsZ has_optionr)Zremove_sectiondict _VAR_REPLsub)configr-r8ZsectionZoptionvaluer5rr3r_expand_globalsYs$       r>rcsfdd}t||S)zIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. cs8|d}|kr|S|tjkr.tj|S|dSr.)r0renvironr1 local_varsrrr5s    z_subst_vars.._replacerr:r;)rrBr5rrAr _subst_varss rDcCs0|}|D]\}}||kr"q|||<qdSr)keysr6)Z target_dictZ other_dictZ target_keyskeyr=rrr _extend_dicts rGcCs`i}|dkri}t|tt|D]4\}}tjdkrDtj|}tjt ||||<q&|S)N)posixr) rGrr'r6rr2r expandusernormpathrD)r+varsresrFr=rrr _expand_varss   rMcsfdd}t||S)Ncs$|d}|kr|S|dSr.r/r1rKrrr5s zformat_value.._replacerrC)r=rKr5rrNr format_values rOcCstjdkrdStjS)NrHr )rr2rrrr_get_default_schemes rPcCstjdd}dd}tjdkrBtjdp.d}|r8|S||dStjdkr|td }|r||r`|S|dd |d tjdd S|r|S|dd SdS)NPYTHONUSERBASEcWstjtjj|Sr)rrrIr)argsrrrjoinusersz_getuserbase..joinuserrAPPDATA~PythondarwinZPYTHONFRAMEWORKLibraryz%d.%drz.local)rr@getr2sysplatformr version_info)env_baserSbaseZ frameworkrrr _getuserbases$     r_c Cstd}td}td}|dkr*i}i}i}tj|ddd}|}W5QRX|D]} | dsZ| d krvqZ|| } | rZ| d d \} } | } | d d } d | kr| || <qZz t | } Wn$t k r| d d || <YqZX| || <qZt | }d}t|dkrt|D]}||}||p>||} | dk r| d } d}| |krpt|| }n| |krd}nx| tjkrtj| }n`| |kr|dr|dd|krd }n$d| |krd}nt|d| }n d || <}|r|| d}|d| ||}d |kr:|||<n~z t |}Wn"t k rh|||<Yn X|||<|||dr|dd|kr|dd}||kr|||<n|||<||qq|D]"\}} t| tr| ||<q|||S)zParse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. z"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}Nzutf-8surrogateescape)encodingerrors#rrz$$$)CFLAGSLDFLAGSZCPPFLAGSrTFZPY_r?)recompilecodecsopen readlines startswithstripmatchr0replaceint ValueErrorlistrElenr7searchstrrr@endstartremover6 isinstanceupdate)filenamerKZ _variable_rxZ _findvar1_rxZ _findvar2_rxZdoneZnotdoneflineslinemnvZtmpvr4Zrenamed_variablesr2r=founditemZafterkrrr_parse_makefiles                            rcCsDtrtjtdSttdr,dttjf}nd}tjt d|dS)z Return the path of the Makefile.ZMakefileabiflagsz config-%s%sr<stdlib) r(rrrrhasattrrZ_PY_VERSION_SHORTrr)Zconfig_dir_namerrrrMs  c Cst}zt||WnJtk r^}z,d|}t|drF|d|j}t|W5d}~XYnXt}z"t|}t||W5QRXWnJtk r}z,d|}t|dr|d|j}t|W5d}~XYnXtr|d|d<dS)z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sstrerrorz (%s)N BLDSHAREDZLDSHARED) rrIOErrorrrrrkrr()rKZmakefileemsgZconfig_hr}rrr _init_posixXs&   rcCsVtd|d<td|d<td|d<d|d<d |d <t|d <tjttj|d <d S)z+Initialize the module as appropriate for NTrZLIBDESTZ platstdlibZ BINLIBDESTr!Z INCLUDEPYz.pydZSOz.exeZEXEZVERSIONZBINDIRN)r_PY_VERSION_SHORT_NO_DOTrrdirnamerrZ executablerNrrr_init_non_posixts   rcCs|dkr i}td}td}|}|s.q||}|rx|dd\}}z t|}Wntk rlYnX|||<q ||}|r d||d<q |S)zParse a config.h-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. Nz"#define ([A-Z][A-Za-z0-9_]+) (.*) z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/ rrr)rhrireadlineror0rqrr)fprKZ define_rxZundef_rxrrrrrrrrs&      cCs:tr$tjdkrtjtd}q,t}ntd}tj|dS)zReturn the path of pyconfig.h.rZPCr"z pyconfig.h)r(rr2rrrr)Zinc_dirrrrrs  cCstttS)z,Return a tuple containing the schemes names.)r7sortedr'r8rrrrr scCs tdS)z*Return a tuple containing the paths names.r )r'Zoptionsrrrrr sTcCs&t|rt||Stt|SdS)zReturn a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. N)r,rMr9r'r6)r+rKexpandrrrr s cCst||||S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r2r+rKrrrrrscGstdkrziattd<ttd<ttd<ttd<tdtdtd<ttd <ttd <ttd <ztjtd <Wntk rd td <YnXt j dkrt tt j dkrt ttj dkrttd<dtkrttd<nttdtd<tr\t j dkr\t}z t }Wntk rd}YnXt jtds\||kr\t j|td}t j|td<tjdkrzt d}t|dd}|dkrdD]2}t|}tdd|}tdd|}|t|<qndt jkrt jd}dD]0}t|}tdd|}|d|}|t|<qtdd } td| } | dk rz| d} t j!| szdD]$}t|}tdd|}|t|<qT|rg} |D]} | "t| q| StSdS)ayWith no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary. Nprefix exec_prefixZ py_versionZpy_version_shortrrZpy_version_nodotr^ZplatbaseZ projectbaserrd)rZos2rHz2.6userbasesrcdirrWr)rgZ BASECFLAGSrfZ PY_CFLAGSrz -arch\s+\w+\s z-isysroot [^ ]*Z ARCHFLAGSrfz-isysroot\s+(\S+)rz-isysroot\s+\S+(\s|$))# _CONFIG_VARS_PREFIX _EXEC_PREFIX _PY_VERSIONrrrZrAttributeErrorrr2rrversionr_rr(getcwdrrisabsrrJr[unamerqsplitrhr;r@rYrur0existsappend)rRr^cwdrZkernel_versionZ major_versionrFflagsZarchrfrZsdkZvalsr2rrrrs                   cCs t|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) )rrY)r2rrrrRscCs^tjdkrnd}tj|}|dkr(tjStjd|}tj|t||}|dkr\dS|dkrhdStjStjd ksttd stjSt \}}}}}| d d }| d d}| d d}|dddkrd||fS|dddkr&|ddkrPd}dt |dd|ddf}n*|dddkrDd||fS|dddkrdd|||fS|ddd krd }t d!} | |} | rP| }n|ddd"krPt} | d#} | } z td$}Wntk rYnJXzt d%|} W5|X| dk r2d&| d'd&dd} | s<| } | rP| }d(}| d&d)krd*td+d krd,}td+}t d-|}ttt|}t|d'kr|d}n^|d.krd,}nN|d/krd0}n>|d1krd2}n.|d3krd4}n|d5krd6}ntd7|fn<|d8kr0tjd9krPd:}n |d;krPtjd9krLd<}nd=}d>|||fS)?aReturn a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rz bit ()Zamd64z win-amd64Zitaniumzwin-ia64rHr/rdr_-NZlinuxz%s-%sZsunosr5Zsolarisz%d.%sr?rZirixZaixz%s-%s.%scygwinz[\d.]+rWZMACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?)rrZmacosxz10.4.z-archrfZfatz -arch\s+(\S+))i386ppc)rx86_64Zintel)rrrZfat3)ppc64rZfat64)rrrrZ universalz%Don't know machine value for archs=%rrlr)ZPowerPCZPower_Macintoshrrz%s-%s-%s) rr2rZrr&r[rtlowerrrrprqrhriror0rrYrkrcloserureadrrrnfindallr7rr)rrmaxsize)rijZlookZosnameZhostreleasermachineZrel_rerZcfgvarsZmacverZ macreleaser}ZcflagsZarchsrrrr [s     $                    cCstSr)rrrrrr scCsFtt|D]0\}\}}|dkr0td|td||fqdS)Nrz%s: z %s = "%s") enumeraterr6print)titledataindexrFr=rrr _print_dicts rcCsRtdttdttdtttdtttdtdS)z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ VariablesN)rr r rPrr rrrrr_mains r__main__)N)N)A__doc__rjrrhrZZos.pathrrZ configparser ImportErrorZ ConfigParser__all__rrrrrrr2rrrr(r#r,ZRawConfigParserr'rir:r>rrrrrrJrrrrrZ _USER_BASErDrGrMrOrPr_rrrrrrr r r rrrr r rrr$rrrrs  "" #   v     # PKd]/edistlib/_backport/misc.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Backports for individual classes and functions.""" import os import sys __all__ = ['cache_from_source', 'callable', 'fsencode'] try: from imp import cache_from_source except ImportError: def cache_from_source(py_file, debug=__debug__): ext = debug and 'c' or 'o' return py_file + ext try: callable = callable except NameError: from collections import Callable def callable(obj): return isinstance(obj, Callable) try: fsencode = os.fsencode except AttributeError: def fsencode(filename): if isinstance(filename, bytes): return filename elif isinstance(filename, str): return filename.encode(sys.getfilesystemencoding()) else: raise TypeError("expect bytes or str, not %s" % type(filename).__name__) PKd]o9 9 distlib/_backport/sysconfig.cfgnu[[posix_prefix] # Configuration directories. Some of these come straight out of the # configure script. They are for implementing the other variables, not to # be used directly in [resource_locations]. confdir = /etc datadir = /usr/share libdir = /usr/lib statedir = /var # User resource directory local = ~/.local/{distribution.name} stdlib = {base}/lib/python{py_version_short} platstdlib = {platbase}/lib/python{py_version_short} purelib = {base}/lib/python{py_version_short}/site-packages platlib = {platbase}/lib/python{py_version_short}/site-packages include = {base}/include/python{py_version_short}{abiflags} platinclude = {platbase}/include/python{py_version_short}{abiflags} data = {base} [posix_home] stdlib = {base}/lib/python platstdlib = {base}/lib/python purelib = {base}/lib/python platlib = {base}/lib/python include = {base}/include/python platinclude = {base}/include/python scripts = {base}/bin data = {base} [nt] stdlib = {base}/Lib platstdlib = {base}/Lib purelib = {base}/Lib/site-packages platlib = {base}/Lib/site-packages include = {base}/Include platinclude = {base}/Include scripts = {base}/Scripts data = {base} [os2] stdlib = {base}/Lib platstdlib = {base}/Lib purelib = {base}/Lib/site-packages platlib = {base}/Lib/site-packages include = {base}/Include platinclude = {base}/Include scripts = {base}/Scripts data = {base} [os2_home] stdlib = {userbase}/lib/python{py_version_short} platstdlib = {userbase}/lib/python{py_version_short} purelib = {userbase}/lib/python{py_version_short}/site-packages platlib = {userbase}/lib/python{py_version_short}/site-packages include = {userbase}/include/python{py_version_short} scripts = {userbase}/bin data = {userbase} [nt_user] stdlib = {userbase}/Python{py_version_nodot} platstdlib = {userbase}/Python{py_version_nodot} purelib = {userbase}/Python{py_version_nodot}/site-packages platlib = {userbase}/Python{py_version_nodot}/site-packages include = {userbase}/Python{py_version_nodot}/Include scripts = {userbase}/Scripts data = {userbase} [posix_user] stdlib = {userbase}/lib/python{py_version_short} platstdlib = {userbase}/lib/python{py_version_short} purelib = {userbase}/lib/python{py_version_short}/site-packages platlib = {userbase}/lib/python{py_version_short}/site-packages include = {userbase}/include/python{py_version_short} scripts = {userbase}/bin data = {userbase} [osx_framework_user] stdlib = {userbase}/lib/python platstdlib = {userbase}/lib/python purelib = {userbase}/lib/python/site-packages platlib = {userbase}/lib/python/site-packages include = {userbase}/include scripts = {userbase}/bin data = {userbase} PKd]#gdistlib/_backport/__init__.pynu["""Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. """ PKd]R(distlib/util.pynu[# # Copyright (C) 2012-2017 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import socket try: import ssl except ImportError: # pragma: no cover ssl = None import subprocess import sys import tarfile import tempfile import textwrap try: import threading except ImportError: # pragma: no cover import dummy_threading as threading import time from . import DistlibException from .compat import (string_types, text_type, shutil, raw_input, StringIO, cache_from_source, urlopen, urljoin, httplib, xmlrpclib, splittype, HTTPHandler, BaseConfigurator, valid_ident, Container, configparser, URLError, ZipFile, fsdecode, unquote, urlparse) logger = logging.getLogger(__name__) # # Requirement parsing code as per PEP 508 # IDENTIFIER = re.compile(r'^([\w\.-]+)\s*') VERSION_IDENTIFIER = re.compile(r'^([\w\.*+-]+)\s*') COMPARE_OP = re.compile(r'^(<=?|>=?|={2,3}|[~!]=)\s*') MARKER_OP = re.compile(r'^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*') OR = re.compile(r'^or\b\s*') AND = re.compile(r'^and\b\s*') NON_SPACE = re.compile(r'(\S+)\s*') STRING_CHUNK = re.compile(r'([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)') def parse_marker(marker_string): """ Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). """ def marker_var(remaining): # either identifier, or literal string m = IDENTIFIER.match(remaining) if m: result = m.groups()[0] remaining = remaining[m.end():] elif not remaining: raise SyntaxError('unexpected end of input') else: q = remaining[0] if q not in '\'"': raise SyntaxError('invalid expression: %s' % remaining) oq = '\'"'.replace(q, '') remaining = remaining[1:] parts = [q] while remaining: # either a string chunk, or oq, or q to terminate if remaining[0] == q: break elif remaining[0] == oq: parts.append(oq) remaining = remaining[1:] else: m = STRING_CHUNK.match(remaining) if not m: raise SyntaxError('error in string literal: %s' % remaining) parts.append(m.groups()[0]) remaining = remaining[m.end():] else: s = ''.join(parts) raise SyntaxError('unterminated string: %s' % s) parts.append(q) result = ''.join(parts) remaining = remaining[1:].lstrip() # skip past closing quote return result, remaining def marker_expr(remaining): if remaining and remaining[0] == '(': result, remaining = marker(remaining[1:].lstrip()) if remaining[0] != ')': raise SyntaxError('unterminated parenthesis: %s' % remaining) remaining = remaining[1:].lstrip() else: lhs, remaining = marker_var(remaining) while remaining: m = MARKER_OP.match(remaining) if not m: break op = m.groups()[0] remaining = remaining[m.end():] rhs, remaining = marker_var(remaining) lhs = {'op': op, 'lhs': lhs, 'rhs': rhs} result = lhs return result, remaining def marker_and(remaining): lhs, remaining = marker_expr(remaining) while remaining: m = AND.match(remaining) if not m: break remaining = remaining[m.end():] rhs, remaining = marker_expr(remaining) lhs = {'op': 'and', 'lhs': lhs, 'rhs': rhs} return lhs, remaining def marker(remaining): lhs, remaining = marker_and(remaining) while remaining: m = OR.match(remaining) if not m: break remaining = remaining[m.end():] rhs, remaining = marker_and(remaining) lhs = {'op': 'or', 'lhs': lhs, 'rhs': rhs} return lhs, remaining return marker(marker_string) def parse_requirement(req): """ Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. """ remaining = req.strip() if not remaining or remaining.startswith('#'): return None m = IDENTIFIER.match(remaining) if not m: raise SyntaxError('name expected: %s' % remaining) distname = m.groups()[0] remaining = remaining[m.end():] extras = mark_expr = versions = uri = None if remaining and remaining[0] == '[': i = remaining.find(']', 1) if i < 0: raise SyntaxError('unterminated extra: %s' % remaining) s = remaining[1:i] remaining = remaining[i + 1:].lstrip() extras = [] while s: m = IDENTIFIER.match(s) if not m: raise SyntaxError('malformed extra: %s' % s) extras.append(m.groups()[0]) s = s[m.end():] if not s: break if s[0] != ',': raise SyntaxError('comma expected in extras: %s' % s) s = s[1:].lstrip() if not extras: extras = None if remaining: if remaining[0] == '@': # it's a URI remaining = remaining[1:].lstrip() m = NON_SPACE.match(remaining) if not m: raise SyntaxError('invalid URI: %s' % remaining) uri = m.groups()[0] t = urlparse(uri) # there are issues with Python and URL parsing, so this test # is a bit crude. See bpo-20271, bpo-23505. Python doesn't # always parse invalid URLs correctly - it should raise # exceptions for malformed URLs if not (t.scheme and t.netloc): raise SyntaxError('Invalid URL: %s' % uri) remaining = remaining[m.end():].lstrip() else: def get_versions(ver_remaining): """ Return a list of operator, version tuples if any are specified, else None. """ m = COMPARE_OP.match(ver_remaining) versions = None if m: versions = [] while True: op = m.groups()[0] ver_remaining = ver_remaining[m.end():] m = VERSION_IDENTIFIER.match(ver_remaining) if not m: raise SyntaxError('invalid version: %s' % ver_remaining) v = m.groups()[0] versions.append((op, v)) ver_remaining = ver_remaining[m.end():] if not ver_remaining or ver_remaining[0] != ',': break ver_remaining = ver_remaining[1:].lstrip() m = COMPARE_OP.match(ver_remaining) if not m: raise SyntaxError('invalid constraint: %s' % ver_remaining) if not versions: versions = None return versions, ver_remaining if remaining[0] != '(': versions, remaining = get_versions(remaining) else: i = remaining.find(')', 1) if i < 0: raise SyntaxError('unterminated parenthesis: %s' % remaining) s = remaining[1:i] remaining = remaining[i + 1:].lstrip() # As a special diversion from PEP 508, allow a version number # a.b.c in parentheses as a synonym for ~= a.b.c (because this # is allowed in earlier PEPs) if COMPARE_OP.match(s): versions, _ = get_versions(s) else: m = VERSION_IDENTIFIER.match(s) if not m: raise SyntaxError('invalid constraint: %s' % s) v = m.groups()[0] s = s[m.end():].lstrip() if s: raise SyntaxError('invalid constraint: %s' % s) versions = [('~=', v)] if remaining: if remaining[0] != ';': raise SyntaxError('invalid requirement: %s' % remaining) remaining = remaining[1:].lstrip() mark_expr, remaining = parse_marker(remaining) if remaining and remaining[0] != '#': raise SyntaxError('unexpected trailing data: %s' % remaining) if not versions: rs = distname else: rs = '%s %s' % (distname, ', '.join(['%s %s' % con for con in versions])) return Container(name=distname, extras=extras, constraints=versions, marker=mark_expr, url=uri, requirement=rs) def get_resources_dests(resources_root, rules): """Find destinations for resources files""" def get_rel_path(root, path): # normalizes and returns a lstripped-/-separated path root = root.replace(os.path.sep, '/') path = path.replace(os.path.sep, '/') assert path.startswith(root) return path[len(root):].lstrip('/') destinations = {} for base, suffix, dest in rules: prefix = os.path.join(resources_root, base) for abs_base in iglob(prefix): abs_glob = os.path.join(abs_base, suffix) for abs_path in iglob(abs_glob): resource_file = get_rel_path(resources_root, abs_path) if dest is None: # remove the entry if it was here destinations.pop(resource_file, None) else: rel_path = get_rel_path(abs_base, abs_path) rel_dest = dest.replace(os.path.sep, '/').rstrip('/') destinations[resource_file] = rel_dest + '/' + rel_path return destinations def in_venv(): if hasattr(sys, 'real_prefix'): # virtualenv venvs result = True else: # PEP 405 venvs result = sys.prefix != getattr(sys, 'base_prefix', sys.prefix) return result def get_executable(): # The __PYVENV_LAUNCHER__ dance is apparently no longer needed, as # changes to the stub launcher mean that sys.executable always points # to the stub on OS X # if sys.platform == 'darwin' and ('__PYVENV_LAUNCHER__' # in os.environ): # result = os.environ['__PYVENV_LAUNCHER__'] # else: # result = sys.executable # return result result = os.path.normcase(sys.executable) if not isinstance(result, text_type): result = fsdecode(result) return result def proceed(prompt, allowed_chars, error_prompt=None, default=None): p = prompt while True: s = raw_input(p) p = prompt if not s and default: s = default if s: c = s[0].lower() if c in allowed_chars: break if error_prompt: p = '%c: %s\n%s' % (c, error_prompt, prompt) return c def extract_by_key(d, keys): if isinstance(keys, string_types): keys = keys.split() result = {} for key in keys: if key in d: result[key] = d[key] return result def read_exports(stream): if sys.version_info[0] >= 3: # needs to be a text stream stream = codecs.getreader('utf-8')(stream) # Try to load as JSON, falling back on legacy format data = stream.read() stream = StringIO(data) try: jdata = json.load(stream) result = jdata['extensions']['python.exports']['exports'] for group, entries in result.items(): for k, v in entries.items(): s = '%s = %s' % (k, v) entry = get_export_entry(s) assert entry is not None entries[k] = entry return result except Exception: stream.seek(0, 0) def read_stream(cp, stream): if hasattr(cp, 'read_file'): cp.read_file(stream) else: cp.readfp(stream) cp = configparser.ConfigParser() try: read_stream(cp, stream) except configparser.MissingSectionHeaderError: stream.close() data = textwrap.dedent(data) stream = StringIO(data) read_stream(cp, stream) result = {} for key in cp.sections(): result[key] = entries = {} for name, value in cp.items(key): s = '%s = %s' % (name, value) entry = get_export_entry(s) assert entry is not None #entry.dist = self entries[name] = entry return result def write_exports(exports, stream): if sys.version_info[0] >= 3: # needs to be a text stream stream = codecs.getwriter('utf-8')(stream) cp = configparser.ConfigParser() for k, v in exports.items(): # TODO check k, v for valid values cp.add_section(k) for entry in v.values(): if entry.suffix is None: s = entry.prefix else: s = '%s:%s' % (entry.prefix, entry.suffix) if entry.flags: s = '%s [%s]' % (s, ', '.join(entry.flags)) cp.set(k, entry.name, s) cp.write(stream) @contextlib.contextmanager def tempdir(): td = tempfile.mkdtemp() try: yield td finally: shutil.rmtree(td) @contextlib.contextmanager def chdir(d): cwd = os.getcwd() try: os.chdir(d) yield finally: os.chdir(cwd) @contextlib.contextmanager def socket_timeout(seconds=15): cto = socket.getdefaulttimeout() try: socket.setdefaulttimeout(seconds) yield finally: socket.setdefaulttimeout(cto) class cached_property(object): def __init__(self, func): self.func = func #for attr in ('__name__', '__module__', '__doc__'): # setattr(self, attr, getattr(func, attr, None)) def __get__(self, obj, cls=None): if obj is None: return self value = self.func(obj) object.__setattr__(obj, self.func.__name__, value) #obj.__dict__[self.func.__name__] = value = self.func(obj) return value def convert_path(pathname): """Return 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises ValueError on non-Unix-ish systems if 'pathname' either starts or ends with a slash. """ if os.sep == '/': return pathname if not pathname: return pathname if pathname[0] == '/': raise ValueError("path '%s' cannot be absolute" % pathname) if pathname[-1] == '/': raise ValueError("path '%s' cannot end with '/'" % pathname) paths = pathname.split('/') while os.curdir in paths: paths.remove(os.curdir) if not paths: return os.curdir return os.path.join(*paths) class FileOperator(object): def __init__(self, dry_run=False): self.dry_run = dry_run self.ensured = set() self._init_record() def _init_record(self): self.record = False self.files_written = set() self.dirs_created = set() def record_as_written(self, path): if self.record: self.files_written.add(path) def newer(self, source, target): """Tell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". """ if not os.path.exists(source): raise DistlibException("file '%r' does not exist" % os.path.abspath(source)) if not os.path.exists(target): return True return os.stat(source).st_mtime > os.stat(target).st_mtime def copy_file(self, infile, outfile, check=True): """Copy a file respecting dry-run and force flags. """ self.ensure_dir(os.path.dirname(outfile)) logger.info('Copying %s to %s', infile, outfile) if not self.dry_run: msg = None if check: if os.path.islink(outfile): msg = '%s is a symlink' % outfile elif os.path.exists(outfile) and not os.path.isfile(outfile): msg = '%s is a non-regular file' % outfile if msg: raise ValueError(msg + ' which would be overwritten') shutil.copyfile(infile, outfile) self.record_as_written(outfile) def copy_stream(self, instream, outfile, encoding=None): assert not os.path.isdir(outfile) self.ensure_dir(os.path.dirname(outfile)) logger.info('Copying stream %s to %s', instream, outfile) if not self.dry_run: if encoding is None: outstream = open(outfile, 'wb') else: outstream = codecs.open(outfile, 'w', encoding=encoding) try: shutil.copyfileobj(instream, outstream) finally: outstream.close() self.record_as_written(outfile) def write_binary_file(self, path, data): self.ensure_dir(os.path.dirname(path)) if not self.dry_run: if os.path.exists(path): os.remove(path) with open(path, 'wb') as f: f.write(data) self.record_as_written(path) def write_text_file(self, path, data, encoding): self.write_binary_file(path, data.encode(encoding)) def set_mode(self, bits, mask, files): if os.name == 'posix' or (os.name == 'java' and os._name == 'posix'): # Set the executable bits (owner, group, and world) on # all the files specified. for f in files: if self.dry_run: logger.info("changing mode of %s", f) else: mode = (os.stat(f).st_mode | bits) & mask logger.info("changing mode of %s to %o", f, mode) os.chmod(f, mode) set_executable_mode = lambda s, f: s.set_mode(0o555, 0o7777, f) def ensure_dir(self, path): path = os.path.abspath(path) if path not in self.ensured and not os.path.exists(path): self.ensured.add(path) d, f = os.path.split(path) self.ensure_dir(d) logger.info('Creating %s' % path) if not self.dry_run: os.mkdir(path) if self.record: self.dirs_created.add(path) def byte_compile(self, path, optimize=False, force=False, prefix=None, hashed_invalidation=False): dpath = cache_from_source(path, not optimize) logger.info('Byte-compiling %s to %s', path, dpath) if not self.dry_run: if force or self.newer(path, dpath): if not prefix: diagpath = None else: assert path.startswith(prefix) diagpath = path[len(prefix):] compile_kwargs = {} if hashed_invalidation and hasattr(py_compile, 'PycInvalidationMode'): compile_kwargs['invalidation_mode'] = py_compile.PycInvalidationMode.CHECKED_HASH py_compile.compile(path, dpath, diagpath, True, **compile_kwargs) # raise error self.record_as_written(dpath) return dpath def ensure_removed(self, path): if os.path.exists(path): if os.path.isdir(path) and not os.path.islink(path): logger.debug('Removing directory tree at %s', path) if not self.dry_run: shutil.rmtree(path) if self.record: if path in self.dirs_created: self.dirs_created.remove(path) else: if os.path.islink(path): s = 'link' else: s = 'file' logger.debug('Removing %s %s', s, path) if not self.dry_run: os.remove(path) if self.record: if path in self.files_written: self.files_written.remove(path) def is_writable(self, path): result = False while not result: if os.path.exists(path): result = os.access(path, os.W_OK) break parent = os.path.dirname(path) if parent == path: break path = parent return result def commit(self): """ Commit recorded changes, turn off recording, return changes. """ assert self.record result = self.files_written, self.dirs_created self._init_record() return result def rollback(self): if not self.dry_run: for f in list(self.files_written): if os.path.exists(f): os.remove(f) # dirs should all be empty now, except perhaps for # __pycache__ subdirs # reverse so that subdirs appear before their parents dirs = sorted(self.dirs_created, reverse=True) for d in dirs: flist = os.listdir(d) if flist: assert flist == ['__pycache__'] sd = os.path.join(d, flist[0]) os.rmdir(sd) os.rmdir(d) # should fail if non-empty self._init_record() def resolve(module_name, dotted_path): if module_name in sys.modules: mod = sys.modules[module_name] else: mod = __import__(module_name) if dotted_path is None: result = mod else: parts = dotted_path.split('.') result = getattr(mod, parts.pop(0)) for p in parts: result = getattr(result, p) return result class ExportEntry(object): def __init__(self, name, prefix, suffix, flags): self.name = name self.prefix = prefix self.suffix = suffix self.flags = flags @cached_property def value(self): return resolve(self.prefix, self.suffix) def __repr__(self): # pragma: no cover return '' % (self.name, self.prefix, self.suffix, self.flags) def __eq__(self, other): if not isinstance(other, ExportEntry): result = False else: result = (self.name == other.name and self.prefix == other.prefix and self.suffix == other.suffix and self.flags == other.flags) return result __hash__ = object.__hash__ ENTRY_RE = re.compile(r'''(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? ''', re.VERBOSE) def get_export_entry(specification): m = ENTRY_RE.search(specification) if not m: result = None if '[' in specification or ']' in specification: raise DistlibException("Invalid specification " "'%s'" % specification) else: d = m.groupdict() name = d['name'] path = d['callable'] colons = path.count(':') if colons == 0: prefix, suffix = path, None else: if colons != 1: raise DistlibException("Invalid specification " "'%s'" % specification) prefix, suffix = path.split(':') flags = d['flags'] if flags is None: if '[' in specification or ']' in specification: raise DistlibException("Invalid specification " "'%s'" % specification) flags = [] else: flags = [f.strip() for f in flags.split(',')] result = ExportEntry(name, prefix, suffix, flags) return result def get_cache_base(suffix=None): """ Return the default base location for distlib caches. If the directory does not exist, it is created. Use the suffix provided for the base directory, and default to '.distlib' if it isn't provided. On Windows, if LOCALAPPDATA is defined in the environment, then it is assumed to be a directory, and will be the parent directory of the result. On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home directory - using os.expanduser('~') - will be the parent directory of the result. The result is just the directory '.distlib' in the parent directory as determined above, or with the name specified with ``suffix``. """ if suffix is None: suffix = '.distlib' if os.name == 'nt' and 'LOCALAPPDATA' in os.environ: result = os.path.expandvars('$localappdata') else: # Assume posix, or old Windows result = os.path.expanduser('~') # we use 'isdir' instead of 'exists', because we want to # fail if there's a file with that name if os.path.isdir(result): usable = os.access(result, os.W_OK) if not usable: logger.warning('Directory exists but is not writable: %s', result) else: try: os.makedirs(result) usable = True except OSError: logger.warning('Unable to create %s', result, exc_info=True) usable = False if not usable: result = tempfile.mkdtemp() logger.warning('Default location unusable, using %s', result) return os.path.join(result, suffix) def path_to_cache_dir(path): """ Convert an absolute path to a directory name for use in a cache. The algorithm used is: #. On Windows, any ``':'`` in the drive is replaced with ``'---'``. #. Any occurrence of ``os.sep`` is replaced with ``'--'``. #. ``'.cache'`` is appended. """ d, p = os.path.splitdrive(os.path.abspath(path)) if d: d = d.replace(':', '---') p = p.replace(os.sep, '--') return d + p + '.cache' def ensure_slash(s): if not s.endswith('/'): return s + '/' return s def parse_credentials(netloc): username = password = None if '@' in netloc: prefix, netloc = netloc.rsplit('@', 1) if ':' not in prefix: username = prefix else: username, password = prefix.split(':', 1) if username: username = unquote(username) if password: password = unquote(password) return username, password, netloc def get_process_umask(): result = os.umask(0o22) os.umask(result) return result def is_string_sequence(seq): result = True i = None for i, s in enumerate(seq): if not isinstance(s, string_types): result = False break assert i is not None return result PROJECT_NAME_AND_VERSION = re.compile('([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-' '([a-z0-9_.+-]+)', re.I) PYTHON_VERSION = re.compile(r'-py(\d\.?\d?)') def split_filename(filename, project_name=None): """ Extract name, version, python version from a filename (no extension) Return name, version, pyver or None """ result = None pyver = None filename = unquote(filename).replace(' ', '-') m = PYTHON_VERSION.search(filename) if m: pyver = m.group(1) filename = filename[:m.start()] if project_name and len(filename) > len(project_name) + 1: m = re.match(re.escape(project_name) + r'\b', filename) if m: n = m.end() result = filename[:n], filename[n + 1:], pyver if result is None: m = PROJECT_NAME_AND_VERSION.match(filename) if m: result = m.group(1), m.group(3), pyver return result # Allow spaces in name because of legacy dists like "Twisted Core" NAME_VERSION_RE = re.compile(r'(?P[\w .-]+)\s*' r'\(\s*(?P[^\s)]+)\)$') def parse_name_and_version(p): """ A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. """ m = NAME_VERSION_RE.match(p) if not m: raise DistlibException('Ill-formed name/version string: \'%s\'' % p) d = m.groupdict() return d['name'].strip().lower(), d['ver'] def get_extras(requested, available): result = set() requested = set(requested or []) available = set(available or []) if '*' in requested: requested.remove('*') result |= available for r in requested: if r == '-': result.add(r) elif r.startswith('-'): unwanted = r[1:] if unwanted not in available: logger.warning('undeclared extra: %s' % unwanted) if unwanted in result: result.remove(unwanted) else: if r not in available: logger.warning('undeclared extra: %s' % r) result.add(r) return result # # Extended metadata functionality # def _get_external_data(url): result = {} try: # urlopen might fail if it runs into redirections, # because of Python issue #13696. Fixed in locators # using a custom redirect handler. resp = urlopen(url) headers = resp.info() ct = headers.get('Content-Type') if not ct.startswith('application/json'): logger.debug('Unexpected response for JSON request: %s', ct) else: reader = codecs.getreader('utf-8')(resp) #data = reader.read().decode('utf-8') #result = json.loads(data) result = json.load(reader) except Exception as e: logger.exception('Failed to get external data for %s: %s', url, e) return result _external_data_base_url = 'https://www.red-dove.com/pypi/projects/' def get_project_data(name): url = '%s/%s/project.json' % (name[0].upper(), name) url = urljoin(_external_data_base_url, url) result = _get_external_data(url) return result def get_package_data(name, version): url = '%s/%s/package-%s.json' % (name[0].upper(), name, version) url = urljoin(_external_data_base_url, url) return _get_external_data(url) class Cache(object): """ A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. """ def __init__(self, base): """ Initialise an instance. :param base: The base directory where the cache should be located. """ # we use 'isdir' instead of 'exists', because we want to # fail if there's a file with that name if not os.path.isdir(base): # pragma: no cover os.makedirs(base) if (os.stat(base).st_mode & 0o77) != 0: logger.warning('Directory \'%s\' is not private', base) self.base = os.path.abspath(os.path.normpath(base)) def prefix_to_dir(self, prefix): """ Converts a resource prefix to a directory name in the cache. """ return path_to_cache_dir(prefix) def clear(self): """ Clear the cache. """ not_removed = [] for fn in os.listdir(self.base): fn = os.path.join(self.base, fn) try: if os.path.islink(fn) or os.path.isfile(fn): os.remove(fn) elif os.path.isdir(fn): shutil.rmtree(fn) except Exception: not_removed.append(fn) return not_removed class EventMixin(object): """ A very simple publish/subscribe system. """ def __init__(self): self._subscribers = {} def add(self, event, subscriber, append=True): """ Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. """ subs = self._subscribers if event not in subs: subs[event] = deque([subscriber]) else: sq = subs[event] if append: sq.append(subscriber) else: sq.appendleft(subscriber) def remove(self, event, subscriber): """ Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. """ subs = self._subscribers if event not in subs: raise ValueError('No subscribers: %r' % event) subs[event].remove(subscriber) def get_subscribers(self, event): """ Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. """ return iter(self._subscribers.get(event, ())) def publish(self, event, *args, **kwargs): """ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. """ result = [] for subscriber in self.get_subscribers(event): try: value = subscriber(event, *args, **kwargs) except Exception: logger.exception('Exception during event publication') value = None result.append(value) logger.debug('publish %s: args = %s, kwargs = %s, result = %s', event, args, kwargs, result) return result # # Simple sequencing # class Sequencer(object): def __init__(self): self._preds = {} self._succs = {} self._nodes = set() # nodes with no preds/succs def add_node(self, node): self._nodes.add(node) def remove_node(self, node, edges=False): if node in self._nodes: self._nodes.remove(node) if edges: for p in set(self._preds.get(node, ())): self.remove(p, node) for s in set(self._succs.get(node, ())): self.remove(node, s) # Remove empties for k, v in list(self._preds.items()): if not v: del self._preds[k] for k, v in list(self._succs.items()): if not v: del self._succs[k] def add(self, pred, succ): assert pred != succ self._preds.setdefault(succ, set()).add(pred) self._succs.setdefault(pred, set()).add(succ) def remove(self, pred, succ): assert pred != succ try: preds = self._preds[succ] succs = self._succs[pred] except KeyError: # pragma: no cover raise ValueError('%r not a successor of anything' % succ) try: preds.remove(pred) succs.remove(succ) except KeyError: # pragma: no cover raise ValueError('%r not a successor of %r' % (succ, pred)) def is_step(self, step): return (step in self._preds or step in self._succs or step in self._nodes) def get_steps(self, final): if not self.is_step(final): raise ValueError('Unknown: %r' % final) result = [] todo = [] seen = set() todo.append(final) while todo: step = todo.pop(0) if step in seen: # if a step was already seen, # move it to the end (so it will appear earlier # when reversed on return) ... but not for the # final step, as that would be confusing for # users if step != final: result.remove(step) result.append(step) else: seen.add(step) result.append(step) preds = self._preds.get(step, ()) todo.extend(preds) return reversed(result) @property def strong_connections(self): #http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm index_counter = [0] stack = [] lowlinks = {} index = {} result = [] graph = self._succs def strongconnect(node): # set the depth index for this node to the smallest unused index index[node] = index_counter[0] lowlinks[node] = index_counter[0] index_counter[0] += 1 stack.append(node) # Consider successors try: successors = graph[node] except Exception: successors = [] for successor in successors: if successor not in lowlinks: # Successor has not yet been visited strongconnect(successor) lowlinks[node] = min(lowlinks[node],lowlinks[successor]) elif successor in stack: # the successor is in the stack and hence in the current # strongly connected component (SCC) lowlinks[node] = min(lowlinks[node],index[successor]) # If `node` is a root node, pop the stack and generate an SCC if lowlinks[node] == index[node]: connected_component = [] while True: successor = stack.pop() connected_component.append(successor) if successor == node: break component = tuple(connected_component) # storing the result result.append(component) for node in graph: if node not in lowlinks: strongconnect(node) return result @property def dot(self): result = ['digraph G {'] for succ in self._preds: preds = self._preds[succ] for pred in preds: result.append(' %s -> %s;' % (pred, succ)) for node in self._nodes: result.append(' %s;' % node) result.append('}') return '\n'.join(result) # # Unarchiving functionality for zip, tar, tgz, tbz, whl # ARCHIVE_EXTENSIONS = ('.tar.gz', '.tar.bz2', '.tar', '.zip', '.tgz', '.tbz', '.whl') def unarchive(archive_filename, dest_dir, format=None, check=True): def check_path(path): if not isinstance(path, text_type): path = path.decode('utf-8') p = os.path.abspath(os.path.join(dest_dir, path)) if not p.startswith(dest_dir) or p[plen] != os.sep: raise ValueError('path outside destination: %r' % p) dest_dir = os.path.abspath(dest_dir) plen = len(dest_dir) archive = None if format is None: if archive_filename.endswith(('.zip', '.whl')): format = 'zip' elif archive_filename.endswith(('.tar.gz', '.tgz')): format = 'tgz' mode = 'r:gz' elif archive_filename.endswith(('.tar.bz2', '.tbz')): format = 'tbz' mode = 'r:bz2' elif archive_filename.endswith('.tar'): format = 'tar' mode = 'r' else: # pragma: no cover raise ValueError('Unknown format for %r' % archive_filename) try: if format == 'zip': archive = ZipFile(archive_filename, 'r') if check: names = archive.namelist() for name in names: check_path(name) else: archive = tarfile.open(archive_filename, mode) if check: names = archive.getnames() for name in names: check_path(name) if format != 'zip' and sys.version_info[0] < 3: # See Python issue 17153. If the dest path contains Unicode, # tarfile extraction fails on Python 2.x if a member path name # contains non-ASCII characters - it leads to an implicit # bytes -> unicode conversion using ASCII to decode. for tarinfo in archive.getmembers(): if not isinstance(tarinfo.name, text_type): tarinfo.name = tarinfo.name.decode('utf-8') archive.extractall(dest_dir) finally: if archive: archive.close() def zip_dir(directory): """zip a directory tree into a BytesIO object""" result = io.BytesIO() dlen = len(directory) with ZipFile(result, "w") as zf: for root, dirs, files in os.walk(directory): for name in files: full = os.path.join(root, name) rel = root[dlen:] dest = os.path.join(rel, name) zf.write(full, dest) return result # # Simple progress bar # UNITS = ('', 'K', 'M', 'G','T','P') class Progress(object): unknown = 'UNKNOWN' def __init__(self, minval=0, maxval=100): assert maxval is None or maxval >= minval self.min = self.cur = minval self.max = maxval self.started = None self.elapsed = 0 self.done = False def update(self, curval): assert self.min <= curval assert self.max is None or curval <= self.max self.cur = curval now = time.time() if self.started is None: self.started = now else: self.elapsed = now - self.started def increment(self, incr): assert incr >= 0 self.update(self.cur + incr) def start(self): self.update(self.min) return self def stop(self): if self.max is not None: self.update(self.max) self.done = True @property def maximum(self): return self.unknown if self.max is None else self.max @property def percentage(self): if self.done: result = '100 %' elif self.max is None: result = ' ?? %' else: v = 100.0 * (self.cur - self.min) / (self.max - self.min) result = '%3d %%' % v return result def format_duration(self, duration): if (duration <= 0) and self.max is None or self.cur == self.min: result = '??:??:??' #elif duration < 1: # result = '--:--:--' else: result = time.strftime('%H:%M:%S', time.gmtime(duration)) return result @property def ETA(self): if self.done: prefix = 'Done' t = self.elapsed #import pdb; pdb.set_trace() else: prefix = 'ETA ' if self.max is None: t = -1 elif self.elapsed == 0 or (self.cur == self.min): t = 0 else: #import pdb; pdb.set_trace() t = float(self.max - self.min) t /= self.cur - self.min t = (t - 1) * self.elapsed return '%s: %s' % (prefix, self.format_duration(t)) @property def speed(self): if self.elapsed == 0: result = 0.0 else: result = (self.cur - self.min) / self.elapsed for unit in UNITS: if result < 1000: break result /= 1000.0 return '%d %sB/s' % (result, unit) # # Glob functionality # RICH_GLOB = re.compile(r'\{([^}]*)\}') _CHECK_RECURSIVE_GLOB = re.compile(r'[^/\\,{]\*\*|\*\*[^/\\,}]') _CHECK_MISMATCH_SET = re.compile(r'^[^{]*\}|\{[^}]*$') def iglob(path_glob): """Extended globbing function that supports ** and {opt1,opt2,opt3}.""" if _CHECK_RECURSIVE_GLOB.search(path_glob): msg = """invalid glob %r: recursive glob "**" must be used alone""" raise ValueError(msg % path_glob) if _CHECK_MISMATCH_SET.search(path_glob): msg = """invalid glob %r: mismatching set marker '{' or '}'""" raise ValueError(msg % path_glob) return _iglob(path_glob) def _iglob(path_glob): rich_path_glob = RICH_GLOB.split(path_glob, 1) if len(rich_path_glob) > 1: assert len(rich_path_glob) == 3, rich_path_glob prefix, set, suffix = rich_path_glob for item in set.split(','): for path in _iglob(''.join((prefix, item, suffix))): yield path else: if '**' not in path_glob: for item in std_iglob(path_glob): yield item else: prefix, radical = path_glob.split('**', 1) if prefix == '': prefix = '.' if radical == '': radical = '*' else: # we support both radical = radical.lstrip('/') radical = radical.lstrip('\\') for path, dir, files in os.walk(prefix): path = os.path.normpath(path) for fn in _iglob(os.path.join(path, radical)): yield fn if ssl: from .compat import (HTTPSHandler as BaseHTTPSHandler, match_hostname, CertificateError) # # HTTPSConnection which verifies certificates/matches domains # class HTTPSConnection(httplib.HTTPSConnection): ca_certs = None # set this to the path to the certs file (.pem) check_domain = True # only used if ca_certs is not None # noinspection PyPropertyAccess def connect(self): sock = socket.create_connection((self.host, self.port), self.timeout) if getattr(self, '_tunnel_host', False): self.sock = sock self._tunnel() if not hasattr(ssl, 'SSLContext'): # For 2.x if self.ca_certs: cert_reqs = ssl.CERT_REQUIRED else: cert_reqs = ssl.CERT_NONE self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file, cert_reqs=cert_reqs, ssl_version=ssl.PROTOCOL_SSLv23, ca_certs=self.ca_certs) else: # pragma: no cover context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) if hasattr(ssl, 'OP_NO_SSLv2'): context.options |= ssl.OP_NO_SSLv2 if self.cert_file: context.load_cert_chain(self.cert_file, self.key_file) kwargs = {} if self.ca_certs: context.verify_mode = ssl.CERT_REQUIRED context.load_verify_locations(cafile=self.ca_certs) if getattr(ssl, 'HAS_SNI', False): kwargs['server_hostname'] = self.host self.sock = context.wrap_socket(sock, **kwargs) if self.ca_certs and self.check_domain: try: match_hostname(self.sock.getpeercert(), self.host) logger.debug('Host verified: %s', self.host) except CertificateError: # pragma: no cover self.sock.shutdown(socket.SHUT_RDWR) self.sock.close() raise class HTTPSHandler(BaseHTTPSHandler): def __init__(self, ca_certs, check_domain=True): BaseHTTPSHandler.__init__(self) self.ca_certs = ca_certs self.check_domain = check_domain def _conn_maker(self, *args, **kwargs): """ This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. """ result = HTTPSConnection(*args, **kwargs) if self.ca_certs: result.ca_certs = self.ca_certs result.check_domain = self.check_domain return result def https_open(self, req): try: return self.do_open(self._conn_maker, req) except URLError as e: if 'certificate verify failed' in str(e.reason): raise CertificateError('Unable to verify server certificate ' 'for %s' % req.host) else: raise # # To prevent against mixing HTTP traffic with HTTPS (examples: A Man-In-The- # Middle proxy using HTTP listens on port 443, or an index mistakenly serves # HTML containing a http://xyz link when it should be https://xyz), # you can use the following handler class, which does not allow HTTP traffic. # # It works by inheriting from HTTPHandler - so build_opener won't add a # handler for HTTP itself. # class HTTPSOnlyHandler(HTTPSHandler, HTTPHandler): def http_open(self, req): raise URLError('Unexpected HTTP request on what should be a secure ' 'connection: %s' % req) # # XML-RPC with timeouts # _ver_info = sys.version_info[:2] if _ver_info == (2, 6): class HTTP(httplib.HTTP): def __init__(self, host='', port=None, **kwargs): if port == 0: # 0 means use port 0, not the default port port = None self._setup(self._connection_class(host, port, **kwargs)) if ssl: class HTTPS(httplib.HTTPS): def __init__(self, host='', port=None, **kwargs): if port == 0: # 0 means use port 0, not the default port port = None self._setup(self._connection_class(host, port, **kwargs)) class Transport(xmlrpclib.Transport): def __init__(self, timeout, use_datetime=0): self.timeout = timeout xmlrpclib.Transport.__init__(self, use_datetime) def make_connection(self, host): h, eh, x509 = self.get_host_info(host) if _ver_info == (2, 6): result = HTTP(h, timeout=self.timeout) else: if not self._connection or host != self._connection[0]: self._extra_headers = eh self._connection = host, httplib.HTTPConnection(h) result = self._connection[1] return result if ssl: class SafeTransport(xmlrpclib.SafeTransport): def __init__(self, timeout, use_datetime=0): self.timeout = timeout xmlrpclib.SafeTransport.__init__(self, use_datetime) def make_connection(self, host): h, eh, kwargs = self.get_host_info(host) if not kwargs: kwargs = {} kwargs['timeout'] = self.timeout if _ver_info == (2, 6): result = HTTPS(host, None, **kwargs) else: if not self._connection or host != self._connection[0]: self._extra_headers = eh self._connection = host, httplib.HTTPSConnection(h, None, **kwargs) result = self._connection[1] return result class ServerProxy(xmlrpclib.ServerProxy): def __init__(self, uri, **kwargs): self.timeout = timeout = kwargs.pop('timeout', None) # The above classes only come into play if a timeout # is specified if timeout is not None: scheme, _ = splittype(uri) use_datetime = kwargs.get('use_datetime', 0) if scheme == 'https': tcls = SafeTransport else: tcls = Transport kwargs['transport'] = t = tcls(timeout, use_datetime=use_datetime) self.transport = t xmlrpclib.ServerProxy.__init__(self, uri, **kwargs) # # CSV functionality. This is provided because on 2.x, the csv module can't # handle Unicode. However, we need to deal with Unicode in e.g. RECORD files. # def _csv_open(fn, mode, **kwargs): if sys.version_info[0] < 3: mode += 'b' else: kwargs['newline'] = '' # Python 3 determines encoding from locale. Force 'utf-8' # file encoding to match other forced utf-8 encoding kwargs['encoding'] = 'utf-8' return open(fn, mode, **kwargs) class CSVBase(object): defaults = { 'delimiter': str(','), # The strs are used because we need native 'quotechar': str('"'), # str in the csv API (2.x won't take 'lineterminator': str('\n') # Unicode) } def __enter__(self): return self def __exit__(self, *exc_info): self.stream.close() class CSVReader(CSVBase): def __init__(self, **kwargs): if 'stream' in kwargs: stream = kwargs['stream'] if sys.version_info[0] >= 3: # needs to be a text stream stream = codecs.getreader('utf-8')(stream) self.stream = stream else: self.stream = _csv_open(kwargs['path'], 'r') self.reader = csv.reader(self.stream, **self.defaults) def __iter__(self): return self def next(self): result = next(self.reader) if sys.version_info[0] < 3: for i, item in enumerate(result): if not isinstance(item, text_type): result[i] = item.decode('utf-8') return result __next__ = next class CSVWriter(CSVBase): def __init__(self, fn, **kwargs): self.stream = _csv_open(fn, 'w') self.writer = csv.writer(self.stream, **self.defaults) def writerow(self, row): if sys.version_info[0] < 3: r = [] for item in row: if isinstance(item, text_type): item = item.encode('utf-8') r.append(item) row = r self.writer.writerow(row) # # Configurator functionality # class Configurator(BaseConfigurator): value_converters = dict(BaseConfigurator.value_converters) value_converters['inc'] = 'inc_convert' def __init__(self, config, base=None): super(Configurator, self).__init__(config) self.base = base or os.getcwd() def configure_custom(self, config): def convert(o): if isinstance(o, (list, tuple)): result = type(o)([convert(i) for i in o]) elif isinstance(o, dict): if '()' in o: result = self.configure_custom(o) else: result = {} for k in o: result[k] = convert(o[k]) else: result = self.convert(o) return result c = config.pop('()') if not callable(c): c = self.resolve(c) props = config.pop('.', None) # Check for valid identifiers args = config.pop('[]', ()) if args: args = tuple([convert(o) for o in args]) items = [(k, convert(config[k])) for k in config if valid_ident(k)] kwargs = dict(items) result = c(*args, **kwargs) if props: for n, v in props.items(): setattr(result, n, convert(v)) return result def __getitem__(self, key): result = self.config[key] if isinstance(result, dict) and '()' in result: self.config[key] = result = self.configure_custom(result) return result def inc_convert(self, value): """Default converter for the inc:// protocol.""" if not os.path.isabs(value): value = os.path.join(self.base, value) with codecs.open(value, 'r', encoding='utf-8') as f: result = json.load(f) return result class SubprocessMixin(object): """ Mixin for running subprocesses and capturing their output """ def __init__(self, verbose=False, progress=None): self.verbose = verbose self.progress = progress def reader(self, stream, context): """ Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. """ progress = self.progress verbose = self.verbose while True: s = stream.readline() if not s: break if progress is not None: progress(s, context) else: if not verbose: sys.stderr.write('.') else: sys.stderr.write(s.decode('utf-8')) sys.stderr.flush() stream.close() def run_command(self, cmd, **kwargs): p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) t1 = threading.Thread(target=self.reader, args=(p.stdout, 'stdout')) t1.start() t2 = threading.Thread(target=self.reader, args=(p.stderr, 'stderr')) t2.start() p.wait() t1.join() t2.join() if self.progress is not None: self.progress('done.', 'main') elif self.verbose: sys.stderr.write('done.\n') return p def normalize_name(name): """Normalize a python package name a la PEP 503""" # https://www.python.org/dev/peps/pep-0503/#normalized-names return re.sub('[-_.]+', '-', name).lower() PKd]8CCdistlib/scripts.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2013-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from io import BytesIO import logging import os import re import struct import sys from .compat import sysconfig, detect_encoding, ZipFile from .resources import finder from .util import (FileOperator, get_export_entry, convert_path, get_executable, in_venv) logger = logging.getLogger(__name__) _DEFAULT_MANIFEST = ''' '''.strip() # check if Python is called on the first line with this expression FIRST_LINE_RE = re.compile(b'^#!.*pythonw?[0-9.]*([ \t].*)?$') SCRIPT_TEMPLATE = r'''# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) ''' def enquote_executable(executable): if ' ' in executable: # make sure we quote only the executable in case of env # for example /usr/bin/env "/dir with spaces/bin/jython" # instead of "/usr/bin/env /dir with spaces/bin/jython" # otherwise whole if executable.startswith('/usr/bin/env '): env, _executable = executable.split(' ', 1) if ' ' in _executable and not _executable.startswith('"'): executable = '%s "%s"' % (env, _executable) else: if not executable.startswith('"'): executable = '"%s"' % executable return executable # Keep the old name around (for now), as there is at least one project using it! _enquote_executable = enquote_executable class ScriptMaker(object): """ A class to copy or create scripts from source scripts or callable specifications. """ script_template = SCRIPT_TEMPLATE executable = None # for shebangs def __init__(self, source_dir, target_dir, add_launchers=True, dry_run=False, fileop=None): self.source_dir = source_dir self.target_dir = target_dir self.add_launchers = add_launchers self.force = False self.clobber = False # It only makes sense to set mode bits on POSIX. self.set_mode = (os.name == 'posix') or (os.name == 'java' and os._name == 'posix') self.variants = set(('', 'X.Y')) self._fileop = fileop or FileOperator(dry_run) self._is_nt = os.name == 'nt' or ( os.name == 'java' and os._name == 'nt') self.version_info = sys.version_info def _get_alternate_executable(self, executable, options): if options.get('gui', False) and self._is_nt: # pragma: no cover dn, fn = os.path.split(executable) fn = fn.replace('python', 'pythonw') executable = os.path.join(dn, fn) return executable if sys.platform.startswith('java'): # pragma: no cover def _is_shell(self, executable): """ Determine if the specified executable is a script (contains a #! line) """ try: with open(executable) as fp: return fp.read(2) == '#!' except (OSError, IOError): logger.warning('Failed to open %s', executable) return False def _fix_jython_executable(self, executable): if self._is_shell(executable): # Workaround for Jython is not needed on Linux systems. import java if java.lang.System.getProperty('os.name') == 'Linux': return executable elif executable.lower().endswith('jython.exe'): # Use wrapper exe for Jython on Windows return executable return '/usr/bin/env %s' % executable def _build_shebang(self, executable, post_interp): """ Build a shebang line. In the simple case (on Windows, or a shebang line which is not too long or contains spaces) use a simple formulation for the shebang. Otherwise, use /bin/sh as the executable, with a contrived shebang which allows the script to run either under Python or sh, using suitable quoting. Thanks to Harald Nordgren for his input. See also: http://www.in-ulm.de/~mascheck/various/shebang/#length https://hg.mozilla.org/mozilla-central/file/tip/mach """ if os.name != 'posix': simple_shebang = True else: # Add 3 for '#!' prefix and newline suffix. shebang_length = len(executable) + len(post_interp) + 3 if sys.platform == 'darwin': max_shebang_length = 512 else: max_shebang_length = 127 simple_shebang = ((b' ' not in executable) and (shebang_length <= max_shebang_length)) if simple_shebang: result = b'#!' + executable + post_interp + b'\n' else: result = b'#!/bin/sh\n' result += b"'''exec' " + executable + post_interp + b' "$0" "$@"\n' result += b"' '''" return result def _get_shebang(self, encoding, post_interp=b'', options=None): enquote = True if self.executable: executable = self.executable enquote = False # assume this will be taken care of elif not sysconfig.is_python_build(): executable = get_executable() elif in_venv(): # pragma: no cover executable = os.path.join(sysconfig.get_path('scripts'), 'python%s' % sysconfig.get_config_var('EXE')) else: # pragma: no cover executable = os.path.join( sysconfig.get_config_var('BINDIR'), 'python%s%s' % (sysconfig.get_config_var('VERSION'), sysconfig.get_config_var('EXE'))) if options: executable = self._get_alternate_executable(executable, options) if sys.platform.startswith('java'): # pragma: no cover executable = self._fix_jython_executable(executable) # Normalise case for Windows - COMMENTED OUT # executable = os.path.normcase(executable) # N.B. The normalising operation above has been commented out: See # issue #124. Although paths in Windows are generally case-insensitive, # they aren't always. For example, a path containing a ẞ (which is a # LATIN CAPITAL LETTER SHARP S - U+1E9E) is normcased to ß (which is a # LATIN SMALL LETTER SHARP S' - U+00DF). The two are not considered by # Windows as equivalent in path names. # If the user didn't specify an executable, it may be necessary to # cater for executable paths with spaces (not uncommon on Windows) if enquote: executable = enquote_executable(executable) # Issue #51: don't use fsencode, since we later try to # check that the shebang is decodable using utf-8. executable = executable.encode('utf-8') # in case of IronPython, play safe and enable frames support if (sys.platform == 'cli' and '-X:Frames' not in post_interp and '-X:FullFrames' not in post_interp): # pragma: no cover post_interp += b' -X:Frames' shebang = self._build_shebang(executable, post_interp) # Python parser starts to read a script using UTF-8 until # it gets a #coding:xxx cookie. The shebang has to be the # first line of a file, the #coding:xxx cookie cannot be # written before. So the shebang has to be decodable from # UTF-8. try: shebang.decode('utf-8') except UnicodeDecodeError: # pragma: no cover raise ValueError( 'The shebang (%r) is not decodable from utf-8' % shebang) # If the script is encoded to a custom encoding (use a # #coding:xxx cookie), the shebang has to be decodable from # the script encoding too. if encoding != 'utf-8': try: shebang.decode(encoding) except UnicodeDecodeError: # pragma: no cover raise ValueError( 'The shebang (%r) is not decodable ' 'from the script encoding (%r)' % (shebang, encoding)) return shebang def _get_script_text(self, entry): return self.script_template % dict(module=entry.prefix, import_name=entry.suffix.split('.')[0], func=entry.suffix) manifest = _DEFAULT_MANIFEST def get_manifest(self, exename): base = os.path.basename(exename) return self.manifest % base def _write_script(self, names, shebang, script_bytes, filenames, ext): use_launcher = self.add_launchers and self._is_nt linesep = os.linesep.encode('utf-8') if not shebang.endswith(linesep): shebang += linesep if not use_launcher: script_bytes = shebang + script_bytes else: # pragma: no cover if ext == 'py': launcher = self._get_launcher('t') else: launcher = self._get_launcher('w') stream = BytesIO() with ZipFile(stream, 'w') as zf: zf.writestr('__main__.py', script_bytes) zip_data = stream.getvalue() script_bytes = launcher + shebang + zip_data for name in names: outname = os.path.join(self.target_dir, name) if use_launcher: # pragma: no cover n, e = os.path.splitext(outname) if e.startswith('.py'): outname = n outname = '%s.exe' % outname try: self._fileop.write_binary_file(outname, script_bytes) except Exception: # Failed writing an executable - it might be in use. logger.warning('Failed to write executable - trying to ' 'use .deleteme logic') dfname = '%s.deleteme' % outname if os.path.exists(dfname): os.remove(dfname) # Not allowed to fail here os.rename(outname, dfname) # nor here self._fileop.write_binary_file(outname, script_bytes) logger.debug('Able to replace executable using ' '.deleteme logic') try: os.remove(dfname) except Exception: pass # still in use - ignore error else: if self._is_nt and not outname.endswith('.' + ext): # pragma: no cover outname = '%s.%s' % (outname, ext) if os.path.exists(outname) and not self.clobber: logger.warning('Skipping existing file %s', outname) continue self._fileop.write_binary_file(outname, script_bytes) if self.set_mode: self._fileop.set_executable_mode([outname]) filenames.append(outname) def _make_script(self, entry, filenames, options=None): post_interp = b'' if options: args = options.get('interpreter_args', []) if args: args = ' %s' % ' '.join(args) post_interp = args.encode('utf-8') shebang = self._get_shebang('utf-8', post_interp, options=options) script = self._get_script_text(entry).encode('utf-8') name = entry.name scriptnames = set() if '' in self.variants: scriptnames.add(name) if 'X' in self.variants: scriptnames.add('%s%s' % (name, self.version_info[0])) if 'X.Y' in self.variants: scriptnames.add('%s-%s.%s' % (name, self.version_info[0], self.version_info[1])) if options and options.get('gui', False): ext = 'pyw' else: ext = 'py' self._write_script(scriptnames, shebang, script, filenames, ext) def _copy_script(self, script, filenames): adjust = False script = os.path.join(self.source_dir, convert_path(script)) outname = os.path.join(self.target_dir, os.path.basename(script)) if not self.force and not self._fileop.newer(script, outname): logger.debug('not copying %s (up-to-date)', script) return # Always open the file, but ignore failures in dry-run mode -- # that way, we'll get accurate feedback if we can read the # script. try: f = open(script, 'rb') except IOError: # pragma: no cover if not self.dry_run: raise f = None else: first_line = f.readline() if not first_line: # pragma: no cover logger.warning('%s: %s is an empty file (skipping)', self.get_command_name(), script) return match = FIRST_LINE_RE.match(first_line.replace(b'\r\n', b'\n')) if match: adjust = True post_interp = match.group(1) or b'' if not adjust: if f: f.close() self._fileop.copy_file(script, outname) if self.set_mode: self._fileop.set_executable_mode([outname]) filenames.append(outname) else: logger.info('copying and adjusting %s -> %s', script, self.target_dir) if not self._fileop.dry_run: encoding, lines = detect_encoding(f.readline) f.seek(0) shebang = self._get_shebang(encoding, post_interp) if b'pythonw' in first_line: # pragma: no cover ext = 'pyw' else: ext = 'py' n = os.path.basename(outname) self._write_script([n], shebang, f.read(), filenames, ext) if f: f.close() @property def dry_run(self): return self._fileop.dry_run @dry_run.setter def dry_run(self, value): self._fileop.dry_run = value if os.name == 'nt' or (os.name == 'java' and os._name == 'nt'): # pragma: no cover # Executable launcher support. # Launchers are from https://bitbucket.org/vinay.sajip/simple_launcher/ def _get_launcher(self, kind): if struct.calcsize('P') == 8: # 64-bit bits = '64' else: bits = '32' name = '%s%s.exe' % (kind, bits) # Issue 31: don't hardcode an absolute package name, but # determine it relative to the current package distlib_package = __name__.rsplit('.', 1)[0] resource = finder(distlib_package).find(name) if not resource: msg = ('Unable to find resource %s in package %s' % (name, distlib_package)) raise ValueError(msg) return resource.bytes # Public API follows def make(self, specification, options=None): """ Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. """ filenames = [] entry = get_export_entry(specification) if entry is None: self._copy_script(specification, filenames) else: self._make_script(entry, filenames, options=options) return filenames def make_multiple(self, specifications, options=None): """ Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, """ filenames = [] for specification in specifications: filenames.extend(self.make(specification, options)) return filenames PKd]@cssdistlib/database.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2017 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """PEP 376 implementation.""" from __future__ import unicode_literals import base64 import codecs import contextlib import hashlib import logging import os import posixpath import sys import zipimport from . import DistlibException, resources from .compat import StringIO from .version import get_scheme, UnsupportedVersionError from .metadata import (Metadata, METADATA_FILENAME, WHEEL_METADATA_FILENAME, LEGACY_METADATA_FILENAME) from .util import (parse_requirement, cached_property, parse_name_and_version, read_exports, write_exports, CSVReader, CSVWriter) __all__ = ['Distribution', 'BaseInstalledDistribution', 'InstalledDistribution', 'EggInfoDistribution', 'DistributionPath'] logger = logging.getLogger(__name__) EXPORTS_FILENAME = 'pydist-exports.json' COMMANDS_FILENAME = 'pydist-commands.json' DIST_FILES = ('INSTALLER', METADATA_FILENAME, 'RECORD', 'REQUESTED', 'RESOURCES', EXPORTS_FILENAME, 'SHARED') DISTINFO_EXT = '.dist-info' class _Cache(object): """ A simple cache mapping names and .dist-info paths to distributions """ def __init__(self): """ Initialise an instance. There is normally one for each DistributionPath. """ self.name = {} self.path = {} self.generated = False def clear(self): """ Clear the cache, setting it to its initial state. """ self.name.clear() self.path.clear() self.generated = False def add(self, dist): """ Add a distribution to the cache. :param dist: The distribution to add. """ if dist.path not in self.path: self.path[dist.path] = dist self.name.setdefault(dist.key, []).append(dist) class DistributionPath(object): """ Represents a set of distributions installed on a path (typically sys.path). """ def __init__(self, path=None, include_egg=False): """ Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. """ if path is None: path = sys.path self.path = path self._include_dist = True self._include_egg = include_egg self._cache = _Cache() self._cache_egg = _Cache() self._cache_enabled = True self._scheme = get_scheme('default') def _get_cache_enabled(self): return self._cache_enabled def _set_cache_enabled(self, value): self._cache_enabled = value cache_enabled = property(_get_cache_enabled, _set_cache_enabled) def clear_cache(self): """ Clears the internal cache. """ self._cache.clear() self._cache_egg.clear() def _yield_distributions(self): """ Yield .dist-info and/or .egg(-info) distributions. """ # We need to check if we've seen some resources already, because on # some Linux systems (e.g. some Debian/Ubuntu variants) there are # symlinks which alias other files in the environment. seen = set() for path in self.path: finder = resources.finder_for_path(path) if finder is None: continue r = finder.find('') if not r or not r.is_container: continue rset = sorted(r.resources) for entry in rset: r = finder.find(entry) if not r or r.path in seen: continue if self._include_dist and entry.endswith(DISTINFO_EXT): possible_filenames = [METADATA_FILENAME, WHEEL_METADATA_FILENAME, LEGACY_METADATA_FILENAME] for metadata_filename in possible_filenames: metadata_path = posixpath.join(entry, metadata_filename) pydist = finder.find(metadata_path) if pydist: break else: continue with contextlib.closing(pydist.as_stream()) as stream: metadata = Metadata(fileobj=stream, scheme='legacy') logger.debug('Found %s', r.path) seen.add(r.path) yield new_dist_class(r.path, metadata=metadata, env=self) elif self._include_egg and entry.endswith(('.egg-info', '.egg')): logger.debug('Found %s', r.path) seen.add(r.path) yield old_dist_class(r.path, self) def _generate_cache(self): """ Scan the path for distributions and populate the cache with those that are found. """ gen_dist = not self._cache.generated gen_egg = self._include_egg and not self._cache_egg.generated if gen_dist or gen_egg: for dist in self._yield_distributions(): if isinstance(dist, InstalledDistribution): self._cache.add(dist) else: self._cache_egg.add(dist) if gen_dist: self._cache.generated = True if gen_egg: self._cache_egg.generated = True @classmethod def distinfo_dirname(cls, name, version): """ The *name* and *version* parameters are converted into their filename-escaped form, i.e. any ``'-'`` characters are replaced with ``'_'`` other than the one in ``'dist-info'`` and the one separating the name from the version number. :parameter name: is converted to a standard distribution name by replacing any runs of non- alphanumeric characters with a single ``'-'``. :type name: string :parameter version: is converted to a standard version string. Spaces become dots, and all other non-alphanumeric characters (except dots) become dashes, with runs of multiple dashes condensed to a single dash. :type version: string :returns: directory name :rtype: string""" name = name.replace('-', '_') return '-'.join([name, version]) + DISTINFO_EXT def get_distributions(self): """ Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances """ if not self._cache_enabled: for dist in self._yield_distributions(): yield dist else: self._generate_cache() for dist in self._cache.path.values(): yield dist if self._include_egg: for dist in self._cache_egg.path.values(): yield dist def get_distribution(self, name): """ Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` """ result = None name = name.lower() if not self._cache_enabled: for dist in self._yield_distributions(): if dist.key == name: result = dist break else: self._generate_cache() if name in self._cache.name: result = self._cache.name[name][0] elif self._include_egg and name in self._cache_egg.name: result = self._cache_egg.name[name][0] return result def provides_distribution(self, name, version=None): """ Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string """ matcher = None if version is not None: try: matcher = self._scheme.matcher('%s (%s)' % (name, version)) except ValueError: raise DistlibException('invalid name or version: %r, %r' % (name, version)) for dist in self.get_distributions(): # We hit a problem on Travis where enum34 was installed and doesn't # have a provides attribute ... if not hasattr(dist, 'provides'): logger.debug('No "provides": %s', dist) else: provided = dist.provides for p in provided: p_name, p_ver = parse_name_and_version(p) if matcher is None: if p_name == name: yield dist break else: if p_name == name and matcher.match(p_ver): yield dist break def get_file_path(self, name, relative_path): """ Return the path to a resource file. """ dist = self.get_distribution(name) if dist is None: raise LookupError('no distribution named %r found' % name) return dist.get_resource_path(relative_path) def get_exported_entries(self, category, name=None): """ Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. """ for dist in self.get_distributions(): r = dist.exports if category in r: d = r[category] if name is not None: if name in d: yield d[name] else: for v in d.values(): yield v class Distribution(object): """ A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. """ build_time_dependency = False """ Set to True if it's known to be only a build-time dependency (i.e. not needed after installation). """ requested = False """A boolean that indicates whether the ``REQUESTED`` metadata file is present (in other words, whether the package was installed by user request or it was installed as a dependency).""" def __init__(self, metadata): """ Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. """ self.metadata = metadata self.name = metadata.name self.key = self.name.lower() # for case-insensitive comparisons self.version = metadata.version self.locator = None self.digest = None self.extras = None # additional features requested self.context = None # environment marker overrides self.download_urls = set() self.digests = {} @property def source_url(self): """ The source archive download URL for this distribution. """ return self.metadata.source_url download_url = source_url # Backward compatibility @property def name_and_version(self): """ A utility property which displays the name and version in parentheses. """ return '%s (%s)' % (self.name, self.version) @property def provides(self): """ A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. """ plist = self.metadata.provides s = '%s (%s)' % (self.name, self.version) if s not in plist: plist.append(s) return plist def _get_requirements(self, req_attr): md = self.metadata logger.debug('Getting requirements from metadata %r', md.todict()) reqts = getattr(md, req_attr) return set(md.get_requirements(reqts, extras=self.extras, env=self.context)) @property def run_requires(self): return self._get_requirements('run_requires') @property def meta_requires(self): return self._get_requirements('meta_requires') @property def build_requires(self): return self._get_requirements('build_requires') @property def test_requires(self): return self._get_requirements('test_requires') @property def dev_requires(self): return self._get_requirements('dev_requires') def matches_requirement(self, req): """ Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. """ # Requirement may contain extras - parse to lose those # from what's passed to the matcher r = parse_requirement(req) scheme = get_scheme(self.metadata.scheme) try: matcher = scheme.matcher(r.requirement) except UnsupportedVersionError: # XXX compat-mode if cannot read the version logger.warning('could not read version %r - using name only', req) name = req.split()[0] matcher = scheme.matcher(name) name = matcher.key # case-insensitive result = False for p in self.provides: p_name, p_ver = parse_name_and_version(p) if p_name != name: continue try: result = matcher.match(p_ver) break except UnsupportedVersionError: pass return result def __repr__(self): """ Return a textual representation of this instance, """ if self.source_url: suffix = ' [%s]' % self.source_url else: suffix = '' return '' % (self.name, self.version, suffix) def __eq__(self, other): """ See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. """ if type(other) is not type(self): result = False else: result = (self.name == other.name and self.version == other.version and self.source_url == other.source_url) return result def __hash__(self): """ Compute hash in a way which matches the equality test. """ return hash(self.name) + hash(self.version) + hash(self.source_url) class BaseInstalledDistribution(Distribution): """ This is the base class for installed distributions (whether PEP 376 or legacy). """ hasher = None def __init__(self, metadata, path, env=None): """ Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. """ super(BaseInstalledDistribution, self).__init__(metadata) self.path = path self.dist_path = env def get_hash(self, data, hasher=None): """ Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str """ if hasher is None: hasher = self.hasher if hasher is None: hasher = hashlib.md5 prefix = '' else: hasher = getattr(hashlib, hasher) prefix = '%s=' % self.hasher digest = hasher(data).digest() digest = base64.urlsafe_b64encode(digest).rstrip(b'=').decode('ascii') return '%s%s' % (prefix, digest) class InstalledDistribution(BaseInstalledDistribution): """ Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). """ hasher = 'sha256' def __init__(self, path, metadata=None, env=None): self.modules = [] self.finder = finder = resources.finder_for_path(path) if finder is None: raise ValueError('finder unavailable for %s' % path) if env and env._cache_enabled and path in env._cache.path: metadata = env._cache.path[path].metadata elif metadata is None: r = finder.find(METADATA_FILENAME) # Temporary - for Wheel 0.23 support if r is None: r = finder.find(WHEEL_METADATA_FILENAME) # Temporary - for legacy support if r is None: r = finder.find(LEGACY_METADATA_FILENAME) if r is None: raise ValueError('no %s found in %s' % (METADATA_FILENAME, path)) with contextlib.closing(r.as_stream()) as stream: metadata = Metadata(fileobj=stream, scheme='legacy') super(InstalledDistribution, self).__init__(metadata, path, env) if env and env._cache_enabled: env._cache.add(self) r = finder.find('REQUESTED') self.requested = r is not None p = os.path.join(path, 'top_level.txt') if os.path.exists(p): with open(p, 'rb') as f: data = f.read().decode('utf-8') self.modules = data.splitlines() def __repr__(self): return '' % ( self.name, self.version, self.path) def __str__(self): return "%s %s" % (self.name, self.version) def _get_records(self): """ Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). """ results = [] r = self.get_distinfo_resource('RECORD') with contextlib.closing(r.as_stream()) as stream: with CSVReader(stream=stream) as record_reader: # Base location is parent dir of .dist-info dir #base_location = os.path.dirname(self.path) #base_location = os.path.abspath(base_location) for row in record_reader: missing = [None for i in range(len(row), 3)] path, checksum, size = row + missing #if not os.path.isabs(path): # path = path.replace('/', os.sep) # path = os.path.join(base_location, path) results.append((path, checksum, size)) return results @cached_property def exports(self): """ Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. """ result = {} r = self.get_distinfo_resource(EXPORTS_FILENAME) if r: result = self.read_exports() return result def read_exports(self): """ Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. """ result = {} r = self.get_distinfo_resource(EXPORTS_FILENAME) if r: with contextlib.closing(r.as_stream()) as stream: result = read_exports(stream) return result def write_exports(self, exports): """ Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. """ rf = self.get_distinfo_file(EXPORTS_FILENAME) with open(rf, 'w') as f: write_exports(exports, f) def get_resource_path(self, relative_path): """ NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. """ r = self.get_distinfo_resource('RESOURCES') with contextlib.closing(r.as_stream()) as stream: with CSVReader(stream=stream) as resources_reader: for relative, destination in resources_reader: if relative == relative_path: return destination raise KeyError('no resource file with relative path %r ' 'is installed' % relative_path) def list_installed_files(self): """ Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) """ for result in self._get_records(): yield result def write_installed_files(self, paths, prefix, dry_run=False): """ Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. """ prefix = os.path.join(prefix, '') base = os.path.dirname(self.path) base_under_prefix = base.startswith(prefix) base = os.path.join(base, '') record_path = self.get_distinfo_file('RECORD') logger.info('creating %s', record_path) if dry_run: return None with CSVWriter(record_path) as writer: for path in paths: if os.path.isdir(path) or path.endswith(('.pyc', '.pyo')): # do not put size and hash, as in PEP-376 hash_value = size = '' else: size = '%d' % os.path.getsize(path) with open(path, 'rb') as fp: hash_value = self.get_hash(fp.read()) if path.startswith(base) or (base_under_prefix and path.startswith(prefix)): path = os.path.relpath(path, base) writer.writerow((path, hash_value, size)) # add the RECORD file itself if record_path.startswith(base): record_path = os.path.relpath(record_path, base) writer.writerow((record_path, '', '')) return record_path def check_installed_files(self): """ Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. """ mismatches = [] base = os.path.dirname(self.path) record_path = self.get_distinfo_file('RECORD') for path, hash_value, size in self.list_installed_files(): if not os.path.isabs(path): path = os.path.join(base, path) if path == record_path: continue if not os.path.exists(path): mismatches.append((path, 'exists', True, False)) elif os.path.isfile(path): actual_size = str(os.path.getsize(path)) if size and actual_size != size: mismatches.append((path, 'size', size, actual_size)) elif hash_value: if '=' in hash_value: hasher = hash_value.split('=', 1)[0] else: hasher = None with open(path, 'rb') as f: actual_hash = self.get_hash(f.read(), hasher) if actual_hash != hash_value: mismatches.append((path, 'hash', hash_value, actual_hash)) return mismatches @cached_property def shared_locations(self): """ A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. """ result = {} shared_path = os.path.join(self.path, 'SHARED') if os.path.isfile(shared_path): with codecs.open(shared_path, 'r', encoding='utf-8') as f: lines = f.read().splitlines() for line in lines: key, value = line.split('=', 1) if key == 'namespace': result.setdefault(key, []).append(value) else: result[key] = value return result def write_shared_locations(self, paths, dry_run=False): """ Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. """ shared_path = os.path.join(self.path, 'SHARED') logger.info('creating %s', shared_path) if dry_run: return None lines = [] for key in ('prefix', 'lib', 'headers', 'scripts', 'data'): path = paths[key] if os.path.isdir(paths[key]): lines.append('%s=%s' % (key, path)) for ns in paths.get('namespace', ()): lines.append('namespace=%s' % ns) with codecs.open(shared_path, 'w', encoding='utf-8') as f: f.write('\n'.join(lines)) return shared_path def get_distinfo_resource(self, path): if path not in DIST_FILES: raise DistlibException('invalid path for a dist-info file: ' '%r at %r' % (path, self.path)) finder = resources.finder_for_path(self.path) if finder is None: raise DistlibException('Unable to get a finder for %s' % self.path) return finder.find(path) def get_distinfo_file(self, path): """ Returns a path located under the ``.dist-info`` directory. Returns a string representing the path. :parameter path: a ``'/'``-separated path relative to the ``.dist-info`` directory or an absolute path; If *path* is an absolute path and doesn't start with the ``.dist-info`` directory path, a :class:`DistlibException` is raised :type path: str :rtype: str """ # Check if it is an absolute path # XXX use relpath, add tests if path.find(os.sep) >= 0: # it's an absolute path? distinfo_dirname, path = path.split(os.sep)[-2:] if distinfo_dirname != self.path.split(os.sep)[-1]: raise DistlibException( 'dist-info file %r does not belong to the %r %s ' 'distribution' % (path, self.name, self.version)) # The file must be relative if path not in DIST_FILES: raise DistlibException('invalid path for a dist-info file: ' '%r at %r' % (path, self.path)) return os.path.join(self.path, path) def list_distinfo_files(self): """ Iterates over the ``RECORD`` entries and returns paths for each line if the path is pointing to a file located in the ``.dist-info`` directory or one of its subdirectories. :returns: iterator of paths """ base = os.path.dirname(self.path) for path, checksum, size in self._get_records(): # XXX add separator or use real relpath algo if not os.path.isabs(path): path = os.path.join(base, path) if path.startswith(self.path): yield path def __eq__(self, other): return (isinstance(other, InstalledDistribution) and self.path == other.path) # See http://docs.python.org/reference/datamodel#object.__hash__ __hash__ = object.__hash__ class EggInfoDistribution(BaseInstalledDistribution): """Created with the *path* of the ``.egg-info`` directory or file provided to the constructor. It reads the metadata contained in the file itself, or if the given path happens to be a directory, the metadata is read from the file ``PKG-INFO`` under that directory.""" requested = True # as we have no way of knowing, assume it was shared_locations = {} def __init__(self, path, env=None): def set_name_and_version(s, n, v): s.name = n s.key = n.lower() # for case-insensitive comparisons s.version = v self.path = path self.dist_path = env if env and env._cache_enabled and path in env._cache_egg.path: metadata = env._cache_egg.path[path].metadata set_name_and_version(self, metadata.name, metadata.version) else: metadata = self._get_metadata(path) # Need to be set before caching set_name_and_version(self, metadata.name, metadata.version) if env and env._cache_enabled: env._cache_egg.add(self) super(EggInfoDistribution, self).__init__(metadata, path, env) def _get_metadata(self, path): requires = None def parse_requires_data(data): """Create a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. """ reqs = [] lines = data.splitlines() for line in lines: line = line.strip() if line.startswith('['): logger.warning('Unexpected line: quitting requirement scan: %r', line) break r = parse_requirement(line) if not r: logger.warning('Not recognised as a requirement: %r', line) continue if r.extras: logger.warning('extra requirements in requires.txt are ' 'not supported') if not r.constraints: reqs.append(r.name) else: cons = ', '.join('%s%s' % c for c in r.constraints) reqs.append('%s (%s)' % (r.name, cons)) return reqs def parse_requires_path(req_path): """Create a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. """ reqs = [] try: with codecs.open(req_path, 'r', 'utf-8') as fp: reqs = parse_requires_data(fp.read()) except IOError: pass return reqs tl_path = tl_data = None if path.endswith('.egg'): if os.path.isdir(path): p = os.path.join(path, 'EGG-INFO') meta_path = os.path.join(p, 'PKG-INFO') metadata = Metadata(path=meta_path, scheme='legacy') req_path = os.path.join(p, 'requires.txt') tl_path = os.path.join(p, 'top_level.txt') requires = parse_requires_path(req_path) else: # FIXME handle the case where zipfile is not available zipf = zipimport.zipimporter(path) fileobj = StringIO( zipf.get_data('EGG-INFO/PKG-INFO').decode('utf8')) metadata = Metadata(fileobj=fileobj, scheme='legacy') try: data = zipf.get_data('EGG-INFO/requires.txt') tl_data = zipf.get_data('EGG-INFO/top_level.txt').decode('utf-8') requires = parse_requires_data(data.decode('utf-8')) except IOError: requires = None elif path.endswith('.egg-info'): if os.path.isdir(path): req_path = os.path.join(path, 'requires.txt') requires = parse_requires_path(req_path) path = os.path.join(path, 'PKG-INFO') tl_path = os.path.join(path, 'top_level.txt') metadata = Metadata(path=path, scheme='legacy') else: raise DistlibException('path must end with .egg-info or .egg, ' 'got %r' % path) if requires: metadata.add_requirements(requires) # look for top-level modules in top_level.txt, if present if tl_data is None: if tl_path is not None and os.path.exists(tl_path): with open(tl_path, 'rb') as f: tl_data = f.read().decode('utf-8') if not tl_data: tl_data = [] else: tl_data = tl_data.splitlines() self.modules = tl_data return metadata def __repr__(self): return '' % ( self.name, self.version, self.path) def __str__(self): return "%s %s" % (self.name, self.version) def check_installed_files(self): """ Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. """ mismatches = [] record_path = os.path.join(self.path, 'installed-files.txt') if os.path.exists(record_path): for path, _, _ in self.list_installed_files(): if path == record_path: continue if not os.path.exists(path): mismatches.append((path, 'exists', True, False)) return mismatches def list_installed_files(self): """ Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: a list of (path, hash, size) """ def _md5(path): f = open(path, 'rb') try: content = f.read() finally: f.close() return hashlib.md5(content).hexdigest() def _size(path): return os.stat(path).st_size record_path = os.path.join(self.path, 'installed-files.txt') result = [] if os.path.exists(record_path): with codecs.open(record_path, 'r', encoding='utf-8') as f: for line in f: line = line.strip() p = os.path.normpath(os.path.join(self.path, line)) # "./" is present as a marker between installed files # and installation metadata files if not os.path.exists(p): logger.warning('Non-existent file: %s', p) if p.endswith(('.pyc', '.pyo')): continue #otherwise fall through and fail if not os.path.isdir(p): result.append((p, _md5(p), _size(p))) result.append((record_path, None, None)) return result def list_distinfo_files(self, absolute=False): """ Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths """ record_path = os.path.join(self.path, 'installed-files.txt') if os.path.exists(record_path): skip = True with codecs.open(record_path, 'r', encoding='utf-8') as f: for line in f: line = line.strip() if line == './': skip = False continue if not skip: p = os.path.normpath(os.path.join(self.path, line)) if p.startswith(self.path): if absolute: yield p else: yield line def __eq__(self, other): return (isinstance(other, EggInfoDistribution) and self.path == other.path) # See http://docs.python.org/reference/datamodel#object.__hash__ __hash__ = object.__hash__ new_dist_class = InstalledDistribution old_dist_class = EggInfoDistribution class DependencyGraph(object): """ Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. """ def __init__(self): self.adjacency_list = {} self.reverse_list = {} self.missing = {} def add_distribution(self, distribution): """Add the *distribution* to the graph. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` """ self.adjacency_list[distribution] = [] self.reverse_list[distribution] = [] #self.missing[distribution] = [] def add_edge(self, x, y, label=None): """Add an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type label: ``str`` or ``None`` """ self.adjacency_list[x].append((y, label)) # multiple edges are allowed, so be careful if x not in self.reverse_list[y]: self.reverse_list[y].append(x) def add_missing(self, distribution, requirement): """ Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str`` """ logger.debug('%s missing %r', distribution, requirement) self.missing.setdefault(distribution, []).append(requirement) def _repr_dist(self, dist): return '%s %s' % (dist.name, dist.version) def repr_node(self, dist, level=1): """Prints only a subgraph""" output = [self._repr_dist(dist)] for other, label in self.adjacency_list[dist]: dist = self._repr_dist(other) if label is not None: dist = '%s [%s]' % (dist, label) output.append(' ' * level + str(dist)) suboutput = self.repr_node(other, level + 1) subs = suboutput.split('\n') output.extend(subs[1:]) return '\n'.join(output) def to_dot(self, f, skip_disconnected=True): """Writes a DOT output for the graph to the provided file *f*. If *skip_disconnected* is set to ``True``, then all distributions that are not dependent on any other distribution are skipped. :type f: has to support ``file``-like operations :type skip_disconnected: ``bool`` """ disconnected = [] f.write("digraph dependencies {\n") for dist, adjs in self.adjacency_list.items(): if len(adjs) == 0 and not skip_disconnected: disconnected.append(dist) for other, label in adjs: if not label is None: f.write('"%s" -> "%s" [label="%s"]\n' % (dist.name, other.name, label)) else: f.write('"%s" -> "%s"\n' % (dist.name, other.name)) if not skip_disconnected and len(disconnected) > 0: f.write('subgraph disconnected {\n') f.write('label = "Disconnected"\n') f.write('bgcolor = red\n') for dist in disconnected: f.write('"%s"' % dist.name) f.write('\n') f.write('}\n') f.write('}\n') def topological_sort(self): """ Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. """ result = [] # Make a shallow copy of the adjacency list alist = {} for k, v in self.adjacency_list.items(): alist[k] = v[:] while True: # See what we can remove in this run to_remove = [] for k, v in list(alist.items())[:]: if not v: to_remove.append(k) del alist[k] if not to_remove: # What's left in alist (if anything) is a cycle. break # Remove from the adjacency list of others for k, v in alist.items(): alist[k] = [(d, r) for d, r in v if d not in to_remove] logger.debug('Moving to result: %s', ['%s (%s)' % (d.name, d.version) for d in to_remove]) result.extend(to_remove) return result, list(alist.keys()) def __repr__(self): """Representation of the graph""" output = [] for dist, adjs in self.adjacency_list.items(): output.append(self.repr_node(dist)) return '\n'.join(output) def make_graph(dists, scheme='default'): """Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance """ scheme = get_scheme(scheme) graph = DependencyGraph() provided = {} # maps names to lists of (version, dist) tuples # first, build the graph and find out what's provided for dist in dists: graph.add_distribution(dist) for p in dist.provides: name, version = parse_name_and_version(p) logger.debug('Add to provided: %s, %s, %s', name, version, dist) provided.setdefault(name, []).append((version, dist)) # now make the edges for dist in dists: requires = (dist.run_requires | dist.meta_requires | dist.build_requires | dist.dev_requires) for req in requires: try: matcher = scheme.matcher(req) except UnsupportedVersionError: # XXX compat-mode if cannot read the version logger.warning('could not read version %r - using name only', req) name = req.split()[0] matcher = scheme.matcher(name) name = matcher.key # case-insensitive matched = False if name in provided: for version, provider in provided[name]: try: match = matcher.match(version) except UnsupportedVersionError: match = False if match: graph.add_edge(dist, provider, req) matched = True break if not matched: graph.add_missing(dist, req) return graph def get_dependent_dists(dists, dist): """Recursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested """ if dist not in dists: raise DistlibException('given distribution %r is not a member ' 'of the list' % dist.name) graph = make_graph(dists) dep = [dist] # dependent distributions todo = graph.reverse_list[dist] # list of nodes we should inspect while todo: d = todo.pop() dep.append(d) for succ in graph.reverse_list[d]: if succ not in dep: todo.append(succ) dep.pop(0) # remove dist from dep, was there to prevent infinite loops return dep def get_required_dists(dists, dist): """Recursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested """ if dist not in dists: raise DistlibException('given distribution %r is not a member ' 'of the list' % dist.name) graph = make_graph(dists) req = [] # required distributions todo = graph.adjacency_list[dist] # list of nodes we should inspect while todo: d = todo.pop()[0] req.append(d) for pred in graph.adjacency_list[d]: if pred not in req: todo.append(pred) return req def make_dist(name, version, **kwargs): """ A convenience method for making a dist given just a name and version. """ summary = kwargs.pop('summary', 'Placeholder for summary') md = Metadata(**kwargs) md.name = name md.version = version md.summary = summary or 'Placeholder for summary' return Distribution(md) PKd]distlib/wheel.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import base64 import codecs import datetime import distutils.util from email import message_from_file import hashlib import imp import json import logging import os import posixpath import re import shutil import sys import tempfile import zipfile from . import __version__, DistlibException from .compat import sysconfig, ZipFile, fsdecode, text_type, filter from .database import InstalledDistribution from .metadata import (Metadata, METADATA_FILENAME, WHEEL_METADATA_FILENAME, LEGACY_METADATA_FILENAME) from .util import (FileOperator, convert_path, CSVReader, CSVWriter, Cache, cached_property, get_cache_base, read_exports, tempdir) from .version import NormalizedVersion, UnsupportedVersionError logger = logging.getLogger(__name__) cache = None # created when needed if hasattr(sys, 'pypy_version_info'): # pragma: no cover IMP_PREFIX = 'pp' elif sys.platform.startswith('java'): # pragma: no cover IMP_PREFIX = 'jy' elif sys.platform == 'cli': # pragma: no cover IMP_PREFIX = 'ip' else: IMP_PREFIX = 'cp' VER_SUFFIX = sysconfig.get_config_var('py_version_nodot') if not VER_SUFFIX: # pragma: no cover VER_SUFFIX = '%s%s' % sys.version_info[:2] PYVER = 'py' + VER_SUFFIX IMPVER = IMP_PREFIX + VER_SUFFIX ARCH = distutils.util.get_platform().replace('-', '_').replace('.', '_') ABI = sysconfig.get_config_var('SOABI') if ABI and ABI.startswith('cpython-'): ABI = ABI.replace('cpython-', 'cp') else: def _derive_abi(): parts = ['cp', VER_SUFFIX] if sysconfig.get_config_var('Py_DEBUG'): parts.append('d') if sysconfig.get_config_var('WITH_PYMALLOC'): parts.append('m') if sysconfig.get_config_var('Py_UNICODE_SIZE') == 4: parts.append('u') return ''.join(parts) ABI = _derive_abi() del _derive_abi FILENAME_RE = re.compile(r''' (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ ''', re.IGNORECASE | re.VERBOSE) NAME_VERSION_RE = re.compile(r''' (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ ''', re.IGNORECASE | re.VERBOSE) SHEBANG_RE = re.compile(br'\s*#![^\r\n]*') SHEBANG_DETAIL_RE = re.compile(br'^(\s*#!("[^"]+"|\S+))\s+(.*)$') SHEBANG_PYTHON = b'#!python' SHEBANG_PYTHONW = b'#!pythonw' if os.sep == '/': to_posix = lambda o: o else: to_posix = lambda o: o.replace(os.sep, '/') class Mounter(object): def __init__(self): self.impure_wheels = {} self.libs = {} def add(self, pathname, extensions): self.impure_wheels[pathname] = extensions self.libs.update(extensions) def remove(self, pathname): extensions = self.impure_wheels.pop(pathname) for k, v in extensions: if k in self.libs: del self.libs[k] def find_module(self, fullname, path=None): if fullname in self.libs: result = self else: result = None return result def load_module(self, fullname): if fullname in sys.modules: result = sys.modules[fullname] else: if fullname not in self.libs: raise ImportError('unable to find extension for %s' % fullname) result = imp.load_dynamic(fullname, self.libs[fullname]) result.__loader__ = self parts = fullname.rsplit('.', 1) if len(parts) > 1: result.__package__ = parts[0] return result _hook = Mounter() class Wheel(object): """ Class to build and install from Wheel files (PEP 427). """ wheel_version = (1, 1) hash_kind = 'sha256' def __init__(self, filename=None, sign=False, verify=False): """ Initialise an instance using a (valid) filename. """ self.sign = sign self.should_verify = verify self.buildver = '' self.pyver = [PYVER] self.abi = ['none'] self.arch = ['any'] self.dirname = os.getcwd() if filename is None: self.name = 'dummy' self.version = '0.1' self._filename = self.filename else: m = NAME_VERSION_RE.match(filename) if m: info = m.groupdict('') self.name = info['nm'] # Reinstate the local version separator self.version = info['vn'].replace('_', '-') self.buildver = info['bn'] self._filename = self.filename else: dirname, filename = os.path.split(filename) m = FILENAME_RE.match(filename) if not m: raise DistlibException('Invalid name or ' 'filename: %r' % filename) if dirname: self.dirname = os.path.abspath(dirname) self._filename = filename info = m.groupdict('') self.name = info['nm'] self.version = info['vn'] self.buildver = info['bn'] self.pyver = info['py'].split('.') self.abi = info['bi'].split('.') self.arch = info['ar'].split('.') @property def filename(self): """ Build and return a filename from the various components. """ if self.buildver: buildver = '-' + self.buildver else: buildver = '' pyver = '.'.join(self.pyver) abi = '.'.join(self.abi) arch = '.'.join(self.arch) # replace - with _ as a local version separator version = self.version.replace('-', '_') return '%s-%s%s-%s-%s-%s.whl' % (self.name, version, buildver, pyver, abi, arch) @property def exists(self): path = os.path.join(self.dirname, self.filename) return os.path.isfile(path) @property def tags(self): for pyver in self.pyver: for abi in self.abi: for arch in self.arch: yield pyver, abi, arch @cached_property def metadata(self): pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) info_dir = '%s.dist-info' % name_ver wrapper = codecs.getreader('utf-8') with ZipFile(pathname, 'r') as zf: wheel_metadata = self.get_wheel_metadata(zf) wv = wheel_metadata['Wheel-Version'].split('.', 1) file_version = tuple([int(i) for i in wv]) # if file_version < (1, 1): # fns = [WHEEL_METADATA_FILENAME, METADATA_FILENAME, # LEGACY_METADATA_FILENAME] # else: # fns = [WHEEL_METADATA_FILENAME, METADATA_FILENAME] fns = [WHEEL_METADATA_FILENAME, LEGACY_METADATA_FILENAME] result = None for fn in fns: try: metadata_filename = posixpath.join(info_dir, fn) with zf.open(metadata_filename) as bf: wf = wrapper(bf) result = Metadata(fileobj=wf) if result: break except KeyError: pass if not result: raise ValueError('Invalid wheel, because metadata is ' 'missing: looked in %s' % ', '.join(fns)) return result def get_wheel_metadata(self, zf): name_ver = '%s-%s' % (self.name, self.version) info_dir = '%s.dist-info' % name_ver metadata_filename = posixpath.join(info_dir, 'WHEEL') with zf.open(metadata_filename) as bf: wf = codecs.getreader('utf-8')(bf) message = message_from_file(wf) return dict(message) @cached_property def info(self): pathname = os.path.join(self.dirname, self.filename) with ZipFile(pathname, 'r') as zf: result = self.get_wheel_metadata(zf) return result def process_shebang(self, data): m = SHEBANG_RE.match(data) if m: end = m.end() shebang, data_after_shebang = data[:end], data[end:] # Preserve any arguments after the interpreter if b'pythonw' in shebang.lower(): shebang_python = SHEBANG_PYTHONW else: shebang_python = SHEBANG_PYTHON m = SHEBANG_DETAIL_RE.match(shebang) if m: args = b' ' + m.groups()[-1] else: args = b'' shebang = shebang_python + args data = shebang + data_after_shebang else: cr = data.find(b'\r') lf = data.find(b'\n') if cr < 0 or cr > lf: term = b'\n' else: if data[cr:cr + 2] == b'\r\n': term = b'\r\n' else: term = b'\r' data = SHEBANG_PYTHON + term + data return data def get_hash(self, data, hash_kind=None): if hash_kind is None: hash_kind = self.hash_kind try: hasher = getattr(hashlib, hash_kind) except AttributeError: raise DistlibException('Unsupported hash algorithm: %r' % hash_kind) result = hasher(data).digest() result = base64.urlsafe_b64encode(result).rstrip(b'=').decode('ascii') return hash_kind, result def write_record(self, records, record_path, base): records = list(records) # make a copy, as mutated p = to_posix(os.path.relpath(record_path, base)) records.append((p, '', '')) with CSVWriter(record_path) as writer: for row in records: writer.writerow(row) def write_records(self, info, libdir, archive_paths): records = [] distinfo, info_dir = info hasher = getattr(hashlib, self.hash_kind) for ap, p in archive_paths: with open(p, 'rb') as f: data = f.read() digest = '%s=%s' % self.get_hash(data) size = os.path.getsize(p) records.append((ap, digest, size)) p = os.path.join(distinfo, 'RECORD') self.write_record(records, p, libdir) ap = to_posix(os.path.join(info_dir, 'RECORD')) archive_paths.append((ap, p)) def build_zip(self, pathname, archive_paths): with ZipFile(pathname, 'w', zipfile.ZIP_DEFLATED) as zf: for ap, p in archive_paths: logger.debug('Wrote %s to %s in wheel', p, ap) zf.write(p, ap) def build(self, paths, tags=None, wheel_version=None): """ Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. """ if tags is None: tags = {} libkey = list(filter(lambda o: o in paths, ('purelib', 'platlib')))[0] if libkey == 'platlib': is_pure = 'false' default_pyver = [IMPVER] default_abi = [ABI] default_arch = [ARCH] else: is_pure = 'true' default_pyver = [PYVER] default_abi = ['none'] default_arch = ['any'] self.pyver = tags.get('pyver', default_pyver) self.abi = tags.get('abi', default_abi) self.arch = tags.get('arch', default_arch) libdir = paths[libkey] name_ver = '%s-%s' % (self.name, self.version) data_dir = '%s.data' % name_ver info_dir = '%s.dist-info' % name_ver archive_paths = [] # First, stuff which is not in site-packages for key in ('data', 'headers', 'scripts'): if key not in paths: continue path = paths[key] if os.path.isdir(path): for root, dirs, files in os.walk(path): for fn in files: p = fsdecode(os.path.join(root, fn)) rp = os.path.relpath(p, path) ap = to_posix(os.path.join(data_dir, key, rp)) archive_paths.append((ap, p)) if key == 'scripts' and not p.endswith('.exe'): with open(p, 'rb') as f: data = f.read() data = self.process_shebang(data) with open(p, 'wb') as f: f.write(data) # Now, stuff which is in site-packages, other than the # distinfo stuff. path = libdir distinfo = None for root, dirs, files in os.walk(path): if root == path: # At the top level only, save distinfo for later # and skip it for now for i, dn in enumerate(dirs): dn = fsdecode(dn) if dn.endswith('.dist-info'): distinfo = os.path.join(root, dn) del dirs[i] break assert distinfo, '.dist-info directory expected, not found' for fn in files: # comment out next suite to leave .pyc files in if fsdecode(fn).endswith(('.pyc', '.pyo')): continue p = os.path.join(root, fn) rp = to_posix(os.path.relpath(p, path)) archive_paths.append((rp, p)) # Now distinfo. Assumed to be flat, i.e. os.listdir is enough. files = os.listdir(distinfo) for fn in files: if fn not in ('RECORD', 'INSTALLER', 'SHARED', 'WHEEL'): p = fsdecode(os.path.join(distinfo, fn)) ap = to_posix(os.path.join(info_dir, fn)) archive_paths.append((ap, p)) wheel_metadata = [ 'Wheel-Version: %d.%d' % (wheel_version or self.wheel_version), 'Generator: distlib %s' % __version__, 'Root-Is-Purelib: %s' % is_pure, ] for pyver, abi, arch in self.tags: wheel_metadata.append('Tag: %s-%s-%s' % (pyver, abi, arch)) p = os.path.join(distinfo, 'WHEEL') with open(p, 'w') as f: f.write('\n'.join(wheel_metadata)) ap = to_posix(os.path.join(info_dir, 'WHEEL')) archive_paths.append((ap, p)) # sort the entries by archive path. Not needed by any spec, but it # keeps the archive listing and RECORD tidier than they would otherwise # be. Use the number of path segments to keep directory entries together, # and keep the dist-info stuff at the end. def sorter(t): ap = t[0] n = ap.count('/') if '.dist-info' in ap: n += 10000 return (n, ap) archive_paths = sorted(archive_paths, key=sorter) # Now, at last, RECORD. # Paths in here are archive paths - nothing else makes sense. self.write_records((distinfo, info_dir), libdir, archive_paths) # Now, ready to build the zip file pathname = os.path.join(self.dirname, self.filename) self.build_zip(pathname, archive_paths) return pathname def skip_entry(self, arcname): """ Determine whether an archive entry should be skipped when verifying or installing. """ # The signature file won't be in RECORD, # and we don't currently don't do anything with it # We also skip directories, as they won't be in RECORD # either. See: # # https://github.com/pypa/wheel/issues/294 # https://github.com/pypa/wheel/issues/287 # https://github.com/pypa/wheel/pull/289 # return arcname.endswith(('/', '/RECORD.jws')) def install(self, paths, maker, **kwargs): """ Install a wheel to the specified paths. If kwarg ``warner`` is specified, it should be a callable, which will be called with two tuples indicating the wheel version of this software and the wheel version in the file, if there is a discrepancy in the versions. This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are not written. If kwarg ``bytecode_hashed_invalidation`` is True, written bytecode will try to use file-hash based invalidation (PEP-552) on supported interpreter versions (CPython 2.7+). The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. """ dry_run = maker.dry_run warner = kwargs.get('warner') lib_only = kwargs.get('lib_only', False) bc_hashed_invalidation = kwargs.get('bytecode_hashed_invalidation', False) pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) data_dir = '%s.data' % name_ver info_dir = '%s.dist-info' % name_ver metadata_name = posixpath.join(info_dir, LEGACY_METADATA_FILENAME) wheel_metadata_name = posixpath.join(info_dir, 'WHEEL') record_name = posixpath.join(info_dir, 'RECORD') wrapper = codecs.getreader('utf-8') with ZipFile(pathname, 'r') as zf: with zf.open(wheel_metadata_name) as bwf: wf = wrapper(bwf) message = message_from_file(wf) wv = message['Wheel-Version'].split('.', 1) file_version = tuple([int(i) for i in wv]) if (file_version != self.wheel_version) and warner: warner(self.wheel_version, file_version) if message['Root-Is-Purelib'] == 'true': libdir = paths['purelib'] else: libdir = paths['platlib'] records = {} with zf.open(record_name) as bf: with CSVReader(stream=bf) as reader: for row in reader: p = row[0] records[p] = row data_pfx = posixpath.join(data_dir, '') info_pfx = posixpath.join(info_dir, '') script_pfx = posixpath.join(data_dir, 'scripts', '') # make a new instance rather than a copy of maker's, # as we mutate it fileop = FileOperator(dry_run=dry_run) fileop.record = True # so we can rollback if needed bc = not sys.dont_write_bytecode # Double negatives. Lovely! outfiles = [] # for RECORD writing # for script copying/shebang processing workdir = tempfile.mkdtemp() # set target dir later # we default add_launchers to False, as the # Python Launcher should be used instead maker.source_dir = workdir maker.target_dir = None try: for zinfo in zf.infolist(): arcname = zinfo.filename if isinstance(arcname, text_type): u_arcname = arcname else: u_arcname = arcname.decode('utf-8') if self.skip_entry(u_arcname): continue row = records[u_arcname] if row[2] and str(zinfo.file_size) != row[2]: raise DistlibException('size mismatch for ' '%s' % u_arcname) if row[1]: kind, value = row[1].split('=', 1) with zf.open(arcname) as bf: data = bf.read() _, digest = self.get_hash(data, kind) if digest != value: raise DistlibException('digest mismatch for ' '%s' % arcname) if lib_only and u_arcname.startswith((info_pfx, data_pfx)): logger.debug('lib_only: skipping %s', u_arcname) continue is_script = (u_arcname.startswith(script_pfx) and not u_arcname.endswith('.exe')) if u_arcname.startswith(data_pfx): _, where, rp = u_arcname.split('/', 2) outfile = os.path.join(paths[where], convert_path(rp)) else: # meant for site-packages. if u_arcname in (wheel_metadata_name, record_name): continue outfile = os.path.join(libdir, convert_path(u_arcname)) if not is_script: with zf.open(arcname) as bf: fileop.copy_stream(bf, outfile) outfiles.append(outfile) # Double check the digest of the written file if not dry_run and row[1]: with open(outfile, 'rb') as bf: data = bf.read() _, newdigest = self.get_hash(data, kind) if newdigest != digest: raise DistlibException('digest mismatch ' 'on write for ' '%s' % outfile) if bc and outfile.endswith('.py'): try: pyc = fileop.byte_compile(outfile, hashed_invalidation=bc_hashed_invalidation) outfiles.append(pyc) except Exception: # Don't give up if byte-compilation fails, # but log it and perhaps warn the user logger.warning('Byte-compilation failed', exc_info=True) else: fn = os.path.basename(convert_path(arcname)) workname = os.path.join(workdir, fn) with zf.open(arcname) as bf: fileop.copy_stream(bf, workname) dn, fn = os.path.split(outfile) maker.target_dir = dn filenames = maker.make(fn) fileop.set_executable_mode(filenames) outfiles.extend(filenames) if lib_only: logger.debug('lib_only: returning None') dist = None else: # Generate scripts # Try to get pydist.json so we can see if there are # any commands to generate. If this fails (e.g. because # of a legacy wheel), log a warning but don't give up. commands = None file_version = self.info['Wheel-Version'] if file_version == '1.0': # Use legacy info ep = posixpath.join(info_dir, 'entry_points.txt') try: with zf.open(ep) as bwf: epdata = read_exports(bwf) commands = {} for key in ('console', 'gui'): k = '%s_scripts' % key if k in epdata: commands['wrap_%s' % key] = d = {} for v in epdata[k].values(): s = '%s:%s' % (v.prefix, v.suffix) if v.flags: s += ' [%s]' % ','.join(v.flags) d[v.name] = s except Exception: logger.warning('Unable to read legacy script ' 'metadata, so cannot generate ' 'scripts') else: try: with zf.open(metadata_name) as bwf: wf = wrapper(bwf) commands = json.load(wf).get('extensions') if commands: commands = commands.get('python.commands') except Exception: logger.warning('Unable to read JSON metadata, so ' 'cannot generate scripts') if commands: console_scripts = commands.get('wrap_console', {}) gui_scripts = commands.get('wrap_gui', {}) if console_scripts or gui_scripts: script_dir = paths.get('scripts', '') if not os.path.isdir(script_dir): raise ValueError('Valid script path not ' 'specified') maker.target_dir = script_dir for k, v in console_scripts.items(): script = '%s = %s' % (k, v) filenames = maker.make(script) fileop.set_executable_mode(filenames) if gui_scripts: options = {'gui': True } for k, v in gui_scripts.items(): script = '%s = %s' % (k, v) filenames = maker.make(script, options) fileop.set_executable_mode(filenames) p = os.path.join(libdir, info_dir) dist = InstalledDistribution(p) # Write SHARED paths = dict(paths) # don't change passed in dict del paths['purelib'] del paths['platlib'] paths['lib'] = libdir p = dist.write_shared_locations(paths, dry_run) if p: outfiles.append(p) # Write RECORD dist.write_installed_files(outfiles, paths['prefix'], dry_run) return dist except Exception: # pragma: no cover logger.exception('installation failed.') fileop.rollback() raise finally: shutil.rmtree(workdir) def _get_dylib_cache(self): global cache if cache is None: # Use native string to avoid issues on 2.x: see Python #20140. base = os.path.join(get_cache_base(), str('dylib-cache'), '%s.%s' % sys.version_info[:2]) cache = Cache(base) return cache def _get_extensions(self): pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) info_dir = '%s.dist-info' % name_ver arcname = posixpath.join(info_dir, 'EXTENSIONS') wrapper = codecs.getreader('utf-8') result = [] with ZipFile(pathname, 'r') as zf: try: with zf.open(arcname) as bf: wf = wrapper(bf) extensions = json.load(wf) cache = self._get_dylib_cache() prefix = cache.prefix_to_dir(pathname) cache_base = os.path.join(cache.base, prefix) if not os.path.isdir(cache_base): os.makedirs(cache_base) for name, relpath in extensions.items(): dest = os.path.join(cache_base, convert_path(relpath)) if not os.path.exists(dest): extract = True else: file_time = os.stat(dest).st_mtime file_time = datetime.datetime.fromtimestamp(file_time) info = zf.getinfo(relpath) wheel_time = datetime.datetime(*info.date_time) extract = wheel_time > file_time if extract: zf.extract(relpath, cache_base) result.append((name, dest)) except KeyError: pass return result def is_compatible(self): """ Determine if a wheel is compatible with the running system. """ return is_compatible(self) def is_mountable(self): """ Determine if a wheel is asserted as mountable by its metadata. """ return True # for now - metadata details TBD def mount(self, append=False): pathname = os.path.abspath(os.path.join(self.dirname, self.filename)) if not self.is_compatible(): msg = 'Wheel %s not compatible with this Python.' % pathname raise DistlibException(msg) if not self.is_mountable(): msg = 'Wheel %s is marked as not mountable.' % pathname raise DistlibException(msg) if pathname in sys.path: logger.debug('%s already in path', pathname) else: if append: sys.path.append(pathname) else: sys.path.insert(0, pathname) extensions = self._get_extensions() if extensions: if _hook not in sys.meta_path: sys.meta_path.append(_hook) _hook.add(pathname, extensions) def unmount(self): pathname = os.path.abspath(os.path.join(self.dirname, self.filename)) if pathname not in sys.path: logger.debug('%s not in path', pathname) else: sys.path.remove(pathname) if pathname in _hook.impure_wheels: _hook.remove(pathname) if not _hook.impure_wheels: if _hook in sys.meta_path: sys.meta_path.remove(_hook) def verify(self): pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) data_dir = '%s.data' % name_ver info_dir = '%s.dist-info' % name_ver metadata_name = posixpath.join(info_dir, LEGACY_METADATA_FILENAME) wheel_metadata_name = posixpath.join(info_dir, 'WHEEL') record_name = posixpath.join(info_dir, 'RECORD') wrapper = codecs.getreader('utf-8') with ZipFile(pathname, 'r') as zf: with zf.open(wheel_metadata_name) as bwf: wf = wrapper(bwf) message = message_from_file(wf) wv = message['Wheel-Version'].split('.', 1) file_version = tuple([int(i) for i in wv]) # TODO version verification records = {} with zf.open(record_name) as bf: with CSVReader(stream=bf) as reader: for row in reader: p = row[0] records[p] = row for zinfo in zf.infolist(): arcname = zinfo.filename if isinstance(arcname, text_type): u_arcname = arcname else: u_arcname = arcname.decode('utf-8') # See issue #115: some wheels have .. in their entries, but # in the filename ... e.g. __main__..py ! So the check is # updated to look for .. in the directory portions p = u_arcname.split('/') if '..' in p: raise DistlibException('invalid entry in ' 'wheel: %r' % u_arcname) if self.skip_entry(u_arcname): continue row = records[u_arcname] if row[2] and str(zinfo.file_size) != row[2]: raise DistlibException('size mismatch for ' '%s' % u_arcname) if row[1]: kind, value = row[1].split('=', 1) with zf.open(arcname) as bf: data = bf.read() _, digest = self.get_hash(data, kind) if digest != value: raise DistlibException('digest mismatch for ' '%s' % arcname) def update(self, modifier, dest_dir=None, **kwargs): """ Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. """ def get_version(path_map, info_dir): version = path = None key = '%s/%s' % (info_dir, LEGACY_METADATA_FILENAME) if key not in path_map: key = '%s/PKG-INFO' % info_dir if key in path_map: path = path_map[key] version = Metadata(path=path).version return version, path def update_version(version, path): updated = None try: v = NormalizedVersion(version) i = version.find('-') if i < 0: updated = '%s+1' % version else: parts = [int(s) for s in version[i + 1:].split('.')] parts[-1] += 1 updated = '%s+%s' % (version[:i], '.'.join(str(i) for i in parts)) except UnsupportedVersionError: logger.debug('Cannot update non-compliant (PEP-440) ' 'version %r', version) if updated: md = Metadata(path=path) md.version = updated legacy = path.endswith(LEGACY_METADATA_FILENAME) md.write(path=path, legacy=legacy) logger.debug('Version updated from %r to %r', version, updated) pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) info_dir = '%s.dist-info' % name_ver record_name = posixpath.join(info_dir, 'RECORD') with tempdir() as workdir: with ZipFile(pathname, 'r') as zf: path_map = {} for zinfo in zf.infolist(): arcname = zinfo.filename if isinstance(arcname, text_type): u_arcname = arcname else: u_arcname = arcname.decode('utf-8') if u_arcname == record_name: continue if '..' in u_arcname: raise DistlibException('invalid entry in ' 'wheel: %r' % u_arcname) zf.extract(zinfo, workdir) path = os.path.join(workdir, convert_path(u_arcname)) path_map[u_arcname] = path # Remember the version. original_version, _ = get_version(path_map, info_dir) # Files extracted. Call the modifier. modified = modifier(path_map, **kwargs) if modified: # Something changed - need to build a new wheel. current_version, path = get_version(path_map, info_dir) if current_version and (current_version == original_version): # Add or update local version to signify changes. update_version(current_version, path) # Decide where the new wheel goes. if dest_dir is None: fd, newpath = tempfile.mkstemp(suffix='.whl', prefix='wheel-update-', dir=workdir) os.close(fd) else: if not os.path.isdir(dest_dir): raise DistlibException('Not a directory: %r' % dest_dir) newpath = os.path.join(dest_dir, self.filename) archive_paths = list(path_map.items()) distinfo = os.path.join(workdir, info_dir) info = distinfo, info_dir self.write_records(info, workdir, archive_paths) self.build_zip(newpath, archive_paths) if dest_dir is None: shutil.copyfile(newpath, pathname) return modified def compatible_tags(): """ Return (pyver, abi, arch) tuples compatible with this Python. """ versions = [VER_SUFFIX] major = VER_SUFFIX[0] for minor in range(sys.version_info[1] - 1, - 1, -1): versions.append(''.join([major, str(minor)])) abis = [] for suffix, _, _ in imp.get_suffixes(): if suffix.startswith('.abi'): abis.append(suffix.split('.', 2)[1]) abis.sort() if ABI != 'none': abis.insert(0, ABI) abis.append('none') result = [] arches = [ARCH] if sys.platform == 'darwin': m = re.match(r'(\w+)_(\d+)_(\d+)_(\w+)$', ARCH) if m: name, major, minor, arch = m.groups() minor = int(minor) matches = [arch] if arch in ('i386', 'ppc'): matches.append('fat') if arch in ('i386', 'ppc', 'x86_64'): matches.append('fat3') if arch in ('ppc64', 'x86_64'): matches.append('fat64') if arch in ('i386', 'x86_64'): matches.append('intel') if arch in ('i386', 'x86_64', 'intel', 'ppc', 'ppc64'): matches.append('universal') while minor >= 0: for match in matches: s = '%s_%s_%s_%s' % (name, major, minor, match) if s != ARCH: # already there arches.append(s) minor -= 1 # Most specific - our Python version, ABI and arch for abi in abis: for arch in arches: result.append((''.join((IMP_PREFIX, versions[0])), abi, arch)) # where no ABI / arch dependency, but IMP_PREFIX dependency for i, version in enumerate(versions): result.append((''.join((IMP_PREFIX, version)), 'none', 'any')) if i == 0: result.append((''.join((IMP_PREFIX, version[0])), 'none', 'any')) # no IMP_PREFIX, ABI or arch dependency for i, version in enumerate(versions): result.append((''.join(('py', version)), 'none', 'any')) if i == 0: result.append((''.join(('py', version[0])), 'none', 'any')) return set(result) COMPATIBLE_TAGS = compatible_tags() del compatible_tags def is_compatible(wheel, tags=None): if not isinstance(wheel, Wheel): wheel = Wheel(wheel) # assume it's a filename result = False if tags is None: tags = COMPATIBLE_TAGS for ver, abi, arch in tags: if ver in wheel.pyver and abi in wheel.abi and arch in wheel.arch: result = True break return result PKd]UQ*-distlib/locators.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except ImportError: # pragma: no cover import dummy_threading as threading import zlib from . import DistlibException from .compat import (urljoin, urlparse, urlunparse, url2pathname, pathname2url, queue, quote, unescape, string_types, build_opener, HTTPRedirectHandler as BaseRedirectHandler, text_type, Request, HTTPError, URLError) from .database import Distribution, DistributionPath, make_dist from .metadata import Metadata, MetadataInvalidError from .util import (cached_property, parse_credentials, ensure_slash, split_filename, get_project_data, parse_requirement, parse_name_and_version, ServerProxy, normalize_name) from .version import get_scheme, UnsupportedVersionError from .wheel import Wheel, is_compatible logger = logging.getLogger(__name__) HASHER_HASH = re.compile(r'^(\w+)=([a-f0-9]+)') CHARSET = re.compile(r';\s*charset\s*=\s*(.*)\s*$', re.I) HTML_CONTENT_TYPE = re.compile('text/html|application/x(ht)?ml') DEFAULT_INDEX = 'https://pypi.org/pypi' def get_all_distribution_names(url=None): """ Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. """ if url is None: url = DEFAULT_INDEX client = ServerProxy(url, timeout=3.0) try: return client.list_packages() finally: client('close')() class RedirectHandler(BaseRedirectHandler): """ A class to work around a bug in some Python 3.2.x releases. """ # There's a bug in the base version for some 3.2.x # (e.g. 3.2.2 on Ubuntu Oneiric). If a Location header # returns e.g. /abc, it bails because it says the scheme '' # is bogus, when actually it should use the request's # URL for the scheme. See Python issue #13696. def http_error_302(self, req, fp, code, msg, headers): # Some servers (incorrectly) return multiple Location headers # (so probably same goes for URI). Use first header. newurl = None for key in ('location', 'uri'): if key in headers: newurl = headers[key] break if newurl is None: # pragma: no cover return urlparts = urlparse(newurl) if urlparts.scheme == '': newurl = urljoin(req.get_full_url(), newurl) if hasattr(headers, 'replace_header'): headers.replace_header(key, newurl) else: headers[key] = newurl return BaseRedirectHandler.http_error_302(self, req, fp, code, msg, headers) http_error_301 = http_error_303 = http_error_307 = http_error_302 class Locator(object): """ A base class for locators - things that locate distributions. """ source_extensions = ('.tar.gz', '.tar.bz2', '.tar', '.zip', '.tgz', '.tbz') binary_extensions = ('.egg', '.exe', '.whl') excluded_extensions = ('.pdf',) # A list of tags indicating which wheels you want to match. The default # value of None matches against the tags compatible with the running # Python. If you want to match other values, set wheel_tags on a locator # instance to a list of tuples (pyver, abi, arch) which you want to match. wheel_tags = None downloadable_extensions = source_extensions + ('.whl',) def __init__(self, scheme='default'): """ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. """ self._cache = {} self.scheme = scheme # Because of bugs in some of the handlers on some of the platforms, # we use our own opener rather than just using urlopen. self.opener = build_opener(RedirectHandler()) # If get_project() is called from locate(), the matcher instance # is set from the requirement passed to locate(). See issue #18 for # why this can be useful to know. self.matcher = None self.errors = queue.Queue() def get_errors(self): """ Return any errors which have occurred. """ result = [] while not self.errors.empty(): # pragma: no cover try: e = self.errors.get(False) result.append(e) except self.errors.Empty: continue self.errors.task_done() return result def clear_errors(self): """ Clear any errors which may have been logged. """ # Just get the errors and throw them away self.get_errors() def clear_cache(self): self._cache.clear() def _get_scheme(self): return self._scheme def _set_scheme(self, value): self._scheme = value scheme = property(_get_scheme, _set_scheme) def _get_project(self, name): """ For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. """ raise NotImplementedError('Please implement in the subclass') def get_distribution_names(self): """ Return all the distribution names known to this locator. """ raise NotImplementedError('Please implement in the subclass') def get_project(self, name): """ For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. """ if self._cache is None: # pragma: no cover result = self._get_project(name) elif name in self._cache: result = self._cache[name] else: self.clear_errors() result = self._get_project(name) self._cache[name] = result return result def score_url(self, url): """ Give an url a score which can be used to choose preferred URLs for a given project release. """ t = urlparse(url) basename = posixpath.basename(t.path) compatible = True is_wheel = basename.endswith('.whl') is_downloadable = basename.endswith(self.downloadable_extensions) if is_wheel: compatible = is_compatible(Wheel(basename), self.wheel_tags) return (t.scheme == 'https', 'pypi.org' in t.netloc, is_downloadable, is_wheel, compatible, basename) def prefer_url(self, url1, url2): """ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. """ result = url2 if url1: s1 = self.score_url(url1) s2 = self.score_url(url2) if s1 > s2: result = url1 if result != url2: logger.debug('Not replacing %r with %r', url1, url2) else: logger.debug('Replacing %r with %r', url1, url2) return result def split_filename(self, filename, project_name): """ Attempt to split a filename in project name, version and Python version. """ return split_filename(filename, project_name) def convert_url_to_download_info(self, url, project_name): """ See if a URL is a candidate for a download URL for a project (the URL has typically been scraped from an HTML page). If it is, a dictionary is returned with keys "name", "version", "filename" and "url"; otherwise, None is returned. """ def same_project(name1, name2): return normalize_name(name1) == normalize_name(name2) result = None scheme, netloc, path, params, query, frag = urlparse(url) if frag.lower().startswith('egg='): # pragma: no cover logger.debug('%s: version hint in fragment: %r', project_name, frag) m = HASHER_HASH.match(frag) if m: algo, digest = m.groups() else: algo, digest = None, None origpath = path if path and path[-1] == '/': # pragma: no cover path = path[:-1] if path.endswith('.whl'): try: wheel = Wheel(path) if not is_compatible(wheel, self.wheel_tags): logger.debug('Wheel not compatible: %s', path) else: if project_name is None: include = True else: include = same_project(wheel.name, project_name) if include: result = { 'name': wheel.name, 'version': wheel.version, 'filename': wheel.filename, 'url': urlunparse((scheme, netloc, origpath, params, query, '')), 'python-version': ', '.join( ['.'.join(list(v[2:])) for v in wheel.pyver]), } except Exception as e: # pragma: no cover logger.warning('invalid path for wheel: %s', path) elif not path.endswith(self.downloadable_extensions): # pragma: no cover logger.debug('Not downloadable: %s', path) else: # downloadable extension path = filename = posixpath.basename(path) for ext in self.downloadable_extensions: if path.endswith(ext): path = path[:-len(ext)] t = self.split_filename(path, project_name) if not t: # pragma: no cover logger.debug('No match for project/version: %s', path) else: name, version, pyver = t if not project_name or same_project(project_name, name): result = { 'name': name, 'version': version, 'filename': filename, 'url': urlunparse((scheme, netloc, origpath, params, query, '')), #'packagetype': 'sdist', } if pyver: # pragma: no cover result['python-version'] = pyver break if result and algo: result['%s_digest' % algo] = digest return result def _get_digest(self, info): """ Get a digest from a dictionary by looking at a "digests" dictionary or keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5. """ result = None if 'digests' in info: digests = info['digests'] for algo in ('sha256', 'md5'): if algo in digests: result = (algo, digests[algo]) break if not result: for algo in ('sha256', 'md5'): key = '%s_digest' % algo if key in info: result = (algo, info[key]) break return result def _update_version_data(self, result, info): """ Update a result dictionary (the final result from _get_project) with a dictionary for a specific version, which typically holds information gleaned from a filename or URL for an archive for the distribution. """ name = info.pop('name') version = info.pop('version') if version in result: dist = result[version] md = dist.metadata else: dist = make_dist(name, version, scheme=self.scheme) md = dist.metadata dist.digest = digest = self._get_digest(info) url = info['url'] result['digests'][url] = digest if md.source_url != info['url']: md.source_url = self.prefer_url(md.source_url, url) result['urls'].setdefault(version, set()).add(url) dist.locator = self result[version] = dist def locate(self, requirement, prereleases=False): """ Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. """ result = None r = parse_requirement(requirement) if r is None: # pragma: no cover raise DistlibException('Not a valid requirement: %r' % requirement) scheme = get_scheme(self.scheme) self.matcher = matcher = scheme.matcher(r.requirement) logger.debug('matcher: %s (%s)', matcher, type(matcher).__name__) versions = self.get_project(r.name) if len(versions) > 2: # urls and digests keys are present # sometimes, versions are invalid slist = [] vcls = matcher.version_class for k in versions: if k in ('urls', 'digests'): continue try: if not matcher.match(k): logger.debug('%s did not match %r', matcher, k) else: if prereleases or not vcls(k).is_prerelease: slist.append(k) else: logger.debug('skipping pre-release ' 'version %s of %s', k, matcher.name) except Exception: # pragma: no cover logger.warning('error matching %s with %r', matcher, k) pass # slist.append(k) if len(slist) > 1: slist = sorted(slist, key=scheme.key) if slist: logger.debug('sorted list: %s', slist) version = slist[-1] result = versions[version] if result: if r.extras: result.extras = r.extras result.download_urls = versions.get('urls', {}).get(version, set()) d = {} sd = versions.get('digests', {}) for url in result.download_urls: if url in sd: # pragma: no cover d[url] = sd[url] result.digests = d self.matcher = None return result class PyPIRPCLocator(Locator): """ This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). """ def __init__(self, url, **kwargs): """ Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. """ super(PyPIRPCLocator, self).__init__(**kwargs) self.base_url = url self.client = ServerProxy(url, timeout=3.0) def get_distribution_names(self): """ Return all the distribution names known to this locator. """ return set(self.client.list_packages()) def _get_project(self, name): result = {'urls': {}, 'digests': {}} versions = self.client.package_releases(name, True) for v in versions: urls = self.client.release_urls(name, v) data = self.client.release_data(name, v) metadata = Metadata(scheme=self.scheme) metadata.name = data['name'] metadata.version = data['version'] metadata.license = data.get('license') metadata.keywords = data.get('keywords', []) metadata.summary = data.get('summary') dist = Distribution(metadata) if urls: info = urls[0] metadata.source_url = info['url'] dist.digest = self._get_digest(info) dist.locator = self result[v] = dist for info in urls: url = info['url'] digest = self._get_digest(info) result['urls'].setdefault(v, set()).add(url) result['digests'][url] = digest return result class PyPIJSONLocator(Locator): """ This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. """ def __init__(self, url, **kwargs): super(PyPIJSONLocator, self).__init__(**kwargs) self.base_url = ensure_slash(url) def get_distribution_names(self): """ Return all the distribution names known to this locator. """ raise NotImplementedError('Not available from this locator') def _get_project(self, name): result = {'urls': {}, 'digests': {}} url = urljoin(self.base_url, '%s/json' % quote(name)) try: resp = self.opener.open(url) data = resp.read().decode() # for now d = json.loads(data) md = Metadata(scheme=self.scheme) data = d['info'] md.name = data['name'] md.version = data['version'] md.license = data.get('license') md.keywords = data.get('keywords', []) md.summary = data.get('summary') dist = Distribution(md) dist.locator = self urls = d['urls'] result[md.version] = dist for info in d['urls']: url = info['url'] dist.download_urls.add(url) dist.digests[url] = self._get_digest(info) result['urls'].setdefault(md.version, set()).add(url) result['digests'][url] = self._get_digest(info) # Now get other releases for version, infos in d['releases'].items(): if version == md.version: continue # already done omd = Metadata(scheme=self.scheme) omd.name = md.name omd.version = version odist = Distribution(omd) odist.locator = self result[version] = odist for info in infos: url = info['url'] odist.download_urls.add(url) odist.digests[url] = self._get_digest(info) result['urls'].setdefault(version, set()).add(url) result['digests'][url] = self._get_digest(info) # for info in urls: # md.source_url = info['url'] # dist.digest = self._get_digest(info) # dist.locator = self # for info in urls: # url = info['url'] # result['urls'].setdefault(md.version, set()).add(url) # result['digests'][url] = self._get_digest(info) except Exception as e: self.errors.put(text_type(e)) logger.exception('JSON fetch failed: %s', e) return result class Page(object): """ This class represents a scraped HTML page. """ # The following slightly hairy-looking regex just looks for the contents of # an anchor link, which has an attribute "href" either immediately preceded # or immediately followed by a "rel" attribute. The attribute values can be # declared with double quotes, single quotes or no quotes - which leads to # the length of the expression. _href = re.compile(""" (rel\\s*=\\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\\s\n]*))\\s+)? href\\s*=\\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\\s\n]*)) (\\s+rel\\s*=\\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\\s\n]*)))? """, re.I | re.S | re.X) _base = re.compile(r"""]+)""", re.I | re.S) def __init__(self, data, url): """ Initialise an instance with the Unicode page contents and the URL they came from. """ self.data = data self.base_url = self.url = url m = self._base.search(self.data) if m: self.base_url = m.group(1) _clean_re = re.compile(r'[^a-z0-9$&+,/:;=?@.#%_\\|-]', re.I) @cached_property def links(self): """ Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. """ def clean(url): "Tidy up an URL." scheme, netloc, path, params, query, frag = urlparse(url) return urlunparse((scheme, netloc, quote(path), params, query, frag)) result = set() for match in self._href.finditer(self.data): d = match.groupdict('') rel = (d['rel1'] or d['rel2'] or d['rel3'] or d['rel4'] or d['rel5'] or d['rel6']) url = d['url1'] or d['url2'] or d['url3'] url = urljoin(self.base_url, url) url = unescape(url) url = self._clean_re.sub(lambda m: '%%%2x' % ord(m.group(0)), url) result.add((url, rel)) # We sort the result, hoping to bring the most recent versions # to the front result = sorted(result, key=lambda t: t[0], reverse=True) return result class SimpleScrapingLocator(Locator): """ A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. """ # These are used to deal with various Content-Encoding schemes. decoders = { 'deflate': zlib.decompress, 'gzip': lambda b: gzip.GzipFile(fileobj=BytesIO(d)).read(), 'none': lambda b: b, } def __init__(self, url, timeout=None, num_workers=10, **kwargs): """ Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. """ super(SimpleScrapingLocator, self).__init__(**kwargs) self.base_url = ensure_slash(url) self.timeout = timeout self._page_cache = {} self._seen = set() self._to_fetch = queue.Queue() self._bad_hosts = set() self.skip_externals = False self.num_workers = num_workers self._lock = threading.RLock() # See issue #45: we need to be resilient when the locator is used # in a thread, e.g. with concurrent.futures. We can't use self._lock # as it is for coordinating our internal threads - the ones created # in _prepare_threads. self._gplock = threading.RLock() self.platform_check = False # See issue #112 def _prepare_threads(self): """ Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). """ self._threads = [] for i in range(self.num_workers): t = threading.Thread(target=self._fetch) t.setDaemon(True) t.start() self._threads.append(t) def _wait_threads(self): """ Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. """ # Note that you need two loops, since you can't say which # thread will get each sentinel for t in self._threads: self._to_fetch.put(None) # sentinel for t in self._threads: t.join() self._threads = [] def _get_project(self, name): result = {'urls': {}, 'digests': {}} with self._gplock: self.result = result self.project_name = name url = urljoin(self.base_url, '%s/' % quote(name)) self._seen.clear() self._page_cache.clear() self._prepare_threads() try: logger.debug('Queueing %s', url) self._to_fetch.put(url) self._to_fetch.join() finally: self._wait_threads() del self.result return result platform_dependent = re.compile(r'\b(linux_(i\d86|x86_64|arm\w+)|' r'win(32|_amd64)|macosx_?\d+)\b', re.I) def _is_platform_dependent(self, url): """ Does an URL refer to a platform-specific download? """ return self.platform_dependent.search(url) def _process_download(self, url): """ See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. """ if self.platform_check and self._is_platform_dependent(url): info = None else: info = self.convert_url_to_download_info(url, self.project_name) logger.debug('process_download: %s -> %s', url, info) if info: with self._lock: # needed because self.result is shared self._update_version_data(self.result, info) return info def _should_queue(self, link, referrer, rel): """ Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. """ scheme, netloc, path, _, _, _ = urlparse(link) if path.endswith(self.source_extensions + self.binary_extensions + self.excluded_extensions): result = False elif self.skip_externals and not link.startswith(self.base_url): result = False elif not referrer.startswith(self.base_url): result = False elif rel not in ('homepage', 'download'): result = False elif scheme not in ('http', 'https', 'ftp'): result = False elif self._is_platform_dependent(link): result = False else: host = netloc.split(':', 1)[0] if host.lower() == 'localhost': result = False else: result = True logger.debug('should_queue: %s (%s) from %s -> %s', link, rel, referrer, result) return result def _fetch(self): """ Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. """ while True: url = self._to_fetch.get() try: if url: page = self.get_page(url) if page is None: # e.g. after an error continue for link, rel in page.links: if link not in self._seen: try: self._seen.add(link) if (not self._process_download(link) and self._should_queue(link, url, rel)): logger.debug('Queueing %s from %s', link, url) self._to_fetch.put(link) except MetadataInvalidError: # e.g. invalid versions pass except Exception as e: # pragma: no cover self.errors.put(text_type(e)) finally: # always do this, to avoid hangs :-) self._to_fetch.task_done() if not url: #logger.debug('Sentinel seen, quitting.') break def get_page(self, url): """ Get the HTML for an URL, possibly from an in-memory cache. XXX TODO Note: this cache is never actually cleared. It's assumed that the data won't get stale over the lifetime of a locator instance (not necessarily true for the default_locator). """ # http://peak.telecommunity.com/DevCenter/EasyInstall#package-index-api scheme, netloc, path, _, _, _ = urlparse(url) if scheme == 'file' and os.path.isdir(url2pathname(path)): url = urljoin(ensure_slash(url), 'index.html') if url in self._page_cache: result = self._page_cache[url] logger.debug('Returning %s from cache: %s', url, result) else: host = netloc.split(':', 1)[0] result = None if host in self._bad_hosts: logger.debug('Skipping %s due to bad host %s', url, host) else: req = Request(url, headers={'Accept-encoding': 'identity'}) try: logger.debug('Fetching %s', url) resp = self.opener.open(req, timeout=self.timeout) logger.debug('Fetched %s', url) headers = resp.info() content_type = headers.get('Content-Type', '') if HTML_CONTENT_TYPE.match(content_type): final_url = resp.geturl() data = resp.read() encoding = headers.get('Content-Encoding') if encoding: decoder = self.decoders[encoding] # fail if not found data = decoder(data) encoding = 'utf-8' m = CHARSET.search(content_type) if m: encoding = m.group(1) try: data = data.decode(encoding) except UnicodeError: # pragma: no cover data = data.decode('latin-1') # fallback result = Page(data, final_url) self._page_cache[final_url] = result except HTTPError as e: if e.code != 404: logger.exception('Fetch failed: %s: %s', url, e) except URLError as e: # pragma: no cover logger.exception('Fetch failed: %s: %s', url, e) with self._lock: self._bad_hosts.add(host) except Exception as e: # pragma: no cover logger.exception('Fetch failed: %s: %s', url, e) finally: self._page_cache[url] = result # even if None (failure) return result _distname_re = re.compile(']*>([^<]+)<') def get_distribution_names(self): """ Return all the distribution names known to this locator. """ result = set() page = self.get_page(self.base_url) if not page: raise DistlibException('Unable to get %s' % self.base_url) for match in self._distname_re.finditer(page.data): result.add(match.group(1)) return result class DirectoryLocator(Locator): """ This class locates distributions in a directory tree. """ def __init__(self, path, **kwargs): """ Initialise an instance. :param path: The root of the directory tree to search. :param kwargs: Passed to the superclass constructor, except for: * recursive - if True (the default), subdirectories are recursed into. If False, only the top-level directory is searched, """ self.recursive = kwargs.pop('recursive', True) super(DirectoryLocator, self).__init__(**kwargs) path = os.path.abspath(path) if not os.path.isdir(path): # pragma: no cover raise DistlibException('Not a directory: %r' % path) self.base_dir = path def should_include(self, filename, parent): """ Should a filename be considered as a candidate for a distribution archive? As well as the filename, the directory which contains it is provided, though not used by the current implementation. """ return filename.endswith(self.downloadable_extensions) def _get_project(self, name): result = {'urls': {}, 'digests': {}} for root, dirs, files in os.walk(self.base_dir): for fn in files: if self.should_include(fn, root): fn = os.path.join(root, fn) url = urlunparse(('file', '', pathname2url(os.path.abspath(fn)), '', '', '')) info = self.convert_url_to_download_info(url, name) if info: self._update_version_data(result, info) if not self.recursive: break return result def get_distribution_names(self): """ Return all the distribution names known to this locator. """ result = set() for root, dirs, files in os.walk(self.base_dir): for fn in files: if self.should_include(fn, root): fn = os.path.join(root, fn) url = urlunparse(('file', '', pathname2url(os.path.abspath(fn)), '', '', '')) info = self.convert_url_to_download_info(url, None) if info: result.add(info['name']) if not self.recursive: break return result class JSONLocator(Locator): """ This locator uses special extended metadata (not available on PyPI) and is the basis of performant dependency resolution in distlib. Other locators require archive downloads before dependencies can be determined! As you might imagine, that can be slow. """ def get_distribution_names(self): """ Return all the distribution names known to this locator. """ raise NotImplementedError('Not available from this locator') def _get_project(self, name): result = {'urls': {}, 'digests': {}} data = get_project_data(name) if data: for info in data.get('files', []): if info['ptype'] != 'sdist' or info['pyversion'] != 'source': continue # We don't store summary in project metadata as it makes # the data bigger for no benefit during dependency # resolution dist = make_dist(data['name'], info['version'], summary=data.get('summary', 'Placeholder for summary'), scheme=self.scheme) md = dist.metadata md.source_url = info['url'] # TODO SHA256 digest if 'digest' in info and info['digest']: dist.digest = ('md5', info['digest']) md.dependencies = info.get('requirements', {}) dist.exports = info.get('exports', {}) result[dist.version] = dist result['urls'].setdefault(dist.version, set()).add(info['url']) return result class DistPathLocator(Locator): """ This locator finds installed distributions in a path. It can be useful for adding to an :class:`AggregatingLocator`. """ def __init__(self, distpath, **kwargs): """ Initialise an instance. :param distpath: A :class:`DistributionPath` instance to search. """ super(DistPathLocator, self).__init__(**kwargs) assert isinstance(distpath, DistributionPath) self.distpath = distpath def _get_project(self, name): dist = self.distpath.get_distribution(name) if dist is None: result = {'urls': {}, 'digests': {}} else: result = { dist.version: dist, 'urls': {dist.version: set([dist.source_url])}, 'digests': {dist.version: set([None])} } return result class AggregatingLocator(Locator): """ This class allows you to chain and/or merge a list of locators. """ def __init__(self, *locators, **kwargs): """ Initialise an instance. :param locators: The list of locators to search. :param kwargs: Passed to the superclass constructor, except for: * merge - if False (the default), the first successful search from any of the locators is returned. If True, the results from all locators are merged (this can be slow). """ self.merge = kwargs.pop('merge', False) self.locators = locators super(AggregatingLocator, self).__init__(**kwargs) def clear_cache(self): super(AggregatingLocator, self).clear_cache() for locator in self.locators: locator.clear_cache() def _set_scheme(self, value): self._scheme = value for locator in self.locators: locator.scheme = value scheme = property(Locator.scheme.fget, _set_scheme) def _get_project(self, name): result = {} for locator in self.locators: d = locator.get_project(name) if d: if self.merge: files = result.get('urls', {}) digests = result.get('digests', {}) # next line could overwrite result['urls'], result['digests'] result.update(d) df = result.get('urls') if files and df: for k, v in files.items(): if k in df: df[k] |= v else: df[k] = v dd = result.get('digests') if digests and dd: dd.update(digests) else: # See issue #18. If any dists are found and we're looking # for specific constraints, we only return something if # a match is found. For example, if a DirectoryLocator # returns just foo (1.0) while we're looking for # foo (>= 2.0), we'll pretend there was nothing there so # that subsequent locators can be queried. Otherwise we # would just return foo (1.0) which would then lead to a # failure to find foo (>= 2.0), because other locators # weren't searched. Note that this only matters when # merge=False. if self.matcher is None: found = True else: found = False for k in d: if self.matcher.match(k): found = True break if found: result = d break return result def get_distribution_names(self): """ Return all the distribution names known to this locator. """ result = set() for locator in self.locators: try: result |= locator.get_distribution_names() except NotImplementedError: pass return result # We use a legacy scheme simply because most of the dists on PyPI use legacy # versions which don't conform to PEP 426 / PEP 440. default_locator = AggregatingLocator( JSONLocator(), SimpleScrapingLocator('https://pypi.org/simple/', timeout=3.0), scheme='legacy') locate = default_locator.locate NAME_VERSION_RE = re.compile(r'(?P[\w-]+)\s*' r'\(\s*(==\s*)?(?P[^)]+)\)$') class DependencyFinder(object): """ Locate dependencies for distributions. """ def __init__(self, locator=None): """ Initialise an instance, using the specified locator to locate distributions. """ self.locator = locator or default_locator self.scheme = get_scheme(self.locator.scheme) def add_distribution(self, dist): """ Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add. """ logger.debug('adding distribution %s', dist) name = dist.key self.dists_by_name[name] = dist self.dists[(name, dist.version)] = dist for p in dist.provides: name, version = parse_name_and_version(p) logger.debug('Add to provided: %s, %s, %s', name, version, dist) self.provided.setdefault(name, set()).add((version, dist)) def remove_distribution(self, dist): """ Remove a distribution from the finder. This will update internal information about who provides what. :param dist: The distribution to remove. """ logger.debug('removing distribution %s', dist) name = dist.key del self.dists_by_name[name] del self.dists[(name, dist.version)] for p in dist.provides: name, version = parse_name_and_version(p) logger.debug('Remove from provided: %s, %s, %s', name, version, dist) s = self.provided[name] s.remove((version, dist)) if not s: del self.provided[name] def get_matcher(self, reqt): """ Get a version matcher for a requirement. :param reqt: The requirement :type reqt: str :return: A version matcher (an instance of :class:`distlib.version.Matcher`). """ try: matcher = self.scheme.matcher(reqt) except UnsupportedVersionError: # pragma: no cover # XXX compat-mode if cannot read the version name = reqt.split()[0] matcher = self.scheme.matcher(name) return matcher def find_providers(self, reqt): """ Find the distributions which can fulfill a requirement. :param reqt: The requirement. :type reqt: str :return: A set of distribution which can fulfill the requirement. """ matcher = self.get_matcher(reqt) name = matcher.key # case-insensitive result = set() provided = self.provided if name in provided: for version, provider in provided[name]: try: match = matcher.match(version) except UnsupportedVersionError: match = False if match: result.add(provider) break return result def try_to_replace(self, provider, other, problems): """ Attempt to replace one provider with another. This is typically used when resolving dependencies from multiple sources, e.g. A requires (B >= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. """ rlist = self.reqts[other] unmatched = set() for s in rlist: matcher = self.get_matcher(s) if not matcher.match(provider.version): unmatched.add(s) if unmatched: # can't replace other with provider problems.add(('cantreplace', provider, other, frozenset(unmatched))) result = False else: # can replace other with provider self.remove_distribution(other) del self.reqts[other] for s in rlist: self.reqts.setdefault(provider, set()).add(s) self.add_distribution(provider) result = True return result def find(self, requirement, meta_extras=None, prereleases=False): """ Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. """ self.provided = {} self.dists = {} self.dists_by_name = {} self.reqts = {} meta_extras = set(meta_extras or []) if ':*:' in meta_extras: meta_extras.remove(':*:') # :meta: and :run: are implicitly included meta_extras |= set([':test:', ':build:', ':dev:']) if isinstance(requirement, Distribution): dist = odist = requirement logger.debug('passed %s as requirement', odist) else: dist = odist = self.locator.locate(requirement, prereleases=prereleases) if dist is None: raise DistlibException('Unable to locate %r' % requirement) logger.debug('located %s', odist) dist.requested = True problems = set() todo = set([dist]) install_dists = set([odist]) while todo: dist = todo.pop() name = dist.key # case-insensitive if name not in self.dists_by_name: self.add_distribution(dist) else: #import pdb; pdb.set_trace() other = self.dists_by_name[name] if other != dist: self.try_to_replace(dist, other, problems) ireqts = dist.run_requires | dist.meta_requires sreqts = dist.build_requires ereqts = set() if meta_extras and dist in install_dists: for key in ('test', 'build', 'dev'): e = ':%s:' % key if e in meta_extras: ereqts |= getattr(dist, '%s_requires' % key) all_reqts = ireqts | sreqts | ereqts for r in all_reqts: providers = self.find_providers(r) if not providers: logger.debug('No providers found for %r', r) provider = self.locator.locate(r, prereleases=prereleases) # If no provider is found and we didn't consider # prereleases, consider them now. if provider is None and not prereleases: provider = self.locator.locate(r, prereleases=True) if provider is None: logger.debug('Cannot satisfy %r', r) problems.add(('unsatisfied', r)) else: n, v = provider.key, provider.version if (n, v) not in self.dists: todo.add(provider) providers.add(provider) if r in ireqts and dist in install_dists: install_dists.add(provider) logger.debug('Adding %s to install_dists', provider.name_and_version) for p in providers: name = p.key if name not in self.dists_by_name: self.reqts.setdefault(p, set()).add(r) else: other = self.dists_by_name[name] if other != p: # see if other can be replaced by p self.try_to_replace(p, other, problems) dists = set(self.dists.values()) for dist in dists: dist.build_time_dependency = dist not in install_dists if dist.build_time_dependency: logger.debug('%s is a build-time dependency only.', dist.name_and_version) logger.debug('find done for %s', odist) return dists, problems PKd]h(,_[_[distlib/version.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2017 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. """ import logging import re from .compat import string_types from .util import parse_requirement __all__ = ['NormalizedVersion', 'NormalizedMatcher', 'LegacyVersion', 'LegacyMatcher', 'SemanticVersion', 'SemanticMatcher', 'UnsupportedVersionError', 'get_scheme'] logger = logging.getLogger(__name__) class UnsupportedVersionError(ValueError): """This is an unsupported version.""" pass class Version(object): def __init__(self, s): self._string = s = s.strip() self._parts = parts = self.parse(s) assert isinstance(parts, tuple) assert len(parts) > 0 def parse(self, s): raise NotImplementedError('please implement in a subclass') def _check_compatible(self, other): if type(self) != type(other): raise TypeError('cannot compare %r and %r' % (self, other)) def __eq__(self, other): self._check_compatible(other) return self._parts == other._parts def __ne__(self, other): return not self.__eq__(other) def __lt__(self, other): self._check_compatible(other) return self._parts < other._parts def __gt__(self, other): return not (self.__lt__(other) or self.__eq__(other)) def __le__(self, other): return self.__lt__(other) or self.__eq__(other) def __ge__(self, other): return self.__gt__(other) or self.__eq__(other) # See http://docs.python.org/reference/datamodel#object.__hash__ def __hash__(self): return hash(self._parts) def __repr__(self): return "%s('%s')" % (self.__class__.__name__, self._string) def __str__(self): return self._string @property def is_prerelease(self): raise NotImplementedError('Please implement in subclasses.') class Matcher(object): version_class = None # value is either a callable or the name of a method _operators = { '<': lambda v, c, p: v < c, '>': lambda v, c, p: v > c, '<=': lambda v, c, p: v == c or v < c, '>=': lambda v, c, p: v == c or v > c, '==': lambda v, c, p: v == c, '===': lambda v, c, p: v == c, # by default, compatible => >=. '~=': lambda v, c, p: v == c or v > c, '!=': lambda v, c, p: v != c, } # this is a method only to support alternative implementations # via overriding def parse_requirement(self, s): return parse_requirement(s) def __init__(self, s): if self.version_class is None: raise ValueError('Please specify a version class') self._string = s = s.strip() r = self.parse_requirement(s) if not r: raise ValueError('Not valid: %r' % s) self.name = r.name self.key = self.name.lower() # for case-insensitive comparisons clist = [] if r.constraints: # import pdb; pdb.set_trace() for op, s in r.constraints: if s.endswith('.*'): if op not in ('==', '!='): raise ValueError('\'.*\' not allowed for ' '%r constraints' % op) # Could be a partial version (e.g. for '2.*') which # won't parse as a version, so keep it as a string vn, prefix = s[:-2], True # Just to check that vn is a valid version self.version_class(vn) else: # Should parse as a version, so we can create an # instance for the comparison vn, prefix = self.version_class(s), False clist.append((op, vn, prefix)) self._parts = tuple(clist) def match(self, version): """ Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. """ if isinstance(version, string_types): version = self.version_class(version) for operator, constraint, prefix in self._parts: f = self._operators.get(operator) if isinstance(f, string_types): f = getattr(self, f) if not f: msg = ('%r not implemented ' 'for %s' % (operator, self.__class__.__name__)) raise NotImplementedError(msg) if not f(version, constraint, prefix): return False return True @property def exact_version(self): result = None if len(self._parts) == 1 and self._parts[0][0] in ('==', '==='): result = self._parts[0][1] return result def _check_compatible(self, other): if type(self) != type(other) or self.name != other.name: raise TypeError('cannot compare %s and %s' % (self, other)) def __eq__(self, other): self._check_compatible(other) return self.key == other.key and self._parts == other._parts def __ne__(self, other): return not self.__eq__(other) # See http://docs.python.org/reference/datamodel#object.__hash__ def __hash__(self): return hash(self.key) + hash(self._parts) def __repr__(self): return "%s(%r)" % (self.__class__.__name__, self._string) def __str__(self): return self._string PEP440_VERSION_RE = re.compile(r'^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?' r'(\.(post)(\d+))?(\.(dev)(\d+))?' r'(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$') def _pep_440_key(s): s = s.strip() m = PEP440_VERSION_RE.match(s) if not m: raise UnsupportedVersionError('Not a valid version: %s' % s) groups = m.groups() nums = tuple(int(v) for v in groups[1].split('.')) while len(nums) > 1 and nums[-1] == 0: nums = nums[:-1] if not groups[0]: epoch = 0 else: epoch = int(groups[0]) pre = groups[4:6] post = groups[7:9] dev = groups[10:12] local = groups[13] if pre == (None, None): pre = () else: pre = pre[0], int(pre[1]) if post == (None, None): post = () else: post = post[0], int(post[1]) if dev == (None, None): dev = () else: dev = dev[0], int(dev[1]) if local is None: local = () else: parts = [] for part in local.split('.'): # to ensure that numeric compares as > lexicographic, avoid # comparing them directly, but encode a tuple which ensures # correct sorting if part.isdigit(): part = (1, int(part)) else: part = (0, part) parts.append(part) local = tuple(parts) if not pre: # either before pre-release, or final release and after if not post and dev: # before pre-release pre = ('a', -1) # to sort before a0 else: pre = ('z',) # to sort after all pre-releases # now look at the state of post and dev. if not post: post = ('_',) # sort before 'a' if not dev: dev = ('final',) #print('%s -> %s' % (s, m.groups())) return epoch, nums, pre, post, dev, local _normalized_key = _pep_440_key class NormalizedVersion(Version): """A rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b """ def parse(self, s): result = _normalized_key(s) # _normalized_key loses trailing zeroes in the release # clause, since that's needed to ensure that X.Y == X.Y.0 == X.Y.0.0 # However, PEP 440 prefix matching needs it: for example, # (~= 1.4.5.0) matches differently to (~= 1.4.5.0.0). m = PEP440_VERSION_RE.match(s) # must succeed groups = m.groups() self._release_clause = tuple(int(v) for v in groups[1].split('.')) return result PREREL_TAGS = set(['a', 'b', 'c', 'rc', 'dev']) @property def is_prerelease(self): return any(t[0] in self.PREREL_TAGS for t in self._parts if t) def _match_prefix(x, y): x = str(x) y = str(y) if x == y: return True if not x.startswith(y): return False n = len(y) return x[n] == '.' class NormalizedMatcher(Matcher): version_class = NormalizedVersion # value is either a callable or the name of a method _operators = { '~=': '_match_compatible', '<': '_match_lt', '>': '_match_gt', '<=': '_match_le', '>=': '_match_ge', '==': '_match_eq', '===': '_match_arbitrary', '!=': '_match_ne', } def _adjust_local(self, version, constraint, prefix): if prefix: strip_local = '+' not in constraint and version._parts[-1] else: # both constraint and version are # NormalizedVersion instances. # If constraint does not have a local component, # ensure the version doesn't, either. strip_local = not constraint._parts[-1] and version._parts[-1] if strip_local: s = version._string.split('+', 1)[0] version = self.version_class(s) return version, constraint def _match_lt(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) if version >= constraint: return False release_clause = constraint._release_clause pfx = '.'.join([str(i) for i in release_clause]) return not _match_prefix(version, pfx) def _match_gt(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) if version <= constraint: return False release_clause = constraint._release_clause pfx = '.'.join([str(i) for i in release_clause]) return not _match_prefix(version, pfx) def _match_le(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) return version <= constraint def _match_ge(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) return version >= constraint def _match_eq(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) if not prefix: result = (version == constraint) else: result = _match_prefix(version, constraint) return result def _match_arbitrary(self, version, constraint, prefix): return str(version) == str(constraint) def _match_ne(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) if not prefix: result = (version != constraint) else: result = not _match_prefix(version, constraint) return result def _match_compatible(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) if version == constraint: return True if version < constraint: return False # if not prefix: # return True release_clause = constraint._release_clause if len(release_clause) > 1: release_clause = release_clause[:-1] pfx = '.'.join([str(i) for i in release_clause]) return _match_prefix(version, pfx) _REPLACEMENTS = ( (re.compile('[.+-]$'), ''), # remove trailing puncts (re.compile(r'^[.](\d)'), r'0.\1'), # .N -> 0.N at start (re.compile('^[.-]'), ''), # remove leading puncts (re.compile(r'^\((.*)\)$'), r'\1'), # remove parentheses (re.compile(r'^v(ersion)?\s*(\d+)'), r'\2'), # remove leading v(ersion) (re.compile(r'^r(ev)?\s*(\d+)'), r'\2'), # remove leading v(ersion) (re.compile('[.]{2,}'), '.'), # multiple runs of '.' (re.compile(r'\b(alfa|apha)\b'), 'alpha'), # misspelt alpha (re.compile(r'\b(pre-alpha|prealpha)\b'), 'pre.alpha'), # standardise (re.compile(r'\(beta\)$'), 'beta'), # remove parentheses ) _SUFFIX_REPLACEMENTS = ( (re.compile('^[:~._+-]+'), ''), # remove leading puncts (re.compile('[,*")([\\]]'), ''), # remove unwanted chars (re.compile('[~:+_ -]'), '.'), # replace illegal chars (re.compile('[.]{2,}'), '.'), # multiple runs of '.' (re.compile(r'\.$'), ''), # trailing '.' ) _NUMERIC_PREFIX = re.compile(r'(\d+(\.\d+)*)') def _suggest_semantic_version(s): """ Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. """ result = s.strip().lower() for pat, repl in _REPLACEMENTS: result = pat.sub(repl, result) if not result: result = '0.0.0' # Now look for numeric prefix, and separate it out from # the rest. #import pdb; pdb.set_trace() m = _NUMERIC_PREFIX.match(result) if not m: prefix = '0.0.0' suffix = result else: prefix = m.groups()[0].split('.') prefix = [int(i) for i in prefix] while len(prefix) < 3: prefix.append(0) if len(prefix) == 3: suffix = result[m.end():] else: suffix = '.'.join([str(i) for i in prefix[3:]]) + result[m.end():] prefix = prefix[:3] prefix = '.'.join([str(i) for i in prefix]) suffix = suffix.strip() if suffix: #import pdb; pdb.set_trace() # massage the suffix. for pat, repl in _SUFFIX_REPLACEMENTS: suffix = pat.sub(repl, suffix) if not suffix: result = prefix else: sep = '-' if 'dev' in suffix else '+' result = prefix + sep + suffix if not is_semver(result): result = None return result def _suggest_normalized_version(s): """Suggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. """ try: _normalized_key(s) return s # already rational except UnsupportedVersionError: pass rs = s.lower() # part of this could use maketrans for orig, repl in (('-alpha', 'a'), ('-beta', 'b'), ('alpha', 'a'), ('beta', 'b'), ('rc', 'c'), ('-final', ''), ('-pre', 'c'), ('-release', ''), ('.release', ''), ('-stable', ''), ('+', '.'), ('_', '.'), (' ', ''), ('.final', ''), ('final', '')): rs = rs.replace(orig, repl) # if something ends with dev or pre, we add a 0 rs = re.sub(r"pre$", r"pre0", rs) rs = re.sub(r"dev$", r"dev0", rs) # if we have something like "b-2" or "a.2" at the end of the # version, that is probably beta, alpha, etc # let's remove the dash or dot rs = re.sub(r"([abc]|rc)[\-\.](\d+)$", r"\1\2", rs) # 1.0-dev-r371 -> 1.0.dev371 # 0.1-dev-r79 -> 0.1.dev79 rs = re.sub(r"[\-\.](dev)[\-\.]?r?(\d+)$", r".\1\2", rs) # Clean: 2.0.a.3, 2.0.b1, 0.9.0~c1 rs = re.sub(r"[.~]?([abc])\.?", r"\1", rs) # Clean: v0.3, v1.0 if rs.startswith('v'): rs = rs[1:] # Clean leading '0's on numbers. #TODO: unintended side-effect on, e.g., "2003.05.09" # PyPI stats: 77 (~2%) better rs = re.sub(r"\b0+(\d+)(?!\d)", r"\1", rs) # Clean a/b/c with no version. E.g. "1.0a" -> "1.0a0". Setuptools infers # zero. # PyPI stats: 245 (7.56%) better rs = re.sub(r"(\d+[abc])$", r"\g<1>0", rs) # the 'dev-rNNN' tag is a dev tag rs = re.sub(r"\.?(dev-r|dev\.r)\.?(\d+)$", r".dev\2", rs) # clean the - when used as a pre delimiter rs = re.sub(r"-(a|b|c)(\d+)$", r"\1\2", rs) # a terminal "dev" or "devel" can be changed into ".dev0" rs = re.sub(r"[\.\-](dev|devel)$", r".dev0", rs) # a terminal "dev" can be changed into ".dev0" rs = re.sub(r"(?![\.\-])dev$", r".dev0", rs) # a terminal "final" or "stable" can be removed rs = re.sub(r"(final|stable)$", "", rs) # The 'r' and the '-' tags are post release tags # 0.4a1.r10 -> 0.4a1.post10 # 0.9.33-17222 -> 0.9.33.post17222 # 0.9.33-r17222 -> 0.9.33.post17222 rs = re.sub(r"\.?(r|-|-r)\.?(\d+)$", r".post\2", rs) # Clean 'r' instead of 'dev' usage: # 0.9.33+r17222 -> 0.9.33.dev17222 # 1.0dev123 -> 1.0.dev123 # 1.0.git123 -> 1.0.dev123 # 1.0.bzr123 -> 1.0.dev123 # 0.1a0dev.123 -> 0.1a0.dev123 # PyPI stats: ~150 (~4%) better rs = re.sub(r"\.?(dev|git|bzr)\.?(\d+)$", r".dev\2", rs) # Clean '.pre' (normalized from '-pre' above) instead of 'c' usage: # 0.2.pre1 -> 0.2c1 # 0.2-c1 -> 0.2c1 # 1.0preview123 -> 1.0c123 # PyPI stats: ~21 (0.62%) better rs = re.sub(r"\.?(pre|preview|-c)(\d+)$", r"c\g<2>", rs) # Tcl/Tk uses "px" for their post release markers rs = re.sub(r"p(\d+)$", r".post\1", rs) try: _normalized_key(rs) except UnsupportedVersionError: rs = None return rs # # Legacy version processing (distribute-compatible) # _VERSION_PART = re.compile(r'([a-z]+|\d+|[\.-])', re.I) _VERSION_REPLACE = { 'pre': 'c', 'preview': 'c', '-': 'final-', 'rc': 'c', 'dev': '@', '': None, '.': None, } def _legacy_key(s): def get_parts(s): result = [] for p in _VERSION_PART.split(s.lower()): p = _VERSION_REPLACE.get(p, p) if p: if '0' <= p[:1] <= '9': p = p.zfill(8) else: p = '*' + p result.append(p) result.append('*final') return result result = [] for p in get_parts(s): if p.startswith('*'): if p < '*final': while result and result[-1] == '*final-': result.pop() while result and result[-1] == '00000000': result.pop() result.append(p) return tuple(result) class LegacyVersion(Version): def parse(self, s): return _legacy_key(s) @property def is_prerelease(self): result = False for x in self._parts: if (isinstance(x, string_types) and x.startswith('*') and x < '*final'): result = True break return result class LegacyMatcher(Matcher): version_class = LegacyVersion _operators = dict(Matcher._operators) _operators['~='] = '_match_compatible' numeric_re = re.compile(r'^(\d+(\.\d+)*)') def _match_compatible(self, version, constraint, prefix): if version < constraint: return False m = self.numeric_re.match(str(constraint)) if not m: logger.warning('Cannot compute compatible match for version %s ' ' and constraint %s', version, constraint) return True s = m.groups()[0] if '.' in s: s = s.rsplit('.', 1)[0] return _match_prefix(version, s) # # Semantic versioning # _SEMVER_RE = re.compile(r'^(\d+)\.(\d+)\.(\d+)' r'(-[a-z0-9]+(\.[a-z0-9-]+)*)?' r'(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$', re.I) def is_semver(s): return _SEMVER_RE.match(s) def _semantic_key(s): def make_tuple(s, absent): if s is None: result = (absent,) else: parts = s[1:].split('.') # We can't compare ints and strings on Python 3, so fudge it # by zero-filling numeric values so simulate a numeric comparison result = tuple([p.zfill(8) if p.isdigit() else p for p in parts]) return result m = is_semver(s) if not m: raise UnsupportedVersionError(s) groups = m.groups() major, minor, patch = [int(i) for i in groups[:3]] # choose the '|' and '*' so that versions sort correctly pre, build = make_tuple(groups[3], '|'), make_tuple(groups[5], '*') return (major, minor, patch), pre, build class SemanticVersion(Version): def parse(self, s): return _semantic_key(s) @property def is_prerelease(self): return self._parts[1][0] != '|' class SemanticMatcher(Matcher): version_class = SemanticVersion class VersionScheme(object): def __init__(self, key, matcher, suggester=None): self.key = key self.matcher = matcher self.suggester = suggester def is_valid_version(self, s): try: self.matcher.version_class(s) result = True except UnsupportedVersionError: result = False return result def is_valid_matcher(self, s): try: self.matcher(s) result = True except UnsupportedVersionError: result = False return result def is_valid_constraint_list(self, s): """ Used for processing some metadata fields """ return self.is_valid_matcher('dummy_name (%s)' % s) def suggest(self, s): if self.suggester is None: result = None else: result = self.suggester(s) return result _SCHEMES = { 'normalized': VersionScheme(_normalized_key, NormalizedMatcher, _suggest_normalized_version), 'legacy': VersionScheme(_legacy_key, LegacyMatcher, lambda self, s: s), 'semantic': VersionScheme(_semantic_key, SemanticMatcher, _suggest_semantic_version), } _SCHEMES['default'] = _SCHEMES['normalized'] def get_scheme(name): if name not in _SCHEMES: raise ValueError('unknown scheme name: %r' % name) return _SCHEMES[name] PKd]+distlib/compat.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys try: import ssl except ImportError: # pragma: no cover ssl = None if sys.version_info[0] < 3: # pragma: no cover from StringIO import StringIO string_types = basestring, text_type = unicode from types import FileType as file_type import __builtin__ as builtins import ConfigParser as configparser from ._backport import shutil from urlparse import urlparse, urlunparse, urljoin, urlsplit, urlunsplit from urllib import (urlretrieve, quote as _quote, unquote, url2pathname, pathname2url, ContentTooShortError, splittype) def quote(s): if isinstance(s, unicode): s = s.encode('utf-8') return _quote(s) import urllib2 from urllib2 import (Request, urlopen, URLError, HTTPError, HTTPBasicAuthHandler, HTTPPasswordMgr, HTTPHandler, HTTPRedirectHandler, build_opener) if ssl: from urllib2 import HTTPSHandler import httplib import xmlrpclib import Queue as queue from HTMLParser import HTMLParser import htmlentitydefs raw_input = raw_input from itertools import ifilter as filter from itertools import ifilterfalse as filterfalse _userprog = None def splituser(host): """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.""" global _userprog if _userprog is None: import re _userprog = re.compile('^(.*)@(.*)$') match = _userprog.match(host) if match: return match.group(1, 2) return None, host else: # pragma: no cover from io import StringIO string_types = str, text_type = str from io import TextIOWrapper as file_type import builtins import configparser import shutil from urllib.parse import (urlparse, urlunparse, urljoin, splituser, quote, unquote, urlsplit, urlunsplit, splittype) from urllib.request import (urlopen, urlretrieve, Request, url2pathname, pathname2url, HTTPBasicAuthHandler, HTTPPasswordMgr, HTTPHandler, HTTPRedirectHandler, build_opener) if ssl: from urllib.request import HTTPSHandler from urllib.error import HTTPError, URLError, ContentTooShortError import http.client as httplib import urllib.request as urllib2 import xmlrpc.client as xmlrpclib import queue from html.parser import HTMLParser import html.entities as htmlentitydefs raw_input = input from itertools import filterfalse filter = filter try: from ssl import match_hostname, CertificateError except ImportError: # pragma: no cover class CertificateError(ValueError): pass def _dnsname_match(dn, hostname, max_wildcards=1): """Matching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 """ pats = [] if not dn: return False parts = dn.split('.') leftmost, remainder = parts[0], parts[1:] wildcards = leftmost.count('*') if wildcards > max_wildcards: # Issue #17980: avoid denials of service by refusing more # than one wildcard per fragment. A survey of established # policy among SSL implementations showed it to be a # reasonable choice. raise CertificateError( "too many wildcards in certificate DNS name: " + repr(dn)) # speed up common case w/o wildcards if not wildcards: return dn.lower() == hostname.lower() # RFC 6125, section 6.4.3, subitem 1. # The client SHOULD NOT attempt to match a presented identifier in which # the wildcard character comprises a label other than the left-most label. if leftmost == '*': # When '*' is a fragment by itself, it matches a non-empty dotless # fragment. pats.append('[^.]+') elif leftmost.startswith('xn--') or hostname.startswith('xn--'): # RFC 6125, section 6.4.3, subitem 3. # The client SHOULD NOT attempt to match a presented identifier # where the wildcard character is embedded within an A-label or # U-label of an internationalized domain name. pats.append(re.escape(leftmost)) else: # Otherwise, '*' matches any dotless string, e.g. www* pats.append(re.escape(leftmost).replace(r'\*', '[^.]*')) # add the remaining fragments, ignore any wildcards for frag in remainder: pats.append(re.escape(frag)) pat = re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE) return pat.match(hostname) def match_hostname(cert, hostname): """Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. """ if not cert: raise ValueError("empty or no certificate, match_hostname needs a " "SSL socket or SSL context with either " "CERT_OPTIONAL or CERT_REQUIRED") dnsnames = [] san = cert.get('subjectAltName', ()) for key, value in san: if key == 'DNS': if _dnsname_match(value, hostname): return dnsnames.append(value) if not dnsnames: # The subject is only checked when there is no dNSName entry # in subjectAltName for sub in cert.get('subject', ()): for key, value in sub: # XXX according to RFC 2818, the most specific Common Name # must be used. if key == 'commonName': if _dnsname_match(value, hostname): return dnsnames.append(value) if len(dnsnames) > 1: raise CertificateError("hostname %r " "doesn't match either of %s" % (hostname, ', '.join(map(repr, dnsnames)))) elif len(dnsnames) == 1: raise CertificateError("hostname %r " "doesn't match %r" % (hostname, dnsnames[0])) else: raise CertificateError("no appropriate commonName or " "subjectAltName fields were found") try: from types import SimpleNamespace as Container except ImportError: # pragma: no cover class Container(object): """ A generic container for when multiple values need to be returned """ def __init__(self, **kwargs): self.__dict__.update(kwargs) try: from shutil import which except ImportError: # pragma: no cover # Implementation from Python 3.3 def which(cmd, mode=os.F_OK | os.X_OK, path=None): """Given a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. """ # Check that a given file can be accessed with the correct mode. # Additionally check that `file` is not a directory, as on Windows # directories pass the os.access check. def _access_check(fn, mode): return (os.path.exists(fn) and os.access(fn, mode) and not os.path.isdir(fn)) # If we're given a path with a directory part, look it up directly rather # than referring to PATH directories. This includes checking relative to the # current directory, e.g. ./script if os.path.dirname(cmd): if _access_check(cmd, mode): return cmd return None if path is None: path = os.environ.get("PATH", os.defpath) if not path: return None path = path.split(os.pathsep) if sys.platform == "win32": # The current directory takes precedence on Windows. if not os.curdir in path: path.insert(0, os.curdir) # PATHEXT is necessary to check on Windows. pathext = os.environ.get("PATHEXT", "").split(os.pathsep) # See if the given file matches any of the expected path extensions. # This will allow us to short circuit when given "python.exe". # If it does match, only test that one, otherwise we have to try # others. if any(cmd.lower().endswith(ext.lower()) for ext in pathext): files = [cmd] else: files = [cmd + ext for ext in pathext] else: # On other platforms you don't have things like PATHEXT to tell you # what file suffixes are executable, so just pass on cmd as-is. files = [cmd] seen = set() for dir in path: normdir = os.path.normcase(dir) if not normdir in seen: seen.add(normdir) for thefile in files: name = os.path.join(dir, thefile) if _access_check(name, mode): return name return None # ZipFile is a context manager in 2.7, but not in 2.6 from zipfile import ZipFile as BaseZipFile if hasattr(BaseZipFile, '__enter__'): # pragma: no cover ZipFile = BaseZipFile else: # pragma: no cover from zipfile import ZipExtFile as BaseZipExtFile class ZipExtFile(BaseZipExtFile): def __init__(self, base): self.__dict__.update(base.__dict__) def __enter__(self): return self def __exit__(self, *exc_info): self.close() # return None, so if an exception occurred, it will propagate class ZipFile(BaseZipFile): def __enter__(self): return self def __exit__(self, *exc_info): self.close() # return None, so if an exception occurred, it will propagate def open(self, *args, **kwargs): base = BaseZipFile.open(self, *args, **kwargs) return ZipExtFile(base) try: from platform import python_implementation except ImportError: # pragma: no cover def python_implementation(): """Return a string identifying the Python implementation.""" if 'PyPy' in sys.version: return 'PyPy' if os.name == 'java': return 'Jython' if sys.version.startswith('IronPython'): return 'IronPython' return 'CPython' try: import sysconfig except ImportError: # pragma: no cover from ._backport import sysconfig try: callable = callable except NameError: # pragma: no cover from collections.abc import Callable def callable(obj): return isinstance(obj, Callable) try: fsencode = os.fsencode fsdecode = os.fsdecode except AttributeError: # pragma: no cover # Issue #99: on some systems (e.g. containerised), # sys.getfilesystemencoding() returns None, and we need a real value, # so fall back to utf-8. From the CPython 2.7 docs relating to Unix and # sys.getfilesystemencoding(): the return value is "the user’s preference # according to the result of nl_langinfo(CODESET), or None if the # nl_langinfo(CODESET) failed." _fsencoding = sys.getfilesystemencoding() or 'utf-8' if _fsencoding == 'mbcs': _fserrors = 'strict' else: _fserrors = 'surrogateescape' def fsencode(filename): if isinstance(filename, bytes): return filename elif isinstance(filename, text_type): return filename.encode(_fsencoding, _fserrors) else: raise TypeError("expect bytes or str, not %s" % type(filename).__name__) def fsdecode(filename): if isinstance(filename, text_type): return filename elif isinstance(filename, bytes): return filename.decode(_fsencoding, _fserrors) else: raise TypeError("expect bytes or str, not %s" % type(filename).__name__) try: from tokenize import detect_encoding except ImportError: # pragma: no cover from codecs import BOM_UTF8, lookup import re cookie_re = re.compile(r"coding[:=]\s*([-\w.]+)") def _get_normal_name(orig_enc): """Imitates get_normal_name in tokenizer.c.""" # Only care about the first 12 characters. enc = orig_enc[:12].lower().replace("_", "-") if enc == "utf-8" or enc.startswith("utf-8-"): return "utf-8" if enc in ("latin-1", "iso-8859-1", "iso-latin-1") or \ enc.startswith(("latin-1-", "iso-8859-1-", "iso-latin-1-")): return "iso-8859-1" return orig_enc def detect_encoding(readline): """ The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. """ try: filename = readline.__self__.name except AttributeError: filename = None bom_found = False encoding = None default = 'utf-8' def read_or_stop(): try: return readline() except StopIteration: return b'' def find_cookie(line): try: # Decode as UTF-8. Either the line is an encoding declaration, # in which case it should be pure ASCII, or it must be UTF-8 # per default encoding. line_string = line.decode('utf-8') except UnicodeDecodeError: msg = "invalid or missing encoding declaration" if filename is not None: msg = '{} for {!r}'.format(msg, filename) raise SyntaxError(msg) matches = cookie_re.findall(line_string) if not matches: return None encoding = _get_normal_name(matches[0]) try: codec = lookup(encoding) except LookupError: # This behaviour mimics the Python interpreter if filename is None: msg = "unknown encoding: " + encoding else: msg = "unknown encoding for {!r}: {}".format(filename, encoding) raise SyntaxError(msg) if bom_found: if codec.name != 'utf-8': # This behaviour mimics the Python interpreter if filename is None: msg = 'encoding problem: utf-8' else: msg = 'encoding problem for {!r}: utf-8'.format(filename) raise SyntaxError(msg) encoding += '-sig' return encoding first = read_or_stop() if first.startswith(BOM_UTF8): bom_found = True first = first[3:] default = 'utf-8-sig' if not first: return default, [] encoding = find_cookie(first) if encoding: return encoding, [first] second = read_or_stop() if not second: return default, [first] encoding = find_cookie(second) if encoding: return encoding, [first, second] return default, [first, second] # For converting & <-> & etc. try: from html import escape except ImportError: from cgi import escape if sys.version_info[:2] < (3, 4): unescape = HTMLParser().unescape else: from html import unescape try: from collections import ChainMap except ImportError: # pragma: no cover from collections import MutableMapping try: from reprlib import recursive_repr as _recursive_repr except ImportError: def _recursive_repr(fillvalue='...'): ''' Decorator to make a repr function return fillvalue for a recursive call ''' def decorating_function(user_function): repr_running = set() def wrapper(self): key = id(self), get_ident() if key in repr_running: return fillvalue repr_running.add(key) try: result = user_function(self) finally: repr_running.discard(key) return result # Can't use functools.wraps() here because of bootstrap issues wrapper.__module__ = getattr(user_function, '__module__') wrapper.__doc__ = getattr(user_function, '__doc__') wrapper.__name__ = getattr(user_function, '__name__') wrapper.__annotations__ = getattr(user_function, '__annotations__', {}) return wrapper return decorating_function class ChainMap(MutableMapping): ''' A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. ''' def __init__(self, *maps): '''Initialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. ''' self.maps = list(maps) or [{}] # always at least one map def __missing__(self, key): raise KeyError(key) def __getitem__(self, key): for mapping in self.maps: try: return mapping[key] # can't use 'key in mapping' with defaultdict except KeyError: pass return self.__missing__(key) # support subclasses that define __missing__ def get(self, key, default=None): return self[key] if key in self else default def __len__(self): return len(set().union(*self.maps)) # reuses stored hash values if possible def __iter__(self): return iter(set().union(*self.maps)) def __contains__(self, key): return any(key in m for m in self.maps) def __bool__(self): return any(self.maps) @_recursive_repr() def __repr__(self): return '{0.__class__.__name__}({1})'.format( self, ', '.join(map(repr, self.maps))) @classmethod def fromkeys(cls, iterable, *args): 'Create a ChainMap with a single dict created from the iterable.' return cls(dict.fromkeys(iterable, *args)) def copy(self): 'New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]' return self.__class__(self.maps[0].copy(), *self.maps[1:]) __copy__ = copy def new_child(self): # like Django's Context.push() 'New ChainMap with a new dict followed by all previous maps.' return self.__class__({}, *self.maps) @property def parents(self): # like Django's Context.pop() 'New ChainMap from maps[1:].' return self.__class__(*self.maps[1:]) def __setitem__(self, key, value): self.maps[0][key] = value def __delitem__(self, key): try: del self.maps[0][key] except KeyError: raise KeyError('Key not found in the first mapping: {!r}'.format(key)) def popitem(self): 'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.' try: return self.maps[0].popitem() except KeyError: raise KeyError('No keys found in the first mapping.') def pop(self, key, *args): 'Remove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].' try: return self.maps[0].pop(key, *args) except KeyError: raise KeyError('Key not found in the first mapping: {!r}'.format(key)) def clear(self): 'Clear maps[0], leaving maps[1:] intact.' self.maps[0].clear() try: from importlib.util import cache_from_source # Python >= 3.4 except ImportError: # pragma: no cover try: from imp import cache_from_source except ImportError: # pragma: no cover def cache_from_source(path, debug_override=None): assert path.endswith('.py') if debug_override is None: debug_override = __debug__ if debug_override: suffix = 'c' else: suffix = 'o' return path + suffix try: from collections import OrderedDict except ImportError: # pragma: no cover ## {{{ http://code.activestate.com/recipes/576693/ (r9) # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. try: from thread import get_ident as _get_ident except ImportError: from dummy_thread import get_ident as _get_ident try: from _abcoll import KeysView, ValuesView, ItemsView except ImportError: pass class OrderedDict(dict): 'Dictionary that remembers insertion order' # An inherited dict maps keys to values. # The inherited dict provides __getitem__, __len__, __contains__, and get. # The remaining methods are order-aware. # Big-O running times for all methods are the same as for regular dictionaries. # The internal self.__map dictionary maps keys to links in a doubly linked list. # The circular doubly linked list starts and ends with a sentinel element. # The sentinel element never gets deleted (this simplifies the algorithm). # Each link is stored as a list of length three: [PREV, NEXT, KEY]. def __init__(self, *args, **kwds): '''Initialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. ''' if len(args) > 1: raise TypeError('expected at most 1 arguments, got %d' % len(args)) try: self.__root except AttributeError: self.__root = root = [] # sentinel node root[:] = [root, root, None] self.__map = {} self.__update(*args, **kwds) def __setitem__(self, key, value, dict_setitem=dict.__setitem__): 'od.__setitem__(i, y) <==> od[i]=y' # Setting a new item creates a new link which goes at the end of the linked # list, and the inherited dictionary is updated with the new key/value pair. if key not in self: root = self.__root last = root[0] last[1] = root[0] = self.__map[key] = [last, root, key] dict_setitem(self, key, value) def __delitem__(self, key, dict_delitem=dict.__delitem__): 'od.__delitem__(y) <==> del od[y]' # Deleting an existing item uses self.__map to find the link which is # then removed by updating the links in the predecessor and successor nodes. dict_delitem(self, key) link_prev, link_next, key = self.__map.pop(key) link_prev[1] = link_next link_next[0] = link_prev def __iter__(self): 'od.__iter__() <==> iter(od)' root = self.__root curr = root[1] while curr is not root: yield curr[2] curr = curr[1] def __reversed__(self): 'od.__reversed__() <==> reversed(od)' root = self.__root curr = root[0] while curr is not root: yield curr[2] curr = curr[0] def clear(self): 'od.clear() -> None. Remove all items from od.' try: for node in self.__map.itervalues(): del node[:] root = self.__root root[:] = [root, root, None] self.__map.clear() except AttributeError: pass dict.clear(self) def popitem(self, last=True): '''od.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. ''' if not self: raise KeyError('dictionary is empty') root = self.__root if last: link = root[0] link_prev = link[0] link_prev[1] = root root[0] = link_prev else: link = root[1] link_next = link[1] root[1] = link_next link_next[0] = root key = link[2] del self.__map[key] value = dict.pop(self, key) return key, value # -- the following methods do not depend on the internal structure -- def keys(self): 'od.keys() -> list of keys in od' return list(self) def values(self): 'od.values() -> list of values in od' return [self[key] for key in self] def items(self): 'od.items() -> list of (key, value) pairs in od' return [(key, self[key]) for key in self] def iterkeys(self): 'od.iterkeys() -> an iterator over the keys in od' return iter(self) def itervalues(self): 'od.itervalues -> an iterator over the values in od' for k in self: yield self[k] def iteritems(self): 'od.iteritems -> an iterator over the (key, value) items in od' for k in self: yield (k, self[k]) def update(*args, **kwds): '''od.update(E, **F) -> None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v ''' if len(args) > 2: raise TypeError('update() takes at most 2 positional ' 'arguments (%d given)' % (len(args),)) elif not args: raise TypeError('update() takes at least 1 argument (0 given)') self = args[0] # Make progressively weaker assumptions about "other" other = () if len(args) == 2: other = args[1] if isinstance(other, dict): for key in other: self[key] = other[key] elif hasattr(other, 'keys'): for key in other.keys(): self[key] = other[key] else: for key, value in other: self[key] = value for key, value in kwds.items(): self[key] = value __update = update # let subclasses override update without breaking __init__ __marker = object() def pop(self, key, default=__marker): '''od.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. ''' if key in self: result = self[key] del self[key] return result if default is self.__marker: raise KeyError(key) return default def setdefault(self, key, default=None): 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' if key in self: return self[key] self[key] = default return default def __repr__(self, _repr_running=None): 'od.__repr__() <==> repr(od)' if not _repr_running: _repr_running = {} call_key = id(self), _get_ident() if call_key in _repr_running: return '...' _repr_running[call_key] = 1 try: if not self: return '%s()' % (self.__class__.__name__,) return '%s(%r)' % (self.__class__.__name__, self.items()) finally: del _repr_running[call_key] def __reduce__(self): 'Return state information for pickling' items = [[k, self[k]] for k in self] inst_dict = vars(self).copy() for k in vars(OrderedDict()): inst_dict.pop(k, None) if inst_dict: return (self.__class__, (items,), inst_dict) return self.__class__, (items,) def copy(self): 'od.copy() -> a shallow copy of od' return self.__class__(self) @classmethod def fromkeys(cls, iterable, value=None): '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). ''' d = cls() for key in iterable: d[key] = value return d def __eq__(self, other): '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. ''' if isinstance(other, OrderedDict): return len(self)==len(other) and self.items() == other.items() return dict.__eq__(self, other) def __ne__(self, other): return not self == other # -- the following methods are only used in Python 2.7 -- def viewkeys(self): "od.viewkeys() -> a set-like object providing a view on od's keys" return KeysView(self) def viewvalues(self): "od.viewvalues() -> an object providing a view on od's values" return ValuesView(self) def viewitems(self): "od.viewitems() -> a set-like object providing a view on od's items" return ItemsView(self) try: from logging.config import BaseConfigurator, valid_ident except ImportError: # pragma: no cover IDENTIFIER = re.compile('^[a-z_][a-z0-9_]*$', re.I) def valid_ident(s): m = IDENTIFIER.match(s) if not m: raise ValueError('Not a valid Python identifier: %r' % s) return True # The ConvertingXXX classes are wrappers around standard Python containers, # and they serve to convert any suitable values in the container. The # conversion converts base dicts, lists and tuples to their wrapped # equivalents, whereas strings which match a conversion format are converted # appropriately. # # Each wrapper should have a configurator attribute holding the actual # configurator to use for conversion. class ConvertingDict(dict): """A converting dictionary wrapper.""" def __getitem__(self, key): value = dict.__getitem__(self, key) result = self.configurator.convert(value) #If the converted value is different, save for next time if value is not result: self[key] = result if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self result.key = key return result def get(self, key, default=None): value = dict.get(self, key, default) result = self.configurator.convert(value) #If the converted value is different, save for next time if value is not result: self[key] = result if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self result.key = key return result def pop(self, key, default=None): value = dict.pop(self, key, default) result = self.configurator.convert(value) if value is not result: if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self result.key = key return result class ConvertingList(list): """A converting list wrapper.""" def __getitem__(self, key): value = list.__getitem__(self, key) result = self.configurator.convert(value) #If the converted value is different, save for next time if value is not result: self[key] = result if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self result.key = key return result def pop(self, idx=-1): value = list.pop(self, idx) result = self.configurator.convert(value) if value is not result: if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self return result class ConvertingTuple(tuple): """A converting tuple wrapper.""" def __getitem__(self, key): value = tuple.__getitem__(self, key) result = self.configurator.convert(value) if value is not result: if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self result.key = key return result class BaseConfigurator(object): """ The configurator base class which defines some useful defaults. """ CONVERT_PATTERN = re.compile(r'^(?P[a-z]+)://(?P.*)$') WORD_PATTERN = re.compile(r'^\s*(\w+)\s*') DOT_PATTERN = re.compile(r'^\.\s*(\w+)\s*') INDEX_PATTERN = re.compile(r'^\[\s*(\w+)\s*\]\s*') DIGIT_PATTERN = re.compile(r'^\d+$') value_converters = { 'ext' : 'ext_convert', 'cfg' : 'cfg_convert', } # We might want to use a different one, e.g. importlib importer = staticmethod(__import__) def __init__(self, config): self.config = ConvertingDict(config) self.config.configurator = self def resolve(self, s): """ Resolve strings to objects using standard import and attribute syntax. """ name = s.split('.') used = name.pop(0) try: found = self.importer(used) for frag in name: used += '.' + frag try: found = getattr(found, frag) except AttributeError: self.importer(used) found = getattr(found, frag) return found except ImportError: e, tb = sys.exc_info()[1:] v = ValueError('Cannot resolve %r: %s' % (s, e)) v.__cause__, v.__traceback__ = e, tb raise v def ext_convert(self, value): """Default converter for the ext:// protocol.""" return self.resolve(value) def cfg_convert(self, value): """Default converter for the cfg:// protocol.""" rest = value m = self.WORD_PATTERN.match(rest) if m is None: raise ValueError("Unable to convert %r" % value) else: rest = rest[m.end():] d = self.config[m.groups()[0]] #print d, rest while rest: m = self.DOT_PATTERN.match(rest) if m: d = d[m.groups()[0]] else: m = self.INDEX_PATTERN.match(rest) if m: idx = m.groups()[0] if not self.DIGIT_PATTERN.match(idx): d = d[idx] else: try: n = int(idx) # try as number first (most likely) d = d[n] except TypeError: d = d[idx] if m: rest = rest[m.end():] else: raise ValueError('Unable to convert ' '%r at %r' % (value, rest)) #rest should be empty return d def convert(self, value): """ Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. """ if not isinstance(value, ConvertingDict) and isinstance(value, dict): value = ConvertingDict(value) value.configurator = self elif not isinstance(value, ConvertingList) and isinstance(value, list): value = ConvertingList(value) value.configurator = self elif not isinstance(value, ConvertingTuple) and\ isinstance(value, tuple): value = ConvertingTuple(value) value.configurator = self elif isinstance(value, string_types): m = self.CONVERT_PATTERN.match(value) if m: d = m.groupdict() prefix = d['prefix'] converter = self.value_converters.get(prefix, None) if converter: suffix = d['suffix'] converter = getattr(self, converter) value = converter(suffix) return value def configure_custom(self, config): """Configure an object with a user-supplied factory.""" c = config.pop('()') if not callable(c): c = self.resolve(c) props = config.pop('.', None) # Check for valid identifiers kwargs = dict([(k, config[k]) for k in config if valid_ident(k)]) result = c(**kwargs) if props: for name, value in props.items(): setattr(result, name, value) return result def as_tuple(self, value): """Utility function which converts lists to tuples.""" if isinstance(value, list): value = tuple(value) return value PKd]A`22distlib/metadata.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Implementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, 1.3/2.1 and withdrawn 2.0). """ from __future__ import unicode_literals import codecs from email import message_from_file import json import logging import re from . import DistlibException, __version__ from .compat import StringIO, string_types, text_type from .markers import interpret from .util import extract_by_key, get_extras from .version import get_scheme, PEP440_VERSION_RE logger = logging.getLogger(__name__) class MetadataMissingError(DistlibException): """A required metadata is missing""" class MetadataConflictError(DistlibException): """Attempt to read or write metadata fields that are conflictual.""" class MetadataUnrecognizedVersionError(DistlibException): """Unknown metadata version number.""" class MetadataInvalidError(DistlibException): """A metadata value is invalid""" # public API of this module __all__ = ['Metadata', 'PKG_INFO_ENCODING', 'PKG_INFO_PREFERRED_VERSION'] # Encoding used for the PKG-INFO files PKG_INFO_ENCODING = 'utf-8' # preferred version. Hopefully will be changed # to 1.2 once PEP 345 is supported everywhere PKG_INFO_PREFERRED_VERSION = '1.1' _LINE_PREFIX_1_2 = re.compile('\n \\|') _LINE_PREFIX_PRE_1_2 = re.compile('\n ') _241_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform', 'Summary', 'Description', 'Keywords', 'Home-page', 'Author', 'Author-email', 'License') _314_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform', 'Supported-Platform', 'Summary', 'Description', 'Keywords', 'Home-page', 'Author', 'Author-email', 'License', 'Classifier', 'Download-URL', 'Obsoletes', 'Provides', 'Requires') _314_MARKERS = ('Obsoletes', 'Provides', 'Requires', 'Classifier', 'Download-URL') _345_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform', 'Supported-Platform', 'Summary', 'Description', 'Keywords', 'Home-page', 'Author', 'Author-email', 'Maintainer', 'Maintainer-email', 'License', 'Classifier', 'Download-URL', 'Obsoletes-Dist', 'Project-URL', 'Provides-Dist', 'Requires-Dist', 'Requires-Python', 'Requires-External') _345_MARKERS = ('Provides-Dist', 'Requires-Dist', 'Requires-Python', 'Obsoletes-Dist', 'Requires-External', 'Maintainer', 'Maintainer-email', 'Project-URL') _426_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform', 'Supported-Platform', 'Summary', 'Description', 'Keywords', 'Home-page', 'Author', 'Author-email', 'Maintainer', 'Maintainer-email', 'License', 'Classifier', 'Download-URL', 'Obsoletes-Dist', 'Project-URL', 'Provides-Dist', 'Requires-Dist', 'Requires-Python', 'Requires-External', 'Private-Version', 'Obsoleted-By', 'Setup-Requires-Dist', 'Extension', 'Provides-Extra') _426_MARKERS = ('Private-Version', 'Provides-Extra', 'Obsoleted-By', 'Setup-Requires-Dist', 'Extension') # See issue #106: Sometimes 'Requires' and 'Provides' occur wrongly in # the metadata. Include them in the tuple literal below to allow them # (for now). _566_FIELDS = _426_FIELDS + ('Description-Content-Type', 'Requires', 'Provides') _566_MARKERS = ('Description-Content-Type',) _ALL_FIELDS = set() _ALL_FIELDS.update(_241_FIELDS) _ALL_FIELDS.update(_314_FIELDS) _ALL_FIELDS.update(_345_FIELDS) _ALL_FIELDS.update(_426_FIELDS) _ALL_FIELDS.update(_566_FIELDS) EXTRA_RE = re.compile(r'''extra\s*==\s*("([^"]+)"|'([^']+)')''') def _version2fieldlist(version): if version == '1.0': return _241_FIELDS elif version == '1.1': return _314_FIELDS elif version == '1.2': return _345_FIELDS elif version in ('1.3', '2.1'): return _345_FIELDS + _566_FIELDS elif version == '2.0': return _426_FIELDS raise MetadataUnrecognizedVersionError(version) def _best_version(fields): """Detect the best version depending on the fields used.""" def _has_marker(keys, markers): for marker in markers: if marker in keys: return True return False keys = [] for key, value in fields.items(): if value in ([], 'UNKNOWN', None): continue keys.append(key) possible_versions = ['1.0', '1.1', '1.2', '1.3', '2.0', '2.1'] # first let's try to see if a field is not part of one of the version for key in keys: if key not in _241_FIELDS and '1.0' in possible_versions: possible_versions.remove('1.0') logger.debug('Removed 1.0 due to %s', key) if key not in _314_FIELDS and '1.1' in possible_versions: possible_versions.remove('1.1') logger.debug('Removed 1.1 due to %s', key) if key not in _345_FIELDS and '1.2' in possible_versions: possible_versions.remove('1.2') logger.debug('Removed 1.2 due to %s', key) if key not in _566_FIELDS and '1.3' in possible_versions: possible_versions.remove('1.3') logger.debug('Removed 1.3 due to %s', key) if key not in _566_FIELDS and '2.1' in possible_versions: if key != 'Description': # In 2.1, description allowed after headers possible_versions.remove('2.1') logger.debug('Removed 2.1 due to %s', key) if key not in _426_FIELDS and '2.0' in possible_versions: possible_versions.remove('2.0') logger.debug('Removed 2.0 due to %s', key) # possible_version contains qualified versions if len(possible_versions) == 1: return possible_versions[0] # found ! elif len(possible_versions) == 0: logger.debug('Out of options - unknown metadata set: %s', fields) raise MetadataConflictError('Unknown metadata set') # let's see if one unique marker is found is_1_1 = '1.1' in possible_versions and _has_marker(keys, _314_MARKERS) is_1_2 = '1.2' in possible_versions and _has_marker(keys, _345_MARKERS) is_2_1 = '2.1' in possible_versions and _has_marker(keys, _566_MARKERS) is_2_0 = '2.0' in possible_versions and _has_marker(keys, _426_MARKERS) if int(is_1_1) + int(is_1_2) + int(is_2_1) + int(is_2_0) > 1: raise MetadataConflictError('You used incompatible 1.1/1.2/2.0/2.1 fields') # we have the choice, 1.0, or 1.2, or 2.0 # - 1.0 has a broken Summary field but works with all tools # - 1.1 is to avoid # - 1.2 fixes Summary but has little adoption # - 2.0 adds more features and is very new if not is_1_1 and not is_1_2 and not is_2_1 and not is_2_0: # we couldn't find any specific marker if PKG_INFO_PREFERRED_VERSION in possible_versions: return PKG_INFO_PREFERRED_VERSION if is_1_1: return '1.1' if is_1_2: return '1.2' if is_2_1: return '2.1' return '2.0' # This follows the rules about transforming keys as described in # https://www.python.org/dev/peps/pep-0566/#id17 _ATTR2FIELD = { name.lower().replace("-", "_"): name for name in _ALL_FIELDS } _FIELD2ATTR = {field: attr for attr, field in _ATTR2FIELD.items()} _PREDICATE_FIELDS = ('Requires-Dist', 'Obsoletes-Dist', 'Provides-Dist') _VERSIONS_FIELDS = ('Requires-Python',) _VERSION_FIELDS = ('Version',) _LISTFIELDS = ('Platform', 'Classifier', 'Obsoletes', 'Requires', 'Provides', 'Obsoletes-Dist', 'Provides-Dist', 'Requires-Dist', 'Requires-External', 'Project-URL', 'Supported-Platform', 'Setup-Requires-Dist', 'Provides-Extra', 'Extension') _LISTTUPLEFIELDS = ('Project-URL',) _ELEMENTSFIELD = ('Keywords',) _UNICODEFIELDS = ('Author', 'Maintainer', 'Summary', 'Description') _MISSING = object() _FILESAFE = re.compile('[^A-Za-z0-9.]+') def _get_name_and_version(name, version, for_filename=False): """Return the distribution name with version. If for_filename is true, return a filename-escaped form.""" if for_filename: # For both name and version any runs of non-alphanumeric or '.' # characters are replaced with a single '-'. Additionally any # spaces in the version string become '.' name = _FILESAFE.sub('-', name) version = _FILESAFE.sub('-', version.replace(' ', '.')) return '%s-%s' % (name, version) class LegacyMetadata(object): """The legacy metadata of a release. Supports versions 1.0, 1.1, 1.2, 2.0 and 1.3/2.1 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name """ # TODO document the mapping API and UNKNOWN default key def __init__(self, path=None, fileobj=None, mapping=None, scheme='default'): if [path, fileobj, mapping].count(None) < 2: raise TypeError('path, fileobj and mapping are exclusive') self._fields = {} self.requires_files = [] self._dependencies = None self.scheme = scheme if path is not None: self.read(path) elif fileobj is not None: self.read_file(fileobj) elif mapping is not None: self.update(mapping) self.set_metadata_version() def set_metadata_version(self): self._fields['Metadata-Version'] = _best_version(self._fields) def _write_field(self, fileobj, name, value): fileobj.write('%s: %s\n' % (name, value)) def __getitem__(self, name): return self.get(name) def __setitem__(self, name, value): return self.set(name, value) def __delitem__(self, name): field_name = self._convert_name(name) try: del self._fields[field_name] except KeyError: raise KeyError(name) def __contains__(self, name): return (name in self._fields or self._convert_name(name) in self._fields) def _convert_name(self, name): if name in _ALL_FIELDS: return name name = name.replace('-', '_').lower() return _ATTR2FIELD.get(name, name) def _default_value(self, name): if name in _LISTFIELDS or name in _ELEMENTSFIELD: return [] return 'UNKNOWN' def _remove_line_prefix(self, value): if self.metadata_version in ('1.0', '1.1'): return _LINE_PREFIX_PRE_1_2.sub('\n', value) else: return _LINE_PREFIX_1_2.sub('\n', value) def __getattr__(self, name): if name in _ATTR2FIELD: return self[name] raise AttributeError(name) # # Public API # # dependencies = property(_get_dependencies, _set_dependencies) def get_fullname(self, filesafe=False): """Return the distribution name with version. If filesafe is true, return a filename-escaped form.""" return _get_name_and_version(self['Name'], self['Version'], filesafe) def is_field(self, name): """return True if name is a valid metadata key""" name = self._convert_name(name) return name in _ALL_FIELDS def is_multi_field(self, name): name = self._convert_name(name) return name in _LISTFIELDS def read(self, filepath): """Read the metadata values from a file path.""" fp = codecs.open(filepath, 'r', encoding='utf-8') try: self.read_file(fp) finally: fp.close() def read_file(self, fileob): """Read the metadata values from a file object.""" msg = message_from_file(fileob) self._fields['Metadata-Version'] = msg['metadata-version'] # When reading, get all the fields we can for field in _ALL_FIELDS: if field not in msg: continue if field in _LISTFIELDS: # we can have multiple lines values = msg.get_all(field) if field in _LISTTUPLEFIELDS and values is not None: values = [tuple(value.split(',')) for value in values] self.set(field, values) else: # single line value = msg[field] if value is not None and value != 'UNKNOWN': self.set(field, value) # PEP 566 specifies that the body be used for the description, if # available body = msg.get_payload() self["Description"] = body if body else self["Description"] # logger.debug('Attempting to set metadata for %s', self) # self.set_metadata_version() def write(self, filepath, skip_unknown=False): """Write the metadata fields to filepath.""" fp = codecs.open(filepath, 'w', encoding='utf-8') try: self.write_file(fp, skip_unknown) finally: fp.close() def write_file(self, fileobject, skip_unknown=False): """Write the PKG-INFO format data to a file object.""" self.set_metadata_version() for field in _version2fieldlist(self['Metadata-Version']): values = self.get(field) if skip_unknown and values in ('UNKNOWN', [], ['UNKNOWN']): continue if field in _ELEMENTSFIELD: self._write_field(fileobject, field, ','.join(values)) continue if field not in _LISTFIELDS: if field == 'Description': if self.metadata_version in ('1.0', '1.1'): values = values.replace('\n', '\n ') else: values = values.replace('\n', '\n |') values = [values] if field in _LISTTUPLEFIELDS: values = [','.join(value) for value in values] for value in values: self._write_field(fileobject, field, value) def update(self, other=None, **kwargs): """Set metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. """ def _set(key, value): if key in _ATTR2FIELD and value: self.set(self._convert_name(key), value) if not other: # other is None or empty container pass elif hasattr(other, 'keys'): for k in other.keys(): _set(k, other[k]) else: for k, v in other: _set(k, v) if kwargs: for k, v in kwargs.items(): _set(k, v) def set(self, name, value): """Control then set a metadata field.""" name = self._convert_name(name) if ((name in _ELEMENTSFIELD or name == 'Platform') and not isinstance(value, (list, tuple))): if isinstance(value, string_types): value = [v.strip() for v in value.split(',')] else: value = [] elif (name in _LISTFIELDS and not isinstance(value, (list, tuple))): if isinstance(value, string_types): value = [value] else: value = [] if logger.isEnabledFor(logging.WARNING): project_name = self['Name'] scheme = get_scheme(self.scheme) if name in _PREDICATE_FIELDS and value is not None: for v in value: # check that the values are valid if not scheme.is_valid_matcher(v.split(';')[0]): logger.warning( "'%s': '%s' is not valid (field '%s')", project_name, v, name) # FIXME this rejects UNKNOWN, is that right? elif name in _VERSIONS_FIELDS and value is not None: if not scheme.is_valid_constraint_list(value): logger.warning("'%s': '%s' is not a valid version (field '%s')", project_name, value, name) elif name in _VERSION_FIELDS and value is not None: if not scheme.is_valid_version(value): logger.warning("'%s': '%s' is not a valid version (field '%s')", project_name, value, name) if name in _UNICODEFIELDS: if name == 'Description': value = self._remove_line_prefix(value) self._fields[name] = value def get(self, name, default=_MISSING): """Get a metadata field.""" name = self._convert_name(name) if name not in self._fields: if default is _MISSING: default = self._default_value(name) return default if name in _UNICODEFIELDS: value = self._fields[name] return value elif name in _LISTFIELDS: value = self._fields[name] if value is None: return [] res = [] for val in value: if name not in _LISTTUPLEFIELDS: res.append(val) else: # That's for Project-URL res.append((val[0], val[1])) return res elif name in _ELEMENTSFIELD: value = self._fields[name] if isinstance(value, string_types): return value.split(',') return self._fields[name] def check(self, strict=False): """Check if the metadata is compliant. If strict is True then raise if no Name or Version are provided""" self.set_metadata_version() # XXX should check the versions (if the file was loaded) missing, warnings = [], [] for attr in ('Name', 'Version'): # required by PEP 345 if attr not in self: missing.append(attr) if strict and missing != []: msg = 'missing required metadata: %s' % ', '.join(missing) raise MetadataMissingError(msg) for attr in ('Home-page', 'Author'): if attr not in self: missing.append(attr) # checking metadata 1.2 (XXX needs to check 1.1, 1.0) if self['Metadata-Version'] != '1.2': return missing, warnings scheme = get_scheme(self.scheme) def are_valid_constraints(value): for v in value: if not scheme.is_valid_matcher(v.split(';')[0]): return False return True for fields, controller in ((_PREDICATE_FIELDS, are_valid_constraints), (_VERSIONS_FIELDS, scheme.is_valid_constraint_list), (_VERSION_FIELDS, scheme.is_valid_version)): for field in fields: value = self.get(field, None) if value is not None and not controller(value): warnings.append("Wrong value for '%s': %s" % (field, value)) return missing, warnings def todict(self, skip_missing=False): """Return fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). This is as per https://www.python.org/dev/peps/pep-0566/#id17. """ self.set_metadata_version() fields = _version2fieldlist(self['Metadata-Version']) data = {} for field_name in fields: if not skip_missing or field_name in self._fields: key = _FIELD2ATTR[field_name] if key != 'project_url': data[key] = self[field_name] else: data[key] = [','.join(u) for u in self[field_name]] return data def add_requirements(self, requirements): if self['Metadata-Version'] == '1.1': # we can't have 1.1 metadata *and* Setuptools requires for field in ('Obsoletes', 'Requires', 'Provides'): if field in self: del self[field] self['Requires-Dist'] += requirements # Mapping API # TODO could add iter* variants def keys(self): return list(_version2fieldlist(self['Metadata-Version'])) def __iter__(self): for key in self.keys(): yield key def values(self): return [self[key] for key in self.keys()] def items(self): return [(key, self[key]) for key in self.keys()] def __repr__(self): return '<%s %s %s>' % (self.__class__.__name__, self.name, self.version) METADATA_FILENAME = 'pydist.json' WHEEL_METADATA_FILENAME = 'metadata.json' LEGACY_METADATA_FILENAME = 'METADATA' class Metadata(object): """ The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. """ METADATA_VERSION_MATCHER = re.compile(r'^\d+(\.\d+)*$') NAME_MATCHER = re.compile('^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$', re.I) VERSION_MATCHER = PEP440_VERSION_RE SUMMARY_MATCHER = re.compile('.{1,2047}') METADATA_VERSION = '2.0' GENERATOR = 'distlib (%s)' % __version__ MANDATORY_KEYS = { 'name': (), 'version': (), 'summary': ('legacy',), } INDEX_KEYS = ('name version license summary description author ' 'author_email keywords platform home_page classifiers ' 'download_url') DEPENDENCY_KEYS = ('extras run_requires test_requires build_requires ' 'dev_requires provides meta_requires obsoleted_by ' 'supports_environments') SYNTAX_VALIDATORS = { 'metadata_version': (METADATA_VERSION_MATCHER, ()), 'name': (NAME_MATCHER, ('legacy',)), 'version': (VERSION_MATCHER, ('legacy',)), 'summary': (SUMMARY_MATCHER, ('legacy',)), } __slots__ = ('_legacy', '_data', 'scheme') def __init__(self, path=None, fileobj=None, mapping=None, scheme='default'): if [path, fileobj, mapping].count(None) < 2: raise TypeError('path, fileobj and mapping are exclusive') self._legacy = None self._data = None self.scheme = scheme #import pdb; pdb.set_trace() if mapping is not None: try: self._validate_mapping(mapping, scheme) self._data = mapping except MetadataUnrecognizedVersionError: self._legacy = LegacyMetadata(mapping=mapping, scheme=scheme) self.validate() else: data = None if path: with open(path, 'rb') as f: data = f.read() elif fileobj: data = fileobj.read() if data is None: # Initialised with no args - to be added self._data = { 'metadata_version': self.METADATA_VERSION, 'generator': self.GENERATOR, } else: if not isinstance(data, text_type): data = data.decode('utf-8') try: self._data = json.loads(data) self._validate_mapping(self._data, scheme) except ValueError: # Note: MetadataUnrecognizedVersionError does not # inherit from ValueError (it's a DistlibException, # which should not inherit from ValueError). # The ValueError comes from the json.load - if that # succeeds and we get a validation error, we want # that to propagate self._legacy = LegacyMetadata(fileobj=StringIO(data), scheme=scheme) self.validate() common_keys = set(('name', 'version', 'license', 'keywords', 'summary')) none_list = (None, list) none_dict = (None, dict) mapped_keys = { 'run_requires': ('Requires-Dist', list), 'build_requires': ('Setup-Requires-Dist', list), 'dev_requires': none_list, 'test_requires': none_list, 'meta_requires': none_list, 'extras': ('Provides-Extra', list), 'modules': none_list, 'namespaces': none_list, 'exports': none_dict, 'commands': none_dict, 'classifiers': ('Classifier', list), 'source_url': ('Download-URL', None), 'metadata_version': ('Metadata-Version', None), } del none_list, none_dict def __getattribute__(self, key): common = object.__getattribute__(self, 'common_keys') mapped = object.__getattribute__(self, 'mapped_keys') if key in mapped: lk, maker = mapped[key] if self._legacy: if lk is None: result = None if maker is None else maker() else: result = self._legacy.get(lk) else: value = None if maker is None else maker() if key not in ('commands', 'exports', 'modules', 'namespaces', 'classifiers'): result = self._data.get(key, value) else: # special cases for PEP 459 sentinel = object() result = sentinel d = self._data.get('extensions') if d: if key == 'commands': result = d.get('python.commands', value) elif key == 'classifiers': d = d.get('python.details') if d: result = d.get(key, value) else: d = d.get('python.exports') if not d: d = self._data.get('python.exports') if d: result = d.get(key, value) if result is sentinel: result = value elif key not in common: result = object.__getattribute__(self, key) elif self._legacy: result = self._legacy.get(key) else: result = self._data.get(key) return result def _validate_value(self, key, value, scheme=None): if key in self.SYNTAX_VALIDATORS: pattern, exclusions = self.SYNTAX_VALIDATORS[key] if (scheme or self.scheme) not in exclusions: m = pattern.match(value) if not m: raise MetadataInvalidError("'%s' is an invalid value for " "the '%s' property" % (value, key)) def __setattr__(self, key, value): self._validate_value(key, value) common = object.__getattribute__(self, 'common_keys') mapped = object.__getattribute__(self, 'mapped_keys') if key in mapped: lk, _ = mapped[key] if self._legacy: if lk is None: raise NotImplementedError self._legacy[lk] = value elif key not in ('commands', 'exports', 'modules', 'namespaces', 'classifiers'): self._data[key] = value else: # special cases for PEP 459 d = self._data.setdefault('extensions', {}) if key == 'commands': d['python.commands'] = value elif key == 'classifiers': d = d.setdefault('python.details', {}) d[key] = value else: d = d.setdefault('python.exports', {}) d[key] = value elif key not in common: object.__setattr__(self, key, value) else: if key == 'keywords': if isinstance(value, string_types): value = value.strip() if value: value = value.split() else: value = [] if self._legacy: self._legacy[key] = value else: self._data[key] = value @property def name_and_version(self): return _get_name_and_version(self.name, self.version, True) @property def provides(self): if self._legacy: result = self._legacy['Provides-Dist'] else: result = self._data.setdefault('provides', []) s = '%s (%s)' % (self.name, self.version) if s not in result: result.append(s) return result @provides.setter def provides(self, value): if self._legacy: self._legacy['Provides-Dist'] = value else: self._data['provides'] = value def get_requirements(self, reqts, extras=None, env=None): """ Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. """ if self._legacy: result = reqts else: result = [] extras = get_extras(extras or [], self.extras) for d in reqts: if 'extra' not in d and 'environment' not in d: # unconditional include = True else: if 'extra' not in d: # Not extra-dependent - only environment-dependent include = True else: include = d.get('extra') in extras if include: # Not excluded because of extras, check environment marker = d.get('environment') if marker: include = interpret(marker, env) if include: result.extend(d['requires']) for key in ('build', 'dev', 'test'): e = ':%s:' % key if e in extras: extras.remove(e) # A recursive call, but it should terminate since 'test' # has been removed from the extras reqts = self._data.get('%s_requires' % key, []) result.extend(self.get_requirements(reqts, extras=extras, env=env)) return result @property def dictionary(self): if self._legacy: return self._from_legacy() return self._data @property def dependencies(self): if self._legacy: raise NotImplementedError else: return extract_by_key(self._data, self.DEPENDENCY_KEYS) @dependencies.setter def dependencies(self, value): if self._legacy: raise NotImplementedError else: self._data.update(value) def _validate_mapping(self, mapping, scheme): if mapping.get('metadata_version') != self.METADATA_VERSION: raise MetadataUnrecognizedVersionError() missing = [] for key, exclusions in self.MANDATORY_KEYS.items(): if key not in mapping: if scheme not in exclusions: missing.append(key) if missing: msg = 'Missing metadata items: %s' % ', '.join(missing) raise MetadataMissingError(msg) for k, v in mapping.items(): self._validate_value(k, v, scheme) def validate(self): if self._legacy: missing, warnings = self._legacy.check(True) if missing or warnings: logger.warning('Metadata: missing: %s, warnings: %s', missing, warnings) else: self._validate_mapping(self._data, self.scheme) def todict(self): if self._legacy: return self._legacy.todict(True) else: result = extract_by_key(self._data, self.INDEX_KEYS) return result def _from_legacy(self): assert self._legacy and not self._data result = { 'metadata_version': self.METADATA_VERSION, 'generator': self.GENERATOR, } lmd = self._legacy.todict(True) # skip missing ones for k in ('name', 'version', 'license', 'summary', 'description', 'classifier'): if k in lmd: if k == 'classifier': nk = 'classifiers' else: nk = k result[nk] = lmd[k] kw = lmd.get('Keywords', []) if kw == ['']: kw = [] result['keywords'] = kw keys = (('requires_dist', 'run_requires'), ('setup_requires_dist', 'build_requires')) for ok, nk in keys: if ok in lmd and lmd[ok]: result[nk] = [{'requires': lmd[ok]}] result['provides'] = self.provides author = {} maintainer = {} return result LEGACY_MAPPING = { 'name': 'Name', 'version': 'Version', ('extensions', 'python.details', 'license'): 'License', 'summary': 'Summary', 'description': 'Description', ('extensions', 'python.project', 'project_urls', 'Home'): 'Home-page', ('extensions', 'python.project', 'contacts', 0, 'name'): 'Author', ('extensions', 'python.project', 'contacts', 0, 'email'): 'Author-email', 'source_url': 'Download-URL', ('extensions', 'python.details', 'classifiers'): 'Classifier', } def _to_legacy(self): def process_entries(entries): reqts = set() for e in entries: extra = e.get('extra') env = e.get('environment') rlist = e['requires'] for r in rlist: if not env and not extra: reqts.add(r) else: marker = '' if extra: marker = 'extra == "%s"' % extra if env: if marker: marker = '(%s) and %s' % (env, marker) else: marker = env reqts.add(';'.join((r, marker))) return reqts assert self._data and not self._legacy result = LegacyMetadata() nmd = self._data # import pdb; pdb.set_trace() for nk, ok in self.LEGACY_MAPPING.items(): if not isinstance(nk, tuple): if nk in nmd: result[ok] = nmd[nk] else: d = nmd found = True for k in nk: try: d = d[k] except (KeyError, IndexError): found = False break if found: result[ok] = d r1 = process_entries(self.run_requires + self.meta_requires) r2 = process_entries(self.build_requires + self.dev_requires) if self.extras: result['Provides-Extra'] = sorted(self.extras) result['Requires-Dist'] = sorted(r1) result['Setup-Requires-Dist'] = sorted(r2) # TODO: any other fields wanted return result def write(self, path=None, fileobj=None, legacy=False, skip_unknown=True): if [path, fileobj].count(None) != 1: raise ValueError('Exactly one of path and fileobj is needed') self.validate() if legacy: if self._legacy: legacy_md = self._legacy else: legacy_md = self._to_legacy() if path: legacy_md.write(path, skip_unknown=skip_unknown) else: legacy_md.write_file(fileobj, skip_unknown=skip_unknown) else: if self._legacy: d = self._from_legacy() else: d = self._data if fileobj: json.dump(d, fileobj, ensure_ascii=True, indent=2, sort_keys=True) else: with codecs.open(path, 'w', 'utf-8') as f: json.dump(d, f, ensure_ascii=True, indent=2, sort_keys=True) def add_requirements(self, requirements): if self._legacy: self._legacy.add_requirements(requirements) else: run_requires = self._data.setdefault('run_requires', []) always = None for entry in run_requires: if 'environment' not in entry and 'extra' not in entry: always = entry break if always is None: always = { 'requires': requirements } run_requires.insert(0, always) else: rset = set(always['requires']) | set(requirements) always['requires'] = sorted(rset) def __repr__(self): name = self.name or '(no name)' version = self.version or 'no version' return '<%s %s %s (%s)>' % (self.__class__.__name__, self.metadata_version, name, version) PKd]zS7EEdistlib/__init__.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2019 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import logging __version__ = '0.3.1' class DistlibException(Exception): pass try: from logging import NullHandler except ImportError: # pragma: no cover class NullHandler(logging.Handler): def handle(self, record): pass def emit(self, record): pass def createLock(self): self.lock = None logger = logging.getLogger(__name__) logger.addHandler(NullHandler()) PKd]f##distlib/markers.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Parser for the environment markers micro-language defined in PEP 508. """ # Note: In PEP 345, the micro-language was Python compatible, so the ast # module could be used to parse it. However, PEP 508 introduced operators such # as ~= and === which aren't in Python, necessitating a different approach. import os import sys import platform import re from .compat import python_implementation, urlparse, string_types from .util import in_venv, parse_marker __all__ = ['interpret'] def _is_literal(o): if not isinstance(o, string_types) or not o: return False return o[0] in '\'"' class Evaluator(object): """ This class is used to evaluate marker expessions. """ operations = { '==': lambda x, y: x == y, '===': lambda x, y: x == y, '~=': lambda x, y: x == y or x > y, '!=': lambda x, y: x != y, '<': lambda x, y: x < y, '<=': lambda x, y: x == y or x < y, '>': lambda x, y: x > y, '>=': lambda x, y: x == y or x > y, 'and': lambda x, y: x and y, 'or': lambda x, y: x or y, 'in': lambda x, y: x in y, 'not in': lambda x, y: x not in y, } def evaluate(self, expr, context): """ Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. """ if isinstance(expr, string_types): if expr[0] in '\'"': result = expr[1:-1] else: if expr not in context: raise SyntaxError('unknown variable: %s' % expr) result = context[expr] else: assert isinstance(expr, dict) op = expr['op'] if op not in self.operations: raise NotImplementedError('op not implemented: %s' % op) elhs = expr['lhs'] erhs = expr['rhs'] if _is_literal(expr['lhs']) and _is_literal(expr['rhs']): raise SyntaxError('invalid comparison: %s %s %s' % (elhs, op, erhs)) lhs = self.evaluate(elhs, context) rhs = self.evaluate(erhs, context) result = self.operations[op](lhs, rhs) return result def default_context(): def format_full_version(info): version = '%s.%s.%s' % (info.major, info.minor, info.micro) kind = info.releaselevel if kind != 'final': version += kind[0] + str(info.serial) return version if hasattr(sys, 'implementation'): implementation_version = format_full_version(sys.implementation.version) implementation_name = sys.implementation.name else: implementation_version = '0' implementation_name = '' result = { 'implementation_name': implementation_name, 'implementation_version': implementation_version, 'os_name': os.name, 'platform_machine': platform.machine(), 'platform_python_implementation': platform.python_implementation(), 'platform_release': platform.release(), 'platform_system': platform.system(), 'platform_version': platform.version(), 'platform_in_venv': str(in_venv()), 'python_full_version': platform.python_version(), 'python_version': platform.python_version()[:3], 'sys_platform': sys.platform, } return result DEFAULT_CONTEXT = default_context() del default_context evaluator = Evaluator() def interpret(marker, execution_context=None): """ Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping """ try: expr, rest = parse_marker(marker) except Exception as e: raise SyntaxError('Unable to interpret marker syntax: %s: %s' % (marker, e)) if rest and rest[0] != '#': raise SyntaxError('unexpected trailing data in marker: %s: %s' % (marker, rest)) context = dict(DEFAULT_CONTEXT) if execution_context: context.update(execution_context) return evaluator.evaluate(expr, context) PKd]݄**distlib/resources.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import bisect import io import logging import os import pkgutil import shutil import sys import types import zipimport from . import DistlibException from .util import cached_property, get_cache_base, path_to_cache_dir, Cache logger = logging.getLogger(__name__) cache = None # created when needed class ResourceCache(Cache): def __init__(self, base=None): if base is None: # Use native string to avoid issues on 2.x: see Python #20140. base = os.path.join(get_cache_base(), str('resource-cache')) super(ResourceCache, self).__init__(base) def is_stale(self, resource, path): """ Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. """ # Cache invalidation is a hard problem :-) return True def get(self, resource): """ Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. """ prefix, path = resource.finder.get_cache_info(resource) if prefix is None: result = path else: result = os.path.join(self.base, self.prefix_to_dir(prefix), path) dirname = os.path.dirname(result) if not os.path.isdir(dirname): os.makedirs(dirname) if not os.path.exists(result): stale = True else: stale = self.is_stale(resource, path) if stale: # write the bytes of the resource to the cache location with open(result, 'wb') as f: f.write(resource.bytes) return result class ResourceBase(object): def __init__(self, finder, name): self.finder = finder self.name = name class Resource(ResourceBase): """ A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. """ is_container = False # Backwards compatibility def as_stream(self): """ Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. """ return self.finder.get_stream(self) @cached_property def file_path(self): global cache if cache is None: cache = ResourceCache() return cache.get(self) @cached_property def bytes(self): return self.finder.get_bytes(self) @cached_property def size(self): return self.finder.get_size(self) class ResourceContainer(ResourceBase): is_container = True # Backwards compatibility @cached_property def resources(self): return self.finder.get_resources(self) class ResourceFinder(object): """ Resource finder for file system resources. """ if sys.platform.startswith('java'): skipped_extensions = ('.pyc', '.pyo', '.class') else: skipped_extensions = ('.pyc', '.pyo') def __init__(self, module): self.module = module self.loader = getattr(module, '__loader__', None) self.base = os.path.dirname(getattr(module, '__file__', '')) def _adjust_path(self, path): return os.path.realpath(path) def _make_path(self, resource_name): # Issue #50: need to preserve type of path on Python 2.x # like os.path._get_sep if isinstance(resource_name, bytes): # should only happen on 2.x sep = b'/' else: sep = '/' parts = resource_name.split(sep) parts.insert(0, self.base) result = os.path.join(*parts) return self._adjust_path(result) def _find(self, path): return os.path.exists(path) def get_cache_info(self, resource): return None, resource.path def find(self, resource_name): path = self._make_path(resource_name) if not self._find(path): result = None else: if self._is_directory(path): result = ResourceContainer(self, resource_name) else: result = Resource(self, resource_name) result.path = path return result def get_stream(self, resource): return open(resource.path, 'rb') def get_bytes(self, resource): with open(resource.path, 'rb') as f: return f.read() def get_size(self, resource): return os.path.getsize(resource.path) def get_resources(self, resource): def allowed(f): return (f != '__pycache__' and not f.endswith(self.skipped_extensions)) return set([f for f in os.listdir(resource.path) if allowed(f)]) def is_container(self, resource): return self._is_directory(resource.path) _is_directory = staticmethod(os.path.isdir) def iterator(self, resource_name): resource = self.find(resource_name) if resource is not None: todo = [resource] while todo: resource = todo.pop(0) yield resource if resource.is_container: rname = resource.name for name in resource.resources: if not rname: new_name = name else: new_name = '/'.join([rname, name]) child = self.find(new_name) if child.is_container: todo.append(child) else: yield child class ZipResourceFinder(ResourceFinder): """ Resource finder for resources in .zip files. """ def __init__(self, module): super(ZipResourceFinder, self).__init__(module) archive = self.loader.archive self.prefix_len = 1 + len(archive) # PyPy doesn't have a _files attr on zipimporter, and you can't set one if hasattr(self.loader, '_files'): self._files = self.loader._files else: self._files = zipimport._zip_directory_cache[archive] self.index = sorted(self._files) def _adjust_path(self, path): return path def _find(self, path): path = path[self.prefix_len:] if path in self._files: result = True else: if path and path[-1] != os.sep: path = path + os.sep i = bisect.bisect(self.index, path) try: result = self.index[i].startswith(path) except IndexError: result = False if not result: logger.debug('_find failed: %r %r', path, self.loader.prefix) else: logger.debug('_find worked: %r %r', path, self.loader.prefix) return result def get_cache_info(self, resource): prefix = self.loader.archive path = resource.path[1 + len(prefix):] return prefix, path def get_bytes(self, resource): return self.loader.get_data(resource.path) def get_stream(self, resource): return io.BytesIO(self.get_bytes(resource)) def get_size(self, resource): path = resource.path[self.prefix_len:] return self._files[path][3] def get_resources(self, resource): path = resource.path[self.prefix_len:] if path and path[-1] != os.sep: path += os.sep plen = len(path) result = set() i = bisect.bisect(self.index, path) while i < len(self.index): if not self.index[i].startswith(path): break s = self.index[i][plen:] result.add(s.split(os.sep, 1)[0]) # only immediate children i += 1 return result def _is_directory(self, path): path = path[self.prefix_len:] if path and path[-1] != os.sep: path += os.sep i = bisect.bisect(self.index, path) try: result = self.index[i].startswith(path) except IndexError: result = False return result _finder_registry = { type(None): ResourceFinder, zipimport.zipimporter: ZipResourceFinder } try: # In Python 3.6, _frozen_importlib -> _frozen_importlib_external try: import _frozen_importlib_external as _fi except ImportError: import _frozen_importlib as _fi _finder_registry[_fi.SourceFileLoader] = ResourceFinder _finder_registry[_fi.FileFinder] = ResourceFinder del _fi except (ImportError, AttributeError): pass def register_finder(loader, finder_maker): _finder_registry[type(loader)] = finder_maker _finder_cache = {} def finder(package): """ Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. """ if package in _finder_cache: result = _finder_cache[package] else: if package not in sys.modules: __import__(package) module = sys.modules[package] path = getattr(module, '__path__', None) if path is None: raise DistlibException('You cannot get a finder for a module, ' 'only for a package') loader = getattr(module, '__loader__', None) finder_maker = _finder_registry.get(type(loader)) if finder_maker is None: raise DistlibException('Unable to locate finder for %r' % package) result = finder_maker(module) _finder_cache[package] = result return result _dummy_module = types.ModuleType(str('__dummy__')) def finder_for_path(path): """ Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. """ result = None # calls any path hooks, gets importer into cache pkgutil.get_importer(path) loader = sys.path_importer_cache.get(path) finder = _finder_registry.get(type(loader)) if finder: module = _dummy_module module.__file__ = os.path.join(path, '') module.__loader__ = loader result = finder(module) return result PKd]!{ && retrying.pynu[## Copyright 2013-2014 Ray Holder ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, software ## distributed under the License is distributed on an "AS IS" BASIS, ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## See the License for the specific language governing permissions and ## limitations under the License. import random from pip._vendor import six import sys import time import traceback # sys.maxint / 2, since Python 3.2 doesn't have a sys.maxint... MAX_WAIT = 1073741823 def retry(*dargs, **dkw): """ Decorator function that instantiates the Retrying object @param *dargs: positional arguments passed to Retrying object @param **dkw: keyword arguments passed to the Retrying object """ # support both @retry and @retry() as valid syntax if len(dargs) == 1 and callable(dargs[0]): def wrap_simple(f): @six.wraps(f) def wrapped_f(*args, **kw): return Retrying().call(f, *args, **kw) return wrapped_f return wrap_simple(dargs[0]) else: def wrap(f): @six.wraps(f) def wrapped_f(*args, **kw): return Retrying(*dargs, **dkw).call(f, *args, **kw) return wrapped_f return wrap class Retrying(object): def __init__(self, stop=None, wait=None, stop_max_attempt_number=None, stop_max_delay=None, wait_fixed=None, wait_random_min=None, wait_random_max=None, wait_incrementing_start=None, wait_incrementing_increment=None, wait_exponential_multiplier=None, wait_exponential_max=None, retry_on_exception=None, retry_on_result=None, wrap_exception=False, stop_func=None, wait_func=None, wait_jitter_max=None): self._stop_max_attempt_number = 5 if stop_max_attempt_number is None else stop_max_attempt_number self._stop_max_delay = 100 if stop_max_delay is None else stop_max_delay self._wait_fixed = 1000 if wait_fixed is None else wait_fixed self._wait_random_min = 0 if wait_random_min is None else wait_random_min self._wait_random_max = 1000 if wait_random_max is None else wait_random_max self._wait_incrementing_start = 0 if wait_incrementing_start is None else wait_incrementing_start self._wait_incrementing_increment = 100 if wait_incrementing_increment is None else wait_incrementing_increment self._wait_exponential_multiplier = 1 if wait_exponential_multiplier is None else wait_exponential_multiplier self._wait_exponential_max = MAX_WAIT if wait_exponential_max is None else wait_exponential_max self._wait_jitter_max = 0 if wait_jitter_max is None else wait_jitter_max # TODO add chaining of stop behaviors # stop behavior stop_funcs = [] if stop_max_attempt_number is not None: stop_funcs.append(self.stop_after_attempt) if stop_max_delay is not None: stop_funcs.append(self.stop_after_delay) if stop_func is not None: self.stop = stop_func elif stop is None: self.stop = lambda attempts, delay: any(f(attempts, delay) for f in stop_funcs) else: self.stop = getattr(self, stop) # TODO add chaining of wait behaviors # wait behavior wait_funcs = [lambda *args, **kwargs: 0] if wait_fixed is not None: wait_funcs.append(self.fixed_sleep) if wait_random_min is not None or wait_random_max is not None: wait_funcs.append(self.random_sleep) if wait_incrementing_start is not None or wait_incrementing_increment is not None: wait_funcs.append(self.incrementing_sleep) if wait_exponential_multiplier is not None or wait_exponential_max is not None: wait_funcs.append(self.exponential_sleep) if wait_func is not None: self.wait = wait_func elif wait is None: self.wait = lambda attempts, delay: max(f(attempts, delay) for f in wait_funcs) else: self.wait = getattr(self, wait) # retry on exception filter if retry_on_exception is None: self._retry_on_exception = self.always_reject else: self._retry_on_exception = retry_on_exception # TODO simplify retrying by Exception types # retry on result filter if retry_on_result is None: self._retry_on_result = self.never_reject else: self._retry_on_result = retry_on_result self._wrap_exception = wrap_exception def stop_after_attempt(self, previous_attempt_number, delay_since_first_attempt_ms): """Stop after the previous attempt >= stop_max_attempt_number.""" return previous_attempt_number >= self._stop_max_attempt_number def stop_after_delay(self, previous_attempt_number, delay_since_first_attempt_ms): """Stop after the time from the first attempt >= stop_max_delay.""" return delay_since_first_attempt_ms >= self._stop_max_delay def no_sleep(self, previous_attempt_number, delay_since_first_attempt_ms): """Don't sleep at all before retrying.""" return 0 def fixed_sleep(self, previous_attempt_number, delay_since_first_attempt_ms): """Sleep a fixed amount of time between each retry.""" return self._wait_fixed def random_sleep(self, previous_attempt_number, delay_since_first_attempt_ms): """Sleep a random amount of time between wait_random_min and wait_random_max""" return random.randint(self._wait_random_min, self._wait_random_max) def incrementing_sleep(self, previous_attempt_number, delay_since_first_attempt_ms): """ Sleep an incremental amount of time after each attempt, starting at wait_incrementing_start and incrementing by wait_incrementing_increment """ result = self._wait_incrementing_start + (self._wait_incrementing_increment * (previous_attempt_number - 1)) if result < 0: result = 0 return result def exponential_sleep(self, previous_attempt_number, delay_since_first_attempt_ms): exp = 2 ** previous_attempt_number result = self._wait_exponential_multiplier * exp if result > self._wait_exponential_max: result = self._wait_exponential_max if result < 0: result = 0 return result def never_reject(self, result): return False def always_reject(self, result): return True def should_reject(self, attempt): reject = False if attempt.has_exception: reject |= self._retry_on_exception(attempt.value[1]) else: reject |= self._retry_on_result(attempt.value) return reject def call(self, fn, *args, **kwargs): start_time = int(round(time.time() * 1000)) attempt_number = 1 while True: try: attempt = Attempt(fn(*args, **kwargs), attempt_number, False) except: tb = sys.exc_info() attempt = Attempt(tb, attempt_number, True) if not self.should_reject(attempt): return attempt.get(self._wrap_exception) delay_since_first_attempt_ms = int(round(time.time() * 1000)) - start_time if self.stop(attempt_number, delay_since_first_attempt_ms): if not self._wrap_exception and attempt.has_exception: # get() on an attempt with an exception should cause it to be raised, but raise just in case raise attempt.get() else: raise RetryError(attempt) else: sleep = self.wait(attempt_number, delay_since_first_attempt_ms) if self._wait_jitter_max: jitter = random.random() * self._wait_jitter_max sleep = sleep + max(0, jitter) time.sleep(sleep / 1000.0) attempt_number += 1 class Attempt(object): """ An Attempt encapsulates a call to a target function that may end as a normal return value from the function or an Exception depending on what occurred during the execution. """ def __init__(self, value, attempt_number, has_exception): self.value = value self.attempt_number = attempt_number self.has_exception = has_exception def get(self, wrap_exception=False): """ Return the return value of this Attempt instance or raise an Exception. If wrap_exception is true, this Attempt is wrapped inside of a RetryError before being raised. """ if self.has_exception: if wrap_exception: raise RetryError(self) else: six.reraise(self.value[0], self.value[1], self.value[2]) else: return self.value def __repr__(self): if self.has_exception: return "Attempts: {0}, Error:\n{1}".format(self.attempt_number, "".join(traceback.format_tb(self.value[2]))) else: return "Attempts: {0}, Value: {1}".format(self.attempt_number, self.value) class RetryError(Exception): """ A RetryError encapsulates the last Attempt instance right before giving up. """ def __init__(self, last_attempt): self.last_attempt = last_attempt def __str__(self): return "RetryError[{0}]".format(self.last_attempt) PKd]K͘  -pep517/__pycache__/build.cpython-38.opt-1.pycnu[U .e @sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl mZeeZdd Zd d Zd d ZddZd"ddZeZejdddejdddddejdddddejdddddd Zed!kreedS)#z%Build a project using PEP 517 hooks. N)BuildEnvironment)Pep517HookCaller)tempdirmkdir_p)FileNotFoundErrorcCs4ddh}|t|ks0dj|t|d}t|dS)z7 Ensure build system has the requisite fields. requires build-backendz"Missing required fields: {missing})ZmissingN)setformat ValueError)systemZrequiredmessagerDestination in which to save the builds relative to source dircCsPttd|js|jsdnd|js$|js(dndf}|D]}t|j||jq6dS)NZsdistr)listfilterr,Zbinaryr*rZout_dir)argsZdistsr(rrrmainps r6__main__)NN)__doc__argparseZloggingrrr$ZenvbuildrZwrappersrZdirtoolsrrcompatrZ getLogger__name__r!rrrr-r*ArgumentParserparser add_argumentr6 parse_argsrrrrsP        PKd].ؒkk'pep517/__pycache__/check.cpython-38.pycnu[U ʗRe@sdZddlZddlZddlZddlZddlmZmZddl Z ddl m Z ddl Z ddl Z ddlmZddlZddlmZddlmZmZdd lmZdd lmZeeZd d Zd dZddZdddZ dddddZ!ddZ"edkre dS)zHCheck a project and backend by attempting to build using PEP 517 hooks. N)isfilejoin)CalledProcessError)mkdtemp)enable_colourful_output)TOMLDecodeError toml_load)BuildEnvironment)Pep517HookCallerc Cst}z||tdWn*tk rLtdYW5QRdSXz|i}td|Wn.tk rtjdddYW5QRdSXz||tdWn*tk rtd YW5QRdSXt}td |zz| |i}td |Wn4tk r@tjd ddYWW5QRdSX| d sltd|WW5QRdSt ||}t|rtd|ntd|WFW5QRdSt|rtdntdWW5QRdSW5t |XW5QRdSQRXdS)N#Installed static build dependencies+Failed to install static build dependenciesFGot build requires: %s'Failure in get_requires_for_build_sdistTexc_info$Installed dynamic build dependencies,Failed to install dynamic build dependencieszTrying to build sdist in %szbuild_sdist returned %rzFailure in build_sdistz.tar.gzz*Filename %s doesn't have .tar.gz extensionOutput file %s existsOutput file %s does not existzOutput file is a tar filezOutput file is not a tar file)r pip_installloginforerrorget_requires_for_build_sdist Exceptionrshutilrmtree build_sdistendswithpjoinrtarfile is_tarfilehooksZbuild_sys_requiresenvreqstdfilenamepathr*/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pep517/check.pycheck_build_sdistsZ                r,c Cst}z||tdWn*tk rLtdYW5QRdSXz|i}td|Wn.tk rtjdddYW5QRdSXz||tdWn*tk rtd YW5QRdSXt}td |zz| |i}td |Wn4tk r@tjd ddYWW5QRdSX| d sltd|WW5QRdSt ||}t|rtd|ntd|WFW5QRdSt|rtdntdWW5QRdSW5t |XW5QRdSQRXdS)Nr r FrrTrrrzTrying to build wheel in %szbuild_wheel returned %rzFailure in build_wheelz.whlz'Filename %s doesn't have .whl extensionrrzOutput file is a zip filezOutput file is not a zip file)r rrrrrget_requires_for_build_wheelrrrr build_wheelrr rzipfile is_zipfiler#r*r*r+check_build_wheelPsT                 r1c Cst|d}t|rtdntddSzPt|d}t|}W5QRX|d}|d}|d}|d }td Wn(t t fk rtjd d d YdSXt |||}t ||} t ||} | std| std| S)Nzpyproject.tomlzFound pyproject.tomlzMissing pyproject.tomlFrbz build-systemrequiresz build-backendz backend-pathzLoaded pyproject.tomlzInvalid pyproject.tomlTrz%Sdist checks failed; scroll up to seezWheel checks failed)r rrrrioopenr getrKeyErrorr r,r1warning) source_dir pyprojectfZpyproject_dataZbuildsysr3backend backend_pathr$Zsdist_okZwheel_okr*r*r+checks0         r>cCsjtdt}|jddd||}tt|j}|rNt t ddnt t ddt d dS) NzQpep517.check is deprecated. Consider switching to https://pypi.org/project/build/r9z%A directory containing pyproject.toml)helpz Checks passedgreenz Checks failedredr) rr8argparseArgumentParser add_argument parse_argsrr>r9printansisysexit)argvZapargsokr*r*r+mains   rMzzzz)resetboldrAr@cCs8tjdkr,tjr,t|t|tdSt|SdS)NntrN)osnamerHstdoutisatty ansi_codesstr)sattrr*r*r+rGsrG__main__)N)#__doc__rBr4loggingrQos.pathrrr r subprocessrrHr!tempfilerr/Zcolorlogrcompatrr Zenvbuildr wrappersr getLogger__name__rr,r1r>rMrUrGr*r*r*r+s8      98" PKd]cB-pep517/__pycache__/check.cpython-38.opt-1.pycnu[U .e=@sdZddlZddlZddlZddlmZmZddlm Z m Z ddl Z ddl mZddlZddlZddlmZddlZddlmZdd lmZdd lmZeeZd d Zd dZddZdddZ dddddZ!ddZ"edkre dS)zHCheck a project and backend by attempting to build using PEP 517 hooks. N)isfilejoin)TomlDecodeErrorload)CalledProcessError)mkdtemp)enable_colourful_output)BuildEnvironment)Pep517HookCallerc Cst}z||tdWn*tk rLtdYW5QRdSXz|i}td|Wn.tk rtjdddYW5QRdSXz||tdWn*tk rtd YW5QRdSXt}td |zz| |i}td |Wn4tk r@tjd ddYWW5QRdSX| d sltd|WW5QRdSt ||}t|rtd|ntd|WFW5QRdSt|rtdntdWW5QRdSW5t |XW5QRdSQRXdS)N#Installed static build dependencies+Failed to install static build dependenciesFGot build requires: %s'Failure in get_requires_for_build_sdistTexc_info$Installed dynamic build dependencies,Failed to install dynamic build dependencieszTrying to build sdist in %szbuild_sdist returned %rzFailure in build_sdistz.tar.gzz*Filename %s doesn't have .tar.gz extensionOutput file %s existsOutput file %s does not existzOutput file is a tar filezOutput file is not a tar file)r pip_installloginforerrorZget_requires_for_build_sdist ExceptionrshutilrmtreeZ build_sdistendswithpjoinrtarfileZ is_tarfilehooksZbuild_sys_requiresenvZreqsZtdfilenamepathr%s6      98" PKd]sL *pep517/__pycache__/colorlog.cpython-38.pycnu[U ʗRe@sfdZddlZddlZz ddlZWnek r8dZYnXddZGdddejZejfddZ dS) zONicer log formatting with colours. Code copied from Tornado, Apache licensed. NcCsVd}trRttjdrRtjrRzttddkr:d}Wntk rPYnX|S)NFisattycolorsrT)curseshasattrsysstderrrZ setuptermZtigetnum Exception)colorr /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pep517/colorlog.py_stderr_supports_colorsr c@s>eZdZdZejdejdejdejdiZ d ddZ d d Z dS) LogFormatterz&Log formatter with colour support TNcCstjj||di|_|rtrtdp6tdp6d}dtjkrNdkr\nn t |d}|j D] \}}t t ||d|j|<qft tdd|_ t}|d |_tn d|_ d |_d S) aO :arg bool color: Enables color support. :arg string fmt: Log message format. It will be applied to the attributes dict of log records. The text between ``%(color)s`` and ``%(end_color)s`` will be colored depending on the level if color support is on. :arg dict colors: color mappings from logging level to terminal color code :arg string datefmt: Datetime format. Used for formatting ``(asctime)`` placeholder in ``prefix_fmt``. .. versionchanged:: 3.2 Added ``fmt`` and ``datefmt`` arguments. )datefmtZsetafZsetf)rr)rrrasciiZsgr0rFN)logging Formatter__init___colorsr rZtigetstrr version_infostrDEFAULT_COLORSitemsZtparm_normalZinitscrZgetmaxyx termwidthZendwin)selfr rZfg_colorlevelnocodeZscrr r r r2s*      zLogFormatter.__init__cCst|j}dj|jd|jd}|t||jkrJd|j|t|}nd}|j|jkrn|j|j}|j}nd}}|j||||S)Nz{initial}-{name}r)initialname z r) lenmessageformat levelnamer#rr rr)rrecordmlenZ right_textspaceZ start_colorZ end_colorr r r formatMessage]s    zLogFormatter.formatMessage)TN) __name__ __module__ __qualname____doc__rINFOWARNINGERRORCRITICALrrr,r r r r r (s +r cCs0t}|ttj|tj|dS)N)r StreamHandler setFormatterr root addHandlersetLevel)levelhandlerr r r enable_colourful_outputos  r<) r0rrr ImportErrorr rr r1r<r r r r s   GPKd]-pep517/__pycache__/_in_process.cpython-38.pycnu[U .ep@s0dZddlmZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z Gddde ZGdd d e ZGd d d e Zd d ZddZddZddZdZddZddZddZd(ddZddZGdd d e ZGd!d"d"e Zd#d$Zddddd$hZd%d&Ze d'kr,edS))agThis is invoked in a subprocess to call the build backend hooks. It expects: - Command line args: hook_name, control_dir - Environment variables: PEP517_BUILD_BACKEND=entry.point:spec PEP517_BACKEND_PATH=paths (separated with os.pathsep) - control_dir/input.json: - {"kwargs": {...}} Results: - control_dir/output.json - {"return_val": ...} )glob) import_moduleN)joinc@seZdZdZddZdS)BackendUnavailablez&Raised if we cannot import the backendcCs ||_dSN tracebackselfrr B/usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py__init__szBackendUnavailable.__init__N__name__ __module__ __qualname____doc__r r r r r rsrc@seZdZdZddZdS)BackendInvalidz Raised if the backend is invalidcCs ||_dSr)message)r rr r r r %szBackendInvalid.__init__Nrr r r r r#src@seZdZdZdS) HookMissingzARaised if a hook is missing and we are not executing the fallbackNrrrrr r r r r)srcCs<tjtj|}tjtj|}tj||g|kS)z5Test if a file is located within the given directory.)ospathnormcaseabspath commonprefix)filenameZ directoryr r r contained_in-srcstjd}|r*|tj}|tjdd<tjd}|d\}}}z t|Wn t k rpt t YnX|rt fdd|Dstd|r|d D]}t|qS) zFind and load the build backendZPEP517_BACKEND_PATHNrZPEP517_BUILD_BACKEND:c3s|]}tj|VqdSr)r__file__).0robjr r Dsz!_build_backend..z(Backend was not loaded from backend-path.)renvirongetsplitpathsepsysr partitionr ImportErrorrr format_excanyrgetattr)Z backend_pathZextra_pathitemsZepZmod_path_Zobj_pathZ path_partr r!r _build_backend4s&      r0cCs6t}z |j}Wntk r(gYSX||SdSzfInvoke the optional get_requires_for_build_wheel hook Returns [] if the hook is not defined. N)r0get_requires_for_build_wheelAttributeErrorconfig_settingsbackendhookr r r r2Ps   r2cCsJt}z |j}Wn*tk r:|s*tt|||YSX|||SdS)zInvoke optional prepare_metadata_for_build_wheel Implements a fallback by building a wheel if the hook isn't defined, unless _allow_fallback is False in which case HookMissing is raised. N)r0 prepare_metadata_for_build_wheelr3r_get_wheel_metadata_from_wheel)metadata_directoryr5Z_allow_fallbackr6r7r r r r8^s  r8ZPEP517_ALREADY_BUILT_WHEELcCs@g}|D]}td|}|r ||q |r4|StddS)z6Identify the .dist-info folder inside a wheel ZipFile.z[^/\\]+-[^/\\]+\.dist-info/z#No .dist-info folder found in wheelN)Znamelistrematchappend Exception)Zwhl_zipresrmr r r _dist_info_filests   rAc Csddlm}|||}ttj|tdW5QRXtj||}||}t|}|j ||dW5QRX|d ddS)zBuild a wheel and extract the metadata from it. Fallback for when the build backend does not define the 'get_wheel_metadata' hook. r)ZipFilewb)rmembers/) ZzipfilerB build_wheelopenrrrWHEEL_BUILT_MARKERrAZ extractallr')r6r:r5rBZ whl_basenameZwhl_fileZzipfZ dist_infor r r r9s    r9cCsl|sdStj|}tjt|ts*dSttj|d}|sLtddSt |dkrdtddS|dS)zHCheck for a wheel already built during the get_wheel_metadata hook. Nz*.whlz+Found wheel built marker, but no .whl fileszHFound multiple .whl files; unspecified behaviour. Will call build_wheel.r) rrdirnameisfilepjoinrHrrprintlen)r:Zmetadata_parentZ whl_filesr r r _find_already_built_wheels  rOcCs4t|}|r$t||tj|St|||S)zInvoke the mandatory build_wheel hook. If a wheel was already built in the prepare_metadata_for_build_wheel fallback, this will copy it rather than rebuilding the wheel. )rOshutilZcopy2rrbasenamer0rF)Zwheel_directoryr5r:Z prebuilt_whlr r r rFs   rFcCs6t}z |j}Wntk r(gYSX||SdSr1)r0get_requires_for_build_sdistr3r4r r r rRs   rRc@seZdZdZdS)_DummyExceptionz(Nothing should ever raise this exceptionNrr r r r rSsrSc@seZdZdZddZdS)GotUnsupportedOperationz9For internal use when backend raises UnsupportedOperationcCs ||_dSrrr r r r r sz GotUnsupportedOperation.__init__Nrr r r r rTsrTc CsBt}z|||WSt|dtk r<ttYnXdS)z&Invoke the mandatory build_sdist hook.UnsupportedOperationN)r0 build_sdistr.rSrTrr,)Zsdist_directoryr5r6r r r rVs rVc CsNttjdkrtdtjd}tjd}|tkrBtd|t|}tt|d}ddd}z|f|d |d <Wnt k r}zd |d <|j |d <W5d}~XYnt k r}zd |d<|j |d<W5d}~XYnRt k r}zd |d<|j |d <W5d}~XYntk r2d |d<YnXtj|t|ddddS)Nz"Needs args: hook_name, control_dirrIzUnknown hook: %sz input.jsonF) unsupported return_valkwargsrZTZ no_backendrZbackend_invalidZ backend_errorrYZ hook_missingz output.json)indent)rNr)argvexit HOOK_NAMESglobalscompatZ read_jsonrLrrrrrTrZ write_json)Z hook_nameZ control_dirr7Z hook_inputZjson_outer r r mains.     rc__main__)N)!rr importlibrrZos.pathrrLr;rPr)rrar>rrrrr0r2r8rHrAr9rOrFrRrSrTrVr_rcrr r r r sF        PKd]c#``*pep517/__pycache__/__init__.cpython-38.pycnu[U ʗRe@sdZdZddlTdS)z6Wrappers to build Python packages using PEP 517 hooks z0.12.0)*N)__doc__ __version__wrappersrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pep517/__init__.pysPKd]3pep517/__pycache__/_in_process.cpython-38.opt-1.pycnu[U .ep@s0dZddlmZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z Gddde ZGdd d e ZGd d d e Zd d ZddZddZddZdZddZddZddZd(ddZddZGdd d e ZGd!d"d"e Zd#d$Zddddd$hZd%d&Ze d'kr,edS))agThis is invoked in a subprocess to call the build backend hooks. It expects: - Command line args: hook_name, control_dir - Environment variables: PEP517_BUILD_BACKEND=entry.point:spec PEP517_BACKEND_PATH=paths (separated with os.pathsep) - control_dir/input.json: - {"kwargs": {...}} Results: - control_dir/output.json - {"return_val": ...} )glob) import_moduleN)joinc@seZdZdZddZdS)BackendUnavailablez&Raised if we cannot import the backendcCs ||_dSN tracebackselfrr B/usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py__init__szBackendUnavailable.__init__N__name__ __module__ __qualname____doc__r r r r r rsrc@seZdZdZddZdS)BackendInvalidz Raised if the backend is invalidcCs ||_dSr)message)r rr r r r %szBackendInvalid.__init__Nrr r r r r#src@seZdZdZdS) HookMissingzARaised if a hook is missing and we are not executing the fallbackNrrrrr r r r r)srcCs<tjtj|}tjtj|}tj||g|kS)z5Test if a file is located within the given directory.)ospathnormcaseabspath commonprefix)filenameZ directoryr r r contained_in-srcstjd}|r*|tj}|tjdd<tjd}|d\}}}z t|Wn t k rpt t YnX|rt fdd|Dstd|r|d D]}t|qS) zFind and load the build backendZPEP517_BACKEND_PATHNrZPEP517_BUILD_BACKEND:c3s|]}tj|VqdSr)r__file__).0robjr r Dsz!_build_backend..z(Backend was not loaded from backend-path.)renvirongetsplitpathsepsysr partitionr ImportErrorrr format_excanyrgetattr)Z backend_pathZextra_pathitemsZepZmod_path_Zobj_pathZ path_partr r!r _build_backend4s&      r0cCs6t}z |j}Wntk r(gYSX||SdSzfInvoke the optional get_requires_for_build_wheel hook Returns [] if the hook is not defined. N)r0get_requires_for_build_wheelAttributeErrorconfig_settingsbackendhookr r r r2Ps   r2cCsJt}z |j}Wn*tk r:|s*tt|||YSX|||SdS)zInvoke optional prepare_metadata_for_build_wheel Implements a fallback by building a wheel if the hook isn't defined, unless _allow_fallback is False in which case HookMissing is raised. N)r0 prepare_metadata_for_build_wheelr3r_get_wheel_metadata_from_wheel)metadata_directoryr5Z_allow_fallbackr6r7r r r r8^s  r8ZPEP517_ALREADY_BUILT_WHEELcCs@g}|D]}td|}|r ||q |r4|StddS)z6Identify the .dist-info folder inside a wheel ZipFile.z[^/\\]+-[^/\\]+\.dist-info/z#No .dist-info folder found in wheelN)Znamelistrematchappend Exception)Zwhl_zipresrmr r r _dist_info_filests   rAc Csddlm}|||}ttj|tdW5QRXtj||}||}t|}|j ||dW5QRX|d ddS)zBuild a wheel and extract the metadata from it. Fallback for when the build backend does not define the 'get_wheel_metadata' hook. r)ZipFilewb)rmembers/) ZzipfilerB build_wheelopenrrrWHEEL_BUILT_MARKERrAZ extractallr')r6r:r5rBZ whl_basenameZwhl_fileZzipfZ dist_infor r r r9s    r9cCsl|sdStj|}tjt|ts*dSttj|d}|sLtddSt |dkrdtddS|dS)zHCheck for a wheel already built during the get_wheel_metadata hook. Nz*.whlz+Found wheel built marker, but no .whl fileszHFound multiple .whl files; unspecified behaviour. Will call build_wheel.r) rrdirnameisfilepjoinrHrrprintlen)r:Zmetadata_parentZ whl_filesr r r _find_already_built_wheels  rOcCs4t|}|r$t||tj|St|||S)zInvoke the mandatory build_wheel hook. If a wheel was already built in the prepare_metadata_for_build_wheel fallback, this will copy it rather than rebuilding the wheel. )rOshutilZcopy2rrbasenamer0rF)Zwheel_directoryr5r:Z prebuilt_whlr r r rFs   rFcCs6t}z |j}Wntk r(gYSX||SdSr1)r0get_requires_for_build_sdistr3r4r r r rRs   rRc@seZdZdZdS)_DummyExceptionz(Nothing should ever raise this exceptionNrr r r r rSsrSc@seZdZdZddZdS)GotUnsupportedOperationz9For internal use when backend raises UnsupportedOperationcCs ||_dSrrr r r r r sz GotUnsupportedOperation.__init__Nrr r r r rTsrTc CsBt}z|||WSt|dtk r<ttYnXdS)z&Invoke the mandatory build_sdist hook.UnsupportedOperationN)r0 build_sdistr.rSrTrr,)Zsdist_directoryr5r6r r r rVs rVc CsNttjdkrtdtjd}tjd}|tkrBtd|t|}tt|d}ddd}z|f|d |d <Wnt k r}zd |d <|j |d <W5d}~XYnt k r}zd |d<|j |d<W5d}~XYnRt k r}zd |d<|j |d <W5d}~XYntk r2d |d<YnXtj|t|ddddS)Nz"Needs args: hook_name, control_dirrIzUnknown hook: %sz input.jsonF) unsupported return_valkwargsrZTZ no_backendrZbackend_invalidZ backend_errorrYZ hook_missingz output.json)indent)rNr)argvexit HOOK_NAMESglobalscompatZ read_jsonrLrrrrrTrZ write_json)Z hook_nameZ control_dirr7Z hook_inputZjson_outer r r mains.     rc__main__)N)!rr importlibrrZos.pathrrLr;rPr)rrar>rrrrr0r2r8rHrAr9rOrFrRrSrTrVr_rcrr r r r sF        PKd]AײS""0pep517/__pycache__/envbuild.cpython-38.opt-1.pycnu[U .e@sdZddlZddlZddlZddlZddlmZddlZddlm Z ddl m Z ddl m Z mZeeZdd ZGd d d eZdd d ZdddZdS)zIBuild wheels/sdists by installing build deps to a temporary environment. N) check_call) get_paths)mkdtemp)Pep517HookCaller LoggerWrapperc CsHttj|d}t|}W5QRX|d}|d|d|dfS)Nzpyproject.tomlz build-systemrequiresz build-backendz backend-path)openospathjointomlloadget) source_dirfZpyproject_dataZbuildsysr?/usr/lib/python3.8/site-packages/pip/_vendor/pep517/envbuild.py_load_pyprojectsrc@s6eZdZdZdZd ddZddZdd Zd d ZdS) BuildEnvironmentzContext manager to install build deps in a simple temporary environment Based on code I wrote for pip, which is MIT licensed. NTcCs ||_dS)N)_cleanup)selfZcleanuprrr__init__9szBuildEnvironment.__init__cCstdd|_td|jtjdd|_tjdd|_tj dkrHdnd}t ||j|jdd }|d }|jr|tj |jtjd<n|tj tj tjd<|d |d kr|d }n|d tj |d }|jr|tj |jtjd<n |tjd<|S) Nzpep517-build-env-)prefixzTemporary build environment: %sPATH PYTHONPATHntZ posix_prefix)baseZplatbase)varsscriptsZpurelibZplatlib) rr loginfor environr save_pathsave_pythonpathnamerpathsepdefpath)rZinstall_schemeZ install_dirsrZlib_dirsrrr __enter__<s0      zBuildEnvironment.__enter__cCsT|sdStd|tjddddd|jgt|}t|tttj tttj ddS) zAInstall dependencies into this env by calling pip in a subprocessNzCalling pip to install %sz-mZpipZinstallz--ignore-installedz--prefix)stdoutstderr) r r!sys executabler listrrloggingINFOZERROR)rreqscmdrrr pip_install\s$   zBuildEnvironment.pip_installcCs~|jo|jdk otj|j}|r.t|j|jdkrHtjddn |jtjd<|j dkrntjddn |j tjd<dS)Nrr) rr r isdirshutilZrmtreer#r"popr$)rexc_typeZexc_valZexc_tbZ needs_cleanuprrr__exit__js     zBuildEnvironment.__exit__)T) __name__ __module__ __qualname____doc__r rr(r2r7rrrrrs   rc Csn|dkr i}t|\}}}t|||}t8}||||}|||||W5QRSQRXdS)amBuild a wheel from a source directory using PEP 517 hooks. :param str source_dir: Source directory containing pyproject.toml :param str wheel_dir: Target directory to create wheel in :param dict config_settings: Options to pass to build backend This is a blocking function which will run pip in a subprocess to install build requirements. N)rrrr2Zget_requires_for_build_wheel build_wheel) rZ wheel_dirconfig_settingsrbackend backend_pathhooksenvr0rrrr<~s     r<c Csn|dkr i}t|\}}}t|||}t8}||||}|||||W5QRSQRXdS)amBuild an sdist from a source directory using PEP 517 hooks. :param str source_dir: Source directory containing pyproject.toml :param str sdist_dir: Target directory to place sdist in :param dict config_settings: Options to pass to build backend This is a blocking function which will run pip in a subprocess to install build requirements. N)rrrr2Zget_requires_for_build_sdist build_sdist) rZ sdist_dirr=rr>r?r@rAr0rrrrBs     rB)N)N)r;r r.r r4 subprocessrr+Z sysconfigrZtempfilerZwrappersrrZ getLoggerr8r robjectrr<rBrrrrs     a PKd]*wQ Q &pep517/__pycache__/meta.cpython-38.pycnu[U ʗRe @sBdZddlZddlZddlZddlZddlZzddlmZWne k rXddl ZYnXzddl m Z Wn e k rddl m Z YnXddlmZddlmZmZddlmZmZmZddlmZmZmZeeZd d Zdd d ZefddZddZ e!Z"e"j#ddde"j#ddddddZ$edkr>e$dS)z2Build metadata for a project using PEP 517 hooks. N)Path)BuildEnvironment)Pep517HookCallerquiet_subprocess_runner)tempdirmkdir_pdir_to_zipfile)validate_system load_system compat_systemc Cs|i}td|||tdtJ}td|||i}tj||}t |tj|tj |W5QRXdS)NzGot build requires: %sz$Installed dynamic build dependencieszTrying to build metadata in %s) get_requires_for_build_wheelloginfo pip_installr prepare_metadata_for_build_wheelospathjoinshutilmovebasename)hooksenvdestreqstdfilenamesourcer/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pep517/meta.py _prep_metas      r!.c Cs|p t|}tj||pd}t|t|t||d|d}|t 2t }| |dt |||W5QRXW5QRXdS)Ndistz build-backendz backend-pathrequires) r rrrrr rgetsubprocess_runnerrrrr!) source_dirrsystemrrrrr build)s  r)c Cs0t }||dt|W5QRSQRXdS)N)r)rr )builderout_dirrrr build_as_zip8s r,cCs:tj|}t|}tjt||d}tt|}t |S)z Given a source directory (root) of a package, return an importlib.metadata.Distribution object with metadata build from that package. )r'r() rr expanduserr functoolspartialr)rr,imp_metaZPathDistribution)rootr(r*rrrr load>s   r2r'z%A directory containing pyproject.toml)helpz --out-dirz-oz>Destination in which to save the builds relative to source dircCst}t|j|jdS)N)parser parse_argsr)r'r+)argsrrr mainVsr7__main__)r"NN)%__doc__argparseloggingrrr.importlib.metadatametadatar0 ImportErrorZimportlib_metadatazipfilerZzippZenvbuildrwrappersrrZdirtoolsrrr r)r r r getLogger__name__rr!r,r2ArgumentParserr4 add_argumentr7rrrr sF      PKd]M-''0pep517/__pycache__/wrappers.cpython-38.opt-1.pycnu[U .eg)@s ddlZddlmZddlZddlmZmZmZddl Z ddl m Z m Z m Z ddlZddlmZddlmZeeeedZed d ZGd d d eZGd ddeZGdddeZGdddeZdddZdddZddZGdddeZGdddej Z!dS)N)contextmanager)dirnameabspathjoin) check_call check_outputSTDOUT)mkdtemp)compatz_in_process.pyc cs"t}z |VW5t|XdSN)r shutilZrmtree)tdr?/usr/lib/python3.8/site-packages/pip/_vendor/pep517/wrappers.pytempdirs rc@seZdZdZddZdS)BackendUnavailablezEWill be raised if the backend cannot be imported in the hook process.cCs ||_dSr  tracebackselfrrrr__init__szBackendUnavailable.__init__N__name__ __module__ __qualname____doc__rrrrrrsrc@seZdZdZddZdS)BackendInvalidz)Will be raised if the backend is invalid.cCs||_||_||_dSr  backend_name backend_pathmessage)rrr r!rrrr szBackendInvalid.__init__Nrrrrrrsrcs eZdZdZfddZZS) HookMissingz Will be raised on missing hooks.cstt||||_dSr )superr"r hook_name)rr$ __class__rrr(szHookMissing.__init__)rrrrr __classcell__rrr%rr"&sr"c@seZdZdZddZdS)UnsupportedOperationzDMay be raised by build_sdist if the backend indicates that it can't.cCs ||_dSr rrrrrr/szUnsupportedOperation.__init__Nrrrrrr(-sr(cCs*tj}|r||t|||ddS)z5The default method of calling the wrapper subprocess.)cwdenvN)osenvironcopyupdatercmdr) extra_environr*rrrdefault_subprocess_runner3s  r2cCs,tj}|r||t|||tddS)zDA method of calling the wrapper subprocess while suppressing output.)r)r*stderrN)r+r,r-r.rrr/rrrquiet_subprocess_runner<s  r4cCsntj|rtdtj|}tjtj||}tj|}tj|}tj||g|krjtd|S)zNormalise and check a backend path. Ensure that the requested backend path is specified as a relative path, and resolves to a location under the given source tree. Return an absolute version of the requested path. zpaths must be relativez paths must be inside source tree) r+pathisabs ValueErrorrnormpathrnormcase commonprefix)Z source_treeZ requestedZ abs_sourceZ abs_requestedZ norm_sourceZnorm_requestedrrrnorm_and_checkEs    r;c@s`eZdZdZdddZeddZdddZdd d Zdd d Z dddZ dddZ ddZ dS)Pep517HookCalleraeA wrapper around a source directory to be built with a PEP 517 backend. source_dir : The path to the source directory, containing pyproject.toml. build_backend : The build backend spec, as per PEP 517, from pyproject.toml. backend_path : The backend path, as per PEP 517, from pyproject.toml. runner : A callable that invokes the wrapper subprocess. The 'runner', if provided, must expect the following: cmd : a list of strings representing the command and arguments to execute, as would be passed to e.g. 'subprocess.check_call'. cwd : a string representing the working directory that must be used for the subprocess. Corresponds to the provided source_dir. extra_environ : a dict mapping environment variable names to values which must be set for the subprocess execution. NcsB|dkr t}t|_|_|r2fdd|D}|_|_dS)Ncsg|]}tj|qSr)r; source_dir).0prrr {sz-Pep517HookCaller.__init__..)r2rr= build_backendr _subprocess_runner)rr=rBr runnerrr@rrns  zPep517HookCaller.__init__ccs|j}||_dV||_dS)z\A context manager for temporarily overriding the default subprocess runner. N)rC)rrDprevrrrsubprocess_runnersz"Pep517HookCaller.subprocess_runnercCs|dd|iS)aGIdentify packages required for building a wheel Returns a list of dependency specifications, e.g.: ["wheel >= 0.25", "setuptools"] This does not include requirements specified in pyproject.toml. It returns the result of calling the equivalently named hook in a subprocess. get_requires_for_build_wheelconfig_settings _call_hookrrHrrrrGs z-Pep517HookCaller.get_requires_for_build_wheelTcCs|dt|||dS)aqPrepare a *.dist-info folder with metadata for this project. Returns the name of the newly created folder. If the build backend defines a hook with this name, it will be called in a subprocess. If not, the backend will be asked to build a wheel, and the dist-info extracted from that (unless _allow_fallback is False). prepare_metadata_for_build_wheel)metadata_directoryrH_allow_fallbackrJr)rrMrHrNrrrrLs z1Pep517HookCaller.prepare_metadata_for_build_wheelcCs(|dk rt|}|dt|||dS)avBuild a wheel from this project. Returns the name of the newly created file. In general, this will call the 'build_wheel' hook in the backend. However, if that was previously called by 'prepare_metadata_for_build_wheel', and the same metadata_directory is used, the previously built wheel will be copied to wheel_directory. N build_wheel)wheel_directoryrHrM)rrJ)rrQrHrMrrrrPs zPep517HookCaller.build_wheelcCs|dd|iS)a<Identify packages required for building a wheel Returns a list of dependency specifications, e.g.: ["setuptools >= 26"] This does not include requirements specified in pyproject.toml. It returns the result of calling the equivalently named hook in a subprocess. get_requires_for_build_sdistrHrIrKrrrrRs z-Pep517HookCaller.get_requires_for_build_sdistcCs|dt||dS)zBuild an sdist from this project. Returns the name of the newly created file. This calls the 'build_sdist' backend hook in a subprocess. build_sdist)sdist_directoryrHrO)rrTrHrrrrSszPep517HookCaller.build_sdistc Cs@tjddkr|jd}n|j}d|i}|jrbtj|j}tjddkrZ|t}||d<t }d|i}t j |t |ddd|j tjt||g|j|d t t |d }|d rt|d d |drt|d d |drt|j|j|dd d|dr"t||dW5QRSQRXdS)NrASCIIZPEP517_BUILD_BACKENDZPEP517_BACKEND_PATHkwargsz input.json)indent)r)r1z output.jsonZ unsupportedrZ no_backendZbackend_invalidZ backend_errorrZ hook_missingZ return_val)sys version_inforBencoder r+pathseprgetfilesystemencodingrr Z write_jsonpjoinrC executable_in_proc_scriptr=Z read_jsongetr(rrr") rr$rWrBr1r rZ hook_inputdatarrrrJsB      zPep517HookCaller._call_hook)NN)N)NT)NN)N)N) rrrrrrrFrGrLrPrRrSrJrrrrr<]s       r<c@s<eZdZdZddZddZeddZdd Zd d Z d S) LoggerWrapperzd Read messages from a pipe and redirect them to a logger (see python's logging module). cCsHtj|d|_||_||_t\|_|_ t |j|_ | dS)NT) threadingThreadrZdaemonloggerlevelr+pipeZfd_readfd_writefdopenreaderstart)rrgrhrrrrs zLoggerWrapper.__init__cCs|jSr )rjr@rrrfilenoszLoggerWrapper.filenocCs|tjr|ddS|S)N)endswithr+linesep)msgrrrremove_newline!szLoggerWrapper.remove_newlinecCs |jD]}|||qdSr )rl_writers)rlinerrrrun%s zLoggerWrapper.runcCs|j|j|dSr )rglogrh)rr!rrrrt)szLoggerWrapper._writeN) rrrrrrn staticmethodrsrvrtrrrrrd s  rd)NN)NN)"re contextlibrr+Zos.pathrrrr_r subprocessrrrrZZtempfiler rYr __file__rar Exceptionrrr"r(r2r4r;objectr<rfrdrrrrs*     /PKd]C.pep517/__pycache__/compat.cpython-38.opt-1.pycnu[U .e @sjdZddlZddlZejddkr4ddZddZnddZd dZzeZWnek rdeZYnXdS) zPython 2/3 compatibilityNc Ks.t|ddd}tj||f|W5QRXdS)Nwutf-8encodingopenjsondumpobjpathkwargsfr=/usr/lib/python3.8/site-packages/pip/_vendor/pep517/compat.py write_json src Cs0t|ddd}t|W5QRSQRXdS)Nrrrrr loadr rrrr read_jsonsrc Ks2t|d}tj||fddi|W5QRXdS)Nwbrrrr rrrrs c Cs,t|d}t|W5QRSQRXdS)Nrbrrrrrrs ) __doc__r sys version_inforrFileNotFoundError NameErrorIOErrorrrrrs PKd] 9  ,pep517/__pycache__/meta.cpython-38.opt-1.pycnu[U .e @sBdZddlZddlZddlZddlZddlZzddlmZWne k rXddl ZYnXzddl m Z Wn e k rddl m Z YnXddlmZddlmZmZddlmZmZmZddlmZmZmZeeZd d Zdd d ZefddZddZ e!Z"e"j#ddde"j#ddddddZ$edkr>e$dS)z2Build metadata for a project using PEP 517 hooks. N)Path)BuildEnvironment)Pep517HookCallerquiet_subprocess_runner)tempdirmkdir_pdir_to_zipfile)validate_system load_system compat_systemc Cs|i}td|||tdtJ}td|||i}tj||}t |tj|tj |W5QRXdS)NzGot build requires: %sz$Installed dynamic build dependencieszTrying to build metadata in %s) Zget_requires_for_build_wheelloginfo pip_installrZ prepare_metadata_for_build_wheelospathjoinshutilZmovebasename)hooksenvdestZreqsZtdfilenamesourcer;/usr/lib/python3.8/site-packages/pip/_vendor/pep517/meta.py _prep_metas      r.c Cs|p t|}tj||pd}t|t|t||d|d}|t 2t }| |dt |||W5QRXW5QRXdS)NZdistz build-backendz backend-pathZrequires) r rrrrr rgetZsubprocess_runnerrrrr) source_dirrsystemrrrrrbuild)s  r!c Cs0t }||dt|W5QRSQRXdS)N)r)rr )builderout_dirrrr build_as_zip8s r$cCs:tj|}t|}tjt||d}tt|}t |S)z Given a source directory (root) of a package, return an importlib.metadata.Distribution object with metadata build from that package. )rr ) rr expanduserr functoolspartialr!rr$imp_metaZPathDistribution)rootr r"rrrrload>s   r*rz%A directory containing pyproject.toml)helpz --out-dirz-oz>Destination in which to save the builds relative to source dircCst}t|j|jdS)N)parser parse_argsr!rr#)argsrrrmainVsr/__main__)rNN)%__doc__argparseZloggingrrr&importlib.metadataZmetadatar( ImportErrorZimportlib_metadataZzipfilerZzippZenvbuildrZwrappersrrZdirtoolsrrr r!r r r Z getLogger__name__r rr$r*ArgumentParserr, add_argumentr/rrrrsF      PKd]G r(pep517/__pycache__/compat.cpython-38.pycnu[U ʗRe@sdZddlZddlZddlZejddkrs$     PKd]*pep517/__pycache__/envbuild.cpython-38.pycnu[U ʗRe@sdZddlZddlZddlZddlZddlmZddlZddlm Z ddl m Z ddl m Z ddlmZmZeeZd d ZGd d d eZdd dZdddZdS)zIBuild wheels/sdists by installing build deps to a temporary environment. N) check_call) get_paths)mkdtemp) toml_load)Pep517HookCaller LoggerWrapperc CsJttj|dd}t|}W5QRX|d}|d|d|dfS)Nzpyproject.tomlrbz build-systemrequiresz build-backendz backend-path)ioopenospathjoinrget) source_dirfZpyproject_dataZbuildsysr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pep517/envbuild.py_load_pyprojects rc@s6eZdZdZdZd ddZddZdd Zd d ZdS) BuildEnvironmentzContext manager to install build deps in a simple temporary environment Based on code I wrote for pip, which is MIT licensed. NTcCs ||_dS)N)_cleanup)selfcleanuprrr__init__=szBuildEnvironment.__init__cCstdd|_td|jtjdd|_tjdd|_tj dkrHdnd}t ||j|jdd }|d }|jr|tj |jtjd<n|tj tj tjd<|d |d kr|d }n|d tj |d }|jr|tj |jtjd<n |tjd<|S) Nzpep517-build-env-)prefixzTemporary build environment: %sPATH PYTHONPATHnt posix_prefix)baseplatbase)varsscriptspurelibplatlib) rrloginfor environr save_pathsave_pythonpathnamerpathsepdefpath)rZinstall_schemeZ install_dirsr#lib_dirsrrr __enter__@s0      zBuildEnvironment.__enter__cCsT|sdStd|tjddddd|jgt|}t|tttj tttj ddS) zAInstall dependencies into this env by calling pip in a subprocessNzCalling pip to install %sz-mpipinstallz--ignore-installedz--prefix)stdoutstderr) r&r'sys executablerlistrrloggingINFOERROR)rreqscmdrrr pip_install`s$   zBuildEnvironment.pip_installcCs~|jo|jdk otj|j}|r.t|j|jdkrHtjddn |jtjd<|j dkrntjddn |j tjd<dS)Nrr) rrr isdirshutilrmtreer)r(popr*)rexc_typeexc_valexc_tbZ needs_cleanuprrr__exit__ns     zBuildEnvironment.__exit__)T) __name__ __module__ __qualname____doc__rrr/r<rDrrrrr!s   rc Csn|dkr i}t|\}}}t|||}t8}||||}|||||W5QRSQRXdS)amBuild a wheel from a source directory using PEP 517 hooks. :param str source_dir: Source directory containing pyproject.toml :param str wheel_dir: Target directory to create wheel in :param dict config_settings: Options to pass to build backend This is a blocking function which will run pip in a subprocess to install build requirements. N)rrrr<get_requires_for_build_wheel build_wheel) r wheel_dirconfig_settingsr backend backend_pathhooksenvr:rrrrJs     rJc Csn|dkr i}t|\}}}t|||}t8}||||}|||||W5QRSQRXdS)amBuild an sdist from a source directory using PEP 517 hooks. :param str source_dir: Source directory containing pyproject.toml :param str sdist_dir: Target directory to place sdist in :param dict config_settings: Options to pass to build backend This is a blocking function which will run pip in a subprocess to install build requirements. N)rrrr<get_requires_for_build_sdist build_sdist) rZ sdist_dirrLr rMrNrOrPr:rrrrRs     rR)N)N)rHr r r7r> subprocessrr4 sysconfigrtempfilercompatrwrappersrr getLoggerrEr&robjectrrJrRrrrrs     a PKd]+10pep517/__pycache__/dirtools.cpython-38.opt-1.pycnu[U .ei@sZddlZddlZddlZddlZddlZddlZddlZejddZddZ ddZ dS)Nc cs$t}z |VW5t|XdS)z2Create a temporary directory in a context manager.N)tempfileZmkdtempshutilZrmtree)Ztdr?/usr/lib/python3.8/site-packages/pip/_vendor/pep517/dirtools.pytempdir s rc OsDztj||WStk r>}z|jtjkr.W5d}~XYnXdS)zWLike `mkdir`, but does not raise an exception if the directory already exists. N)osmkdirOSErrorerrnoZEEXIST)argskwargsexcrrrmkdir_ps  rcCst}t|d}t|D]r\}}}|D]0}tj||}tj||}| |ddq,|D],}tj||}tj||}| ||qbq|S)z0Construct an in-memory zip file for a directory.w/) ioBytesIOzipfileZZipFilerwalkpathjoinrelpathZwritestrwrite)rootbufferZzip_filedirsfilesrZfs_pathZrel_pathrrrdir_to_zipfiles r) rr contextlibrrr rcontextmanagerrrrrrrrs  PKd]3*:600*pep517/__pycache__/wrappers.cpython-38.pycnu[U ʗReu4@sddlZddlmZddlZddlmZmZddlZddl m Z m Z m Z ddl Z ddlmZddlmZddlmZd d d d d ddgZeddZGdd d eZGdd d eZGdd d eZGdd d eZddd ZdddZddZGdddeZGdddej Z!dS)N)contextmanager)abspathjoin) check_call check_outputSTDOUT)mkdtemp)compat)_in_proc_script_pathBackendUnavailableBackendInvalid HookMissingUnsupportedOperationdefault_subprocess_runnerquiet_subprocess_runnerPep517HookCallerc cs"t}z |VW5t|XdSN)rshutilrmtree)tdr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pep517/wrappers.pytempdirs rc@seZdZdZddZdS)r zEWill be raised if the backend cannot be imported in the hook process.cCs ||_dSr tracebackselfrrrr__init__#szBackendUnavailable.__init__N__name__ __module__ __qualname____doc__rrrrrr !sc@seZdZdZddZdS)r z)Will be raised if the backend is invalid.cCs||_||_||_dSr backend_name backend_pathmessage)rr%r&r'rrrr)szBackendInvalid.__init__Nrrrrrr 'scs eZdZdZfddZZS)rz Will be raised on missing hooks.cstt||||_dSr)superrr hook_name)rr) __class__rrr1szHookMissing.__init__)r r!r"r#r __classcell__rrr*rr/sc@seZdZdZddZdS)rzDMay be raised by build_sdist if the backend indicates that it can't.cCs ||_dSrrrrrrr8szUnsupportedOperation.__init__Nrrrrrr6scCs*tj}|r||t|||ddS)z5The default method of calling the wrapper subprocess.)cwdenvN)osenvironcopyupdatercmdr- extra_environr.rrrr<s  cCs,tj}|r||t|||tddS)zDA method of calling the wrapper subprocess while suppressing output.)r-r.stderrN)r/r0r1r2rrr3rrrrEs  cCsntj|rtdtj|}tjtj||}tj|}tj|}tj||g|krjtd|S)zNormalise and check a backend path. Ensure that the requested backend path is specified as a relative path, and resolves to a location under the given source tree. Return an absolute version of the requested path. zpaths must be relativez paths must be inside source tree) r/pathisabs ValueErrorrnormpathrnormcase commonprefix) source_tree requested abs_source abs_requested norm_sourcenorm_requestedrrrnorm_and_checkNs    rCc@seZdZdZdddZeddZddZdd d Zdd d Z dddZ d ddZ d!ddZ d"ddZ d#ddZd$ddZddZdS)%raA wrapper around a source directory to be built with a PEP 517 backend. :param source_dir: The path to the source directory, containing pyproject.toml. :param build_backend: The build backend spec, as per PEP 517, from pyproject.toml. :param backend_path: The backend path, as per PEP 517, from pyproject.toml. :param runner: A callable that invokes the wrapper subprocess. :param python_executable: The Python executable used to invoke the backend The 'runner', if provided, must expect the following: - cmd: a list of strings representing the command and arguments to execute, as would be passed to e.g. 'subprocess.check_call'. - cwd: a string representing the working directory that must be used for the subprocess. Corresponds to the provided source_dir. - extra_environ: a dict mapping environment variable names to values which must be set for the subprocess execution. NcsR|dkr t}t|_|_|r2fdd|D}|_|_|sHtj}|_dS)Ncsg|]}tj|qSr)rC source_dir).0prrr sz-Pep517HookCaller.__init__..) rrrD build_backendr&_subprocess_runnersys executablepython_executable)rrDrIr&runnerrMrrGrrzs  zPep517HookCaller.__init__ccs$|j}||_z dVW5||_XdS)z\A context manager for temporarily overriding the default subprocess runner. N)rJ)rrNprevrrrsubprocess_runners  z"Pep517HookCaller.subprocess_runnercCs |diS)z>Return the list of optional features supported by the backend._supported_features _call_hookrGrrrrQsz$Pep517HookCaller._supported_featurescCs|dd|iS)aIIdentify packages required for building a wheel Returns a list of dependency specifications, e.g.:: ["wheel >= 0.25", "setuptools"] This does not include requirements specified in pyproject.toml. It returns the result of calling the equivalently named hook in a subprocess. get_requires_for_build_wheelconfig_settingsrRrrUrrrrTs z-Pep517HookCaller.get_requires_for_build_wheelTcCs|dt|||dS)auPrepare a ``*.dist-info`` folder with metadata for this project. Returns the name of the newly created folder. If the build backend defines a hook with this name, it will be called in a subprocess. If not, the backend will be asked to build a wheel, and the dist-info extracted from that (unless _allow_fallback is False). prepare_metadata_for_build_wheelmetadata_directoryrU_allow_fallbackrSrrrYrUrZrrrrWs z1Pep517HookCaller.prepare_metadata_for_build_wheelcCs(|dk rt|}|dt|||dS)avBuild a wheel from this project. Returns the name of the newly created file. In general, this will call the 'build_wheel' hook in the backend. However, if that was previously called by 'prepare_metadata_for_build_wheel', and the same metadata_directory is used, the previously built wheel will be copied to wheel_directory. N build_wheelwheel_directoryrUrYrrSrr_rUrYrrrr]s zPep517HookCaller.build_wheelcCs|dd|iS)aSIdentify packages required for building an editable wheel Returns a list of dependency specifications, e.g.:: ["wheel >= 0.25", "setuptools"] This does not include requirements specified in pyproject.toml. It returns the result of calling the equivalently named hook in a subprocess. get_requires_for_build_editablerUrRrVrrrrbs z0Pep517HookCaller.get_requires_for_build_editablecCs|dt|||dS)aPrepare a ``*.dist-info`` folder with metadata for this project. Returns the name of the newly created folder. If the build backend defines a hook with this name, it will be called in a subprocess. If not, the backend will be asked to build an editable wheel, and the dist-info extracted from that (unless _allow_fallback is False). #prepare_metadata_for_build_editablerXr[r\rrrrcs z4Pep517HookCaller.prepare_metadata_for_build_editablecCs(|dk rt|}|dt|||dS)aBuild an editable wheel from this project. Returns the name of the newly created file. In general, this will call the 'build_editable' hook in the backend. However, if that was previously called by 'prepare_metadata_for_build_editable', and the same metadata_directory is used, the previously built wheel will be copied to wheel_directory. Nbuild_editabler^r`rarrrrds zPep517HookCaller.build_editablecCs|dd|iS)a>Identify packages required for building a wheel Returns a list of dependency specifications, e.g.:: ["setuptools >= 26"] This does not include requirements specified in pyproject.toml. It returns the result of calling the equivalently named hook in a subprocess. get_requires_for_build_sdistrUrRrVrrrre s z-Pep517HookCaller.get_requires_for_build_sdistcCs|dt||dS)zBuild an sdist from this project. Returns the name of the newly created file. This calls the 'build_sdist' backend hook in a subprocess. build_sdist)sdist_directoryrUr[)rrgrUrrrrfszPep517HookCaller.build_sdistc Csltjddkr|jd}n|j}d|i}|jrbtj|j}tjddkrZ|t}||d<t }d|i}t j |t |dddt .}|j} |j| tt|||g|j|d W5QRXt t |d } | d rt| d d | drt| d d | dr.t|j|j| dd d| drNt| dpJ|| dW5QRSQRXdS)NrASCIIPEP517_BUILD_BACKENDPEP517_BACKEND_PATHkwargsz input.json)indent)r-r5z output.json unsupportedr no_backendbackend_invalid backend_errorr$ hook_missingmissing_hook_name return_val)rK version_inforIencoder&r/pathseprgetfilesystemencodingrr write_jsonpjoinr rMrJrstrrD read_jsongetrr r r) rr)rlrIr5r&r hook_inputscriptpythondatarrrrS&sF     zPep517HookCaller._call_hook)NNN)N)NT)NN)N)NT)NN)N)N)r r!r"r#rrrPrQrTrWr]rbrcrdrerfrSrrrrrfs2          c@s<eZdZdZddZddZeddZdd Zd d Z d S) LoggerWrapperzd Read messages from a pipe and redirect them to a logger (see python's logging module). cCsHtj|d|_||_||_t\|_|_ t |j|_ | dS)NT) threadingThreadrdaemonloggerlevelr/pipefd_readfd_writefdopenreaderstart)rrrrrrr^s zLoggerWrapper.__init__cCs|jSr)rrGrrrfilenokszLoggerWrapper.filenocCs|tjr|ddS|S)N)endswithr/linesep)msgrrrremove_newlinenszLoggerWrapper.remove_newlinecCs |jD]}|||qdSr)r_writer)rlinerrrrunrs zLoggerWrapper.runcCs|j|j|dSr)rlogr)rr'rrrrvszLoggerWrapper._writeN) r r!r"r#rr staticmethodrrrrrrrrXs  r)NN)NN)"r contextlibrr/os.pathrrr{r subprocessrrrrKtempfilerror in_processr __all__r Exceptionr r rrrrrCobjectrrrrrrrs:       sPKd]p0pep517/__pycache__/__init__.cpython-38.opt-1.pycnu[U .eT@s dZdZdS)z6Wrappers to build Python packages using PEP 517 hooks z0.7.0N)__doc__ __version__rr?/usr/lib/python3.8/site-packages/pip/_vendor/pep517/__init__.pysPKd].ОZZ*pep517/__pycache__/dirtools.cpython-38.pycnu[U ʗRei@sZddlZddlZddlZddlZddlZddlZddlZejddZddZ ddZ dS)Nc cs$t}z |VW5t|XdS)z2Create a temporary directory in a context manager.N)tempfilemkdtempshutilrmtree)tdr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pep517/dirtools.pytempdir s r c OsDztj||WStk r>}z|jtjkr.W5d}~XYnXdS)zWLike `mkdir`, but does not raise an exception if the directory already exists. N)osmkdirOSErrorerrnoEEXIST)argskwargsexcrrrmkdir_ps  rcCst}t|d}t|D]r\}}}|D]0}tj||}tj||}| |ddq,|D],}tj||}tj||}| ||qbq|S)z0Construct an in-memory zip file for a directory.w/) ioBytesIOzipfileZipFiler walkpathjoinrelpathwritestrwrite)rootbufferzip_filedirsfilesrZfs_pathrel_pathrrrdir_to_zipfiles r&) r r contextlibrrr rcontextmanagerr rr&rrrrs  PKd]Ij 'pep517/__pycache__/build.cpython-38.pycnu[U ʗRe @sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl mZmZeeZdd Zd d Zd d ZddZd"ddZeZejdddejdddddejdddddejdddddd Zed!kreedS)#z%Build a project using PEP 517 hooks. N)BuildEnvironment)Pep517HookCaller)tempdirmkdir_p)FileNotFoundError toml_loadcCs4ddh}|t|ks0dj|t|d}t|dS)z7 Ensure build system has the requisite fields. requires build-backendz"Missing required fields: {missing})missingN)setformat ValueError)systemrequiredmessager/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pep517/build.pyvalidate_systems   rc Cs6tj|d}t|d}t|}W5QRX|dS)zC Load the build system from a source dir (pyproject.toml). zpyproject.tomlrbz build-system)ospathjoinioopenr) source_dir pyprojectfZpyproject_datarrr load_systemsrc CsJz t|}Wnttfk r(i}YnX|dd|dddg|S)z Given a source dir, attempt to get a build system backend and requirements from pyproject.toml. Fallback to setuptools but only if the file was not found or a build system was not indicated. r z setuptools.build_meta:__legacy__r setuptoolswheel)rrKeyError setdefault)rrrrr compat_system's  r#c Csdjft}t||}|i}td|||tdtb}td||djft}t||} | |i} tj || } t | tj |tj | W5QRXdS)Nzget_requires_for_build_{dist}zGot build requires: %sz$Installed dynamic build dependencieszTrying to build %s in %sz build_{dist}) r localsgetattrloginfo pip_installrrrrshutilmovebasename) hooksenvdistdestZget_requires_name get_requiresreqstdZ build_namebuildfilenamesourcerrr _do_build:s      r6c Csv|p t|}tj||pd}t|t|t||d|d}t"}| |dt ||||W5QRXdS)Nr.r z backend-pathr ) rrrrrrrgetrr(r6)rr.r/rr,r-rrrr3Ls r3rz%A directory containing pyproject.toml)helpz--binaryz-b store_trueF)actiondefaultz--sourcez-sz --out-dirz-oz>Destination in which to save the builds relative to source dircCsZtdttd|js|js dnd|js.|js2dndf}|D]}t|j||jq@dS)NzQpep517.build is deprecated. Consider switching to https://pypi.org/project/build/sdistr ) r&warninglistfilterr5binaryr3rZout_dir)argsdistsr.rrrmainps rC__main__)NN)__doc__argparserloggingrr)ZenvbuildrwrappersrZdirtoolsrrcompatrr getLogger__name__r&rrr#r6r3ArgumentParserparser add_argumentrC parse_argsrrrrsP       PKd]Afrd d 0pep517/__pycache__/colorlog.cpython-38.opt-1.pycnu[U .e@sfdZddlZddlZz ddlZWnek r8dZYnXddZGdddejZejfddZ dS) zONicer log formatting with colours. Code copied from Tornado, Apache licensed. NcCsVd}trRttjdrRtjrRzttddkr:d}Wntk rPYnX|S)NFisattyZcolorsrT)curseshasattrsysstderrrZ setuptermZtigetnum Exception)colorr ?/usr/lib/python3.8/site-packages/pip/_vendor/pep517/colorlog.py_stderr_supports_colorsr c@s>eZdZdZejdejdejdejdiZ d ddZ d d Z dS) LogFormatterz&Log formatter with colour support TNcCstjj||di|_|rtrtdp6tdp6d}dtjkrNdkr\nn t |d}|j D] \}}t t ||d|j|<qft tdd|_ t}|d |_tn d|_ d |_d S) aO :arg bool color: Enables color support. :arg string fmt: Log message format. It will be applied to the attributes dict of log records. The text between ``%(color)s`` and ``%(end_color)s`` will be colored depending on the level if color support is on. :arg dict colors: color mappings from logging level to terminal color code :arg string datefmt: Datetime format. Used for formatting ``(asctime)`` placeholder in ``prefix_fmt``. .. versionchanged:: 3.2 Added ``fmt`` and ``datefmt`` arguments. )datefmtZsetafZsetf)rr)rr rasciiZsgr0rFN)logging Formatter__init___colorsr rZtigetstrr version_infostrDEFAULT_COLORSitemsZtparm_normalZinitscrZgetmaxyx termwidthZendwin)selfrrZfg_colorlevelnocodeZscrr r r r2s*      zLogFormatter.__init__cCst|j}dj|jd|jd}|t||jkrJd|j|t|}nd}|j|jkrn|j|j}|j}nd}}|j||||S)Nz{initial}-{name}r)initialname z r) lenmessageformatZ levelnamer"rrrr)rrecordZmlenZ right_textZspaceZ start_colorZ end_colorr r r formatMessage]s    zLogFormatter.formatMessage)TN) __name__ __module__ __qualname____doc__rINFOZWARNINGZERRORZCRITICALrrr(r r r r r (s +r cCs0t}|ttj|tj|dS)N)rZ StreamHandlerZ setFormatterr rootZ addHandlerZsetLevel)levelZhandlerr r r enable_colourful_outputos  r0) r,rrr ImportErrorr rr r-r0r r r r s   GPKd] s2  pep517/build.pynu["""Build a project using PEP 517 hooks. """ import argparse import logging import os from pip._vendor import toml import shutil from .envbuild import BuildEnvironment from .wrappers import Pep517HookCaller from .dirtools import tempdir, mkdir_p from .compat import FileNotFoundError log = logging.getLogger(__name__) def validate_system(system): """ Ensure build system has the requisite fields. """ required = {'requires', 'build-backend'} if not (required <= set(system)): message = "Missing required fields: {missing}".format( missing=required-set(system), ) raise ValueError(message) def load_system(source_dir): """ Load the build system from a source dir (pyproject.toml). """ pyproject = os.path.join(source_dir, 'pyproject.toml') with open(pyproject) as f: pyproject_data = toml.load(f) return pyproject_data['build-system'] def compat_system(source_dir): """ Given a source dir, attempt to get a build system backend and requirements from pyproject.toml. Fallback to setuptools but only if the file was not found or a build system was not indicated. """ try: system = load_system(source_dir) except (FileNotFoundError, KeyError): system = {} system.setdefault( 'build-backend', 'setuptools.build_meta:__legacy__', ) system.setdefault('requires', ['setuptools', 'wheel']) return system def _do_build(hooks, env, dist, dest): get_requires_name = 'get_requires_for_build_{dist}'.format(**locals()) get_requires = getattr(hooks, get_requires_name) reqs = get_requires({}) log.info('Got build requires: %s', reqs) env.pip_install(reqs) log.info('Installed dynamic build dependencies') with tempdir() as td: log.info('Trying to build %s in %s', dist, td) build_name = 'build_{dist}'.format(**locals()) build = getattr(hooks, build_name) filename = build(td, {}) source = os.path.join(td, filename) shutil.move(source, os.path.join(dest, os.path.basename(filename))) def build(source_dir, dist, dest=None, system=None): system = system or load_system(source_dir) dest = os.path.join(source_dir, dest or 'dist') mkdir_p(dest) validate_system(system) hooks = Pep517HookCaller( source_dir, system['build-backend'], system.get('backend-path') ) with BuildEnvironment() as env: env.pip_install(system['requires']) _do_build(hooks, env, dist, dest) parser = argparse.ArgumentParser() parser.add_argument( 'source_dir', help="A directory containing pyproject.toml", ) parser.add_argument( '--binary', '-b', action='store_true', default=False, ) parser.add_argument( '--source', '-s', action='store_true', default=False, ) parser.add_argument( '--out-dir', '-o', help="Destination in which to save the builds relative to source dir", ) def main(args): # determine which dists to build dists = list(filter(None, ( 'sdist' if args.source or not args.binary else None, 'wheel' if args.binary or not args.source else None, ))) for dist in dists: build(args.source_dir, dist, args.out_dir) if __name__ == '__main__': main(parser.parse_args()) PKd]sÄ**pep517/wrappers.pynu[import threading from contextlib import contextmanager import os from os.path import dirname, abspath, join as pjoin import shutil from subprocess import check_call, check_output, STDOUT import sys from tempfile import mkdtemp from . import compat try: import importlib.resources as resources def _in_proc_script_path(): return resources.path(__package__, '_in_process.py') except ImportError: @contextmanager def _in_proc_script_path(): yield pjoin(dirname(abspath(__file__)), '_in_process.py') @contextmanager def tempdir(): td = mkdtemp() try: yield td finally: shutil.rmtree(td) class BackendUnavailable(Exception): """Will be raised if the backend cannot be imported in the hook process.""" def __init__(self, traceback): self.traceback = traceback class BackendInvalid(Exception): """Will be raised if the backend is invalid.""" def __init__(self, backend_name, backend_path, message): self.backend_name = backend_name self.backend_path = backend_path self.message = message class HookMissing(Exception): """Will be raised on missing hooks.""" def __init__(self, hook_name): super(HookMissing, self).__init__(hook_name) self.hook_name = hook_name class UnsupportedOperation(Exception): """May be raised by build_sdist if the backend indicates that it can't.""" def __init__(self, traceback): self.traceback = traceback def default_subprocess_runner(cmd, cwd=None, extra_environ=None): """The default method of calling the wrapper subprocess.""" env = os.environ.copy() if extra_environ: env.update(extra_environ) check_call(cmd, cwd=cwd, env=env) def quiet_subprocess_runner(cmd, cwd=None, extra_environ=None): """A method of calling the wrapper subprocess while suppressing output.""" env = os.environ.copy() if extra_environ: env.update(extra_environ) check_output(cmd, cwd=cwd, env=env, stderr=STDOUT) def norm_and_check(source_tree, requested): """Normalise and check a backend path. Ensure that the requested backend path is specified as a relative path, and resolves to a location under the given source tree. Return an absolute version of the requested path. """ if os.path.isabs(requested): raise ValueError("paths must be relative") abs_source = os.path.abspath(source_tree) abs_requested = os.path.normpath(os.path.join(abs_source, requested)) # We have to use commonprefix for Python 2.7 compatibility. So we # normalise case to avoid problems because commonprefix is a character # based comparison :-( norm_source = os.path.normcase(abs_source) norm_requested = os.path.normcase(abs_requested) if os.path.commonprefix([norm_source, norm_requested]) != norm_source: raise ValueError("paths must be inside source tree") return abs_requested class Pep517HookCaller(object): """A wrapper around a source directory to be built with a PEP 517 backend. source_dir : The path to the source directory, containing pyproject.toml. build_backend : The build backend spec, as per PEP 517, from pyproject.toml. backend_path : The backend path, as per PEP 517, from pyproject.toml. runner : A callable that invokes the wrapper subprocess. The 'runner', if provided, must expect the following: cmd : a list of strings representing the command and arguments to execute, as would be passed to e.g. 'subprocess.check_call'. cwd : a string representing the working directory that must be used for the subprocess. Corresponds to the provided source_dir. extra_environ : a dict mapping environment variable names to values which must be set for the subprocess execution. """ def __init__( self, source_dir, build_backend, backend_path=None, runner=None, ): if runner is None: runner = default_subprocess_runner self.source_dir = abspath(source_dir) self.build_backend = build_backend if backend_path: backend_path = [ norm_and_check(self.source_dir, p) for p in backend_path ] self.backend_path = backend_path self._subprocess_runner = runner @contextmanager def subprocess_runner(self, runner): """A context manager for temporarily overriding the default subprocess runner. """ prev = self._subprocess_runner self._subprocess_runner = runner try: yield finally: self._subprocess_runner = prev def get_requires_for_build_wheel(self, config_settings=None): """Identify packages required for building a wheel Returns a list of dependency specifications, e.g.: ["wheel >= 0.25", "setuptools"] This does not include requirements specified in pyproject.toml. It returns the result of calling the equivalently named hook in a subprocess. """ return self._call_hook('get_requires_for_build_wheel', { 'config_settings': config_settings }) def prepare_metadata_for_build_wheel( self, metadata_directory, config_settings=None, _allow_fallback=True): """Prepare a *.dist-info folder with metadata for this project. Returns the name of the newly created folder. If the build backend defines a hook with this name, it will be called in a subprocess. If not, the backend will be asked to build a wheel, and the dist-info extracted from that (unless _allow_fallback is False). """ return self._call_hook('prepare_metadata_for_build_wheel', { 'metadata_directory': abspath(metadata_directory), 'config_settings': config_settings, '_allow_fallback': _allow_fallback, }) def build_wheel( self, wheel_directory, config_settings=None, metadata_directory=None): """Build a wheel from this project. Returns the name of the newly created file. In general, this will call the 'build_wheel' hook in the backend. However, if that was previously called by 'prepare_metadata_for_build_wheel', and the same metadata_directory is used, the previously built wheel will be copied to wheel_directory. """ if metadata_directory is not None: metadata_directory = abspath(metadata_directory) return self._call_hook('build_wheel', { 'wheel_directory': abspath(wheel_directory), 'config_settings': config_settings, 'metadata_directory': metadata_directory, }) def get_requires_for_build_sdist(self, config_settings=None): """Identify packages required for building a wheel Returns a list of dependency specifications, e.g.: ["setuptools >= 26"] This does not include requirements specified in pyproject.toml. It returns the result of calling the equivalently named hook in a subprocess. """ return self._call_hook('get_requires_for_build_sdist', { 'config_settings': config_settings }) def build_sdist(self, sdist_directory, config_settings=None): """Build an sdist from this project. Returns the name of the newly created file. This calls the 'build_sdist' backend hook in a subprocess. """ return self._call_hook('build_sdist', { 'sdist_directory': abspath(sdist_directory), 'config_settings': config_settings, }) def _call_hook(self, hook_name, kwargs): # On Python 2, pytoml returns Unicode values (which is correct) but the # environment passed to check_call needs to contain string values. We # convert here by encoding using ASCII (the backend can only contain # letters, digits and _, . and : characters, and will be used as a # Python identifier, so non-ASCII content is wrong on Python 2 in # any case). # For backend_path, we use sys.getfilesystemencoding. if sys.version_info[0] == 2: build_backend = self.build_backend.encode('ASCII') else: build_backend = self.build_backend extra_environ = {'PEP517_BUILD_BACKEND': build_backend} if self.backend_path: backend_path = os.pathsep.join(self.backend_path) if sys.version_info[0] == 2: backend_path = backend_path.encode(sys.getfilesystemencoding()) extra_environ['PEP517_BACKEND_PATH'] = backend_path with tempdir() as td: hook_input = {'kwargs': kwargs} compat.write_json(hook_input, pjoin(td, 'input.json'), indent=2) # Run the hook in a subprocess with _in_proc_script_path() as script: self._subprocess_runner( [sys.executable, str(script), hook_name, td], cwd=self.source_dir, extra_environ=extra_environ ) data = compat.read_json(pjoin(td, 'output.json')) if data.get('unsupported'): raise UnsupportedOperation(data.get('traceback', '')) if data.get('no_backend'): raise BackendUnavailable(data.get('traceback', '')) if data.get('backend_invalid'): raise BackendInvalid( backend_name=self.build_backend, backend_path=self.backend_path, message=data.get('backend_error', '') ) if data.get('hook_missing'): raise HookMissing(hook_name) return data['return_val'] class LoggerWrapper(threading.Thread): """ Read messages from a pipe and redirect them to a logger (see python's logging module). """ def __init__(self, logger, level): threading.Thread.__init__(self) self.daemon = True self.logger = logger self.level = level # create the pipe and reader self.fd_read, self.fd_write = os.pipe() self.reader = os.fdopen(self.fd_read) self.start() def fileno(self): return self.fd_write @staticmethod def remove_newline(msg): return msg[:-1] if msg.endswith(os.linesep) else msg def run(self): for line in self.reader: self._write(self.remove_newline(line)) def _write(self, message): self.logger.log(self.level, message) PKd]ޟ pep517/meta.pynu["""Build metadata for a project using PEP 517 hooks. """ import argparse import logging import os import shutil import functools try: import importlib.metadata as imp_meta except ImportError: import importlib_metadata as imp_meta try: from zipfile import Path except ImportError: from zipp import Path from .envbuild import BuildEnvironment from .wrappers import Pep517HookCaller, quiet_subprocess_runner from .dirtools import tempdir, mkdir_p, dir_to_zipfile from .build import validate_system, load_system, compat_system log = logging.getLogger(__name__) def _prep_meta(hooks, env, dest): reqs = hooks.get_requires_for_build_wheel({}) log.info('Got build requires: %s', reqs) env.pip_install(reqs) log.info('Installed dynamic build dependencies') with tempdir() as td: log.info('Trying to build metadata in %s', td) filename = hooks.prepare_metadata_for_build_wheel(td, {}) source = os.path.join(td, filename) shutil.move(source, os.path.join(dest, os.path.basename(filename))) def build(source_dir='.', dest=None, system=None): system = system or load_system(source_dir) dest = os.path.join(source_dir, dest or 'dist') mkdir_p(dest) validate_system(system) hooks = Pep517HookCaller( source_dir, system['build-backend'], system.get('backend-path') ) with hooks.subprocess_runner(quiet_subprocess_runner): with BuildEnvironment() as env: env.pip_install(system['requires']) _prep_meta(hooks, env, dest) def build_as_zip(builder=build): with tempdir() as out_dir: builder(dest=out_dir) return dir_to_zipfile(out_dir) def load(root): """ Given a source directory (root) of a package, return an importlib.metadata.Distribution object with metadata build from that package. """ root = os.path.expanduser(root) system = compat_system(root) builder = functools.partial(build, source_dir=root, system=system) path = Path(build_as_zip(builder)) return imp_meta.PathDistribution(path) parser = argparse.ArgumentParser() parser.add_argument( 'source_dir', help="A directory containing pyproject.toml", ) parser.add_argument( '--out-dir', '-o', help="Destination in which to save the builds relative to source dir", ) def main(): args = parser.parse_args() build(args.source_dir, args.out_dir) if __name__ == '__main__': main() PKd]vQIIpep517/check.pynu["""Check a project and backend by attempting to build using PEP 517 hooks. """ import argparse import logging import os from os.path import isfile, join as pjoin from pip._vendor.toml import TomlDecodeError, load as toml_load import shutil from subprocess import CalledProcessError import sys import tarfile from tempfile import mkdtemp import zipfile from .colorlog import enable_colourful_output from .envbuild import BuildEnvironment from .wrappers import Pep517HookCaller log = logging.getLogger(__name__) def check_build_sdist(hooks, build_sys_requires): with BuildEnvironment() as env: try: env.pip_install(build_sys_requires) log.info('Installed static build dependencies') except CalledProcessError: log.error('Failed to install static build dependencies') return False try: reqs = hooks.get_requires_for_build_sdist({}) log.info('Got build requires: %s', reqs) except Exception: log.error('Failure in get_requires_for_build_sdist', exc_info=True) return False try: env.pip_install(reqs) log.info('Installed dynamic build dependencies') except CalledProcessError: log.error('Failed to install dynamic build dependencies') return False td = mkdtemp() log.info('Trying to build sdist in %s', td) try: try: filename = hooks.build_sdist(td, {}) log.info('build_sdist returned %r', filename) except Exception: log.info('Failure in build_sdist', exc_info=True) return False if not filename.endswith('.tar.gz'): log.error( "Filename %s doesn't have .tar.gz extension", filename) return False path = pjoin(td, filename) if isfile(path): log.info("Output file %s exists", path) else: log.error("Output file %s does not exist", path) return False if tarfile.is_tarfile(path): log.info("Output file is a tar file") else: log.error("Output file is not a tar file") return False finally: shutil.rmtree(td) return True def check_build_wheel(hooks, build_sys_requires): with BuildEnvironment() as env: try: env.pip_install(build_sys_requires) log.info('Installed static build dependencies') except CalledProcessError: log.error('Failed to install static build dependencies') return False try: reqs = hooks.get_requires_for_build_wheel({}) log.info('Got build requires: %s', reqs) except Exception: log.error('Failure in get_requires_for_build_sdist', exc_info=True) return False try: env.pip_install(reqs) log.info('Installed dynamic build dependencies') except CalledProcessError: log.error('Failed to install dynamic build dependencies') return False td = mkdtemp() log.info('Trying to build wheel in %s', td) try: try: filename = hooks.build_wheel(td, {}) log.info('build_wheel returned %r', filename) except Exception: log.info('Failure in build_wheel', exc_info=True) return False if not filename.endswith('.whl'): log.error("Filename %s doesn't have .whl extension", filename) return False path = pjoin(td, filename) if isfile(path): log.info("Output file %s exists", path) else: log.error("Output file %s does not exist", path) return False if zipfile.is_zipfile(path): log.info("Output file is a zip file") else: log.error("Output file is not a zip file") return False finally: shutil.rmtree(td) return True def check(source_dir): pyproject = pjoin(source_dir, 'pyproject.toml') if isfile(pyproject): log.info('Found pyproject.toml') else: log.error('Missing pyproject.toml') return False try: with open(pyproject) as f: pyproject_data = toml_load(f) # Ensure the mandatory data can be loaded buildsys = pyproject_data['build-system'] requires = buildsys['requires'] backend = buildsys['build-backend'] backend_path = buildsys.get('backend-path') log.info('Loaded pyproject.toml') except (TomlDecodeError, KeyError): log.error("Invalid pyproject.toml", exc_info=True) return False hooks = Pep517HookCaller(source_dir, backend, backend_path) sdist_ok = check_build_sdist(hooks, requires) wheel_ok = check_build_wheel(hooks, requires) if not sdist_ok: log.warning('Sdist checks failed; scroll up to see') if not wheel_ok: log.warning('Wheel checks failed') return sdist_ok def main(argv=None): ap = argparse.ArgumentParser() ap.add_argument( 'source_dir', help="A directory containing pyproject.toml") args = ap.parse_args(argv) enable_colourful_output() ok = check(args.source_dir) if ok: print(ansi('Checks passed', 'green')) else: print(ansi('Checks failed', 'red')) sys.exit(1) ansi_codes = { 'reset': '\x1b[0m', 'bold': '\x1b[1m', 'red': '\x1b[31m', 'green': '\x1b[32m', } def ansi(s, attr): if os.name != 'nt' and sys.stdout.isatty(): return ansi_codes[attr] + str(s) + ansi_codes['reset'] else: return str(s) if __name__ == '__main__': main() PKd] pep517/_in_process.pynu["""This is invoked in a subprocess to call the build backend hooks. It expects: - Command line args: hook_name, control_dir - Environment variables: PEP517_BUILD_BACKEND=entry.point:spec PEP517_BACKEND_PATH=paths (separated with os.pathsep) - control_dir/input.json: - {"kwargs": {...}} Results: - control_dir/output.json - {"return_val": ...} """ from glob import glob from importlib import import_module import json import os import os.path from os.path import join as pjoin import re import shutil import sys import traceback # This file is run as a script, and `import compat` is not zip-safe, so we # include write_json() and read_json() from compat.py. # # Handle reading and writing JSON in UTF-8, on Python 3 and 2. if sys.version_info[0] >= 3: # Python 3 def write_json(obj, path, **kwargs): with open(path, 'w', encoding='utf-8') as f: json.dump(obj, f, **kwargs) def read_json(path): with open(path, 'r', encoding='utf-8') as f: return json.load(f) else: # Python 2 def write_json(obj, path, **kwargs): with open(path, 'wb') as f: json.dump(obj, f, encoding='utf-8', **kwargs) def read_json(path): with open(path, 'rb') as f: return json.load(f) class BackendUnavailable(Exception): """Raised if we cannot import the backend""" def __init__(self, traceback): self.traceback = traceback class BackendInvalid(Exception): """Raised if the backend is invalid""" def __init__(self, message): self.message = message class HookMissing(Exception): """Raised if a hook is missing and we are not executing the fallback""" def contained_in(filename, directory): """Test if a file is located within the given directory.""" filename = os.path.normcase(os.path.abspath(filename)) directory = os.path.normcase(os.path.abspath(directory)) return os.path.commonprefix([filename, directory]) == directory def _build_backend(): """Find and load the build backend""" # Add in-tree backend directories to the front of sys.path. backend_path = os.environ.get('PEP517_BACKEND_PATH') if backend_path: extra_pathitems = backend_path.split(os.pathsep) sys.path[:0] = extra_pathitems ep = os.environ['PEP517_BUILD_BACKEND'] mod_path, _, obj_path = ep.partition(':') try: obj = import_module(mod_path) except ImportError: raise BackendUnavailable(traceback.format_exc()) if backend_path: if not any( contained_in(obj.__file__, path) for path in extra_pathitems ): raise BackendInvalid("Backend was not loaded from backend-path") if obj_path: for path_part in obj_path.split('.'): obj = getattr(obj, path_part) return obj def get_requires_for_build_wheel(config_settings): """Invoke the optional get_requires_for_build_wheel hook Returns [] if the hook is not defined. """ backend = _build_backend() try: hook = backend.get_requires_for_build_wheel except AttributeError: return [] else: return hook(config_settings) def prepare_metadata_for_build_wheel( metadata_directory, config_settings, _allow_fallback): """Invoke optional prepare_metadata_for_build_wheel Implements a fallback by building a wheel if the hook isn't defined, unless _allow_fallback is False in which case HookMissing is raised. """ backend = _build_backend() try: hook = backend.prepare_metadata_for_build_wheel except AttributeError: if not _allow_fallback: raise HookMissing() return _get_wheel_metadata_from_wheel(backend, metadata_directory, config_settings) else: return hook(metadata_directory, config_settings) WHEEL_BUILT_MARKER = 'PEP517_ALREADY_BUILT_WHEEL' def _dist_info_files(whl_zip): """Identify the .dist-info folder inside a wheel ZipFile.""" res = [] for path in whl_zip.namelist(): m = re.match(r'[^/\\]+-[^/\\]+\.dist-info/', path) if m: res.append(path) if res: return res raise Exception("No .dist-info folder found in wheel") def _get_wheel_metadata_from_wheel( backend, metadata_directory, config_settings): """Build a wheel and extract the metadata from it. Fallback for when the build backend does not define the 'get_wheel_metadata' hook. """ from zipfile import ZipFile whl_basename = backend.build_wheel(metadata_directory, config_settings) with open(os.path.join(metadata_directory, WHEEL_BUILT_MARKER), 'wb'): pass # Touch marker file whl_file = os.path.join(metadata_directory, whl_basename) with ZipFile(whl_file) as zipf: dist_info = _dist_info_files(zipf) zipf.extractall(path=metadata_directory, members=dist_info) return dist_info[0].split('/')[0] def _find_already_built_wheel(metadata_directory): """Check for a wheel already built during the get_wheel_metadata hook. """ if not metadata_directory: return None metadata_parent = os.path.dirname(metadata_directory) if not os.path.isfile(pjoin(metadata_parent, WHEEL_BUILT_MARKER)): return None whl_files = glob(os.path.join(metadata_parent, '*.whl')) if not whl_files: print('Found wheel built marker, but no .whl files') return None if len(whl_files) > 1: print('Found multiple .whl files; unspecified behaviour. ' 'Will call build_wheel.') return None # Exactly one .whl file return whl_files[0] def build_wheel(wheel_directory, config_settings, metadata_directory=None): """Invoke the mandatory build_wheel hook. If a wheel was already built in the prepare_metadata_for_build_wheel fallback, this will copy it rather than rebuilding the wheel. """ prebuilt_whl = _find_already_built_wheel(metadata_directory) if prebuilt_whl: shutil.copy2(prebuilt_whl, wheel_directory) return os.path.basename(prebuilt_whl) return _build_backend().build_wheel(wheel_directory, config_settings, metadata_directory) def get_requires_for_build_sdist(config_settings): """Invoke the optional get_requires_for_build_wheel hook Returns [] if the hook is not defined. """ backend = _build_backend() try: hook = backend.get_requires_for_build_sdist except AttributeError: return [] else: return hook(config_settings) class _DummyException(Exception): """Nothing should ever raise this exception""" class GotUnsupportedOperation(Exception): """For internal use when backend raises UnsupportedOperation""" def __init__(self, traceback): self.traceback = traceback def build_sdist(sdist_directory, config_settings): """Invoke the mandatory build_sdist hook.""" backend = _build_backend() try: return backend.build_sdist(sdist_directory, config_settings) except getattr(backend, 'UnsupportedOperation', _DummyException): raise GotUnsupportedOperation(traceback.format_exc()) HOOK_NAMES = { 'get_requires_for_build_wheel', 'prepare_metadata_for_build_wheel', 'build_wheel', 'get_requires_for_build_sdist', 'build_sdist', } def main(): if len(sys.argv) < 3: sys.exit("Needs args: hook_name, control_dir") hook_name = sys.argv[1] control_dir = sys.argv[2] if hook_name not in HOOK_NAMES: sys.exit("Unknown hook: %s" % hook_name) hook = globals()[hook_name] hook_input = read_json(pjoin(control_dir, 'input.json')) json_out = {'unsupported': False, 'return_val': None} try: json_out['return_val'] = hook(**hook_input['kwargs']) except BackendUnavailable as e: json_out['no_backend'] = True json_out['traceback'] = e.traceback except BackendInvalid as e: json_out['backend_invalid'] = True json_out['backend_error'] = e.message except GotUnsupportedOperation as e: json_out['unsupported'] = True json_out['traceback'] = e.traceback except HookMissing: json_out['hook_missing'] = True write_json(json_out, pjoin(control_dir, 'output.json'), indent=2) if __name__ == '__main__': main() PKd]]  pep517/compat.pynu["""Python 2/3 compatibility""" import json import sys # Handle reading and writing JSON in UTF-8, on Python 3 and 2. if sys.version_info[0] >= 3: # Python 3 def write_json(obj, path, **kwargs): with open(path, 'w', encoding='utf-8') as f: json.dump(obj, f, **kwargs) def read_json(path): with open(path, 'r', encoding='utf-8') as f: return json.load(f) else: # Python 2 def write_json(obj, path, **kwargs): with open(path, 'wb') as f: json.dump(obj, f, encoding='utf-8', **kwargs) def read_json(path): with open(path, 'rb') as f: return json.load(f) # FileNotFoundError try: FileNotFoundError = FileNotFoundError except NameError: FileNotFoundError = IOError PKd] Ehpep517/envbuild.pynu["""Build wheels/sdists by installing build deps to a temporary environment. """ import os import logging from pip._vendor import toml import shutil from subprocess import check_call import sys from sysconfig import get_paths from tempfile import mkdtemp from .wrappers import Pep517HookCaller, LoggerWrapper log = logging.getLogger(__name__) def _load_pyproject(source_dir): with open(os.path.join(source_dir, 'pyproject.toml')) as f: pyproject_data = toml.load(f) buildsys = pyproject_data['build-system'] return ( buildsys['requires'], buildsys['build-backend'], buildsys.get('backend-path'), ) class BuildEnvironment(object): """Context manager to install build deps in a simple temporary environment Based on code I wrote for pip, which is MIT licensed. """ # Copyright (c) 2008-2016 The pip developers (see AUTHORS.txt file) # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. path = None def __init__(self, cleanup=True): self._cleanup = cleanup def __enter__(self): self.path = mkdtemp(prefix='pep517-build-env-') log.info('Temporary build environment: %s', self.path) self.save_path = os.environ.get('PATH', None) self.save_pythonpath = os.environ.get('PYTHONPATH', None) install_scheme = 'nt' if (os.name == 'nt') else 'posix_prefix' install_dirs = get_paths(install_scheme, vars={ 'base': self.path, 'platbase': self.path, }) scripts = install_dirs['scripts'] if self.save_path: os.environ['PATH'] = scripts + os.pathsep + self.save_path else: os.environ['PATH'] = scripts + os.pathsep + os.defpath if install_dirs['purelib'] == install_dirs['platlib']: lib_dirs = install_dirs['purelib'] else: lib_dirs = install_dirs['purelib'] + os.pathsep + \ install_dirs['platlib'] if self.save_pythonpath: os.environ['PYTHONPATH'] = lib_dirs + os.pathsep + \ self.save_pythonpath else: os.environ['PYTHONPATH'] = lib_dirs return self def pip_install(self, reqs): """Install dependencies into this env by calling pip in a subprocess""" if not reqs: return log.info('Calling pip to install %s', reqs) cmd = [ sys.executable, '-m', 'pip', 'install', '--ignore-installed', '--prefix', self.path] + list(reqs) check_call( cmd, stdout=LoggerWrapper(log, logging.INFO), stderr=LoggerWrapper(log, logging.ERROR), ) def __exit__(self, exc_type, exc_val, exc_tb): needs_cleanup = ( self._cleanup and self.path is not None and os.path.isdir(self.path) ) if needs_cleanup: shutil.rmtree(self.path) if self.save_path is None: os.environ.pop('PATH', None) else: os.environ['PATH'] = self.save_path if self.save_pythonpath is None: os.environ.pop('PYTHONPATH', None) else: os.environ['PYTHONPATH'] = self.save_pythonpath def build_wheel(source_dir, wheel_dir, config_settings=None): """Build a wheel from a source directory using PEP 517 hooks. :param str source_dir: Source directory containing pyproject.toml :param str wheel_dir: Target directory to create wheel in :param dict config_settings: Options to pass to build backend This is a blocking function which will run pip in a subprocess to install build requirements. """ if config_settings is None: config_settings = {} requires, backend, backend_path = _load_pyproject(source_dir) hooks = Pep517HookCaller(source_dir, backend, backend_path) with BuildEnvironment() as env: env.pip_install(requires) reqs = hooks.get_requires_for_build_wheel(config_settings) env.pip_install(reqs) return hooks.build_wheel(wheel_dir, config_settings) def build_sdist(source_dir, sdist_dir, config_settings=None): """Build an sdist from a source directory using PEP 517 hooks. :param str source_dir: Source directory containing pyproject.toml :param str sdist_dir: Target directory to place sdist in :param dict config_settings: Options to pass to build backend This is a blocking function which will run pip in a subprocess to install build requirements. """ if config_settings is None: config_settings = {} requires, backend, backend_path = _load_pyproject(source_dir) hooks = Pep517HookCaller(source_dir, backend, backend_path) with BuildEnvironment() as env: env.pip_install(requires) reqs = hooks.get_requires_for_build_sdist(config_settings) env.pip_install(reqs) return hooks.build_sdist(sdist_dir, config_settings) PKd] Vpep517/colorlog.pynu["""Nicer log formatting with colours. Code copied from Tornado, Apache licensed. """ # Copyright 2012 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import sys try: import curses except ImportError: curses = None def _stderr_supports_color(): color = False if curses and hasattr(sys.stderr, 'isatty') and sys.stderr.isatty(): try: curses.setupterm() if curses.tigetnum("colors") > 0: color = True except Exception: pass return color class LogFormatter(logging.Formatter): """Log formatter with colour support """ DEFAULT_COLORS = { logging.INFO: 2, # Green logging.WARNING: 3, # Yellow logging.ERROR: 1, # Red logging.CRITICAL: 1, } def __init__(self, color=True, datefmt=None): r""" :arg bool color: Enables color support. :arg string fmt: Log message format. It will be applied to the attributes dict of log records. The text between ``%(color)s`` and ``%(end_color)s`` will be colored depending on the level if color support is on. :arg dict colors: color mappings from logging level to terminal color code :arg string datefmt: Datetime format. Used for formatting ``(asctime)`` placeholder in ``prefix_fmt``. .. versionchanged:: 3.2 Added ``fmt`` and ``datefmt`` arguments. """ logging.Formatter.__init__(self, datefmt=datefmt) self._colors = {} if color and _stderr_supports_color(): # The curses module has some str/bytes confusion in # python3. Until version 3.2.3, most methods return # bytes, but only accept strings. In addition, we want to # output these strings with the logging module, which # works with unicode strings. The explicit calls to # unicode() below are harmless in python2 but will do the # right conversion in python 3. fg_color = (curses.tigetstr("setaf") or curses.tigetstr("setf") or "") if (3, 0) < sys.version_info < (3, 2, 3): fg_color = str(fg_color, "ascii") for levelno, code in self.DEFAULT_COLORS.items(): self._colors[levelno] = str( curses.tparm(fg_color, code), "ascii") self._normal = str(curses.tigetstr("sgr0"), "ascii") scr = curses.initscr() self.termwidth = scr.getmaxyx()[1] curses.endwin() else: self._normal = '' # Default width is usually 80, but too wide is # worse than too narrow self.termwidth = 70 def formatMessage(self, record): mlen = len(record.message) right_text = '{initial}-{name}'.format(initial=record.levelname[0], name=record.name) if mlen + len(right_text) < self.termwidth: space = ' ' * (self.termwidth - (mlen + len(right_text))) else: space = ' ' if record.levelno in self._colors: start_color = self._colors[record.levelno] end_color = self._normal else: start_color = end_color = '' return record.message + space + start_color + right_text + end_color def enable_colourful_output(level=logging.INFO): handler = logging.StreamHandler() handler.setFormatter(LogFormatter()) logging.root.addHandler(handler) logging.root.setLevel(level) PKd][TTpep517/__init__.pynu["""Wrappers to build Python packages using PEP 517 hooks """ __version__ = '0.8.2' PKd];ϸFiipep517/dirtools.pynu[import os import io import contextlib import tempfile import shutil import errno import zipfile @contextlib.contextmanager def tempdir(): """Create a temporary directory in a context manager.""" td = tempfile.mkdtemp() try: yield td finally: shutil.rmtree(td) def mkdir_p(*args, **kwargs): """Like `mkdir`, but does not raise an exception if the directory already exists. """ try: return os.mkdir(*args, **kwargs) except OSError as exc: if exc.errno != errno.EEXIST: raise def dir_to_zipfile(root): """Construct an in-memory zip file for a directory.""" buffer = io.BytesIO() zip_file = zipfile.ZipFile(buffer, 'w') for root, dirs, files in os.walk(root): for path in dirs: fs_path = os.path.join(root, path) rel_path = os.path.relpath(fs_path, root) zip_file.writestr(rel_path + '/', '') for path in files: fs_path = os.path.join(root, path) rel_path = os.path.relpath(fs_path, root) zip_file.write(fs_path, rel_path) return zip_file PKd]_3e3e appdirs.pynu[#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2005-2010 ActiveState Software Inc. # Copyright (c) 2013 Eddy Petrișor """Utilities for determining application-specific dirs. See for details and usage. """ # Dev Notes: # - MSDN on where to store app data files: # http://support.microsoft.com/default.aspx?scid=kb;en-us;310294#XSLTH3194121123120121120120 # - Mac OS X: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/index.html # - XDG spec for Un*x: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html __version__ = "1.4.4" __version_info__ = tuple(int(segment) for segment in __version__.split(".")) import sys import os PY3 = sys.version_info[0] == 3 if PY3: unicode = str if sys.platform.startswith('java'): import platform os_name = platform.java_ver()[3][0] if os_name.startswith('Windows'): # "Windows XP", "Windows 7", etc. system = 'win32' elif os_name.startswith('Mac'): # "Mac OS X", etc. system = 'darwin' else: # "Linux", "SunOS", "FreeBSD", etc. # Setting this to "linux2" is not ideal, but only Windows or Mac # are actually checked for and the rest of the module expects # *sys.platform* style strings. system = 'linux2' elif sys.platform == 'cli' and os.name == 'nt': # Detect Windows in IronPython to match pip._internal.utils.compat.WINDOWS # Discussion: system = 'win32' else: system = sys.platform def user_data_dir(appname=None, appauthor=None, version=None, roaming=False): r"""Return full path to the user-specific data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user data directories are: Mac OS X: ~/Library/Application Support/ # or ~/.config/, if the other does not exist Unix: ~/.local/share/ # or in $XDG_DATA_HOME, if defined Win XP (not roaming): C:\Documents and Settings\\Application Data\\ Win XP (roaming): C:\Documents and Settings\\Local Settings\Application Data\\ Win 7 (not roaming): C:\Users\\AppData\Local\\ Win 7 (roaming): C:\Users\\AppData\Roaming\\ For Unix, we follow the XDG spec and support $XDG_DATA_HOME. That means, by default "~/.local/share/". """ if system == "win32": if appauthor is None: appauthor = appname const = roaming and "CSIDL_APPDATA" or "CSIDL_LOCAL_APPDATA" path = os.path.normpath(_get_win_folder(const)) if appname: if appauthor is not False: path = os.path.join(path, appauthor, appname) else: path = os.path.join(path, appname) elif system == 'darwin': path = os.path.expanduser('~/Library/Application Support/') if appname: path = os.path.join(path, appname) else: path = os.getenv('XDG_DATA_HOME', os.path.expanduser("~/.local/share")) if appname: path = os.path.join(path, appname) if appname and version: path = os.path.join(path, version) return path def site_data_dir(appname=None, appauthor=None, version=None, multipath=False): r"""Return full path to the user-shared data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "multipath" is an optional parameter only applicable to *nix which indicates that the entire list of data dirs should be returned. By default, the first item from XDG_DATA_DIRS is returned, or '/usr/local/share/', if XDG_DATA_DIRS is not set Typical site data directories are: Mac OS X: /Library/Application Support/ Unix: /usr/local/share/ or /usr/share/ Win XP: C:\Documents and Settings\All Users\Application Data\\ Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) Win 7: C:\ProgramData\\ # Hidden, but writeable on Win 7. For Unix, this is using the $XDG_DATA_DIRS[0] default. WARNING: Do not use this on Windows. See the Vista-Fail note above for why. """ if system == "win32": if appauthor is None: appauthor = appname path = os.path.normpath(_get_win_folder("CSIDL_COMMON_APPDATA")) if appname: if appauthor is not False: path = os.path.join(path, appauthor, appname) else: path = os.path.join(path, appname) elif system == 'darwin': path = os.path.expanduser('/Library/Application Support') if appname: path = os.path.join(path, appname) else: # XDG default for $XDG_DATA_DIRS # only first, if multipath is False path = os.getenv('XDG_DATA_DIRS', os.pathsep.join(['/usr/local/share', '/usr/share'])) pathlist = [os.path.expanduser(x.rstrip(os.sep)) for x in path.split(os.pathsep)] if appname: if version: appname = os.path.join(appname, version) pathlist = [os.path.join(x, appname) for x in pathlist] if multipath: path = os.pathsep.join(pathlist) else: path = pathlist[0] return path if appname and version: path = os.path.join(path, version) return path def user_config_dir(appname=None, appauthor=None, version=None, roaming=False): r"""Return full path to the user-specific config dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user config directories are: Mac OS X: same as user_data_dir Unix: ~/.config/ # or in $XDG_CONFIG_HOME, if defined Win *: same as user_data_dir For Unix, we follow the XDG spec and support $XDG_CONFIG_HOME. That means, by default "~/.config/". """ if system in ["win32", "darwin"]: path = user_data_dir(appname, appauthor, None, roaming) else: path = os.getenv('XDG_CONFIG_HOME', os.path.expanduser("~/.config")) if appname: path = os.path.join(path, appname) if appname and version: path = os.path.join(path, version) return path # for the discussion regarding site_config_dir locations # see def site_config_dir(appname=None, appauthor=None, version=None, multipath=False): r"""Return full path to the user-shared data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "multipath" is an optional parameter only applicable to *nix which indicates that the entire list of config dirs should be returned. By default, the first item from XDG_CONFIG_DIRS is returned, or '/etc/xdg/', if XDG_CONFIG_DIRS is not set Typical site config directories are: Mac OS X: same as site_data_dir Unix: /etc/xdg/ or $XDG_CONFIG_DIRS[i]/ for each value in $XDG_CONFIG_DIRS Win *: same as site_data_dir Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) For Unix, this is using the $XDG_CONFIG_DIRS[0] default, if multipath=False WARNING: Do not use this on Windows. See the Vista-Fail note above for why. """ if system in ["win32", "darwin"]: path = site_data_dir(appname, appauthor) if appname and version: path = os.path.join(path, version) else: # XDG default for $XDG_CONFIG_DIRS (missing or empty) # see # only first, if multipath is False path = os.getenv('XDG_CONFIG_DIRS') or '/etc/xdg' pathlist = [os.path.expanduser(x.rstrip(os.sep)) for x in path.split(os.pathsep) if x] if appname: if version: appname = os.path.join(appname, version) pathlist = [os.path.join(x, appname) for x in pathlist] if multipath: path = os.pathsep.join(pathlist) else: path = pathlist[0] return path def user_cache_dir(appname=None, appauthor=None, version=None, opinion=True): r"""Return full path to the user-specific cache dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "opinion" (boolean) can be False to disable the appending of "Cache" to the base app data dir for Windows. See discussion below. Typical user cache directories are: Mac OS X: ~/Library/Caches/ Unix: ~/.cache/ (XDG default) Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Cache Vista: C:\Users\\AppData\Local\\\Cache On Windows the only suggestion in the MSDN docs is that local settings go in the `CSIDL_LOCAL_APPDATA` directory. This is identical to the non-roaming app data dir (the default returned by `user_data_dir` above). Apps typically put cache data somewhere *under* the given dir here. Some examples: ...\Mozilla\Firefox\Profiles\\Cache ...\Acme\SuperApp\Cache\1.0 OPINION: This function appends "Cache" to the `CSIDL_LOCAL_APPDATA` value. This can be disabled with the `opinion=False` option. """ if system == "win32": if appauthor is None: appauthor = appname path = os.path.normpath(_get_win_folder("CSIDL_LOCAL_APPDATA")) # When using Python 2, return paths as bytes on Windows like we do on # other operating systems. See helper function docs for more details. if not PY3 and isinstance(path, unicode): path = _win_path_to_bytes(path) if appname: if appauthor is not False: path = os.path.join(path, appauthor, appname) else: path = os.path.join(path, appname) if opinion: path = os.path.join(path, "Cache") elif system == 'darwin': path = os.path.expanduser('~/Library/Caches') if appname: path = os.path.join(path, appname) else: path = os.getenv('XDG_CACHE_HOME', os.path.expanduser('~/.cache')) if appname: path = os.path.join(path, appname) if appname and version: path = os.path.join(path, version) return path def user_state_dir(appname=None, appauthor=None, version=None, roaming=False): r"""Return full path to the user-specific state dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user state directories are: Mac OS X: same as user_data_dir Unix: ~/.local/state/ # or in $XDG_STATE_HOME, if defined Win *: same as user_data_dir For Unix, we follow this Debian proposal to extend the XDG spec and support $XDG_STATE_HOME. That means, by default "~/.local/state/". """ if system in ["win32", "darwin"]: path = user_data_dir(appname, appauthor, None, roaming) else: path = os.getenv('XDG_STATE_HOME', os.path.expanduser("~/.local/state")) if appname: path = os.path.join(path, appname) if appname and version: path = os.path.join(path, version) return path def user_log_dir(appname=None, appauthor=None, version=None, opinion=True): r"""Return full path to the user-specific log dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "opinion" (boolean) can be False to disable the appending of "Logs" to the base app data dir for Windows, and "log" to the base cache dir for Unix. See discussion below. Typical user log directories are: Mac OS X: ~/Library/Logs/ Unix: ~/.cache//log # or under $XDG_CACHE_HOME if defined Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Logs Vista: C:\Users\\AppData\Local\\\Logs On Windows the only suggestion in the MSDN docs is that local settings go in the `CSIDL_LOCAL_APPDATA` directory. (Note: I'm interested in examples of what some windows apps use for a logs dir.) OPINION: This function appends "Logs" to the `CSIDL_LOCAL_APPDATA` value for Windows and appends "log" to the user cache dir for Unix. This can be disabled with the `opinion=False` option. """ if system == "darwin": path = os.path.join( os.path.expanduser('~/Library/Logs'), appname) elif system == "win32": path = user_data_dir(appname, appauthor, version) version = False if opinion: path = os.path.join(path, "Logs") else: path = user_cache_dir(appname, appauthor, version) version = False if opinion: path = os.path.join(path, "log") if appname and version: path = os.path.join(path, version) return path class AppDirs(object): """Convenience wrapper for getting application dirs.""" def __init__(self, appname=None, appauthor=None, version=None, roaming=False, multipath=False): self.appname = appname self.appauthor = appauthor self.version = version self.roaming = roaming self.multipath = multipath @property def user_data_dir(self): return user_data_dir(self.appname, self.appauthor, version=self.version, roaming=self.roaming) @property def site_data_dir(self): return site_data_dir(self.appname, self.appauthor, version=self.version, multipath=self.multipath) @property def user_config_dir(self): return user_config_dir(self.appname, self.appauthor, version=self.version, roaming=self.roaming) @property def site_config_dir(self): return site_config_dir(self.appname, self.appauthor, version=self.version, multipath=self.multipath) @property def user_cache_dir(self): return user_cache_dir(self.appname, self.appauthor, version=self.version) @property def user_state_dir(self): return user_state_dir(self.appname, self.appauthor, version=self.version) @property def user_log_dir(self): return user_log_dir(self.appname, self.appauthor, version=self.version) #---- internal support stuff def _get_win_folder_from_registry(csidl_name): """This is a fallback technique at best. I'm not sure if using the registry for this guarantees us the correct answer for all CSIDL_* names. """ if PY3: import winreg as _winreg else: import _winreg shell_folder_name = { "CSIDL_APPDATA": "AppData", "CSIDL_COMMON_APPDATA": "Common AppData", "CSIDL_LOCAL_APPDATA": "Local AppData", }[csidl_name] key = _winreg.OpenKey( _winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" ) dir, type = _winreg.QueryValueEx(key, shell_folder_name) return dir def _get_win_folder_with_pywin32(csidl_name): from win32com.shell import shellcon, shell dir = shell.SHGetFolderPath(0, getattr(shellcon, csidl_name), 0, 0) # Try to make this a unicode path because SHGetFolderPath does # not return unicode strings when there is unicode data in the # path. try: dir = unicode(dir) # Downgrade to short path name if have highbit chars. See # . has_high_char = False for c in dir: if ord(c) > 255: has_high_char = True break if has_high_char: try: import win32api dir = win32api.GetShortPathName(dir) except ImportError: pass except UnicodeError: pass return dir def _get_win_folder_with_ctypes(csidl_name): import ctypes csidl_const = { "CSIDL_APPDATA": 26, "CSIDL_COMMON_APPDATA": 35, "CSIDL_LOCAL_APPDATA": 28, }[csidl_name] buf = ctypes.create_unicode_buffer(1024) ctypes.windll.shell32.SHGetFolderPathW(None, csidl_const, None, 0, buf) # Downgrade to short path name if have highbit chars. See # . has_high_char = False for c in buf: if ord(c) > 255: has_high_char = True break if has_high_char: buf2 = ctypes.create_unicode_buffer(1024) if ctypes.windll.kernel32.GetShortPathNameW(buf.value, buf2, 1024): buf = buf2 return buf.value def _get_win_folder_with_jna(csidl_name): import array from com.sun import jna from com.sun.jna.platform import win32 buf_size = win32.WinDef.MAX_PATH * 2 buf = array.zeros('c', buf_size) shell = win32.Shell32.INSTANCE shell.SHGetFolderPath(None, getattr(win32.ShlObj, csidl_name), None, win32.ShlObj.SHGFP_TYPE_CURRENT, buf) dir = jna.Native.toString(buf.tostring()).rstrip("\0") # Downgrade to short path name if have highbit chars. See # . has_high_char = False for c in dir: if ord(c) > 255: has_high_char = True break if has_high_char: buf = array.zeros('c', buf_size) kernel = win32.Kernel32.INSTANCE if kernel.GetShortPathName(dir, buf, buf_size): dir = jna.Native.toString(buf.tostring()).rstrip("\0") return dir if system == "win32": try: from ctypes import windll _get_win_folder = _get_win_folder_with_ctypes except ImportError: try: import com.sun.jna _get_win_folder = _get_win_folder_with_jna except ImportError: _get_win_folder = _get_win_folder_from_registry def _win_path_to_bytes(path): """Encode Windows paths to bytes. Only used on Python 2. Motivation is to be consistent with other operating systems where paths are also returned as bytes. This avoids problems mixing bytes and Unicode elsewhere in the codebase. For more details and discussion see . If encoding using ASCII and MBCS fails, return the original Unicode path. """ for encoding in ('ASCII', 'MBCS'): try: return path.encode(encoding) except (UnicodeEncodeError, LookupError): pass return path #---- self test code if __name__ == "__main__": appname = "MyApp" appauthor = "MyCompany" props = ("user_data_dir", "user_config_dir", "user_cache_dir", "user_state_dir", "user_log_dir", "site_data_dir", "site_config_dir") print("-- app dirs %s --" % __version__) print("-- app dirs (with optional 'version')") dirs = AppDirs(appname, appauthor, version="1.0") for prop in props: print("%s: %s" % (prop, getattr(dirs, prop))) print("\n-- app dirs (without optional 'version')") dirs = AppDirs(appname, appauthor) for prop in props: print("%s: %s" % (prop, getattr(dirs, prop))) print("\n-- app dirs (without optional 'appauthor')") dirs = AppDirs(appname) for prop in props: print("%s: %s" % (prop, getattr(dirs, prop))) print("\n-- app dirs (with disabled 'appauthor')") dirs = AppDirs(appname, appauthor=False) for prop in props: print("%s: %s" % (prop, getattr(dirs, prop))) PKd](/g g 3webencodings/__pycache__/tests.cpython-38.opt-1.pycnu[U .e@sdZddlmZddlmZmZmZmZmZm Z m Z m Z m Z ddZ ddZd d Zd d Zd dZddZddZddZddZdS)z webencodings.tests ~~~~~~~~~~~~~~~~~~ A basic test suite for Encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. )unicode_literals) lookupLABELSdecodeencode iter_decode iter_encodeIncrementalDecoderIncrementalEncoderUTF8cOs6z|||Wn|k r$YdSXtd|dS)NzDid not raise %s.)AssertionError)Z exceptionZfunctionargskwargsrB/usr/lib/python3.8/site-packages/pip/_vendor/webencodings/tests.py assert_raisess rcCsdSNrrrrr test_labelssrcCsNtD]2}dD]}tdg||\}}q t|}t|}qttD]}qDdS)N)rr )rrr r setvalues)Zlabelrepeatoutput_decoderencodernamerrrtest_all_labels0srcCsTtttddtttddtttgdtttgdtttdtttddS)NséZinvalidé)r LookupErrorrrrr r r rrrrtest_invalid_labelCs  r"cCsdSrrrrrr test_decodeLsr#cCsdSrrrrrr test_encodebsr$cCs dd}dS)NcSst||\}}d|S)N)rjoin)inputZfallback_encodingrZ _encodingrrriter_decode_to_stringlsz/test_iter_decode..iter_decode_to_stringr)r(rrrtest_iter_decodeksr)cCsdSrrrrrrtest_iter_encodesr*cCsd}d}d}d}dS)Ns2, O#ɻtϨu2, O#tsaaZaar)ZencodedZdecodedrrrtest_x_user_defineds r+N)__doc__Z __future__rr%rrrrrr r r r rrrr"r#r$r)r*r+rrrrs ,    PKd]7CC6webencodings/__pycache__/mklabels.cpython-38.opt-1.pycnu[U .e@sfdZddlZzddlmZWn ek r<ddlmZYnXddZddZedkrbe ed dS) z webencodings.mklabels ~~~~~~~~~~~~~~~~~~~~~ Regenarate the webencodings.labels module. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. N)urlopencCs|SN)stringrrE/usr/lib/python3.8/site-packages/pip/_vendor/webencodings/mklabels.py assert_lowersrcsfdg}ddtt|dD}tdd|D|fdd|D|dd |S) Na""" webencodings.labels ~~~~~~~~~~~~~~~~~~~ Map encoding labels to their name. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ # XXX Do not edit! # This file is automatically generated by mklabels.py LABELS = { cSsLg|]D}|dD]6}|dD](}tt|dt|ddfqqqS)Z encodingslabelsuname)reprrlstrip).0categoryencodinglabelrrr ,s  zgenerate..asciicss|]\}}t|VqdSrlenr rr rrr 2szgenerate..c3s,|]$\}}d|dt||fVqdS)z %s:%s %s,  NrrZmax_lenrrr3s}) jsonloadsrreaddecodemaxextendappendjoin)Zurlpartsrrrrgenerates r$__main__z.http://encoding.spec.whatwg.org/encodings.json) __doc__rZurllibr ImportErrorZurllib.requestrr$__name__printrrrrs !PKd],$-webencodings/__pycache__/tests.cpython-38.pycnu[U ʗRe@sdZddlmZddlmZmZmZmZmZm Z m Z m Z m Z ddZ ddZd d Zd d Zd dZddZddZddZddZdS)z webencodings.tests ~~~~~~~~~~~~~~~~~~ A basic test suite for Encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. )unicode_literals) lookupLABELSdecodeencode iter_decode iter_encodeIncrementalDecoderIncrementalEncoderUTF8cOs6z|||Wn|k r$YdSXtd|dS)NzDid not raise %s.AssertionError) exceptionfunctionargskwargsr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/webencodings/tests.py assert_raisess rcCs tdjdksttdjdks$ttdjdks6ttdjdksHttdjdksZttdjdkslttdjdks~ttddksttddksttd jd ksttd jd ksttd jd ksttd jd ksttddksttddkstdS)Nzutf-8zUtf-8zUTF-8utf8zutf8 z utf8 u8uutf-8 zUS-ASCIIz windows-1252z iso-8859-1latin1ZLATIN1zlatin-1uLATİN1)rnamerrrrr test_labelssrcCstD]}td|dt|fks"ttd|dks4tdD]D}tdg||\}}t|gks`tttdg||gks8tq8t|}|ddkst|jddddkstt |}|ddkst|jddddkstqt t D]}t|j |kstqdS)N)rr T)final) rrrrrrlistr r r setvaluesr)labelrepeatoutput_decoderencoderrrrrtest_all_labels0sr(cCsTtttddtttddtttgdtttgdtttdtttddS)Néinvalidé)r LookupErrorrrrr r r rrrrtest_invalid_labelCs  r-cCstdddtdfksttdtddtdfks8ttdddtdfksRttdtdtdfkslttdddtdfksttd ddtdfksttd ddtd fksttd ddtd fksttdddtd fksttdddtd fks ttdddtd fks&ttdddtd fksBttdddtd fks^ttdddtd fkszttdddtd fksttdddtd fkstdS)Nru€érr+asciiér)utf-16beutf-16lesuszUTF-16BEzUTF-16LEzUTF-16)rrrr rrrr test_decodeLs r8cCsptdddksttdddks$ttdddks6ttdddksHttdddksZttdd d ksltdS) Nr+rrr/utf-16r7r5r3r6)rrrrrr test_encodebs r;cCsdd}|gddkst|dgddks.t|dgddksBt|dgdd ksVt|d d gdd kslt|d d gdd kst|dgddkst|dgddkst|dddgddkst|dddgddkst|ddddddgddkst|dgddkst|dgddks$t|dgddks:t|dgddksPt|ddddddgddkspt|ddd gd d!kstdS)"NcSst||\}}d|S)Nr)rjoin)inputfallback_encodingr$ _encodingrrriter_decode_to_stringlsz/test_iter_decode..iter_decode_to_stringrrrr9r+shelloZhellosheslloshellor/r1r)saua�ssuï»r2r4sshx-user-defineduhllor )r@rrrtest_iter_decodeks rIcCsdtgddkstdtdgddks2tdtdgddksLtdtddddgddksltdtddddgddkstdtddddgddkstdtddddgd d kstdtdd dd gd dkstdS)Nrrrr+r9r:r7r5r3r6uhZllorHshllo)r<r rrrrrtest_iter_encodes"    rJcCs@d}d}d}d}t|d|tdfks*tt|d|kss ,    PKd]h10webencodings/__pycache__/mklabels.cpython-38.pycnu[U ʗRe@sfdZddlZzddlmZWn ek r<ddlmZYnXddZddZedkrbe ed dS) z webencodings.mklabels ~~~~~~~~~~~~~~~~~~~~~ Regenarate the webencodings.labels module. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. N)urlopencCs||kst|SN)lowerAssertionError)stringr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/webencodings/mklabels.py assert_lowersr csfdg}ddtt|dD}tdd|D|fdd|D|dd |S) Na""" webencodings.labels ~~~~~~~~~~~~~~~~~~~ Map encoding labels to their name. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ # XXX Do not edit! # This file is automatically generated by mklabels.py LABELS = { cSsLg|]D}|dD]6}|dD](}tt|dt|ddfqqqS) encodingslabelsuname)reprr lstrip).0categoryencodinglabelrrr ,s  zgenerate..asciicss|]\}}t|VqdSrlenrrr rrr 2szgenerate..c3s,|]$\}}d|dt||fVqdS)z %s:%s %s,  Nrrmax_lenrrr3s}) jsonloadsrreaddecodemaxextendappendjoin)urlpartsr rrrgenerates r)__main__z.http://encoding.spec.whatwg.org/encodings.json) __doc__rurllibr ImportErrorurllib.requestr r)__name__printrrrrs !PKd]h 6webencodings/__pycache__/x_user_defined.cpython-38.pycnu[U ʗRe @sdZddlmZddlZGdddejZGdddejZGdd d ejZGd d d eejZGd d d eejZej dej ej eeeedZ dZ ee ZdS)z webencodings.x_user_defined ~~~~~~~~~~~~~~~~~~~~~~~~~~~ An implementation of the x-user-defined encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. )unicode_literalsNc@s eZdZdddZdddZdS) CodecstrictcCst||tSN)codecscharmap_encodeencoding_tableselfinputerrorsr /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/webencodings/x_user_defined.pyencodesz Codec.encodecCst||tSr)rcharmap_decodedecoding_tabler r r rdecodesz Codec.decodeN)r)r)__name__ __module__ __qualname__rrr r r rrs rc@seZdZdddZdS)IncrementalEncoderFcCst||jtdSNr)rrr rr r finalr r rrszIncrementalEncoder.encodeN)F)rrrrr r r rrsrc@seZdZdddZdS)IncrementalDecoderFcCst||jtdSr)rrr rrr r rr$szIncrementalDecoder.decodeN)F)rrrrr r r rr#src@s eZdZdS) StreamWriterNrrrr r r rr(src@s eZdZdS) StreamReaderNrr r r rr,srzx-user-defined)namerrincrementalencoderincrementaldecoder streamreader streamwriteru  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)__doc__ __future__rrrrrrr CodecInforrZ codec_infor charmap_buildrr r r rs*  PKd]ԽG G <webencodings/__pycache__/x_user_defined.cpython-38.opt-1.pycnu[U .e @sdZddlmZddlZGdddejZGdddejZGdd d ejZGd d d eejZGd d d eejZej dej ej eeeedZ dZ ee ZdS)z webencodings.x_user_defined ~~~~~~~~~~~~~~~~~~~~~~~~~~~ An implementation of the x-user-defined encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. )unicode_literalsNc@s eZdZdddZdddZdS) CodecstrictcCst||tSN)codecscharmap_encodeencoding_tableselfinputerrorsr K/usr/lib/python3.8/site-packages/pip/_vendor/webencodings/x_user_defined.pyencodesz Codec.encodecCst||tSr)rcharmap_decodedecoding_tabler r r rdecodesz Codec.decodeN)r)r)__name__ __module__ __qualname__rrr r r rrs rc@seZdZdddZdS)IncrementalEncoderFcCst||jtdSNr)rrr rr r finalr r rrszIncrementalEncoder.encodeN)F)rrrrr r r rrsrc@seZdZdddZdS)IncrementalDecoderFcCst||jtdSr)rrr rrr r rr$szIncrementalDecoder.decodeN)F)rrrrr r r rr#src@s eZdZdS) StreamWriterNrrrr r r rr(src@s eZdZdS) StreamReaderNrr r r rr,srzx-user-defined)namerrincrementalencoderincrementaldecoder streamreader streamwriteru  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)__doc__Z __future__rrrrrrr CodecInforrZ codec_infor charmap_buildrr r r rs*  PKd]+)2&2&0webencodings/__pycache__/__init__.cpython-38.pycnu[U ʗReS)@sdZddlmZddlZddlmZdZddd d d ZiZd d Z ddZ ddZ Gddde Z e dZe dZe dZd+ddZddZedfddZd,dd Zd!d"Zedfd#d$Zd%d&ZGd'd(d(e ZGd)d*d*e ZdS)-a webencodings ~~~~~~~~~~~~ This is a Python implementation of the `WHATWG Encoding standard `. See README for details. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. )unicode_literalsN)LABELSz0.5.1z iso-8859-8z mac-cyrillicz mac-romanZcp874)z iso-8859-8-izx-mac-cyrillic macintoshz windows-874cCs|ddS)a9Transform (only) ASCII letters to lower case: A-Z is mapped to a-z. :param string: An Unicode string. :returns: A new Unicode string. This is used for `ASCII case-insensitive `_ matching of encoding labels. The same matching is also used, among other things, for `CSS keywords `_. This is different from the :meth:`~py:str.lower` method of Unicode strings which also affect non-ASCII characters, sometimes mapping them into the ASCII range: >>> keyword = u'Bac\N{KELVIN SIGN}ground' >>> assert keyword.lower() == u'background' >>> assert ascii_lower(keyword) != keyword.lower() >>> assert ascii_lower(keyword) == u'bac\N{KELVIN SIGN}ground' utf8)encodelowerdecode)stringr /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/webencodings/__init__.py ascii_lower#sr cCsxt|d}t|}|dkr$dSt|}|dkrt|dkrLddlm}nt||}t |}t ||}|t|<|S)u< Look for an encoding by its label. This is the spec’s `get an encoding `_ algorithm. Supported labels are listed there. :param label: A string. :returns: An :class:`Encoding` object, or :obj:`None` for an unknown label. z Nzx-user-definedr) codec_info) r striprgetCACHEZx_user_definedr PYTHON_NAMEScodecslookupEncoding)labelnameencodingrZ python_namer r r r=s      rcCs.t|dr|St|}|dkr*td||S)z Accept either an encoding object or label. :param encoding: An :class:`Encoding` object or a label string. :returns: An :class:`Encoding` object. :raises: :exc:`~exceptions.LookupError` for an unknown label. rNzUnknown encoding label: %r)hasattrr LookupError)Zencoding_or_labelrr r r _get_encoding[s  rc@s eZdZdZddZddZdS)raOReresents a character encoding such as UTF-8, that can be used for decoding or encoding. .. attribute:: name Canonical name of the encoding .. attribute:: codec_info The actual implementation of the encoding, a stdlib :class:`~codecs.CodecInfo` object. See :func:`codecs.register`. cCs||_||_dSN)rr)selfrrr r r __init__|szEncoding.__init__cCs d|jS)Nz )r)rr r r __repr__szEncoding.__repr__N)__name__ __module__ __qualname____doc__rrr r r r rmsrzutf-8zutf-16lezutf-16bereplacecCs2t|}t|\}}|p|}|j||d|fS)a Decode a single string. :param input: A byte string :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :return: A ``(output, encoding)`` tuple of an Unicode string and an :obj:`Encoding`. r)r _detect_bomrr )inputfallback_encodingerrorsZ bom_encodingrr r r r s r cCsV|drt|ddfS|dr4t|ddfS|drNt|ddfSd|fS)zBReturn (bom_encoding, input), with any BOM removed from the input.sNss) startswith_UTF16LE_UTF16BEUTF8)r&r r r r%s   r%strictcCst|j||dS)a; Encode a single string. :param input: An Unicode string. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :return: A byte string. r)rrr)r&rr(r r r rs rcCs$t||}t||}t|}||fS)a "Pull"-based decoder. :param input: An iterable of byte strings. The input is first consumed just enough to determine the encoding based on the precense of a BOM, then consumed on demand when the return value is. :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :returns: An ``(output, encoding)`` tuple. :obj:`output` is an iterable of Unicode strings, :obj:`encoding` is the :obj:`Encoding` that is being used. )IncrementalDecoder_iter_decode_generatornext)r&r'r(decoder generatorrr r r iter_decodes  r5ccs|j}t|}|D]0}||}|r|jdk s0t|jV|Vqtq|ddd}|jdk s^t|jV|rp|VdS|D]}||}|rx|Vqx|ddd}|r|VdS)zqReturn a generator that first yields the :obj:`Encoding`, then yields output chukns as Unicode strings. NTfinal)r iterrAssertionError)r&r3r chunckoutputr r r r1s,  r1cCst||j}t||S)uY “Pull”-based encoder. :param input: An iterable of Unicode strings. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :returns: An iterable of byte strings. )IncrementalEncoderr_iter_encode_generator)r&rr(rr r r iter_encodes r?ccs6|D]}||}|r|Vq|ddd}|r2|VdS)NTr7r )r&rr;r<r r r r>s r>c@s$eZdZdZd ddZd ddZdS) r0uO “Push”-based decoder. :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. r$cCs&t||_||_d|_d|_d|_dS)Nr6)r_fallback_encoding_errors_buffer_decoderr)rr'r(r r r rs  zIncrementalDecoder.__init__FcCs||j}|dk r|||S|j|}t|\}}|dkrVt|dkrP|sP||_dS|j}|j|jj}||_||_ |||S)zDecode one chunk of the input. :param input: A byte string. :param final: Indicate that no more input is available. Must be :obj:`True` if this is the last call. :returns: An Unicode string. Nr*r@) rDrCr%lenrArincrementaldecoderrBr r)rr&r8r3rr r r r 's    zIncrementalDecoder.decodeN)r$)F)r r!r"r#rr r r r r r0s r0c@seZdZdZedfddZdS)r=u “Push”-based encoder. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. .. method:: encode(input, final=False) :param input: An Unicode string. :param final: Indicate that no more input is available. Must be :obj:`True` if this is the last call. :returns: A byte string. r/cCst|}|j|j|_dSr)rrincrementalencoderr)rrr(r r r rTszIncrementalEncoder.__init__N)r r!r"r#r.rr r r r r=Csr=)r$)r$)r# __future__rrlabelsrVERSIONrrr rrobjectrr.r,r-r r%rr5r1r?r>r0r=r r r r s4       3PKd]r$$.webencodings/__pycache__/labels.cpython-38.pycnu[U ʗRe#@sdZddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d d d d d d d d d d d d d d d d d d dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d!d!d!d!d"d"d"d#d#d$d$d$d$d$d$d$d%d%d%d%d%d%d%d%d%d%d&d&d'd(d(d)d*Zd+S),z webencodings.labels ~~~~~~~~~~~~~~~~~~~ Map encoding labels to their name. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. utf-8ibm866 iso-8859-2 iso-8859-3 iso-8859-4 iso-8859-5 iso-8859-6 iso-8859-7 iso-8859-8 iso-8859-8-i iso-8859-10 iso-8859-13 iso-8859-14 iso-8859-15 iso-8859-16koi8-rkoi8-u macintosh windows-874 windows-1250 windows-1251 windows-1252 windows-1253 windows-1254 windows-1255 windows-1256 windows-1257 windows-1258x-mac-cyrillicgbkgb18030 hz-gb-2312big5euc-jp iso-2022-jp shift_jiseuc-kr iso-2022-krutf-16beutf-16lex-user-defined)zunicode-1-1-utf-8rutf8866cp866csibm866r csisolatin2rz iso-ir-101z iso8859-2Ziso88592z iso_8859-2ziso_8859-2:1987l2latin2 csisolatin3rz iso-ir-109z iso8859-3Ziso88593z iso_8859-3ziso_8859-3:1988l3latin3 csisolatin4rz iso-ir-110z iso8859-4Ziso88594z iso_8859-4ziso_8859-4:1988l4latin4csisolatincyrilliccyrillicrz iso-ir-144z iso8859-5Ziso88595z iso_8859-5ziso_8859-5:1988arabiczasmo-708Z csiso88596eZ csiso88596icsisolatinarabiczecma-114rz iso-8859-6-ez iso-8859-6-iz iso-ir-127z iso8859-6Ziso88596z iso_8859-6ziso_8859-6:1987csisolatingreekzecma-118elot_928greekgreek8rz iso-ir-126z iso8859-7Ziso88597z iso_8859-7ziso_8859-7:1987Z sun_eu_greekZ csiso88598ecsisolatinhebrewhebrewr z iso-8859-8-ez iso-ir-138z iso8859-8Ziso88598z iso_8859-8ziso_8859-8:1988ZvisualZ csiso88598ir Zlogical csisolatin6r z iso-ir-157z iso8859-10Z iso885910l6latin6r z iso8859-13Z iso885913r z iso8859-14Z iso885914Z csisolatin9rz iso8859-15Z iso885915z iso_8859-15l9rcskoi8rZkoiZkoi8rkoi8_rrZ csmacintoshmacrz x-mac-romanzdos-874z iso-8859-11z iso8859-11Z iso885911ztis-620rcp1250rzx-cp1250cp1251rzx-cp1251zansi_x3.4-1968asciicp1252cp819 csisolatin1ibm819z iso-8859-1z iso-ir-100z iso8859-1Ziso88591z iso_8859-1ziso_8859-1:1987l1latin1zus-asciirzx-cp1252cp1253rzx-cp1253cp1254 csisolatin5z iso-8859-9z iso-ir-148z iso8859-9Ziso88599z iso_8859-9ziso_8859-9:1989l5latin5rzx-cp1254cp1255rzx-cp1255cp1256rzx-cp1256cp1257rzx-cp1257cp1258rzx-cp1258rzx-mac-ukrainianchineseZcsgb2312csiso58gb231280gb2312Zgb_2312z gb_2312-80rz iso-ir-58zx-gbkrr r!z big5-hkscszcn-big5csbig5zx-x-big5Zcseucpkdfmtjapaneser"zx-euc-jp csiso2022jpr# csshiftjisms_kanjiz shift-jisr$sjisz windows-31jzx-sjisZcseuckrZ csksc56011987r%z iso-ir-149koreanzks_c_5601-1987zks_c_5601-1989ksc5601Zksc_5601z windows-949 csiso2022krr&r'zutf-16r(r)N)__doc__ZLABELSrfrf/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/webencodings/labels.pysPKd]O4webencodings/__pycache__/labels.cpython-38.opt-1.pycnu[U .e#@sdZddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d d d d d d d d d d d d d d d d d d dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d!d!d!d!d"d"d"d#d#d$d$d$d$d$d$d$d%d%d%d%d%d%d%d%d%d%d&d&d'd(d(d)d*Zd+S),z webencodings.labels ~~~~~~~~~~~~~~~~~~~ Map encoding labels to their name. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. utf-8ibm866 iso-8859-2 iso-8859-3 iso-8859-4 iso-8859-5 iso-8859-6 iso-8859-7 iso-8859-8 iso-8859-8-i iso-8859-10 iso-8859-13 iso-8859-14 iso-8859-15 iso-8859-16koi8-rkoi8-u macintosh windows-874 windows-1250 windows-1251 windows-1252 windows-1253 windows-1254 windows-1255 windows-1256 windows-1257 windows-1258x-mac-cyrillicgbkgb18030 hz-gb-2312big5euc-jp iso-2022-jp shift_jiseuc-kr iso-2022-krutf-16beutf-16lex-user-defined)zunicode-1-1-utf-8rutf8866cp866csibm866r csisolatin2rz iso-ir-101z iso8859-2Ziso88592z iso_8859-2ziso_8859-2:1987l2latin2 csisolatin3rz iso-ir-109z iso8859-3Ziso88593z iso_8859-3ziso_8859-3:1988l3latin3 csisolatin4rz iso-ir-110z iso8859-4Ziso88594z iso_8859-4ziso_8859-4:1988l4latin4csisolatincyrilliccyrillicrz iso-ir-144z iso8859-5Ziso88595z iso_8859-5ziso_8859-5:1988arabiczasmo-708Z csiso88596eZ csiso88596icsisolatinarabiczecma-114rz iso-8859-6-ez iso-8859-6-iz iso-ir-127z iso8859-6Ziso88596z iso_8859-6ziso_8859-6:1987csisolatingreekzecma-118elot_928greekgreek8rz iso-ir-126z iso8859-7Ziso88597z iso_8859-7ziso_8859-7:1987Z sun_eu_greekZ csiso88598ecsisolatinhebrewhebrewr z iso-8859-8-ez iso-ir-138z iso8859-8Ziso88598z iso_8859-8ziso_8859-8:1988ZvisualZ csiso88598ir Zlogical csisolatin6r z iso-ir-157z iso8859-10Z iso885910l6latin6r z iso8859-13Z iso885913r z iso8859-14Z iso885914Z csisolatin9rz iso8859-15Z iso885915z iso_8859-15l9rcskoi8rZkoiZkoi8rkoi8_rrZ csmacintoshZmacrz x-mac-romanzdos-874z iso-8859-11z iso8859-11Z iso885911ztis-620rcp1250rzx-cp1250cp1251rzx-cp1251zansi_x3.4-1968asciicp1252cp819 csisolatin1ibm819z iso-8859-1z iso-ir-100z iso8859-1Ziso88591z iso_8859-1ziso_8859-1:1987l1latin1zus-asciirzx-cp1252cp1253rzx-cp1253cp1254 csisolatin5z iso-8859-9z iso-ir-148z iso8859-9Ziso88599z iso_8859-9ziso_8859-9:1989l5latin5rzx-cp1254cp1255rzx-cp1255cp1256rzx-cp1256cp1257rzx-cp1257cp1258rzx-cp1258rzx-mac-ukrainianchineseZcsgb2312csiso58gb231280gb2312Zgb_2312z gb_2312-80rz iso-ir-58zx-gbkrr r!z big5-hkscszcn-big5csbig5zx-x-big5Zcseucpkdfmtjapaneser"zx-euc-jp csiso2022jpr# csshiftjisms_kanjiz shift-jisr$sjisz windows-31jzx-sjisZcseuckrZ csksc56011987r%z iso-ir-149koreanzks_c_5601-1987zks_c_5601-1989ksc5601Zksc_5601z windows-949 csiso2022krr&r'zutf-16r(r)N)__doc__ZLABELSrereC/usr/lib/python3.8/site-packages/pip/_vendor/webencodings/labels.pysPKd]%%6webencodings/__pycache__/__init__.cpython-38.opt-1.pycnu[U .eS)@sdZddlmZddlZddlmZdZddd d d ZiZd d Z ddZ ddZ Gddde Z e dZe dZe dZd+ddZddZedfddZd,dd Zd!d"Zedfd#d$Zd%d&ZGd'd(d(e ZGd)d*d*e ZdS)-a webencodings ~~~~~~~~~~~~ This is a Python implementation of the `WHATWG Encoding standard `. See README for details. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. )unicode_literalsN)LABELSz0.5.1z iso-8859-8z mac-cyrillicz mac-romanZcp874)z iso-8859-8-izx-mac-cyrillic macintoshz windows-874cCs|ddS)a9Transform (only) ASCII letters to lower case: A-Z is mapped to a-z. :param string: An Unicode string. :returns: A new Unicode string. This is used for `ASCII case-insensitive `_ matching of encoding labels. The same matching is also used, among other things, for `CSS keywords `_. This is different from the :meth:`~py:str.lower` method of Unicode strings which also affect non-ASCII characters, sometimes mapping them into the ASCII range: >>> keyword = u'Bac\N{KELVIN SIGN}ground' >>> assert keyword.lower() == u'background' >>> assert ascii_lower(keyword) != keyword.lower() >>> assert ascii_lower(keyword) == u'bac\N{KELVIN SIGN}ground' utf8)encodelowerdecode)stringr E/usr/lib/python3.8/site-packages/pip/_vendor/webencodings/__init__.py ascii_lower#sr cCsxt|d}t|}|dkr$dSt|}|dkrt|dkrLddlm}nt||}t |}t ||}|t|<|S)u< Look for an encoding by its label. This is the spec’s `get an encoding `_ algorithm. Supported labels are listed there. :param label: A string. :returns: An :class:`Encoding` object, or :obj:`None` for an unknown label. z Nzx-user-definedr) codec_info) r striprgetCACHEZx_user_definedr PYTHON_NAMEScodecslookupEncoding)ZlabelnameencodingrZ python_namer r r r=s      rcCs.t|dr|St|}|dkr*td||S)z Accept either an encoding object or label. :param encoding: An :class:`Encoding` object or a label string. :returns: An :class:`Encoding` object. :raises: :exc:`~exceptions.LookupError` for an unknown label. rNzUnknown encoding label: %r)hasattrr LookupError)Zencoding_or_labelrr r r _get_encoding[s  rc@s eZdZdZddZddZdS)raOReresents a character encoding such as UTF-8, that can be used for decoding or encoding. .. attribute:: name Canonical name of the encoding .. attribute:: codec_info The actual implementation of the encoding, a stdlib :class:`~codecs.CodecInfo` object. See :func:`codecs.register`. cCs||_||_dSN)rr)selfrrr r r __init__|szEncoding.__init__cCs d|jS)Nz )r)rr r r __repr__szEncoding.__repr__N)__name__ __module__ __qualname____doc__rrr r r r rmsrzutf-8zutf-16lezutf-16bereplacecCs2t|}t|\}}|p|}|j||d|fS)a Decode a single string. :param input: A byte string :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :return: A ``(output, encoding)`` tuple of an Unicode string and an :obj:`Encoding`. r)r _detect_bomrr )inputfallback_encodingerrorsZ bom_encodingrr r r r s r cCsV|drt|ddfS|dr4t|ddfS|drNt|ddfSd|fS)zBReturn (bom_encoding, input), with any BOM removed from the input.sNss) startswith_UTF16LE_UTF16BEUTF8)r%r r r r$s   r$strictcCst|j||dS)a; Encode a single string. :param input: An Unicode string. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :return: A byte string. r)rrr)r%rr'r r r rs rcCs$t||}t||}t|}||fS)a "Pull"-based decoder. :param input: An iterable of byte strings. The input is first consumed just enough to determine the encoding based on the precense of a BOM, then consumed on demand when the return value is. :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :returns: An ``(output, encoding)`` tuple. :obj:`output` is an iterable of Unicode strings, :obj:`encoding` is the :obj:`Encoding` that is being used. )IncrementalDecoder_iter_decode_generatornext)r%r&r'decoder generatorrr r r iter_decodes  r4ccs|j}t|}|D]"}||}|r|jV|VqXq|ddd}|jV|rT|VdS|D]}||}|r\|Vq\|ddd}|r|VdS)zqReturn a generator that first yields the :obj:`Encoding`, then yields output chukns as Unicode strings. TfinalN)r iterr)r%r2r chunckoutputr r r r0s(  r0cCst||j}t||S)uY “Pull”-based encoder. :param input: An iterable of Unicode strings. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :returns: An iterable of byte strings. )IncrementalEncoderr_iter_encode_generator)r%rr'rr r r iter_encodes r=ccs6|D]}||}|r|Vq|ddd}|r2|VdS)NTr6r )r%rr9r:r r r r<s r<c@s$eZdZdZd ddZd ddZdS) r/uO “Push”-based decoder. :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. r#cCs&t||_||_d|_d|_d|_dS)Nr5)r_fallback_encoding_errors_buffer_decoderr)rr&r'r r r rs  zIncrementalDecoder.__init__FcCs||j}|dk r|||S|j|}t|\}}|dkrVt|dkrP|sP||_dS|j}|j|jj}||_||_ |||S)zDecode one chunk of the input. :param input: A byte string. :param final: Indicate that no more input is available. Must be :obj:`True` if this is the last call. :returns: An Unicode string. Nr)r>) rBrAr$lenr?rincrementaldecoderr@r r)rr%r7r2rr r r r 's    zIncrementalDecoder.decodeN)r#)F)rr r!r"rr r r r r r/s r/c@seZdZdZedfddZdS)r;u “Push”-based encoder. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. .. method:: encode(input, final=False) :param input: An Unicode string. :param final: Indicate that no more input is available. Must be :obj:`True` if this is the last call. :returns: A byte string. r.cCst|}|j|j|_dSr)rrincrementalencoderr)rrr'r r r rTszIncrementalEncoder.__init__N)rr r!r"r-rr r r r r;Csr;)r#)r#)r"Z __future__rrlabelsrZVERSIONrrr rrobjectrr-r+r,r r$rr4r0r=r<r/r;r r r r s4       3PKd]P1webencodings/mklabels.pynu[""" webencodings.mklabels ~~~~~~~~~~~~~~~~~~~~~ Regenarate the webencodings.labels module. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ import json try: from urllib import urlopen except ImportError: from urllib.request import urlopen def assert_lower(string): assert string == string.lower() return string def generate(url): parts = ['''\ """ webencodings.labels ~~~~~~~~~~~~~~~~~~~ Map encoding labels to their name. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ # XXX Do not edit! # This file is automatically generated by mklabels.py LABELS = { '''] labels = [ (repr(assert_lower(label)).lstrip('u'), repr(encoding['name']).lstrip('u')) for category in json.loads(urlopen(url).read().decode('ascii')) for encoding in category['encodings'] for label in encoding['labels']] max_len = max(len(label) for label, name in labels) parts.extend( ' %s:%s %s,\n' % (label, ' ' * (max_len - len(label)), name) for label, name in labels) parts.append('}') return ''.join(parts) if __name__ == '__main__': print(generate('http://encoding.spec.whatwg.org/encodings.json')) PKd]g8pwebencodings/tests.pynu[# coding: utf-8 """ webencodings.tests ~~~~~~~~~~~~~~~~~~ A basic test suite for Encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_literals from . import (lookup, LABELS, decode, encode, iter_decode, iter_encode, IncrementalDecoder, IncrementalEncoder, UTF8) def assert_raises(exception, function, *args, **kwargs): try: function(*args, **kwargs) except exception: return else: # pragma: no cover raise AssertionError('Did not raise %s.' % exception) def test_labels(): assert lookup('utf-8').name == 'utf-8' assert lookup('Utf-8').name == 'utf-8' assert lookup('UTF-8').name == 'utf-8' assert lookup('utf8').name == 'utf-8' assert lookup('utf8').name == 'utf-8' assert lookup('utf8 ').name == 'utf-8' assert lookup(' \r\nutf8\t').name == 'utf-8' assert lookup('u8') is None # Python label. assert lookup('utf-8 ') is None # Non-ASCII white space. assert lookup('US-ASCII').name == 'windows-1252' assert lookup('iso-8859-1').name == 'windows-1252' assert lookup('latin1').name == 'windows-1252' assert lookup('LATIN1').name == 'windows-1252' assert lookup('latin-1') is None assert lookup('LATİN1') is None # ASCII-only case insensitivity. def test_all_labels(): for label in LABELS: assert decode(b'', label) == ('', lookup(label)) assert encode('', label) == b'' for repeat in [0, 1, 12]: output, _ = iter_decode([b''] * repeat, label) assert list(output) == [] assert list(iter_encode([''] * repeat, label)) == [] decoder = IncrementalDecoder(label) assert decoder.decode(b'') == '' assert decoder.decode(b'', final=True) == '' encoder = IncrementalEncoder(label) assert encoder.encode('') == b'' assert encoder.encode('', final=True) == b'' # All encoding names are valid labels too: for name in set(LABELS.values()): assert lookup(name).name == name def test_invalid_label(): assert_raises(LookupError, decode, b'\xEF\xBB\xBF\xc3\xa9', 'invalid') assert_raises(LookupError, encode, 'é', 'invalid') assert_raises(LookupError, iter_decode, [], 'invalid') assert_raises(LookupError, iter_encode, [], 'invalid') assert_raises(LookupError, IncrementalDecoder, 'invalid') assert_raises(LookupError, IncrementalEncoder, 'invalid') def test_decode(): assert decode(b'\x80', 'latin1') == ('€', lookup('latin1')) assert decode(b'\x80', lookup('latin1')) == ('€', lookup('latin1')) assert decode(b'\xc3\xa9', 'utf8') == ('é', lookup('utf8')) assert decode(b'\xc3\xa9', UTF8) == ('é', lookup('utf8')) assert decode(b'\xc3\xa9', 'ascii') == ('é', lookup('ascii')) assert decode(b'\xEF\xBB\xBF\xc3\xa9', 'ascii') == ('é', lookup('utf8')) # UTF-8 with BOM assert decode(b'\xFE\xFF\x00\xe9', 'ascii') == ('é', lookup('utf-16be')) # UTF-16-BE with BOM assert decode(b'\xFF\xFE\xe9\x00', 'ascii') == ('é', lookup('utf-16le')) # UTF-16-LE with BOM assert decode(b'\xFE\xFF\xe9\x00', 'ascii') == ('\ue900', lookup('utf-16be')) assert decode(b'\xFF\xFE\x00\xe9', 'ascii') == ('\ue900', lookup('utf-16le')) assert decode(b'\x00\xe9', 'UTF-16BE') == ('é', lookup('utf-16be')) assert decode(b'\xe9\x00', 'UTF-16LE') == ('é', lookup('utf-16le')) assert decode(b'\xe9\x00', 'UTF-16') == ('é', lookup('utf-16le')) assert decode(b'\xe9\x00', 'UTF-16BE') == ('\ue900', lookup('utf-16be')) assert decode(b'\x00\xe9', 'UTF-16LE') == ('\ue900', lookup('utf-16le')) assert decode(b'\x00\xe9', 'UTF-16') == ('\ue900', lookup('utf-16le')) def test_encode(): assert encode('é', 'latin1') == b'\xe9' assert encode('é', 'utf8') == b'\xc3\xa9' assert encode('é', 'utf8') == b'\xc3\xa9' assert encode('é', 'utf-16') == b'\xe9\x00' assert encode('é', 'utf-16le') == b'\xe9\x00' assert encode('é', 'utf-16be') == b'\x00\xe9' def test_iter_decode(): def iter_decode_to_string(input, fallback_encoding): output, _encoding = iter_decode(input, fallback_encoding) return ''.join(output) assert iter_decode_to_string([], 'latin1') == '' assert iter_decode_to_string([b''], 'latin1') == '' assert iter_decode_to_string([b'\xe9'], 'latin1') == 'é' assert iter_decode_to_string([b'hello'], 'latin1') == 'hello' assert iter_decode_to_string([b'he', b'llo'], 'latin1') == 'hello' assert iter_decode_to_string([b'hell', b'o'], 'latin1') == 'hello' assert iter_decode_to_string([b'\xc3\xa9'], 'latin1') == 'é' assert iter_decode_to_string([b'\xEF\xBB\xBF\xc3\xa9'], 'latin1') == 'é' assert iter_decode_to_string([ b'\xEF\xBB\xBF', b'\xc3', b'\xa9'], 'latin1') == 'é' assert iter_decode_to_string([ b'\xEF\xBB\xBF', b'a', b'\xc3'], 'latin1') == 'a\uFFFD' assert iter_decode_to_string([ b'', b'\xEF', b'', b'', b'\xBB\xBF\xc3', b'\xa9'], 'latin1') == 'é' assert iter_decode_to_string([b'\xEF\xBB\xBF'], 'latin1') == '' assert iter_decode_to_string([b'\xEF\xBB'], 'latin1') == 'ï»' assert iter_decode_to_string([b'\xFE\xFF\x00\xe9'], 'latin1') == 'é' assert iter_decode_to_string([b'\xFF\xFE\xe9\x00'], 'latin1') == 'é' assert iter_decode_to_string([ b'', b'\xFF', b'', b'', b'\xFE\xe9', b'\x00'], 'latin1') == 'é' assert iter_decode_to_string([ b'', b'h\xe9', b'llo'], 'x-user-defined') == 'h\uF7E9llo' def test_iter_encode(): assert b''.join(iter_encode([], 'latin1')) == b'' assert b''.join(iter_encode([''], 'latin1')) == b'' assert b''.join(iter_encode(['é'], 'latin1')) == b'\xe9' assert b''.join(iter_encode(['', 'é', '', ''], 'latin1')) == b'\xe9' assert b''.join(iter_encode(['', 'é', '', ''], 'utf-16')) == b'\xe9\x00' assert b''.join(iter_encode(['', 'é', '', ''], 'utf-16le')) == b'\xe9\x00' assert b''.join(iter_encode(['', 'é', '', ''], 'utf-16be')) == b'\x00\xe9' assert b''.join(iter_encode([ '', 'h\uF7E9', '', 'llo'], 'x-user-defined')) == b'h\xe9llo' def test_x_user_defined(): encoded = b'2,\x0c\x0b\x1aO\xd9#\xcb\x0f\xc9\xbbt\xcf\xa8\xca' decoded = '2,\x0c\x0b\x1aO\uf7d9#\uf7cb\x0f\uf7c9\uf7bbt\uf7cf\uf7a8\uf7ca' encoded = b'aa' decoded = 'aa' assert decode(encoded, 'x-user-defined') == (decoded, lookup('x-user-defined')) assert encode(decoded, 'x-user-defined') == encoded PKd]webencodings/x_user_defined.pynu[# coding: utf-8 """ webencodings.x_user_defined ~~~~~~~~~~~~~~~~~~~~~~~~~~~ An implementation of the x-user-defined encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_literals import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self, input, errors='strict'): return codecs.charmap_encode(input, errors, encoding_table) def decode(self, input, errors='strict'): return codecs.charmap_decode(input, errors, decoding_table) class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, final=False): return codecs.charmap_encode(input, self.errors, encoding_table)[0] class IncrementalDecoder(codecs.IncrementalDecoder): def decode(self, input, final=False): return codecs.charmap_decode(input, self.errors, decoding_table)[0] class StreamWriter(Codec, codecs.StreamWriter): pass class StreamReader(Codec, codecs.StreamReader): pass ### encodings module API codec_info = codecs.CodecInfo( name='x-user-defined', encode=Codec().encode, decode=Codec().decode, incrementalencoder=IncrementalEncoder, incrementaldecoder=IncrementalDecoder, streamreader=StreamReader, streamwriter=StreamWriter, ) ### Decoding Table # Python 3: # for c in range(256): print(' %r' % chr(c if c < 128 else c + 0xF700)) decoding_table = ( '\x00' '\x01' '\x02' '\x03' '\x04' '\x05' '\x06' '\x07' '\x08' '\t' '\n' '\x0b' '\x0c' '\r' '\x0e' '\x0f' '\x10' '\x11' '\x12' '\x13' '\x14' '\x15' '\x16' '\x17' '\x18' '\x19' '\x1a' '\x1b' '\x1c' '\x1d' '\x1e' '\x1f' ' ' '!' '"' '#' '$' '%' '&' "'" '(' ')' '*' '+' ',' '-' '.' '/' '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' ':' ';' '<' '=' '>' '?' '@' 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z' '[' '\\' ']' '^' '_' '`' 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z' '{' '|' '}' '~' '\x7f' '\uf780' '\uf781' '\uf782' '\uf783' '\uf784' '\uf785' '\uf786' '\uf787' '\uf788' '\uf789' '\uf78a' '\uf78b' '\uf78c' '\uf78d' '\uf78e' '\uf78f' '\uf790' '\uf791' '\uf792' '\uf793' '\uf794' '\uf795' '\uf796' '\uf797' '\uf798' '\uf799' '\uf79a' '\uf79b' '\uf79c' '\uf79d' '\uf79e' '\uf79f' '\uf7a0' '\uf7a1' '\uf7a2' '\uf7a3' '\uf7a4' '\uf7a5' '\uf7a6' '\uf7a7' '\uf7a8' '\uf7a9' '\uf7aa' '\uf7ab' '\uf7ac' '\uf7ad' '\uf7ae' '\uf7af' '\uf7b0' '\uf7b1' '\uf7b2' '\uf7b3' '\uf7b4' '\uf7b5' '\uf7b6' '\uf7b7' '\uf7b8' '\uf7b9' '\uf7ba' '\uf7bb' '\uf7bc' '\uf7bd' '\uf7be' '\uf7bf' '\uf7c0' '\uf7c1' '\uf7c2' '\uf7c3' '\uf7c4' '\uf7c5' '\uf7c6' '\uf7c7' '\uf7c8' '\uf7c9' '\uf7ca' '\uf7cb' '\uf7cc' '\uf7cd' '\uf7ce' '\uf7cf' '\uf7d0' '\uf7d1' '\uf7d2' '\uf7d3' '\uf7d4' '\uf7d5' '\uf7d6' '\uf7d7' '\uf7d8' '\uf7d9' '\uf7da' '\uf7db' '\uf7dc' '\uf7dd' '\uf7de' '\uf7df' '\uf7e0' '\uf7e1' '\uf7e2' '\uf7e3' '\uf7e4' '\uf7e5' '\uf7e6' '\uf7e7' '\uf7e8' '\uf7e9' '\uf7ea' '\uf7eb' '\uf7ec' '\uf7ed' '\uf7ee' '\uf7ef' '\uf7f0' '\uf7f1' '\uf7f2' '\uf7f3' '\uf7f4' '\uf7f5' '\uf7f6' '\uf7f7' '\uf7f8' '\uf7f9' '\uf7fa' '\uf7fb' '\uf7fc' '\uf7fd' '\uf7fe' '\uf7ff' ) ### Encoding table encoding_table = codecs.charmap_build(decoding_table) PKd]ǭ##webencodings/labels.pynu[""" webencodings.labels ~~~~~~~~~~~~~~~~~~~ Map encoding labels to their name. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ # XXX Do not edit! # This file is automatically generated by mklabels.py LABELS = { 'unicode-1-1-utf-8': 'utf-8', 'utf-8': 'utf-8', 'utf8': 'utf-8', '866': 'ibm866', 'cp866': 'ibm866', 'csibm866': 'ibm866', 'ibm866': 'ibm866', 'csisolatin2': 'iso-8859-2', 'iso-8859-2': 'iso-8859-2', 'iso-ir-101': 'iso-8859-2', 'iso8859-2': 'iso-8859-2', 'iso88592': 'iso-8859-2', 'iso_8859-2': 'iso-8859-2', 'iso_8859-2:1987': 'iso-8859-2', 'l2': 'iso-8859-2', 'latin2': 'iso-8859-2', 'csisolatin3': 'iso-8859-3', 'iso-8859-3': 'iso-8859-3', 'iso-ir-109': 'iso-8859-3', 'iso8859-3': 'iso-8859-3', 'iso88593': 'iso-8859-3', 'iso_8859-3': 'iso-8859-3', 'iso_8859-3:1988': 'iso-8859-3', 'l3': 'iso-8859-3', 'latin3': 'iso-8859-3', 'csisolatin4': 'iso-8859-4', 'iso-8859-4': 'iso-8859-4', 'iso-ir-110': 'iso-8859-4', 'iso8859-4': 'iso-8859-4', 'iso88594': 'iso-8859-4', 'iso_8859-4': 'iso-8859-4', 'iso_8859-4:1988': 'iso-8859-4', 'l4': 'iso-8859-4', 'latin4': 'iso-8859-4', 'csisolatincyrillic': 'iso-8859-5', 'cyrillic': 'iso-8859-5', 'iso-8859-5': 'iso-8859-5', 'iso-ir-144': 'iso-8859-5', 'iso8859-5': 'iso-8859-5', 'iso88595': 'iso-8859-5', 'iso_8859-5': 'iso-8859-5', 'iso_8859-5:1988': 'iso-8859-5', 'arabic': 'iso-8859-6', 'asmo-708': 'iso-8859-6', 'csiso88596e': 'iso-8859-6', 'csiso88596i': 'iso-8859-6', 'csisolatinarabic': 'iso-8859-6', 'ecma-114': 'iso-8859-6', 'iso-8859-6': 'iso-8859-6', 'iso-8859-6-e': 'iso-8859-6', 'iso-8859-6-i': 'iso-8859-6', 'iso-ir-127': 'iso-8859-6', 'iso8859-6': 'iso-8859-6', 'iso88596': 'iso-8859-6', 'iso_8859-6': 'iso-8859-6', 'iso_8859-6:1987': 'iso-8859-6', 'csisolatingreek': 'iso-8859-7', 'ecma-118': 'iso-8859-7', 'elot_928': 'iso-8859-7', 'greek': 'iso-8859-7', 'greek8': 'iso-8859-7', 'iso-8859-7': 'iso-8859-7', 'iso-ir-126': 'iso-8859-7', 'iso8859-7': 'iso-8859-7', 'iso88597': 'iso-8859-7', 'iso_8859-7': 'iso-8859-7', 'iso_8859-7:1987': 'iso-8859-7', 'sun_eu_greek': 'iso-8859-7', 'csiso88598e': 'iso-8859-8', 'csisolatinhebrew': 'iso-8859-8', 'hebrew': 'iso-8859-8', 'iso-8859-8': 'iso-8859-8', 'iso-8859-8-e': 'iso-8859-8', 'iso-ir-138': 'iso-8859-8', 'iso8859-8': 'iso-8859-8', 'iso88598': 'iso-8859-8', 'iso_8859-8': 'iso-8859-8', 'iso_8859-8:1988': 'iso-8859-8', 'visual': 'iso-8859-8', 'csiso88598i': 'iso-8859-8-i', 'iso-8859-8-i': 'iso-8859-8-i', 'logical': 'iso-8859-8-i', 'csisolatin6': 'iso-8859-10', 'iso-8859-10': 'iso-8859-10', 'iso-ir-157': 'iso-8859-10', 'iso8859-10': 'iso-8859-10', 'iso885910': 'iso-8859-10', 'l6': 'iso-8859-10', 'latin6': 'iso-8859-10', 'iso-8859-13': 'iso-8859-13', 'iso8859-13': 'iso-8859-13', 'iso885913': 'iso-8859-13', 'iso-8859-14': 'iso-8859-14', 'iso8859-14': 'iso-8859-14', 'iso885914': 'iso-8859-14', 'csisolatin9': 'iso-8859-15', 'iso-8859-15': 'iso-8859-15', 'iso8859-15': 'iso-8859-15', 'iso885915': 'iso-8859-15', 'iso_8859-15': 'iso-8859-15', 'l9': 'iso-8859-15', 'iso-8859-16': 'iso-8859-16', 'cskoi8r': 'koi8-r', 'koi': 'koi8-r', 'koi8': 'koi8-r', 'koi8-r': 'koi8-r', 'koi8_r': 'koi8-r', 'koi8-u': 'koi8-u', 'csmacintosh': 'macintosh', 'mac': 'macintosh', 'macintosh': 'macintosh', 'x-mac-roman': 'macintosh', 'dos-874': 'windows-874', 'iso-8859-11': 'windows-874', 'iso8859-11': 'windows-874', 'iso885911': 'windows-874', 'tis-620': 'windows-874', 'windows-874': 'windows-874', 'cp1250': 'windows-1250', 'windows-1250': 'windows-1250', 'x-cp1250': 'windows-1250', 'cp1251': 'windows-1251', 'windows-1251': 'windows-1251', 'x-cp1251': 'windows-1251', 'ansi_x3.4-1968': 'windows-1252', 'ascii': 'windows-1252', 'cp1252': 'windows-1252', 'cp819': 'windows-1252', 'csisolatin1': 'windows-1252', 'ibm819': 'windows-1252', 'iso-8859-1': 'windows-1252', 'iso-ir-100': 'windows-1252', 'iso8859-1': 'windows-1252', 'iso88591': 'windows-1252', 'iso_8859-1': 'windows-1252', 'iso_8859-1:1987': 'windows-1252', 'l1': 'windows-1252', 'latin1': 'windows-1252', 'us-ascii': 'windows-1252', 'windows-1252': 'windows-1252', 'x-cp1252': 'windows-1252', 'cp1253': 'windows-1253', 'windows-1253': 'windows-1253', 'x-cp1253': 'windows-1253', 'cp1254': 'windows-1254', 'csisolatin5': 'windows-1254', 'iso-8859-9': 'windows-1254', 'iso-ir-148': 'windows-1254', 'iso8859-9': 'windows-1254', 'iso88599': 'windows-1254', 'iso_8859-9': 'windows-1254', 'iso_8859-9:1989': 'windows-1254', 'l5': 'windows-1254', 'latin5': 'windows-1254', 'windows-1254': 'windows-1254', 'x-cp1254': 'windows-1254', 'cp1255': 'windows-1255', 'windows-1255': 'windows-1255', 'x-cp1255': 'windows-1255', 'cp1256': 'windows-1256', 'windows-1256': 'windows-1256', 'x-cp1256': 'windows-1256', 'cp1257': 'windows-1257', 'windows-1257': 'windows-1257', 'x-cp1257': 'windows-1257', 'cp1258': 'windows-1258', 'windows-1258': 'windows-1258', 'x-cp1258': 'windows-1258', 'x-mac-cyrillic': 'x-mac-cyrillic', 'x-mac-ukrainian': 'x-mac-cyrillic', 'chinese': 'gbk', 'csgb2312': 'gbk', 'csiso58gb231280': 'gbk', 'gb2312': 'gbk', 'gb_2312': 'gbk', 'gb_2312-80': 'gbk', 'gbk': 'gbk', 'iso-ir-58': 'gbk', 'x-gbk': 'gbk', 'gb18030': 'gb18030', 'hz-gb-2312': 'hz-gb-2312', 'big5': 'big5', 'big5-hkscs': 'big5', 'cn-big5': 'big5', 'csbig5': 'big5', 'x-x-big5': 'big5', 'cseucpkdfmtjapanese': 'euc-jp', 'euc-jp': 'euc-jp', 'x-euc-jp': 'euc-jp', 'csiso2022jp': 'iso-2022-jp', 'iso-2022-jp': 'iso-2022-jp', 'csshiftjis': 'shift_jis', 'ms_kanji': 'shift_jis', 'shift-jis': 'shift_jis', 'shift_jis': 'shift_jis', 'sjis': 'shift_jis', 'windows-31j': 'shift_jis', 'x-sjis': 'shift_jis', 'cseuckr': 'euc-kr', 'csksc56011987': 'euc-kr', 'euc-kr': 'euc-kr', 'iso-ir-149': 'euc-kr', 'korean': 'euc-kr', 'ks_c_5601-1987': 'euc-kr', 'ks_c_5601-1989': 'euc-kr', 'ksc5601': 'euc-kr', 'ksc_5601': 'euc-kr', 'windows-949': 'euc-kr', 'csiso2022kr': 'iso-2022-kr', 'iso-2022-kr': 'iso-2022-kr', 'utf-16be': 'utf-16be', 'utf-16': 'utf-16le', 'utf-16le': 'utf-16le', 'x-user-defined': 'x-user-defined', } PKd]xqS)S)webencodings/__init__.pynu[# coding: utf-8 """ webencodings ~~~~~~~~~~~~ This is a Python implementation of the `WHATWG Encoding standard `. See README for details. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_literals import codecs from .labels import LABELS VERSION = '0.5.1' # Some names in Encoding are not valid Python aliases. Remap these. PYTHON_NAMES = { 'iso-8859-8-i': 'iso-8859-8', 'x-mac-cyrillic': 'mac-cyrillic', 'macintosh': 'mac-roman', 'windows-874': 'cp874'} CACHE = {} def ascii_lower(string): r"""Transform (only) ASCII letters to lower case: A-Z is mapped to a-z. :param string: An Unicode string. :returns: A new Unicode string. This is used for `ASCII case-insensitive `_ matching of encoding labels. The same matching is also used, among other things, for `CSS keywords `_. This is different from the :meth:`~py:str.lower` method of Unicode strings which also affect non-ASCII characters, sometimes mapping them into the ASCII range: >>> keyword = u'Bac\N{KELVIN SIGN}ground' >>> assert keyword.lower() == u'background' >>> assert ascii_lower(keyword) != keyword.lower() >>> assert ascii_lower(keyword) == u'bac\N{KELVIN SIGN}ground' """ # This turns out to be faster than unicode.translate() return string.encode('utf8').lower().decode('utf8') def lookup(label): """ Look for an encoding by its label. This is the spec’s `get an encoding `_ algorithm. Supported labels are listed there. :param label: A string. :returns: An :class:`Encoding` object, or :obj:`None` for an unknown label. """ # Only strip ASCII whitespace: U+0009, U+000A, U+000C, U+000D, and U+0020. label = ascii_lower(label.strip('\t\n\f\r ')) name = LABELS.get(label) if name is None: return None encoding = CACHE.get(name) if encoding is None: if name == 'x-user-defined': from .x_user_defined import codec_info else: python_name = PYTHON_NAMES.get(name, name) # Any python_name value that gets to here should be valid. codec_info = codecs.lookup(python_name) encoding = Encoding(name, codec_info) CACHE[name] = encoding return encoding def _get_encoding(encoding_or_label): """ Accept either an encoding object or label. :param encoding: An :class:`Encoding` object or a label string. :returns: An :class:`Encoding` object. :raises: :exc:`~exceptions.LookupError` for an unknown label. """ if hasattr(encoding_or_label, 'codec_info'): return encoding_or_label encoding = lookup(encoding_or_label) if encoding is None: raise LookupError('Unknown encoding label: %r' % encoding_or_label) return encoding class Encoding(object): """Reresents a character encoding such as UTF-8, that can be used for decoding or encoding. .. attribute:: name Canonical name of the encoding .. attribute:: codec_info The actual implementation of the encoding, a stdlib :class:`~codecs.CodecInfo` object. See :func:`codecs.register`. """ def __init__(self, name, codec_info): self.name = name self.codec_info = codec_info def __repr__(self): return '' % self.name #: The UTF-8 encoding. Should be used for new content and formats. UTF8 = lookup('utf-8') _UTF16LE = lookup('utf-16le') _UTF16BE = lookup('utf-16be') def decode(input, fallback_encoding, errors='replace'): """ Decode a single string. :param input: A byte string :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :return: A ``(output, encoding)`` tuple of an Unicode string and an :obj:`Encoding`. """ # Fail early if `encoding` is an invalid label. fallback_encoding = _get_encoding(fallback_encoding) bom_encoding, input = _detect_bom(input) encoding = bom_encoding or fallback_encoding return encoding.codec_info.decode(input, errors)[0], encoding def _detect_bom(input): """Return (bom_encoding, input), with any BOM removed from the input.""" if input.startswith(b'\xFF\xFE'): return _UTF16LE, input[2:] if input.startswith(b'\xFE\xFF'): return _UTF16BE, input[2:] if input.startswith(b'\xEF\xBB\xBF'): return UTF8, input[3:] return None, input def encode(input, encoding=UTF8, errors='strict'): """ Encode a single string. :param input: An Unicode string. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :return: A byte string. """ return _get_encoding(encoding).codec_info.encode(input, errors)[0] def iter_decode(input, fallback_encoding, errors='replace'): """ "Pull"-based decoder. :param input: An iterable of byte strings. The input is first consumed just enough to determine the encoding based on the precense of a BOM, then consumed on demand when the return value is. :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :returns: An ``(output, encoding)`` tuple. :obj:`output` is an iterable of Unicode strings, :obj:`encoding` is the :obj:`Encoding` that is being used. """ decoder = IncrementalDecoder(fallback_encoding, errors) generator = _iter_decode_generator(input, decoder) encoding = next(generator) return generator, encoding def _iter_decode_generator(input, decoder): """Return a generator that first yields the :obj:`Encoding`, then yields output chukns as Unicode strings. """ decode = decoder.decode input = iter(input) for chunck in input: output = decode(chunck) if output: assert decoder.encoding is not None yield decoder.encoding yield output break else: # Input exhausted without determining the encoding output = decode(b'', final=True) assert decoder.encoding is not None yield decoder.encoding if output: yield output return for chunck in input: output = decode(chunck) if output: yield output output = decode(b'', final=True) if output: yield output def iter_encode(input, encoding=UTF8, errors='strict'): """ “Pull”-based encoder. :param input: An iterable of Unicode strings. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :returns: An iterable of byte strings. """ # Fail early if `encoding` is an invalid label. encode = IncrementalEncoder(encoding, errors).encode return _iter_encode_generator(input, encode) def _iter_encode_generator(input, encode): for chunck in input: output = encode(chunck) if output: yield output output = encode('', final=True) if output: yield output class IncrementalDecoder(object): """ “Push”-based decoder. :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. """ def __init__(self, fallback_encoding, errors='replace'): # Fail early if `encoding` is an invalid label. self._fallback_encoding = _get_encoding(fallback_encoding) self._errors = errors self._buffer = b'' self._decoder = None #: The actual :class:`Encoding` that is being used, #: or :obj:`None` if that is not determined yet. #: (Ie. if there is not enough input yet to determine #: if there is a BOM.) self.encoding = None # Not known yet. def decode(self, input, final=False): """Decode one chunk of the input. :param input: A byte string. :param final: Indicate that no more input is available. Must be :obj:`True` if this is the last call. :returns: An Unicode string. """ decoder = self._decoder if decoder is not None: return decoder(input, final) input = self._buffer + input encoding, input = _detect_bom(input) if encoding is None: if len(input) < 3 and not final: # Not enough data yet. self._buffer = input return '' else: # No BOM encoding = self._fallback_encoding decoder = encoding.codec_info.incrementaldecoder(self._errors).decode self._decoder = decoder self.encoding = encoding return decoder(input, final) class IncrementalEncoder(object): """ “Push”-based encoder. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. .. method:: encode(input, final=False) :param input: An Unicode string. :param final: Indicate that no more input is available. Must be :obj:`True` if this is the last call. :returns: A byte string. """ def __init__(self, encoding=UTF8, errors='strict'): encoding = _get_encoding(encoding) self.encode = encoding.codec_info.incrementalencoder(errors).encode PKd]X+progress/__pycache__/counter.cpython-38.pycnu[U .e\@s`ddlmZddlmZmZGdddeZGdddeZGdd d eZGd d d eZd S) )unicode_literals)InfiniteProgressc@seZdZddZdS)CountercCs|t|jdSN)writestrindexselfr @/usr/lib/python3.8/site-packages/pip/_vendor/progress/counter.pyupdateszCounter.updateN__name__ __module__ __qualname__rr r r rrsrc@seZdZddZdS) CountdowncCs|t|jdSr)rr Z remainingr r r rrszCountdown.updateNrr r r rrsrc@seZdZdZddZdS)Stack)  u▁u▂u▃u▄u▅u▆u▇u█cCs6t|j}t|dt|j|}||j|dS)Nr)lenphasesminintZprogressr)r Znphasesir r rr"s z Stack.updateN)rrrrrr r r rrsrc@seZdZdZdS)Pie)u○u◔u◑u◕u●N)rrrrr r r rr(srN) Z __future__rrrrrrrr r r rs  PKd]- - 'progress/__pycache__/bar.cpython-38.pycnu[U .e& @sddlmZddlZddlmZGdddeZGdddeZGd d d eZGd d d eZGd ddeZ Gddde Z Gddde Z dS))unicode_literalsN)Progressc@s,eZdZdZdZdZdZdZdZddZ d S) Bar z%(index)d/%(max)dz |z|  #cCsjt|j|j}|j|}|j|}|j|}|j|}|j|}d||j|||j |g}| |dS)N) intwidthprogressmessagefill empty_fillsuffixjoin bar_prefix bar_suffixwriteln)selfZ filled_lengthZ empty_lengthr baremptyrliners  PKd]X1progress/__pycache__/counter.cpython-38.opt-1.pycnu[U .e\@s`ddlmZddlmZmZGdddeZGdddeZGdd d eZGd d d eZd S) )unicode_literals)InfiniteProgressc@seZdZddZdS)CountercCs|t|jdSN)writestrindexselfr @/usr/lib/python3.8/site-packages/pip/_vendor/progress/counter.pyupdateszCounter.updateN__name__ __module__ __qualname__rr r r rrsrc@seZdZddZdS) CountdowncCs|t|jdSr)rr Z remainingr r r rrszCountdown.updateNrr r r rrsrc@seZdZdZddZdS)Stack)  u▁u▂u▃u▄u▅u▆u▇u█cCs6t|j}t|dt|j|}||j|dS)Nr)lenphasesminintZprogressr)r Znphasesir r rr"s z Stack.updateN)rrrrrr r r rrsrc@seZdZdZdS)Pie)u○u◔u◑u◕u●N)rrrrr r r rr(srN) Z __future__rrrrrrrr r r rs  PKd] ,progress/__pycache__/__init__.cpython-38.pycnu[U .e@sddlmZmZddlmZddlmZddlmZddl m Z zddl m Z Wn e k rpddl m Z YnXdZd Zd ZGd d d eZGd ddeZdS))divisionprint_function)deque) timedelta)ceil)stderr) monotonic)timez1.5z[?25lz[?25hc@seZdZeZdZdZdZd&ddZddZ e dd Z e d d Z d d Z ddZddZddZddZddZddZddZd'ddZdd Zd!d"Zd#d$Zd%S)(Infinite TcKsd|_t|_d|_|j|_|j|_t|jd|_| D]\}}t |||q:d|_ ||_ |j r|r|jrttd|j dt|j d|j d|j dS)Nr)maxlenr endfile)indexrstart_tsavg_avg_update_ts_tsr sma_window_xputitemssetattr_widthmessageris_tty hide_cursorprint HIDE_CURSORflush)selfrkwargskeyvalr%A/usr/lib/python3.8/site-packages/pip/_vendor/progress/__init__.py__init__'szInfinite.__init__cCs|drdSt||dS)N_) startswithgetattr)r!r#r%r%r& __getitem__:s zInfinite.__getitem__cCstt|jSN)intrrr!r%r%r&elapsed?szInfinite.elapsedcCs t|jdSN)Zseconds)rr/r.r%r%r& elapsed_tdCszInfinite.elapsed_tdcCs`|dkr\t|j}|j||t}||jks@||jdkr\t|jt|j|_||_dS)Nr)lenrappendrrrsumr)r!ndtZxput_lennowr%r%r& update_avgGs   zInfinite.update_avgcCsdSr,r%r.r%r%r&updateRszInfinite.updatecCsdSr,r%r.r%r%r&startUszInfinite.startcCs"|jr|rtdd|jddS)Nz r r)rrrr.r%r%r&clearlnXszInfinite.clearlncCsT|jrP|rP|j||j}td|d|jdt|jt||_|jdS)N r r) rrrljustrrmaxr3r )r!sliner%r%r&write\s zInfinite.writecCs4|jr0|r0|t|d|jd|jdS)Nr r)rrr<rr )r!rAr%r%r&writelncszInfinite.writelncCs4|jr0|r0t|jd|jr0ttd|jddS)N)rr r)rrrr SHOW_CURSORr.r%r%r&finishis zInfinite.finishcCs|jr|jSdS)NT) check_ttyrisattyr.r%r%r&roszInfinite.is_ttyr2cCs:t}||j}|||||_|j||_|dSr,)rrr9rr:)r!r6r8r7r%r%r&nextrs    z Infinite.nextc cs,||D]}|V|q W5QRXdSr,)rHr!itxr%r%r&iterzsz Infinite.itercCs ||Sr,)r;r.r%r%r& __enter__szInfinite.__enter__cCs |dSr,)rE)r!exc_typeZexc_valZexc_tbr%r%r&__exit__szInfinite.__exit__N)r )r2)__name__ __module__ __qualname__rrrrFrr'r+propertyr/r1r9r:r;r<rBrCrErrHrLrMrOr%r%r%r&r !s,     r cspeZdZfddZeddZeddZeddZed d Zed d Z d dZ ddZ ddZ Z S)Progresscs$tt|j|||dd|_dS)Nr?d)superrTr'getr?)r!argsr" __class__r%r&r'szProgress.__init__cCstt|j|jSr,)r-rr remainingr.r%r%r&etasz Progress.etacCs t|jdSr0)rr\r.r%r%r&eta_tdszProgress.eta_tdcCs |jdS)NrU)progressr.r%r%r&percentszProgress.percentcCstd|j|jS)Nr2)minrr?r.r%r%r&r^szProgress.progresscCst|j|jdS)Nr)r?rr.r%r%r&r[szProgress.remainingcCs |dSr,)r:r.r%r%r&r;szProgress.startcCs||j}||dSr,)rrH)r!rZincrr%r%r&gotos z Progress.gotoc csPzt||_Wntk r"YnX||D]}|V|q.W5QRXdSr,)r3r? TypeErrorrHrIr%r%r&rLsz Progress.iter)rPrQrRr'rSr\r]r_r^r[r;rarL __classcell__r%r%rYr&rTs      rTN)Z __future__rr collectionsrZdatetimerZmathrsysrr r ImportError __version__rrDobjectr rTr%r%r%r&s    gPKd]BTT1progress/__pycache__/spinner.cpython-38.opt-1.pycnu[U .ed@slddlmZddlmZGdddeZGdddeZGdd d eZGd d d eZGd d d eZdS))unicode_literals)Infinitec@seZdZdZdZddZdS)Spinner)-\|/TcCs$|jt|j}||j|dS)N)indexlenphaseswrite)selfir@/usr/lib/python3.8/site-packages/pip/_vendor/progress/spinner.pyupdateszSpinner.updateN)__name__ __module__ __qualname__r Z hide_cursorrrrrrrsrc@seZdZddddgZdS) PieSpinneru◷u◶u◵u◴Nrrrr rrrrrsrc@seZdZddddgZdS) MoonSpinneru◑u◒u◐u◓Nrrrrrr"src@seZdZddddddgZdS) LineSpinneru⎺u⎻u⎼u⎽Nrrrrrr&src@s eZdZddddddddgZd S) PixelSpinneru⣾u⣷u⣯u⣟u⡿u⢿u⣻u⣽Nrrrrrr*srN) Z __future__rrrrrrrrrrrs   PKd]BTT+progress/__pycache__/spinner.cpython-38.pycnu[U .ed@slddlmZddlmZGdddeZGdddeZGdd d eZGd d d eZGd d d eZdS))unicode_literals)Infinitec@seZdZdZdZddZdS)Spinner)-\|/TcCs$|jt|j}||j|dS)N)indexlenphaseswrite)selfir@/usr/lib/python3.8/site-packages/pip/_vendor/progress/spinner.pyupdateszSpinner.updateN)__name__ __module__ __qualname__r Z hide_cursorrrrrrrsrc@seZdZddddgZdS) PieSpinneru◷u◶u◵u◴Nrrrr rrrrrsrc@seZdZddddgZdS) MoonSpinneru◑u◒u◐u◓Nrrrrrr"src@seZdZddddddgZdS) LineSpinneru⎺u⎻u⎼u⎽Nrrrrrr&src@s eZdZddddddddgZd S) PixelSpinneru⣾u⣷u⣯u⣟u⡿u⢿u⣻u⣽Nrrrrrr*srN) Z __future__rrrrrrrrrrrs   PKd] 2progress/__pycache__/__init__.cpython-38.opt-1.pycnu[U .e@sddlmZmZddlmZddlmZddlmZddl m Z zddl m Z Wn e k rpddl m Z YnXdZd Zd ZGd d d eZGd ddeZdS))divisionprint_function)deque) timedelta)ceil)stderr) monotonic)timez1.5z[?25lz[?25hc@seZdZeZdZdZdZd&ddZddZ e dd Z e d d Z d d Z ddZddZddZddZddZddZddZd'ddZdd Zd!d"Zd#d$Zd%S)(Infinite TcKsd|_t|_d|_|j|_|j|_t|jd|_| D]\}}t |||q:d|_ ||_ |j r|r|jrttd|j dt|j d|j d|j dS)Nr)maxlenr endfile)indexrstart_tsavg_avg_update_ts_tsr sma_window_xputitemssetattr_widthmessageris_tty hide_cursorprint HIDE_CURSORflush)selfrkwargskeyvalr%A/usr/lib/python3.8/site-packages/pip/_vendor/progress/__init__.py__init__'szInfinite.__init__cCs|drdSt||dS)N_) startswithgetattr)r!r#r%r%r& __getitem__:s zInfinite.__getitem__cCstt|jSN)intrrr!r%r%r&elapsed?szInfinite.elapsedcCs t|jdSN)Zseconds)rr/r.r%r%r& elapsed_tdCszInfinite.elapsed_tdcCs`|dkr\t|j}|j||t}||jks@||jdkr\t|jt|j|_||_dS)Nr)lenrappendrrrsumr)r!ndtZxput_lennowr%r%r& update_avgGs   zInfinite.update_avgcCsdSr,r%r.r%r%r&updateRszInfinite.updatecCsdSr,r%r.r%r%r&startUszInfinite.startcCs"|jr|rtdd|jddS)Nz r r)rrrr.r%r%r&clearlnXszInfinite.clearlncCsT|jrP|rP|j||j}td|d|jdt|jt||_|jdS)N r r) rrrljustrrmaxr3r )r!sliner%r%r&write\s zInfinite.writecCs4|jr0|r0|t|d|jd|jdS)Nr r)rrr<rr )r!rAr%r%r&writelncszInfinite.writelncCs4|jr0|r0t|jd|jr0ttd|jddS)N)rr r)rrrr SHOW_CURSORr.r%r%r&finishis zInfinite.finishcCs|jr|jSdS)NT) check_ttyrisattyr.r%r%r&roszInfinite.is_ttyr2cCs:t}||j}|||||_|j||_|dSr,)rrr9rr:)r!r6r8r7r%r%r&nextrs    z Infinite.nextc cs,||D]}|V|q W5QRXdSr,)rHr!itxr%r%r&iterzsz Infinite.itercCs ||Sr,)r;r.r%r%r& __enter__szInfinite.__enter__cCs |dSr,)rE)r!exc_typeZexc_valZexc_tbr%r%r&__exit__szInfinite.__exit__N)r )r2)__name__ __module__ __qualname__rrrrFrr'r+propertyr/r1r9r:r;r<rBrCrErrHrLrMrOr%r%r%r&r !s,     r cspeZdZfddZeddZeddZeddZed d Zed d Z d dZ ddZ ddZ Z S)Progresscs$tt|j|||dd|_dS)Nr?d)superrTr'getr?)r!argsr" __class__r%r&r'szProgress.__init__cCstt|j|jSr,)r-rr remainingr.r%r%r&etasz Progress.etacCs t|jdSr0)rr\r.r%r%r&eta_tdszProgress.eta_tdcCs |jdS)NrU)progressr.r%r%r&percentszProgress.percentcCstd|j|jS)Nr2)minrr?r.r%r%r&r^szProgress.progresscCst|j|jdS)Nr)r?rr.r%r%r&r[szProgress.remainingcCs |dSr,)r:r.r%r%r&r;szProgress.startcCs||j}||dSr,)rrH)r!rZincrr%r%r&gotos z Progress.gotoc csPzt||_Wntk r"YnX||D]}|V|q.W5QRXdSr,)r3r? TypeErrorrHrIr%r%r&rLsz Progress.iter)rPrQrRr'rSr\r]r_r^r[r;rarL __classcell__r%r%rYr&rTs      rTN)Z __future__rr collectionsrZdatetimerZmathrsysrr r ImportError __version__rrDobjectr rTr%r%r%r&s    gPKd]- - -progress/__pycache__/bar.cpython-38.opt-1.pycnu[U .e& @sddlmZddlZddlmZGdddeZGdddeZGd d d eZGd d d eZGd ddeZ Gddde Z Gddde Z dS))unicode_literalsN)Progressc@s,eZdZdZdZdZdZdZdZddZ d S) Bar z%(index)d/%(max)dz |z|  #cCsjt|j|j}|j|}|j|}|j|}|j|}|j|}d||j|||j |g}| |dS)N) intwidthprogressmessagefill empty_fillsuffixjoin bar_prefix bar_suffixwriteln)selfZ filled_lengthZ empty_lengthr baremptyrliners  PKd]̵& & progress/bar.pynu[# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. from __future__ import unicode_literals import sys from . import Progress class Bar(Progress): width = 32 suffix = '%(index)d/%(max)d' bar_prefix = ' |' bar_suffix = '| ' empty_fill = ' ' fill = '#' def update(self): filled_length = int(self.width * self.progress) empty_length = self.width - filled_length message = self.message % self bar = self.fill * filled_length empty = self.empty_fill * empty_length suffix = self.suffix % self line = ''.join([message, self.bar_prefix, bar, empty, self.bar_suffix, suffix]) self.writeln(line) class ChargingBar(Bar): suffix = '%(percent)d%%' bar_prefix = ' ' bar_suffix = ' ' empty_fill = '∙' fill = '█' class FillingSquaresBar(ChargingBar): empty_fill = '▢' fill = '▣' class FillingCirclesBar(ChargingBar): empty_fill = '◯' fill = '◉' class IncrementalBar(Bar): if sys.platform.startswith('win'): phases = (u' ', u'▌', u'█') else: phases = (' ', '▏', '▎', '▍', '▌', '▋', '▊', '▉', '█') def update(self): nphases = len(self.phases) filled_len = self.width * self.progress nfull = int(filled_len) # Number of full chars phase = int((filled_len - nfull) * nphases) # Phase of last char nempty = self.width - nfull # Number of empty chars message = self.message % self bar = self.phases[-1] * nfull current = self.phases[phase] if phase > 0 else '' empty = self.empty_fill * max(0, nempty - len(current)) suffix = self.suffix % self line = ''.join([message, self.bar_prefix, bar, current, empty, self.bar_suffix, suffix]) self.writeln(line) class PixelBar(IncrementalBar): phases = ('⡀', '⡄', '⡆', '⡇', '⣇', '⣧', '⣷', '⣿') class ShadyBar(IncrementalBar): phases = (' ', '░', '▒', '▓', '█') PKd]/ݺddprogress/spinner.pynu[# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. from __future__ import unicode_literals from . import Infinite class Spinner(Infinite): phases = ('-', '\\', '|', '/') hide_cursor = True def update(self): i = self.index % len(self.phases) self.write(self.phases[i]) class PieSpinner(Spinner): phases = ['◷', '◶', '◵', '◴'] class MoonSpinner(Spinner): phases = ['◑', '◒', '◐', '◓'] class LineSpinner(Spinner): phases = ['⎺', '⎻', '⎼', '⎽', '⎼', '⎻'] class PixelSpinner(Spinner): phases = ['⣾', '⣷', '⣯', '⣟', '⡿', '⢿', '⣻', '⣽'] PKd]BiKprogress/__init__.pynu[# Copyright (c) 2012 Giorgos Verigakis # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. from __future__ import division, print_function from collections import deque from datetime import timedelta from math import ceil from sys import stderr try: from time import monotonic except ImportError: from time import time as monotonic __version__ = '1.5' HIDE_CURSOR = '\x1b[?25l' SHOW_CURSOR = '\x1b[?25h' class Infinite(object): file = stderr sma_window = 10 # Simple Moving Average window check_tty = True hide_cursor = True def __init__(self, message='', **kwargs): self.index = 0 self.start_ts = monotonic() self.avg = 0 self._avg_update_ts = self.start_ts self._ts = self.start_ts self._xput = deque(maxlen=self.sma_window) for key, val in kwargs.items(): setattr(self, key, val) self._width = 0 self.message = message if self.file and self.is_tty(): if self.hide_cursor: print(HIDE_CURSOR, end='', file=self.file) print(self.message, end='', file=self.file) self.file.flush() def __getitem__(self, key): if key.startswith('_'): return None return getattr(self, key, None) @property def elapsed(self): return int(monotonic() - self.start_ts) @property def elapsed_td(self): return timedelta(seconds=self.elapsed) def update_avg(self, n, dt): if n > 0: xput_len = len(self._xput) self._xput.append(dt / n) now = monotonic() # update when we're still filling _xput, then after every second if (xput_len < self.sma_window or now - self._avg_update_ts > 1): self.avg = sum(self._xput) / len(self._xput) self._avg_update_ts = now def update(self): pass def start(self): pass def clearln(self): if self.file and self.is_tty(): print('\r\x1b[K', end='', file=self.file) def write(self, s): if self.file and self.is_tty(): line = self.message + s.ljust(self._width) print('\r' + line, end='', file=self.file) self._width = max(self._width, len(s)) self.file.flush() def writeln(self, line): if self.file and self.is_tty(): self.clearln() print(line, end='', file=self.file) self.file.flush() def finish(self): if self.file and self.is_tty(): print(file=self.file) if self.hide_cursor: print(SHOW_CURSOR, end='', file=self.file) def is_tty(self): return self.file.isatty() if self.check_tty else True def next(self, n=1): now = monotonic() dt = now - self._ts self.update_avg(n, dt) self._ts = now self.index = self.index + n self.update() def iter(self, it): with self: for x in it: yield x self.next() def __enter__(self): self.start() return self def __exit__(self, exc_type, exc_val, exc_tb): self.finish() class Progress(Infinite): def __init__(self, *args, **kwargs): super(Progress, self).__init__(*args, **kwargs) self.max = kwargs.get('max', 100) @property def eta(self): return int(ceil(self.avg * self.remaining)) @property def eta_td(self): return timedelta(seconds=self.eta) @property def percent(self): return self.progress * 100 @property def progress(self): return min(1, self.index / self.max) @property def remaining(self): return max(self.max - self.index, 0) def start(self): self.update() def goto(self, index): incr = index - self.index self.next(incr) def iter(self, it): try: self.max = len(it) except TypeError: pass with self: for x in it: yield x self.next() PKd]xแ\\progress/counter.pynu[# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. from __future__ import unicode_literals from . import Infinite, Progress class Counter(Infinite): def update(self): self.write(str(self.index)) class Countdown(Progress): def update(self): self.write(str(self.remaining)) class Stack(Progress): phases = (' ', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def update(self): nphases = len(self.phases) i = min(nphases - 1, int(self.progress * nphases)) self.write(self.phases[i]) class Pie(Stack): phases = ('○', '◔', '◑', '◕', '●') PKd]oϨ4html5lib/__pycache__/_tokenizer.cpython-38.opt-1.pycnu[U .e$+@sddlmZmZmZddlmZddlmZddl m Z ddl m Z ddl m Z m Z ddl mZmZmZdd l mZmZdd l mZdd lmZdd lmZee ZGd ddeZdS))absolute_importdivisionunicode_literals)unichr)deque)spaceCharacters)entities) asciiLettersasciiUpper2Lower)digits hexDigitsEOF) tokenTypes tagTokenTypes)replacementCharacters)HTMLInputStream)TriecsdeZdZdZdfdd ZddZddZdd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'dLdMZ(dNdOZ)dPdQZ*dRdSZ+dTdUZ,dVdWZ-dXdYZ.dZd[Z/d\d]Z0d^d_Z1d`daZ2dbdcZ3dddeZ4dfdgZ5dhdiZ6djdkZ7dldmZ8dndoZ9dpdqZ:drdsZ;dtduZdzd{Z?d|d}Z@d~dZAddZBddZCddZDddZEddZFddZGddZHddZIddZJddZKddZLZMS) HTMLTokenizera  This class takes care of tokenizing HTML. * self.currentToken Holds the token that is currently being processed. * self.state Holds a reference to the method to be invoked... XXX * self.stream Points to HTMLInputStream object. Nc sFt|f||_||_d|_g|_|j|_d|_d|_t t | dS)NF) rstreamparserZ escapeFlagZ lastFourChars dataStatestateescape currentTokensuperr__init__)selfrrkwargs __class__C/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_tokenizer.pyr"szHTMLTokenizer.__init__ccsPtg|_|rL|jjr6td|jjddVq|jr |jVq6q dS)z This is where the magic happens. We do our usually processing through the states and when we have a token to return we yield the token which pauses processing until the next token is requested. ParseErrorrtypedataN)r tokenQueuerrerrorsrpoppopleftrr!r!r"__iter__1s  zHTMLTokenizer.__iter__c %Cst}d}|rt}d}g}|j}||krH|tk rH|||j}q"td||}|tkrt|}|j t ddd|idnbd|krd ksn|d krd }|j t ddd|idn d |krd ksnd|krdksnd|krdksnd|kr,dksn|t ddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d g#kr|j t ddd|idz t |}Wn>t k r|d6}t d|d?Bt d7|d8@B}YnX|d9kr|j t dd:d;|j||S)r#z'expected-tag-name-but-got-right-bracketr$rOz<>?z'expected-tag-name-but-got-question-markzexpected-tag-namerHT)rr:markupDeclarationOpenStatercloseTagOpenStater rr tagNameStater'r;rrAbogusCommentStaterpr!r!r"rcis@           zHTMLTokenizer.tagOpenStatecCs|j}|tkr0td|gdd|_|j|_n|dkrX|jtddd|j |_nn|t kr|jtddd|jtd d d|j |_n0|jtdd d |id |j ||j |_dS)NrZFr%rYr&r[rtr#z*expected-closing-tag-but-got-right-bracketr$z expected-closing-tag-but-got-eofrOr'r;rrrscriptDataDoubleEscapedStaterrr rArpr!r!r"rs    z.HTMLTokenizer.scriptDataDoubleEscapeStartStatecCs|j}|dkr2|jtddd|j|_n|dkrZ|jtddd|j|_nt|dkr|jtddd|jtdddn>|tkr|jtdd d|j |_n|jtd|dd S NrrOr$rHr_r#r`r2eof-in-script-in-scriptT) rr:r'r;r scriptDataDoubleEscapedDashStater(scriptDataDoubleEscapedLessThanSignStaterrrpr!r!r"rs*        z*HTMLTokenizer.scriptDataDoubleEscapedStatecCs|j}|dkr2|jtddd|j|_n|dkrZ|jtddd|j|_n|dkr|jtddd|jtddd|j|_nF|t kr|jtdd d|j |_n|jtd|d|j|_d Sr) rr:r'r;r$scriptDataDoubleEscapedDashDashStaterrrrrrpr!r!r"rs.        z.HTMLTokenizer.scriptDataDoubleEscapedDashStatecCs|j}|dkr*|jtdddn|dkrR|jtddd|j|_n|dkrz|jtddd|j|_n|dkr|jtddd|jtdd d|j|_nF|t kr|jtdd d|j |_n|jtd|d|j|_d S) NrrOr$rHrtr_r#r`r2rT) rr:r'r;rrrrorrrrpr!r!r"rs2        z2HTMLTokenizer.scriptDataDoubleEscapedDashDashStatecCsP|j}|dkr8|jtdddd|_|j|_n|j||j |_dS)NrsrOr$r/T) rr:r'r;rrscriptDataDoubleEscapeEndStaterrArrpr!r!r"r0s   z6HTMLTokenizer.scriptDataDoubleEscapedLessThanSignStatecCs|j}|ttdBkrR|jtd|d|jdkrH|j |_ q|j |_ nB|t kr|jtd|d|j|7_n|j ||j |_ dSr)rr:rr>r'r;rrrrrrr rArpr!r!r"r;s    z,HTMLTokenizer.scriptDataDoubleEscapeEndStatecCs0|j}|tkr$|jtdn|tkrJ|jd|dg|j|_n|dkr\| n|dkrn|j |_n|dkr|j t ddd |jd|dg|j|_n|d kr|j t dd d |jdd dg|j|_nF|t kr|j t dd d |j|_n|jd|dg|j|_dS)NTr&r/rtrs)'"rMrHr##invalid-character-in-attribute-namer$r_r`r2z#expected-attribute-name-but-got-eof)rr:rrdr rr;attributeNameStaterr^r}r'rrrrpr!r!r"r|Ks<           z&HTMLTokenizer.beforeAttributeNameStatecCs|j}d}d}|dkr&|j|_n.|tkr\|jddd||jtd7<d}n|dkrjd}n|tkr||j|_n|dkr|j |_n|d kr|j t d d d |jdddd 7<d}n|dkr |j t d dd |jddd|7<d}nH|t kr6|j t d dd |j|_n|jddd|7<d}|r|jdddt|jddd<|jdddD]>\}}|jddd|kr|j t d dd qҐq|r|dS)NTFrMr&rJrrtrsr_r#r`r$r2rrrHrzeof-in-attribute-namezduplicate-attribute)rr:beforeAttributeValueStaterr rrdrafterAttributeNameStater}r'r;rrrr\r r^)rr&ZleavingThisStateZ emitTokenrY_r!r!r"ris^             z HTMLTokenizer.attributeNameStatecCsD|j}|tkr$|jtdn|dkr8|j|_n|dkrJ|n|tkrp|jd |dg|j |_n|dkr|j |_n|dkr|j t dd d |jd d dg|j |_n|d kr|j t dd d |jd |dg|j |_nF|tkr$|j t ddd |j|_n|jd |dg|j |_dS)NTrMrtr&r/rsr_r#r`r$r2rz&invalid-character-after-attribute-namezexpected-end-of-tag-but-got-eof)rr:rrdrrr^r rr;rr}r'rrrrpr!r!r"rs@            z%HTMLTokenizer.afterAttributeNameStatecCsh|j}|tkr$|jtdn@|dkr8|j|_n,|dkrX|j|_|j|n |dkrj|j|_n|dkr|j t ddd| n|d kr|j t dd d|j d d d d7<|j|_n|dkr|j t ddd|j d d d |7<|j|_nL|tkrB|j t ddd|j|_n"|j d d d |7<|j|_dS)NTrrGrrtr#z.expected-attribute-value-but-got-right-bracketr$r_r`r&rJrr2)rMrH`z"equals-in-unquoted-attribute-valuez$expected-attribute-value-but-got-eof)rr:rrdattributeValueDoubleQuotedStaterattributeValueUnQuotedStaterAattributeValueSingleQuotedStater'r;rr^rrrrpr!r!r"rsF             z'HTMLTokenizer.beforeAttributeValueStatecCs|j}|dkr|j|_n|dkr0|dn|dkrj|jtddd|jddd d 7<nN|t kr|jtdd d|j |_n&|jddd ||j d 7<d S)NrrGr_r#r`r$r&rJrr2z#eof-in-attribute-value-double-quote)rrGr_T rr:afterAttributeValueStaterrXr'r;rrrrrdrpr!r!r"rs&       z-HTMLTokenizer.attributeValueDoubleQuotedStatecCs|j}|dkr|j|_n|dkr0|dn|dkrj|jtddd|jddd d 7<nN|t kr|jtdd d|j |_n&|jddd ||j d 7<d S)NrrGr_r#r`r$r&rJrr2z#eof-in-attribute-value-single-quote)rrGr_Trrpr!r!r"rs&       z-HTMLTokenizer.attributeValueSingleQuotedStatecCs|j}|tkr|j|_n|dkr0|dn|dkrB|n|dkr||jt ddd|j ddd |7<n|d kr|jt dd d|j ddd d 7<nV|t kr|jt dd d|j |_n.|j ddd ||j tdtB7<dS)NrGrt)rrrMrHrr#z0unexpected-character-in-unquoted-attribute-valuer$r&rJrr_r`r2z eof-in-attribute-value-no-quotes)rGrtrrrMrHrr_T)rr:rr|rrXr^r'r;rrrrrdr>rpr!r!r"rs4         z)HTMLTokenizer.attributeValueUnQuotedStatecCs|j}|tkr|j|_n|dkr.|np|dkr@|j|_n^|tkrt|j t ddd|j ||j |_n*|j t ddd|j ||j|_dS)Nrtrsr#z$unexpected-EOF-after-attribute-valuer$z*unexpected-character-after-attribute-valueT) rr:rr|rr^r}rr'r;rrArrpr!r!r"r s&         z&HTMLTokenizer.afterAttributeValueStatecCs|j}|dkr&d|jd<|n^|tkrZ|jtddd|j||j |_ n*|jtddd|j||j |_ dS)NrtTr[r#z#unexpected-EOF-after-solidus-in-tagr$z)unexpected-character-after-solidus-in-tag) rr:rr^rr'r;rrArrr|rpr!r!r"r}4s         z&HTMLTokenizer.selfClosingStartTagStatecCsD|jd}|dd}|jtd|d|j|j|_dS)Nrtr_r2Commentr$T) rrdreplacer'r;rr:rrrpr!r!r"ryFs    zHTMLTokenizer.bogusCommentStatecCs|jg}|ddkrR||j|ddkrPtddd|_|j|_dSn|ddkrd}dD](}||j|d|krfd }qqf|rtd ddddd |_|j|_dSn|dd krD|jdk rD|jj j rD|jj j dj |jj j krDd}d D].}||j|d|krd }q2q|rD|j |_dS|jtddd|rt|j|qZ|j|_dS)NrJrrr/r$T)dD))oOrDCtTyYpPeEFZDoctype)r%rYpublicIdsystemIdcorrect[)rrArrrr#zexpected-dashes-or-doctype)rr:r;rrcommentStartStater doctypeStaterZtreeZ openElements namespaceZdefaultNamespacecdataSectionStater'rAr)ry)rrCmatchedexpectedr!r!r"rvUs\       z(HTMLTokenizer.markupDeclarationOpenStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd d|j|j|j|_nP|t kr|jtdd d|j|j|j|_n|jd|7<|j |_d S) Nrr_r#r`r$r&r2rtincorrect-commenteof-in-commentT) rr:commentStartDashStaterr'r;rrrr commentStaterpr!r!r"rs.       zHTMLTokenizer.commentStartStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd d|j|j|j|_nT|t kr|jtdd d|j|j|j|_n|jdd|7<|j |_d S) Nrr_r#r`r$r&-�rtrrT) rr:commentEndStaterr'r;rrrrrrpr!r!r"rs.       z#HTMLTokenizer.commentStartDashStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<nT|tkr|jtddd|j|j|j |_n|jd||j d 7<d S) Nrr_r#r`r$r&r2r)rr_T) rr:commentEndDashStaterr'r;rrrrrdrpr!r!r"rs$       zHTMLTokenizer.commentStatecCs|j}|dkr|j|_n|dkrV|jtddd|jdd7<|j|_nT|t kr|jtddd|j|j|j |_n|jdd|7<|j|_d S) Nrr_r#r`r$r&rzeof-in-comment-end-dashT) rr:rrr'r;rrrrrrpr!r!r"rs$      z!HTMLTokenizer.commentEndDashStatecCs,|j}|dkr*|j|j|j|_n|dkrd|jtddd|jdd7<|j|_n|dkr|jtdd d|j |_n|d kr|jtdd d|jd|7<nj|t kr|jtdd d|j|j|j|_n4|jtdd d|jdd|7<|j|_dS)Nrtr_r#r`r$r&u--�rrz,unexpected-bang-after-double-dash-in-commentrz,unexpected-dash-after-double-dash-in-commentzeof-in-comment-double-dashzunexpected-char-in-commentz--T) rr:r'r;rrrrrcommentEndBangStaterrpr!r!r"rs@          zHTMLTokenizer.commentEndStatecCs|j}|dkr*|j|j|j|_n|dkrN|jdd7<|j|_n|dkr|jtddd|jdd 7<|j |_nT|t kr|jtdd d|j|j|j|_n|jdd|7<|j |_d S) Nrtrr&z--!r_r#r`r$u--!�zeof-in-comment-end-bang-stateT) rr:r'r;rrrrrrrrpr!r!r"rs,       z!HTMLTokenizer.commentEndBangStatecCs|j}|tkr|j|_nj|tkr\|jtdddd|j d<|j|j |j |_n*|jtddd|j ||j|_dS)Nr#!expected-doctype-name-but-got-eofr$Frzneed-space-after-doctypeT) rr:rbeforeDoctypeNameStaterrr'r;rrrrArpr!r!r"r s        zHTMLTokenizer.doctypeStatecCs|j}|tkrn|dkrT|jtdddd|jd<|j|j|j|_n|dkr|jtdddd |jd <|j |_nR|t kr|jtdd dd|jd<|j|j|j|_n||jd <|j |_d S) Nrtr#z+expected-doctype-name-but-got-right-bracketr$Frr_r`r2rYrT) rr:rr'r;rrrrdoctypeNameStaterrpr!r!r"rs4           z$HTMLTokenizer.beforeDoctypeNameStatecCs|j}|tkr2|jdt|jd<|j|_n|dkrh|jdt|jd<|j |j|j |_n|dkr|j t ddd|jdd7<|j |_nh|t kr|j t dddd |jd <|jdt|jd<|j |j|j |_n|jd|7<d S) NrYrtr_r#r`r$r2zeof-in-doctype-nameFrT)rr:rrr\r afterDoctypeNameStaterr'r;rrrrrpr!r!r"r6s0        zHTMLTokenizer.doctypeNameStatecCsH|j}|tkrn.|dkr8|j|j|j|_n |tkrd|jd<|j ||jt ddd|j|j|j|_n|dkrd}d D]}|j}||krd}qq|r|j |_dSnD|d kr d}d D]}|j}||krd}qq|r |j |_dS|j ||jt dd d |idd|jd<|j |_dS)NrtFrr#eof-in-doctyper$rT))uU)bB)lL)iIrsS)rrrr)mMz*expected-space-or-right-bracket-in-doctyper&r1)rr:rr'r;rrrrrArafterDoctypePublicKeywordStateafterDoctypeSystemKeywordStatebogusDoctypeState)rr&rrr!r!r"rOsT            z#HTMLTokenizer.afterDoctypeNameStatecCs|j}|tkr|j|_n|dkrP|jtddd|j||j|_nT|t kr|jtdddd|j d<|j|j |j |_n|j||j|_dS N)rrr#unexpected-char-in-doctyper$rFrT) rr:r"beforeDoctypePublicIdentifierStaterr'r;rrArrrrpr!r!r"rs&         z,HTMLTokenizer.afterDoctypePublicKeywordStatecCs|j}|tkrn|dkr0d|jd<|j|_n|dkrLd|jd<|j|_n|dkr|jt dddd |jd <|j|j|j |_nh|t kr|jt dd dd |jd <|j|j|j |_n(|jt dd dd |jd <|j |_d S)Nrr/rrrtr#unexpected-end-of-doctyper$FrrrT) rr:rr(doctypePublicIdentifierDoubleQuotedStater(doctypePublicIdentifierSingleQuotedStater'r;rrrrrpr!r!r"rs:             z0HTMLTokenizer.beforeDoctypePublicIdentifierStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd dd |jd <|j|j|j|_nR|t kr|jtdd dd |jd <|j|j|j|_n|jd|7<d S)Nrr_r#r`r$rr2rtrFrrT rr:!afterDoctypePublicIdentifierStaterr'r;rrrrrpr!r!r"rs0         z6HTMLTokenizer.doctypePublicIdentifierDoubleQuotedStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd dd |jd <|j|j|j|_nR|t kr|jtdd dd |jd <|j|j|j|_n|jd|7<d S)Nrr_r#r`r$rr2rtrFrrTrrpr!r!r"rs0         z6HTMLTokenizer.doctypePublicIdentifierSingleQuotedStatecCs |j}|tkr|j|_n|dkr<|j|j|j|_n|dkrn|jt dddd|jd<|j |_n|dkr|jt dddd|jd<|j |_nh|t kr|jt dd dd |jd <|j|j|j|_n(|jt dddd |jd <|j |_d S) Nrtrr#rr$r/rrrFrT)rr:r-betweenDoctypePublicAndSystemIdentifiersStaterr'r;rrr(doctypeSystemIdentifierDoubleQuotedState(doctypeSystemIdentifierSingleQuotedStaterrrpr!r!r"rs>              z/HTMLTokenizer.afterDoctypePublicIdentifierStatecCs|j}|tkrn|dkr4|j|j|j|_n|dkrPd|jd<|j|_n|dkrld|jd<|j |_nh|t kr|jt dddd |jd <|j|j|j|_n(|jt dd dd |jd <|j |_d S) Nrtrr/rrr#rr$FrrT) rr:rr'r;rrrrrrrrrpr!r!r"rs2           z;HTMLTokenizer.betweenDoctypePublicAndSystemIdentifiersStatecCs|j}|tkr|j|_n|dkrP|jtddd|j||j|_nT|t kr|jtdddd|j d<|j|j |j |_n|j||j|_dSr) rr:r"beforeDoctypeSystemIdentifierStaterr'r;rrArrrrpr!r!r"rs&         z,HTMLTokenizer.afterDoctypeSystemKeywordStatecCs|j}|tkrn|dkr0d|jd<|j|_n|dkrLd|jd<|j|_n|dkr|jt dddd |jd <|j|j|j |_nh|t kr|jt dd dd |jd <|j|j|j |_n(|jt dddd |jd <|j |_d S) Nrr/rrrtr#rr$FrrT) rr:rrrrrr'r;rrrrrpr!r!r"r/s:             z0HTMLTokenizer.beforeDoctypeSystemIdentifierStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd dd |jd <|j|j|j|_nR|t kr|jtdd dd |jd <|j|j|j|_n|jd|7<d S)Nrr_r#r`r$rr2rtrFrrT rr:!afterDoctypeSystemIdentifierStaterr'r;rrrrrpr!r!r"rLs0         z6HTMLTokenizer.doctypeSystemIdentifierDoubleQuotedStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd dd |jd <|j|j|j|_nR|t kr|jtdd dd |jd <|j|j|j|_n|jd|7<d S)Nrr_r#r`r$rr2rtrFrrTrrpr!r!r"rds0         z6HTMLTokenizer.doctypeSystemIdentifierSingleQuotedStatecCs|j}|tkrn~|dkr4|j|j|j|_n^|tkrt|jt dddd|jd<|j|j|j|_n|jt ddd|j |_dS) Nrtr#rr$FrrT) rr:rr'r;rrrrrrrpr!r!r"r|s$      z/HTMLTokenizer.afterDoctypeSystemIdentifierStatecCsZ|j}|dkr*|j|j|j|_n,|tkrV|j||j|j|j|_ndS)NrtT) rr:r'r;rrrrrArpr!r!r"rs    zHTMLTokenizer.bogusDoctypeStatecCsg}||jd||jd|j}|tkr>qvq|ddddkrj|ddd|d<qvq||qd|}|d}|dkrt|D]}|jt d d d q| dd }|r|jt d |d |j |_ dS)N]rtrJz]]r/r_rr#r`r$r2rOT) r;rrdr:rr=countranger'rrrr)rr&r:Z nullCountrr!r!r"rs0         zHTMLTokenizer.cdataSectionState)N)NF)N__name__ __module__ __qualname____doc__rr,rFrWrXr^rrbrjrhrmrorqrcrwrxrirrrlrrrnrrrrrrrrrrrrrrrrr|rrrrrrrr}ryrvrrrrrrrrrrrrrrrrrrrrrrr __classcell__r!r!rr"rs H P#         6 "-3rN)Z __future__rrrZpip._vendor.sixrr? collectionsrZ constantsrr r r r r rrrrZ _inputstreamrZ_trierrPobjectrr!r!r!r"s       PKd]UU0html5lib/__pycache__/_inputstream.cpython-38.pycnu[U .e(!@sddlmZmZmZddlmZmZddlmZm Z ddl Z ddl Z ddl m Z ddlmZmZmZmZddlmZdd lmZdd lmZzdd lmZWnek reZYnXed d eDZedd eDZedd eDZeeddgBZdZej rJeddkr&e!ddks*t"e #edde$ddZ%n e #eZ%e&ddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5g Z'e #d6Z(iZ)Gd7d8d8e*Z+d9d:Z,Gd;d<dd>e-Z.Gd?d@d@e/Z0GdAdBdBe*Z1GdCdDdDe*Z2dEdFZ3dS)G)absolute_importdivisionunicode_literals) text_type binary_type) http_clienturllibN) webencodings)EOFspaceCharacters asciiLettersasciiUppercase)_ReparseException)_utils)StringIO)BytesIOcCsg|]}|dqSasciiencode.0itemrE/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_inputstream.py srcCsg|]}|dqSrrrrrrrscCsg|]}|dqSrrrrrrrs>.)sumr#r%rrrr,^szBufferedStream._bufferedBytescCs<|j|}|j||jdd7<t||jd<|Sr')r"r4r#appendr$r()r%r3datarrrr1as   zBufferedStream._readStreamcCs|}g}|jd}|jd}|t|jkr|dkr|dks>t|j|}|t||krl|}|||g|_n"t||}|t|g|_|d7}|||||||8}d}q|r|||d|S)Nrr )r$r(r#r-r7r1join)r%r3ZremainingBytesrvZ bufferIndexZ bufferOffsetZ bufferedDataZ bytesToReadrrrr2hs&     zBufferedStream._readFromBufferN) __name__ __module__ __qualname____doc__r&r+r0r4r,r1r2rrrrr!9s  r!cKst|tjs(t|tjjr.t|jtjr.d}n&t|drJt|dt }n t|t }|rdd|D}|rvt d|t |f|St |f|SdS)NFr4rcSsg|]}|dr|qS)Z _encoding)endswith)rxrrrrs z#HTMLInputStream..z3Cannot set an encoding with a unicode input, set %r) isinstancerZ HTTPResponserZresponseZaddbasefphasattrr4r TypeErrorHTMLUnicodeInputStreamHTMLBinaryInputStream)sourcekwargsZ isUnicodeZ encodingsrrrHTMLInputStreams       rJc@speZdZdZdZddZddZddZd d Zd d Z d dZ dddZ ddZ ddZ dddZddZdS)rFProvides a unicode stream of characters to the HTMLTokenizer. This class takes care of character encoding and removing or replacing incorrect byte-sequences and also provides column and line tracking. i(cCsZtjsd|_ntddkr$|j|_n|j|_dg|_tddf|_| ||_ | dS)Initialises the HTMLInputStream. HTMLInputStream(source, [encoding]) -> Normalized stream from source for use by html5lib. source can be either a file-object, local filename or a string. The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element) Nu􏿿r rutf-8certain) rsupports_lone_surrogatesreportCharacterErrorsr(characterErrorsUCS4characterErrorsUCS2ZnewLineslookupEncoding charEncoding openStream dataStreamreset)r%rHrrrr&s   zHTMLUnicodeInputStream.__init__cCs.d|_d|_d|_g|_d|_d|_d|_dS)Nr)r* chunkSize chunkOffseterrors prevNumLines prevNumCols_bufferedCharacterr6rrrrWszHTMLUnicodeInputStream.resetcCst|dr|}nt|}|SzvProduces a file object from source. source can be either a file object, local filename or a string. r4)rDrr%rHr"rrrrUs z!HTMLUnicodeInputStream.openStreamcCsT|j}|dd|}|j|}|dd|}|dkr@|j|}n ||d}||fS)N rrr )r*countr\rfindr])r%r.r*ZnLinesZ positionLineZ lastLinePosZpositionColumnrrr _positions   z HTMLUnicodeInputStream._positioncCs||j\}}|d|fS)z:Returns (line, col) of the current position in the stream.r )rdrZ)r%linecolrrrr$szHTMLUnicodeInputStream.positioncCs6|j|jkr|stS|j}|j|}|d|_|S)zo Read one character from the stream or queue if available. Return EOF when EOF is reached. r )rZrY readChunkr r*)r%rZcharrrrrhs   zHTMLUnicodeInputStream.charNcCs|dkr|j}||j\|_|_d|_d|_d|_|j|}|j rX|j |}d|_ n|s`dSt |dkrt |d}|dksd|krdkrnn|d|_ |dd}|j r| || d d }| d d }||_t ||_d S) NrXrFr r iz ra T)_defaultChunkSizerdrYr\r]r*rZrVr4r^r(ordrPreplace)r%rYr8Zlastvrrrrgs0           z HTMLUnicodeInputStream.readChunkcCs(ttt|D]}|jdqdS)Ninvalid-codepoint)ranger(invalid_unicode_refindallr[r7)r%r8_rrrrQ%sz*HTMLUnicodeInputStream.characterErrorsUCS4cCsd}t|D]}|rqt|}|}t|||drrt|||d}|tkrl|j dd}q|dkr|dkr|t |dkr|j dqd}|j dqdS)NFroTrjir ) rqfinditerrmgroupstartrZisSurrogatePairZsurrogatePairToCodepointnon_bmp_invalid_codepointsr[r7r()r%r8skipmatchZ codepointr)Zchar_valrrrrR)s"  z*HTMLUnicodeInputStream.characterErrorsUCS2Fc Cszt||f}Wnhtk rx|D]}t|dks$tq$ddd|D}|sZd|}td|}t||f<YnXg}||j|j }|dkr|j |j krqn0| }||j kr| |j|j |||_ q| |j|j d| s~qq~d|} | S)z Returns a string of characters from the stream up to but not including any character in 'characters' or EOF. 'characters' must be a container that supports the 'in' method and iteration over its characters. rXcSsg|]}dt|qS)z\x%02x)rm)rcrrrrNsz5HTMLUnicodeInputStream.charsUntil..z^%sz[%s]+N)charsUntilRegExKeyErrorrmr-r:recompilerzr*rZrYendr7rg) r%Z charactersZoppositecharsr|Zregexr;mrrrrr charsUntil@s0    z!HTMLUnicodeInputStream.charsUntilcCsT|dk rP|jdkr.||j|_|jd7_n"|jd8_|j|j|ksPtdSr')rZr*rYr-)r%rhrrrungetos   zHTMLUnicodeInputStream.unget)N)F)r<r=r>r?rlr&rWrUrdr$rhrgrQrRrrrrrrrFs   & /rFc@sLeZdZdZdddZddZd d Zdd d Zd dZddZ ddZ dS)rGrKN windows-1252TcCsn|||_t||jd|_d|_||_||_||_||_ ||_ | ||_ |j ddk sbt |dS)rLidrN)rU rawStreamrFr& numBytesMetanumBytesChardetoverride_encodingtransport_encodingsame_origin_parent_encodinglikely_encodingdefault_encodingdetermineEncodingrTr-rW)r%rHrrrrrZ useChardetrrrr&s  zHTMLBinaryInputStream.__init__cCs&|jdj|jd|_t|dS)Nrrn)rTZ codec_info streamreaderrrVrFrWr6rrrrWszHTMLBinaryInputStream.resetcCsDt|dr|}nt|}z||Wnt|}YnX|Sr_)rDrr0r+r!r`rrrrUs z HTMLBinaryInputStream.openStreamcCs|df}|ddk r|St|jdf}|ddk r:|St|jdf}|ddk rX|S|df}|ddk rt|St|jdf}|ddk r|djds|St|jdf}|ddk r|S|rpzddl m }Wnt k rYnXg}|}|j s<|j |j}t|tst|s&q<||||q|t|jd}|j d|dk rp|dfSt|jdf}|ddk r|StddfS)NrNrZ tentativezutf-16)UniversalDetectorencodingr) detectBOMrSrrdetectEncodingMetarname startswithrZ%pip._vendor.chardet.universaldetectorr ImportErrorZdonerr4rrBr3r-r7Zfeedcloseresultr0r)r%ZchardetrTrZbuffersZdetectorr#rrrrrsR           z'HTMLBinaryInputStream.determineEncodingcCs|jddkstt|}|dkr&dS|jdkrFtd}|dk stnT||jdkrf|jddf|_n4|jd|df|_|td|jd|fdS)Nr rNutf-16beutf-16lerMrzEncoding changed from %s to %s)rTr-rSrrr0rWr)r%Z newEncodingrrrchangeEncodings   z$HTMLBinaryInputStream.changeEncodingc Cstjdtjdtjdtjdtjdi}|jd}t|t sr?r&rWrUrrrrrrrrrGs * >"rGc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ e e e Z ddZe eZefddZddZddZddZdS) EncodingByteszString-like object with an associated position and various extra methods If the position is ever greater than the string length then an exception is raisedcCst|tstt||SN)rBr3r-__new__lowerr%valuerrrrLszEncodingBytes.__new__cCs d|_dS)Nr)rdrrrrr&PszEncodingBytes.__init__cCs|Srrr6rrr__iter__TszEncodingBytes.__iter__cCs>|jd}|_|t|kr"tn |dkr.t|||dS)Nr rrdr( StopIterationrEr%prrr__next__Ws  zEncodingBytes.__next__cCs|Sr)rr6rrrnext_szEncodingBytes.nextcCsB|j}|t|krtn |dkr$t|d|_}|||dSr'rrrrrpreviouscs zEncodingBytes.previouscCs|jt|krt||_dSrrdr(r)r%r$rrr setPositionlszEncodingBytes.setPositioncCs*|jt|krt|jdkr"|jSdSdS)Nrrr6rrr getPositionqs  zEncodingBytes.getPositioncCs||j|jdSNr )r$r6rrrgetCurrentByte{szEncodingBytes.getCurrentBytecCsH|j}|t|kr>|||d}||kr4||_|S|d7}q||_dS)zSkip past a list of charactersr Nr$r(rdr%rrr|rrrrys  zEncodingBytes.skipcCsH|j}|t|kr>|||d}||kr4||_|S|d7}q||_dSrrrrrr skipUntils  zEncodingBytes.skipUntilcCs>|j}|||t|}||}|r:|jt|7_|S)zLook for a sequence of bytes at the start of a string. If the bytes are found return True and advance the position to the byte after the match. Otherwise return False and leave the position alone)r$r(r)r%r3rr8r;rrr matchBytess  zEncodingBytes.matchBytescCsR||jd|}|dkrJ|jdkr,d|_|j|t|d7_dStdS)zLook for the next sequence of bytes matching a given sequence. If a match is found advance the position to the last byte of the matchNrrr T)r$findrdr(r)r%r3Z newPositionrrrjumpTos zEncodingBytes.jumpToN)r<r=r>r?rr&rrrrrrpropertyr$r currentBytespaceCharactersBytesryrrrrrrrrHs      rc@sXeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ dS)rz?Mini parser for detecting character encoding from meta elementscCst||_d|_dS)z3string - the data to work on for encoding detectionN)rr8rr%r8rrrr&s zEncodingParser.__init__c Csd|jfd|jfd|jfd|jfd|jfd|jff}|jD]Z}d}|D]D\}}|j|rFz|}WqWqFtk rd}YqYqFXqF|s:qq:|jS) Nsr8rr6rrrrszEncodingParser.handleCommentcCs|jjtkrdSd}d}|}|dkr,dS|ddkr\|ddk}|r|dk r||_dSq|ddkr|d}t|}|dk r||_dSq|ddkrtt|d}|}|dk rt|}|dk r|r||_dS|}qdS) NTFrs http-equivr s content-typecharsetscontent) r8rr getAttributerrSContentAttrParserrparse)r%Z hasPragmaZpendingEncodingattrZtentativeEncodingcodecZ contentParserrrrrs8      zEncodingParser.handleMetacCs |dS)NF)handlePossibleTagr6rrrrsz%EncodingParser.handlePossibleStartTagcCst|j|dS)NT)rr8rr6rrrrs z#EncodingParser.handlePossibleEndTagcCsb|j}|jtkr(|r$||dS|t}|dkrD|n|}|dk r^|}qLdS)NTr)r8rasciiLettersBytesrrrspacesAngleBracketsr)r%ZendTagr8r|rrrrrs    z EncodingParser.handlePossibleTagcCs |jdS)Nrrr6rrrrszEncodingParser.handleOthercCs|j}|ttdgB}|dks2t|dks2t|dkr>dSg}g}|dkrV|rVqnX|tkrj|}qnD|dkrd|dfS|tkr|| n|dkrdS||t |}qF|dkr| d|dfSt ||}|dkrJ|}t |}||kr"t |d|d|fS|tkr<|| q||qnJ|d krbd|dfS|tkr||| n|dkrdS||t |}|t krd|d|fS|tkr|| n|dkrdS||qdS) z_Return a name,value pair for the next attribute in the stream, if one is found, or None/Nr )rN=)rrr9)'"r) r8ryr frozensetr(r-r:asciiUppercaseBytesr7rrrr)r%r8r|ZattrNameZ attrValueZ quoteCharrrrrsb             zEncodingParser.getAttributeN) r<r=r>r?r&rrrrrrrrrrrrrs$rc@seZdZddZddZdS)rcCst|tst||_dSr)rBr3r-r8rrrrr&fszContentAttrParser.__init__cCsz|jd|jjd7_|j|jjdksr&rrrrrresrcCsft|tr0z|d}Wntk r.YdSX|dk r^z t|WStk rZYdSXndSdS)z{Return the python codec name corresponding to an encoding or None if the string doesn't correspond to a valid encoding.rN)rBrdecodeUnicodeDecodeErrorr lookupAttributeError)rrrrrSs   rS)4Z __future__rrrZpip._vendor.sixrrZpip._vendor.six.movesrrrrZ pip._vendorr Z constantsr r r rrrXriorrrrrrrrZinvalid_unicode_no_surrogaterOrbr-revalrqsetrxZascii_punctuation_rer}objectr!rJrFrGr3rrrrSrrrrs     "   JgIh6'PKd]dn))4html5lib/__pycache__/serializer.cpython-38.opt-1.pycnu[U .e=@szddlmZmZmZddlmZddlZddlmZm Z ddl m Z m Z m Z ddl mZmZmZddlmZmZdd lmZd e d Zed ed Zed edZiZeddkZeeD]n\Z Z!eree!dksesee!dkrqe!dkree!dkre"e!Z!ne#e!Z!e!eks0e $re ee!<qddZ%ede%dddZ&Gddde'Z(Gddde)Z*dS))absolute_importdivisionunicode_literals) text_typeN)register_errorxmlcharrefreplace_errors) voidElementsbooleanAttributesspaceCharacters)rcdataElementsentities xmlEntities) treewalkers_utils)escapez"'=<>`[]u_  /`  ᠎᠏           

   ]u􏿿&c Cst|ttfrg}g}d}t|j|j|jD]n\}}|rDd}q2||j}t|j|t |j|dgrt |j||d}d}nt |}| |q2|D]V}t |} | r| d| | | ds| dq| dt|ddqd||jfSt|SdS)NFrTr;z&#x%s;r) isinstanceUnicodeEncodeErrorUnicodeTranslateError enumerateobjectstartendrZisSurrogatePairminsurrogatePairToCodepointordappend_encode_entity_mapgetendswithhexjoinr) excresZ codepointsskipicindexZ codepointZcper/C/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/serializer.pyhtmlentityreplace_errors*s0 "      r1htmlentityreplaceetreecKs$t|}tf|}||||S)aSerializes the input token stream using the specified treewalker :arg input: the token stream to serialize :arg tree: the treewalker to use :arg encoding: the encoding to use :arg serializer_opts: any options to pass to the :py:class:`html5lib.serializer.HTMLSerializer` that gets created :returns: the tree serialized as a string Example: >>> from html5lib.html5parser import parse >>> from html5lib.serializer import serialize >>> token_stream = parse('

Hi!

') >>> serialize(token_stream, omit_optional_tags=False) '

Hi!

' )rZ getTreeWalkerHTMLSerializerrender)inputZtreeencodingZserializer_optsZwalkersr/r/r0 serializeKs  r9c@s~eZdZdZdZdZdZdZdZdZ dZ dZ dZ dZ dZdZdZdZddZdd Zd d Zdd dZdddZdddZd S)r4legacy"TF)quote_attr_values quote_charuse_best_quote_charomit_optional_tagsminimize_boolean_attributesuse_trailing_solidusspace_before_trailing_solidusescape_lt_in_attrs escape_rcdataresolve_entitiesalphabetical_attributesinject_meta_charsetstrip_whitespacesanitizec Ksvt|t|j}t|dkr2tdtt|d|kr@d|_|jD]}t||||t ||qFg|_ d|_ dS)aB Initialize HTMLSerializer :arg inject_meta_charset: Whether or not to inject the meta charset. Defaults to ``True``. :arg quote_attr_values: Whether to quote attribute values that don't require quoting per legacy browser behavior (``"legacy"``), when required by the standard (``"spec"``), or always (``"always"``). Defaults to ``"legacy"``. :arg quote_char: Use given quote character for attribute quoting. Defaults to ``"`` which will use double quotes unless attribute value contains a double quote, in which case single quotes are used. :arg escape_lt_in_attrs: Whether or not to escape ``<`` in attribute values. Defaults to ``False``. :arg escape_rcdata: Whether to escape characters that need to be escaped within normal elements within rcdata elements such as style. Defaults to ``False``. :arg resolve_entities: Whether to resolve named character entities that appear in the source tree. The XML predefined entities < > & " ' are unaffected by this setting. Defaults to ``True``. :arg strip_whitespace: Whether to remove semantically meaningless whitespace. (This compresses all whitespace to a single space except within ``pre``.) Defaults to ``False``. :arg minimize_boolean_attributes: Shortens boolean attributes to give just the attribute value, for example:: becomes:: Defaults to ``True``. :arg use_trailing_solidus: Includes a close-tag slash at the end of the start tag of void elements (empty elements whose end tag is forbidden). E.g. ``
``. Defaults to ``False``. :arg space_before_trailing_solidus: Places a space immediately before the closing slash in a tag using a trailing solidus. E.g. ``
``. Requires ``use_trailing_solidus=True``. Defaults to ``True``. :arg sanitize: Strip all unsafe or unknown constructs from output. See :py:class:`html5lib.filters.sanitizer.Filter`. Defaults to ``False``. :arg omit_optional_tags: Omit start/end tags that are optional. Defaults to ``True``. :arg alphabetical_attributes: Reorder attributes to be in alphabetical order. Defaults to ``False``. rz2__init__() got an unexpected keyword argument '%s'r=FN) frozensetoptionslen TypeErrornextiterr>setattrr$getattrerrorsstrict)selfkwargsZunexpected_argsattrr/r/r0__init__sO  zHTMLSerializer.__init__cCs|jr||jdS|SdS)Nr2r7encoderTstringr/r/r0rYszHTMLSerializer.encodecCs|jr||jdS|SdS)NrSrXrZr/r/r0 encodeStrictszHTMLSerializer.encodeStrictNccs||_d}g|_|r0|jr0ddlm}|||}|jrJddlm}||}|jrdddlm}||}|j r~ddl m}||}|j rddl m}||}|D]>}|d}|dkr\d|d}|dr|d |d7}n|d r|d 7}|d rF|d  d d kr,|d  dd kr&|dd}nd }|d||d |f7}|d7}||Vq|dkr|dksv|r|r|d dd kr|d||dVn|t|dVq|dkr|d} |d| V| tkr|jsd}n|r |d|dD]\\} } } | } | }|dV|| V|jrv| t| tkr| tdtkr|dV|jdkst|d krd}n@|jdkrt|dk }n$|jd krt|dk }ntd!|d"d#}|j r|d$d%}|r|j!}|j"rHd|kr0d |kr0d }nd |krHd|krHd}|dkr`|dd&}n |d d'}||V||V||Vn ||Vq| t#kr|j$r|j%r|d(Vn |d)V|dVq|d*kr(|d} | tkrd}n|r|d|d+| Vq|d,krj|d}| d-d krT|d.|d/|dVq|d0kr|d} | d1}|t&kr|d2| |j'r|t(krt&|}nd3| }||Vq||dqdS)4NFr)FiltertypeZDoctypez )Z CharactersSpaceCharactersrbdatazCommentz--zComment contains --z ZEntityrzEntity %s not recognizedz&%s;))r7rRrGZfilters.inject_meta_charsetr]rFZfilters.alphabeticalattributesrHZfilters.whitespacerIZfilters.sanitizerr?Zfilters.optionaltagsfindserializeErrorr\rYrr rDitemsr@r r$tupler<rL_quoteAttributeSpecsearch_quoteAttributeLegacy ValueErrorreplacerCr=r>r rArBr rEr)rT treewalkerr7Zin_cdatar]tokenr^Zdoctyper=r__Z attr_nameZ attr_valuekvZ quote_attrrckeyr/r/r0r9s                                    zHTMLSerializer.serializecCs2|rdt|||Sdt||SdS)anSerializes the stream from the treewalker into a string :arg treewalker: the treewalker to serialize :arg encoding: the string encoding to use :returns: the serialized tree Example: >>> from html5lib import parse, getTreeWalker >>> from html5lib.serializer import HTMLSerializer >>> token_stream = parse('Hi!') >>> walker = getTreeWalker('etree') >>> serializer = HTMLSerializer(omit_optional_tags=False) >>> serializer.render(walker(token_stream)) 'Hi!' rN)r'listr9)rTrtr7r/r/r0r5wszHTMLSerializer.renderXXX ERROR MESSAGE NEEDEDcCs|j||jrtdS)N)rRr"rSSerializeError)rTrcr/r/r0rls zHTMLSerializer.serializeError)N)N)r|)__name__ __module__ __qualname__r<r=r>r?r@rArBrCrDrErFrGrHrIrKrWrYr\r9r5rlr/r/r/r0r4hs,Y  r4c@seZdZdZdS)r}zError in serialized treeN)r~rr__doc__r/r/r/r0r}sr})r3N)+Z __future__rrrZpip._vendor.sixrrecodecsrrZ constantsr r r r r rrrrZxml.sax.saxutilsrr'Z_quoteAttributeSpecCharscompilerorqr#rLZ_is_ucs4r{rmrwrxr r!islowerr1r9rr4 Exceptionr}r/r/r/r0sD          1PKd]jU $*$*.html5lib/__pycache__/serializer.cpython-38.pycnu[U .e=@szddlmZmZmZddlmZddlZddlmZm Z ddl m Z m Z m Z ddl mZmZmZddlmZmZdd lmZd e d Zed ed Zed edZiZeddkZeeD]n\Z Z!eree!dksesee!dkrqe!dkree!dkre"e!Z!ne#e!Z!e!eks0e $re ee!<qddZ%ede%dddZ&Gddde'Z(Gddde)Z*dS))absolute_importdivisionunicode_literals) text_typeN)register_errorxmlcharrefreplace_errors) voidElementsbooleanAttributesspaceCharacters)rcdataElementsentities xmlEntities) treewalkers_utils)escapez"'=<>`[]u_  /`  ᠎᠏           

   ]u􏿿&c Cst|ttfrg}g}d}t|j|j|jD]n\}}|rDd}q2||j}t|j|t |j|dgrt |j||d}d}nt |}| |q2|D]V}t |} | r| d| | | ds| dq| dt|ddqd||jfSt|SdS)NFrTr;z&#x%s;r) isinstanceUnicodeEncodeErrorUnicodeTranslateError enumerateobjectstartendrZisSurrogatePairminsurrogatePairToCodepointordappend_encode_entity_mapgetendswithhexjoinr) excresZ codepointsskipicindexZ codepointZcper/C/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/serializer.pyhtmlentityreplace_errors*s0 "      r1htmlentityreplaceetreecKs$t|}tf|}||||S)aSerializes the input token stream using the specified treewalker :arg input: the token stream to serialize :arg tree: the treewalker to use :arg encoding: the encoding to use :arg serializer_opts: any options to pass to the :py:class:`html5lib.serializer.HTMLSerializer` that gets created :returns: the tree serialized as a string Example: >>> from html5lib.html5parser import parse >>> from html5lib.serializer import serialize >>> token_stream = parse('

Hi!

') >>> serialize(token_stream, omit_optional_tags=False) '

Hi!

' )rZ getTreeWalkerHTMLSerializerrender)inputZtreeencodingZserializer_optsZwalkersr/r/r0 serializeKs  r9c@s~eZdZdZdZdZdZdZdZdZ dZ dZ dZ dZ dZdZdZdZddZdd Zd d Zdd dZdddZdddZd S)r4legacy"TF)quote_attr_values quote_charuse_best_quote_charomit_optional_tagsminimize_boolean_attributesuse_trailing_solidusspace_before_trailing_solidusescape_lt_in_attrs escape_rcdataresolve_entitiesalphabetical_attributesinject_meta_charsetstrip_whitespacesanitizec Ksvt|t|j}t|dkr2tdtt|d|kr@d|_|jD]}t||||t ||qFg|_ d|_ dS)aB Initialize HTMLSerializer :arg inject_meta_charset: Whether or not to inject the meta charset. Defaults to ``True``. :arg quote_attr_values: Whether to quote attribute values that don't require quoting per legacy browser behavior (``"legacy"``), when required by the standard (``"spec"``), or always (``"always"``). Defaults to ``"legacy"``. :arg quote_char: Use given quote character for attribute quoting. Defaults to ``"`` which will use double quotes unless attribute value contains a double quote, in which case single quotes are used. :arg escape_lt_in_attrs: Whether or not to escape ``<`` in attribute values. Defaults to ``False``. :arg escape_rcdata: Whether to escape characters that need to be escaped within normal elements within rcdata elements such as style. Defaults to ``False``. :arg resolve_entities: Whether to resolve named character entities that appear in the source tree. The XML predefined entities < > & " ' are unaffected by this setting. Defaults to ``True``. :arg strip_whitespace: Whether to remove semantically meaningless whitespace. (This compresses all whitespace to a single space except within ``pre``.) Defaults to ``False``. :arg minimize_boolean_attributes: Shortens boolean attributes to give just the attribute value, for example:: becomes:: Defaults to ``True``. :arg use_trailing_solidus: Includes a close-tag slash at the end of the start tag of void elements (empty elements whose end tag is forbidden). E.g. ``
``. Defaults to ``False``. :arg space_before_trailing_solidus: Places a space immediately before the closing slash in a tag using a trailing solidus. E.g. ``
``. Requires ``use_trailing_solidus=True``. Defaults to ``True``. :arg sanitize: Strip all unsafe or unknown constructs from output. See :py:class:`html5lib.filters.sanitizer.Filter`. Defaults to ``False``. :arg omit_optional_tags: Omit start/end tags that are optional. Defaults to ``True``. :arg alphabetical_attributes: Reorder attributes to be in alphabetical order. Defaults to ``False``. rz2__init__() got an unexpected keyword argument '%s'r=FN) frozensetoptionslen TypeErrornextiterr>setattrr$getattrerrorsstrict)selfkwargsZunexpected_argsattrr/r/r0__init__sO  zHTMLSerializer.__init__cCs*t|tst|jr"||jdS|SdS)Nr2rrAssertionErrorr7encoderTstringr/r/r0rZszHTMLSerializer.encodecCs*t|tst|jr"||jdS|SdS)NrSrXr[r/r/r0 encodeStrictszHTMLSerializer.encodeStrictNccs||_d}g|_|r0|jr0ddlm}|||}|jrJddlm}||}|jrdddlm}||}|j r~ddl m}||}|j rddl m}||}|D]>}|d}|dkr\d|d}|dr|d |d7}n|d r|d 7}|d rF|d  d d kr,|d  dd kr&|dd}nd }|d||d |f7}|d7}||Vq|dkr|dksv|r|r|d dd kr|d||dVn|t|dVq|dkr|d} |d| V| tkr|jsd}n|r |d|dD]\\} } } | } | }|dV|| V|jrv| t| tkr| tdtkr|dV|jdkst|d krd}n@|jdkrt|dk }n$|jd krt|dk }ntd!|d"d#}|j r|d$d%}|r|j!}|j"rHd|kr0d |kr0d }nd |krHd|krHd}|dkr`|dd&}n |d d'}||V||V||Vn ||Vq| t#kr|j$r|j%r|d(Vn |d)V|dVq|d*kr(|d} | tkrd}n|r|d|d+| Vq|d,krj|d}| d-d krT|d.|d/|dVq|d0kr|d} | d1}|t&kr|d2| |j'r|t(krt&|}nd3| }||Vq||dqdS)4NFr)FiltertypeZDoctypez )Z CharactersSpaceCharactersrcdatazCommentz--zComment contains --z ZEntityrzEntity %s not recognizedz&%s;))r7rRrGZfilters.inject_meta_charsetr^rFZfilters.alphabeticalattributesrHZfilters.whitespacerIZfilters.sanitizerr?Zfilters.optionaltagsfindserializeErrorr]rZrr rDitemsr@r r$tupler<rL_quoteAttributeSpecsearch_quoteAttributeLegacy ValueErrorreplacerCr=r>r rArBr rEr)rT treewalkerr7Zin_cdatar^tokenr_Zdoctyper=r`_Z attr_nameZ attr_valuekvZ quote_attrrdkeyr/r/r0r9s                                    zHTMLSerializer.serializecCs2|rdt|||Sdt||SdS)anSerializes the stream from the treewalker into a string :arg treewalker: the treewalker to serialize :arg encoding: the string encoding to use :returns: the serialized tree Example: >>> from html5lib import parse, getTreeWalker >>> from html5lib.serializer import HTMLSerializer >>> token_stream = parse('Hi!') >>> walker = getTreeWalker('etree') >>> serializer = HTMLSerializer(omit_optional_tags=False) >>> serializer.render(walker(token_stream)) 'Hi!' rN)r'listr9)rTrur7r/r/r0r5wszHTMLSerializer.renderXXX ERROR MESSAGE NEEDEDcCs|j||jrtdS)N)rRr"rSSerializeError)rTrdr/r/r0rms zHTMLSerializer.serializeError)N)N)r})__name__ __module__ __qualname__r<r=r>r?r@rArBrCrDrErFrGrHrIrKrWrZr]r9r5rmr/r/r/r0r4hs,Y  r4c@seZdZdZdS)r~zError in serialized treeN)rrr__doc__r/r/r/r0r~sr~)r3N)+Z __future__rrrZpip._vendor.sixrrecodecsrrZ constantsr r r r r rrrrZxml.sax.saxutilsrr'Z_quoteAttributeSpecCharscompilerprrr#rLZ_is_ucs4r|rnrxryr r!islowerr1r9rr4 Exceptionr~r/r/r/r0sD          1PKd]r7`t 0html5lib/__pycache__/_utils.cpython-38.opt-1.pycnu[U .e@sddlmZmZmZddlmZddlmZzddlm m Z Wn&e k rhddl m mZ YnXddddd d gZzed Zeeesed ZWnd ZYnXdZGdddeZddZddZdd ZddZdS))absolute_importdivisionunicode_literals) ModuleType) text_typeN default_etreeMethodDispatcherisSurrogatePairsurrogatePairToCodepointmoduleFactoryFactorysupports_lone_surrogatesz"\uD800"z u"\uD800"FTc@s"eZdZdZdddZddZdS) rapDict with 2 special properties: On initiation, keys that are lists, sets or tuples are converted to multiple keys so accessing any one of the items in the original list-like object returns the matching value md = MethodDispatcher({("foo", "bar"):"baz"}) md["foo"] == "baz" A default value which can be set through the default attribute. cCsbg}|D]B\}}t|ttttfr<|D]}|||fq&q|||fqt||d|_dSN) isinstancelisttuple frozensetsetappenddict__init__default)selfitemsZ _dictEntriesnamevalueitemr r ?/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_utils.pyr1s  zMethodDispatcher.__init__cCst|||jSr)rgetr)rkeyr r r __getitem__@szMethodDispatcher.__getitem__N)r )__name__ __module__ __qualname____doc__rr r r r rr$s cCsLt|dkoJt|ddkoJt|ddkoJt|ddkoJt|ddkS)Nrii)lenord)datar r rr Gs cCs,dt|dddt|dd}|S)Nirr&ir'r()r*)r+Zchar_valr r rr Mscsifdd}|S)Ncsttjtdrd|j}n d|j}t|}z|||WStk rt|}|f||}|j|dkri|<d|kri||<d||kri|||<||||<|YSXdS)Nz _%s_factorys _%s_factoryrargskwargs) rrr!typerrKeyError__dict__update)Z baseModuler-r.rZ kwargs_tuplemodZobjsfactoryZ moduleCacher r moduleFactoryYs$      z+moduleFactoryFactory..moduleFactoryr )r5r6r r4rr Vscsifdd}|S)Ncs2t|t|f}|kr*|||<|Sr)rr)r-r.rcachefuncr rwrappedvszmemoize..wrappedr )r9r:r r7rmemoizessr;)Z __future__rrrtypesrZpip._vendor.sixrZxml.etree.cElementTreeZetreeZ cElementTreer ImportErrorZxml.etree.ElementTreeZ ElementTree__all__evalZ_xrr rrr r r r;r r r rs0     # PKd]t,html5lib/__pycache__/__init__.cpython-38.pycnu[U .e@shdZddlmZmZmZddlmZmZmZddl m Z ddl m Z ddl mZdd d d d d gZdZdS)a HTML parsing library based on the `WHATWG HTML specification `_. The parser is designed to be compatible with existing HTML found in the wild and implements well-defined error recovery that is largely compatible with modern desktop web browsers. Example usage:: from pip._vendor import html5lib with open("my_document.html", "rb") as f: tree = html5lib.parse(f) For convenience, this module re-exports the following names: * :func:`~.html5parser.parse` * :func:`~.html5parser.parseFragment` * :class:`~.html5parser.HTMLParser` * :func:`~.treebuilders.getTreeBuilder` * :func:`~.treewalkers.getTreeWalker` * :func:`~.serializer.serialize` )absolute_importdivisionunicode_literals) HTMLParserparse parseFragment)getTreeBuilder) getTreeWalker) serializerrrr r r z1.0.1N)__doc__Z __future__rrrZ html5parserrrrZ treebuildersr Z treewalkersr Z serializerr __all__ __version__rrA/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/__init__.pys   PKd]'w *html5lib/__pycache__/_utils.cpython-38.pycnu[U .e@sddlmZmZmZddlmZddlmZzddlm m Z Wn&e k rhddl m mZ YnXddddd d gZz,ed Zeeesed ZeeestWnd ZYnXdZGdddeZddZddZdd ZddZdS))absolute_importdivisionunicode_literals) ModuleType) text_typeN default_etreeMethodDispatcherisSurrogatePairsurrogatePairToCodepointmoduleFactoryFactorysupports_lone_surrogatesz"\uD800"z u"\uD800"FTc@s"eZdZdZdddZddZdS) rapDict with 2 special properties: On initiation, keys that are lists, sets or tuples are converted to multiple keys so accessing any one of the items in the original list-like object returns the matching value md = MethodDispatcher({("foo", "bar"):"baz"}) md["foo"] == "baz" A default value which can be set through the default attribute. cCsvg}|D]B\}}t|ttttfr<|D]}|||fq&q|||fqt||t|t|kslt d|_ dSN) isinstancelisttuple frozensetsetappenddict__init__lenAssertionErrordefault)selfitemsZ _dictEntriesnamevalueitemr r ?/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_utils.pyr1s  zMethodDispatcher.__init__cCst|||jSr)rgetr)rkeyr r r __getitem__@szMethodDispatcher.__getitem__N)r )__name__ __module__ __qualname____doc__rr"r r r rr$s cCsLt|dkoJt|ddkoJt|ddkoJt|ddkoJt|ddkS)Nrii)rord)datar r rr Gs cCs,dt|dddt|dd}|S)Nirr(ir)r*)r+)r,Zchar_valr r rr Mscsifdd}|S)Ncsttjtdrd|j}n d|j}t|}z|||WStk rt|}|f||}|j|dkri|<d|kri||<d||kri|||<||||<|YSXdS)Nz _%s_factorys _%s_factoryrargskwargs) rrr#typerrKeyError__dict__update)Z baseModuler.r/rZ kwargs_tuplemodZobjsfactoryZ moduleCacher r moduleFactoryYs$      z+moduleFactoryFactory..moduleFactoryr )r6r7r r5rr Vscsifdd}|S)Ncs2t|t|f}|kr*|||<|Sr)rr)r.r/r!cachefuncr rwrappedvszmemoize..wrappedr )r:r;r r8rmemoizessr<)Z __future__rrrtypesrZpip._vendor.sixrZxml.etree.cElementTreeZetreeZ cElementTreer ImportErrorZxml.etree.ElementTreeZ ElementTree__all__evalZ_xrrr rrr r r r<r r r rs0     # PKd]Yp5p53html5lib/__pycache__/_ihatexml.cpython-38.opt-1.pycnu[U .eAA @sddlmZmZmZddlZddlZddlmZdZdZ dZ dZ d Z d ee gZd ee d d d e e gZd ed gZedZedZddZddZeddZddZddZddZddZedZedZed ZGd!d"d"eZ dS)#)absolute_importdivisionunicode_literalsN)DataLossWarninga^ [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5] | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386 | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE] | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0 | [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F] | [#x0451-#x045C] | [#x045E-#x0481] | [#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC] | [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] | #x0559 | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2] | [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] | [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5 | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D | [#x0958-#x0961] | [#x0985-#x098C] | [#x098F-#x0990] | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9] | [#x09DC-#x09DD] | [#x09DF-#x09E1] | [#x09F0-#x09F1] | [#x0A05-#x0A0A] | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30] | [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39] | [#x0A59-#x0A5C] | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B] | #x0A8D | [#x0A8F-#x0A91] | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0 | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] | [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A] | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C] | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33] | [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] | #x0CDE | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C] | [#x0D0E-#x0D10] | [#x0D12-#x0D28] | [#x0D2A-#x0D39] | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33] | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88] | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F] | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB] | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] | [#x0F49-#x0F69] | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103] | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] | [#x110E-#x1112] | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150 | [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165 | #x1167 | #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175 | #x119E | #x11A8 | #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8] | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9 | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15] | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D] | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D] | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4] | [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126 | [#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094] | [#x30A1-#x30FA] | [#x3105-#x312C] | [#xAC00-#xD7A3]z*[#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]a [#x0300-#x0345] | [#x0360-#x0361] | [#x0483-#x0486] | [#x0591-#x05A1] | [#x05A3-#x05B9] | [#x05BB-#x05BD] | #x05BF | [#x05C1-#x05C2] | #x05C4 | [#x064B-#x0652] | #x0670 | [#x06D6-#x06DC] | [#x06DD-#x06DF] | [#x06E0-#x06E4] | [#x06E7-#x06E8] | [#x06EA-#x06ED] | [#x0901-#x0903] | #x093C | [#x093E-#x094C] | #x094D | [#x0951-#x0954] | [#x0962-#x0963] | [#x0981-#x0983] | #x09BC | #x09BE | #x09BF | [#x09C0-#x09C4] | [#x09C7-#x09C8] | [#x09CB-#x09CD] | #x09D7 | [#x09E2-#x09E3] | #x0A02 | #x0A3C | #x0A3E | #x0A3F | [#x0A40-#x0A42] | [#x0A47-#x0A48] | [#x0A4B-#x0A4D] | [#x0A70-#x0A71] | [#x0A81-#x0A83] | #x0ABC | [#x0ABE-#x0AC5] | [#x0AC7-#x0AC9] | [#x0ACB-#x0ACD] | [#x0B01-#x0B03] | #x0B3C | [#x0B3E-#x0B43] | [#x0B47-#x0B48] | [#x0B4B-#x0B4D] | [#x0B56-#x0B57] | [#x0B82-#x0B83] | [#x0BBE-#x0BC2] | [#x0BC6-#x0BC8] | [#x0BCA-#x0BCD] | #x0BD7 | [#x0C01-#x0C03] | [#x0C3E-#x0C44] | [#x0C46-#x0C48] | [#x0C4A-#x0C4D] | [#x0C55-#x0C56] | [#x0C82-#x0C83] | [#x0CBE-#x0CC4] | [#x0CC6-#x0CC8] | [#x0CCA-#x0CCD] | [#x0CD5-#x0CD6] | [#x0D02-#x0D03] | [#x0D3E-#x0D43] | [#x0D46-#x0D48] | [#x0D4A-#x0D4D] | #x0D57 | #x0E31 | [#x0E34-#x0E3A] | [#x0E47-#x0E4E] | #x0EB1 | [#x0EB4-#x0EB9] | [#x0EBB-#x0EBC] | [#x0EC8-#x0ECD] | [#x0F18-#x0F19] | #x0F35 | #x0F37 | #x0F39 | #x0F3E | #x0F3F | [#x0F71-#x0F84] | [#x0F86-#x0F8B] | [#x0F90-#x0F95] | #x0F97 | [#x0F99-#x0FAD] | [#x0FB1-#x0FB7] | #x0FB9 | [#x20D0-#x20DC] | #x20E1 | [#x302A-#x302F] | #x3099 | #x309Aa  [#x0030-#x0039] | [#x0660-#x0669] | [#x06F0-#x06F9] | [#x0966-#x096F] | [#x09E6-#x09EF] | [#x0A66-#x0A6F] | [#x0AE6-#x0AEF] | [#x0B66-#x0B6F] | [#x0BE7-#x0BEF] | [#x0C66-#x0C6F] | [#x0CE6-#x0CEF] | [#x0D66-#x0D6F] | [#x0E50-#x0E59] | [#x0ED0-#x0ED9] | [#x0F20-#x0F29]z} #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46 | #x0EC6 | #x3005 | #[#x3031-#x3035] | [#x309D-#x309E] | [#x30FC-#x30FE] | .-_z#x([\d|A-F]{4,4})z'\[#x([\d|A-F]{4,4})-#x([\d|A-F]{4,4})\]cCsdd|dD}g}|D]}d}ttfD]V}||}|dk r,|dd|Dt|ddkrz|dd|d<d }qq,|s|t|gdqt|}|S) NcSsg|] }|qS)strip.0itemr r B/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_ihatexml.py hsz$charStringToList..rFcSsg|] }t|qSr )hexToIntr r r rrosrT) splitreChar reCharRangematchappendgroupslenordnormaliseCharList)charsZ charRangesrvrZ foundMatchZregexprr r rcharStringToListgs   r cCst|}|D]}q g}d}|t|krd}|||||t|kr|||d|dddkr|||d|dd<|d7}q8||7}q|SNrrr)sortedrr)charListrrijr r rr|s 0  rZFFFFcCsg}|ddkr*|d|dddgt|ddD].\}}||dd||dddgq:|ddtkr||dddtg|Sr!)r enumerate max_unicode)r#rr$rr r r missingRangess (r)cCsng}|D]V}|d|dkr4|tt|dq|tt|ddtt|dqdd|S)Nrrr z[%s])r escapeRegexpchrjoin)r#rrr r rlistToRegexpStrsr.cCs t|dS)Nr&)int)Zhex_strr r rrsrcCs"d}|D]}||d|}q|S)N)r^$*+?{}[]|()r \)replace)stringZspecialCharacterscharr r rr+sr+u[-,/:-@\[-\^`\{-¶¸-¿×÷IJ-ijĿ-ŀʼnſDŽ-njDZ-dzǶ-ǹȘ-ɏʩ-ʺ˂-ˏ˒-˿͆-͟͢-΅΋΍΢Ϗϗ-ϙϛϝϟϡϴ-ЀЍѐѝ҂҇-ҏӅ-ӆӉ-ӊӍ-ӏӬ-ӭӶ-ӷӺ-԰՗-՘՚-ՠև-֐ֺ֢־׀׃ׅ-׏׫-ׯ׳-ؠػ-ؿٓ-ٟ٪-ٯڸ-ڹڿۏ۔۩ۮ-ۯۺ-ऀऄऺ-ऻॎ-ॐॕ-ॗ।-॥॰-ঀ঄঍-঎঑-঒঩঱঳-঵঺-঻ঽ৅-৆৉-৊ৎ-৖৘-৛৞৤-৥৲-ਁਃ-਄਋-਎਑-਒਩਱਴਷਺-਻਽੃-੆੉-੊੎-੘੝੟-੥ੵ-઀઄ઌ઎઒઩઱઴઺-઻૆૊૎-૟ૡ-૥૰-଀଄଍-଎଑-଒଩଱଴-ଵ଺-଻ୄ-୆୉-୊୎-୕୘-୛୞ୢ-୥୰-஁஄஋-஍஑஖-஘஛஝஠-஢஥-஧஫-஭ஶ஺-஽௃-௅௉௎-௖௘-௦௰-ఀఄ఍఑఩ఴ఺-ఽ౅౉౎-౔౗-౟ౢ-౥౰-ಁ಄಍಑಩಴಺-ಽ೅೉೎-೔೗-ೝ೟ೢ-೥೰-ഁഄ഍഑ഩഺ-ഽൄ-൅൉ൎ-ൖ൘-ൟൢ-൥൰-฀ฯ฻-฿๏๚-຀຃຅-ຆຉ຋-ຌຎ-ຓຘຠ຤຦ຨ-ຩຬຯ຺຾-຿໅໇໎-໏໚-༗༚-༟༪-༴༶༸༺-༽཈ཪ-཰྅ྌ-ྏྖ྘ྮ-ྰྸྺ-႟჆-჏ჷ-ჿᄁᄄᄈᄊᄍᄓ-ᄻᄽᄿᅁ-ᅋᅍᅏᅑ-ᅓᅖ-ᅘᅚ-ᅞᅢᅤᅦᅨᅪ-ᅬᅯ-ᅱᅴᅶ-ᆝᆟ-ᆧᆩ-ᆪᆬ-ᆭᆰ-ᆶᆹᆻᇃ-ᇪᇬ-ᇯᇱ-ᇸᇺ-᷿ẜ-ẟỺ-ỿ἖-἗἞-἟὆-὇὎-὏὘὚὜὞὾-὿᾵᾽᾿-῁῅῍-῏῔-῕῜-῟῭-῱῵´-⃏⃝-⃠⃢-℥℧-℩ℬ-ℭℯ-ⅿↃ-〄〆〈-〠〰〶-぀ゕ-゘゛-゜ゟ-゠・ヿ-㄄ㄭ-䷿龦-꯿힤-￿]u[-@\[-\^`\{-¿×÷IJ-ijĿ-ŀʼnſDŽ-njDZ-dzǶ-ǹȘ-ɏʩ-ʺ˂-΅·΋΍΢Ϗϗ-ϙϛϝϟϡϴ-ЀЍѐѝ҂-ҏӅ-ӆӉ-ӊӍ-ӏӬ-ӭӶ-ӷӺ-԰՗-՘՚-ՠև-׏׫-ׯ׳-ؠػ-ـً-ٰڸ-ڹڿۏ۔ۖ-ۤۧ-ऄऺ-़ा-ॗॢ-঄঍-঎঑-঒঩঱঳-঵঺-৛৞ৢ-৯৲-਄਋-਎਑-਒਩਱਴਷਺-੘੝੟-ੱੵ-઄ઌ઎઒઩઱઴઺-઼ા-૟ૡ-଄଍-଎଑-଒଩଱଴-ଵ଺-଼ା-୛୞ୢ-஄஋-஍஑஖-஘஛஝஠-஢஥-஧஫-஭ஶ஺-ఄ఍఑఩ఴ఺-౟ౢ-಄಍಑಩಴಺-ೝ೟ೢ-ഄ഍഑ഩഺ-ൟൢ-฀ฯัิ-฿ๆ-຀຃຅-ຆຉ຋-ຌຎ-ຓຘຠ຤຦ຨ-ຩຬຯັິ-ຼ຾-຿໅-༿཈ཪ-႟჆-჏ჷ-ჿᄁᄄᄈᄊᄍᄓ-ᄻᄽᄿᅁ-ᅋᅍᅏᅑ-ᅓᅖ-ᅘᅚ-ᅞᅢᅤᅦᅨᅪ-ᅬᅯ-ᅱᅴᅶ-ᆝᆟ-ᆧᆩ-ᆪᆬ-ᆭᆰ-ᆶᆹᆻᇃ-ᇪᇬ-ᇯᇱ-ᇸᇺ-᷿ẜ-ẟỺ-ỿ἖-἗἞-἟὆-὇὎-὏὘὚὜὞὾-὿᾵᾽᾿-῁῅῍-῏῔-῕῜-῟῭-῱῵´-℥℧-℩ℬ-ℭℯ-ⅿↃ-〆〈-〠〪-぀ゕ-゠・-㄄ㄭ-䷿龦-꯿힤-￿]z#[^ a-zA-Z0-9\-'()+,./:=?;!*#@$_%]c@sreZdZedZdddZdddZd d Zd d Z d dZ ddZ ddZ ddZ ddZddZddZdS) InfosetFilterz U[\dA-F]{5,5}FTcCs.||_||_||_||_||_||_i|_dSN)dropXmlnsLocalNamedropXmlnsAttrNspreventDoubleDashCommentspreventDashAtCommentEndreplaceFormFeedCharacterspreventSingleQuotePubid replaceCache)selfrBrCrDrErFrGr r r__init__szInfosetFilter.__init__NcCsL|jr |dr tdtdS|jr>|dkr>tdtdS||SdS)Nzxmlns:z"Attributes cannot begin with xmlnszhttp://www.w3.org/2000/xmlns/z)Attributes cannot be in the xml namespace)rB startswithwarningswarnrrC toXmlName)rIname namespacer r rcoerceAttributes  zInfosetFilter.coerceAttributecCs ||SrA)rN)rIrOr r r coerceElementszInfosetFilter.coerceElementcCsJ|jrFd|kr(tdt|dd}q|drFtdt|d7}|S)Nz--z'Comments cannot contain adjacent dashesz- -r zComments cannot end in a dash )rDrLrMrr=endswith)rIdatar r r coerceComments   zInfosetFilter.coerceCommentcCs6|jr2t|dD]}tdtq|dd}|S)N zText cannot contain U+000CrS)rFrangecountrLrMrr=)rIrUr r r rcoerceCharacterss  zInfosetFilter.coerceCharacterscCsl|}t|D]&}tdt||}|||}q|jrh|ddkrhtdt|d|d}|S)NzCoercing non-XML pubid'rz!Pubid cannot contain single quote) nonPubidCharRegexpfindallrLrMrgetReplacementCharacterr=rGfind)rIrUZ dataOutputr? replacementr r r coercePubids   zInfosetFilter.coercePubidc Cs|d}|dd}t|}|r:tdt||}n|}|}tt|}|D]&}tdt||} | || }qT||S)NrrzCoercing non-XML name) nonXmlNameFirstBMPRegexprrLrMrr^setnonXmlNameBMPRegexpr]r=) rIrO nameFirstZnameRestmZnameFirstOutputZnameRestOutputZ replaceCharsr?r`r r rrNs      zInfosetFilter.toXmlNamecCs$||jkr|j|}n ||}|SrA)rH escapeCharrIr?r`r r rr^s   z%InfosetFilter.getReplacementCharactercCs,t|j|D]}||||}q|SrA)rcreplacementRegexpr]r= unescapeChar)rIrOrr r r fromXmlNameszInfosetFilter.fromXmlNamecCsdt|}||j|<|S)NzU%05X)rrHrhr r rrgs  zInfosetFilter.escapeCharcCstt|dddS)Nrr&)r,r/)rIZcharcoder r rrjszInfosetFilter.unescapeChar)FFFFTF)N)__name__ __module__ __qualname__recompilerirJrQrRrVrZrarNr^rkrgrjr r r rr@s$     r@)!Z __future__rrrrorLZ constantsrZbaseCharZ ideographicZcombiningCharacterZdigitZextenderr-ZletterrOrerprrr rr/r(r)r.rr+rdrbr\objectr@r r r rs4 0        PKd];055-html5lib/__pycache__/_ihatexml.cpython-38.pycnu[U .eAA @sddlmZmZmZddlZddlZddlmZdZdZ dZ dZ d Z d ee gZd ee d d d e e gZd ed gZedZedZddZddZeddZddZddZddZddZedZedZed ZGd!d"d"eZ dS)#)absolute_importdivisionunicode_literalsN)DataLossWarninga^ [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5] | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386 | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE] | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0 | [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F] | [#x0451-#x045C] | [#x045E-#x0481] | [#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC] | [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] | #x0559 | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2] | [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] | [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5 | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D | [#x0958-#x0961] | [#x0985-#x098C] | [#x098F-#x0990] | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9] | [#x09DC-#x09DD] | [#x09DF-#x09E1] | [#x09F0-#x09F1] | [#x0A05-#x0A0A] | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30] | [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39] | [#x0A59-#x0A5C] | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B] | #x0A8D | [#x0A8F-#x0A91] | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0 | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] | [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A] | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C] | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33] | [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] | #x0CDE | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C] | [#x0D0E-#x0D10] | [#x0D12-#x0D28] | [#x0D2A-#x0D39] | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33] | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88] | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F] | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB] | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] | [#x0F49-#x0F69] | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103] | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] | [#x110E-#x1112] | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150 | [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165 | #x1167 | #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175 | #x119E | #x11A8 | #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8] | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9 | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15] | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D] | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D] | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4] | [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126 | [#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094] | [#x30A1-#x30FA] | [#x3105-#x312C] | [#xAC00-#xD7A3]z*[#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]a [#x0300-#x0345] | [#x0360-#x0361] | [#x0483-#x0486] | [#x0591-#x05A1] | [#x05A3-#x05B9] | [#x05BB-#x05BD] | #x05BF | [#x05C1-#x05C2] | #x05C4 | [#x064B-#x0652] | #x0670 | [#x06D6-#x06DC] | [#x06DD-#x06DF] | [#x06E0-#x06E4] | [#x06E7-#x06E8] | [#x06EA-#x06ED] | [#x0901-#x0903] | #x093C | [#x093E-#x094C] | #x094D | [#x0951-#x0954] | [#x0962-#x0963] | [#x0981-#x0983] | #x09BC | #x09BE | #x09BF | [#x09C0-#x09C4] | [#x09C7-#x09C8] | [#x09CB-#x09CD] | #x09D7 | [#x09E2-#x09E3] | #x0A02 | #x0A3C | #x0A3E | #x0A3F | [#x0A40-#x0A42] | [#x0A47-#x0A48] | [#x0A4B-#x0A4D] | [#x0A70-#x0A71] | [#x0A81-#x0A83] | #x0ABC | [#x0ABE-#x0AC5] | [#x0AC7-#x0AC9] | [#x0ACB-#x0ACD] | [#x0B01-#x0B03] | #x0B3C | [#x0B3E-#x0B43] | [#x0B47-#x0B48] | [#x0B4B-#x0B4D] | [#x0B56-#x0B57] | [#x0B82-#x0B83] | [#x0BBE-#x0BC2] | [#x0BC6-#x0BC8] | [#x0BCA-#x0BCD] | #x0BD7 | [#x0C01-#x0C03] | [#x0C3E-#x0C44] | [#x0C46-#x0C48] | [#x0C4A-#x0C4D] | [#x0C55-#x0C56] | [#x0C82-#x0C83] | [#x0CBE-#x0CC4] | [#x0CC6-#x0CC8] | [#x0CCA-#x0CCD] | [#x0CD5-#x0CD6] | [#x0D02-#x0D03] | [#x0D3E-#x0D43] | [#x0D46-#x0D48] | [#x0D4A-#x0D4D] | #x0D57 | #x0E31 | [#x0E34-#x0E3A] | [#x0E47-#x0E4E] | #x0EB1 | [#x0EB4-#x0EB9] | [#x0EBB-#x0EBC] | [#x0EC8-#x0ECD] | [#x0F18-#x0F19] | #x0F35 | #x0F37 | #x0F39 | #x0F3E | #x0F3F | [#x0F71-#x0F84] | [#x0F86-#x0F8B] | [#x0F90-#x0F95] | #x0F97 | [#x0F99-#x0FAD] | [#x0FB1-#x0FB7] | #x0FB9 | [#x20D0-#x20DC] | #x20E1 | [#x302A-#x302F] | #x3099 | #x309Aa  [#x0030-#x0039] | [#x0660-#x0669] | [#x06F0-#x06F9] | [#x0966-#x096F] | [#x09E6-#x09EF] | [#x0A66-#x0A6F] | [#x0AE6-#x0AEF] | [#x0B66-#x0B6F] | [#x0BE7-#x0BEF] | [#x0C66-#x0C6F] | [#x0CE6-#x0CEF] | [#x0D66-#x0D6F] | [#x0E50-#x0E59] | [#x0ED0-#x0ED9] | [#x0F20-#x0F29]z} #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46 | #x0EC6 | #x3005 | #[#x3031-#x3035] | [#x309D-#x309E] | [#x30FC-#x30FE] | .-_z#x([\d|A-F]{4,4})z'\[#x([\d|A-F]{4,4})-#x([\d|A-F]{4,4})\]cCsdd|dD}g}|D]}d}ttfD]V}||}|dk r,|dd|Dt|ddkrz|dd|d<d }qq,|st|dkst|t|gdqt |}|S) NcSsg|] }|qS)strip.0itemr r B/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_ihatexml.py hsz$charStringToList..rFcSsg|] }t|qSr )hexToIntr r r rrosrT) splitreChar reCharRangematchappendgroupslenAssertionErrorordnormaliseCharList)charsZ charRangesrvrZ foundMatchZregexprr r rcharStringToListgs"  r!cCst|}|D]}|d|dks tq g}d}|t|krd}|||||t|kr|||d|dddkr|||d|dd<|d7}qL||7}q.|S)Nrrr)sortedrrr)charListrr ijr r rr|s 0  rZFFFFcCsg}|ddkr*|d|dddgt|ddD].\}}||dd||dddgq:|ddtkr||dddtg|S)Nrrr)r enumerate max_unicode)r#r r$rr r r missingRangess (r)cCsng}|D]V}|d|dkr4|tt|dq|tt|ddtt|dqdd|S)Nrrr z[%s])r escapeRegexpchrjoin)r#r rr r rlistToRegexpStrsr.cCs t|dS)Nr&)int)Zhex_strr r rrsrcCs"d}|D]}||d|}q|S)N)r^$*+?{}[]|()r \)replace)stringZspecialCharacterscharr r rr+sr+u[-,/:-@\[-\^`\{-¶¸-¿×÷IJ-ijĿ-ŀʼnſDŽ-njDZ-dzǶ-ǹȘ-ɏʩ-ʺ˂-ˏ˒-˿͆-͟͢-΅΋΍΢Ϗϗ-ϙϛϝϟϡϴ-ЀЍѐѝ҂҇-ҏӅ-ӆӉ-ӊӍ-ӏӬ-ӭӶ-ӷӺ-԰՗-՘՚-ՠև-֐ֺ֢־׀׃ׅ-׏׫-ׯ׳-ؠػ-ؿٓ-ٟ٪-ٯڸ-ڹڿۏ۔۩ۮ-ۯۺ-ऀऄऺ-ऻॎ-ॐॕ-ॗ।-॥॰-ঀ঄঍-঎঑-঒঩঱঳-঵঺-঻ঽ৅-৆৉-৊ৎ-৖৘-৛৞৤-৥৲-ਁਃ-਄਋-਎਑-਒਩਱਴਷਺-਻਽੃-੆੉-੊੎-੘੝੟-੥ੵ-઀઄ઌ઎઒઩઱઴઺-઻૆૊૎-૟ૡ-૥૰-଀଄଍-଎଑-଒଩଱଴-ଵ଺-଻ୄ-୆୉-୊୎-୕୘-୛୞ୢ-୥୰-஁஄஋-஍஑஖-஘஛஝஠-஢஥-஧஫-஭ஶ஺-஽௃-௅௉௎-௖௘-௦௰-ఀఄ఍఑఩ఴ఺-ఽ౅౉౎-౔౗-౟ౢ-౥౰-ಁ಄಍಑಩಴಺-ಽ೅೉೎-೔೗-ೝ೟ೢ-೥೰-ഁഄ഍഑ഩഺ-ഽൄ-൅൉ൎ-ൖ൘-ൟൢ-൥൰-฀ฯ฻-฿๏๚-຀຃຅-ຆຉ຋-ຌຎ-ຓຘຠ຤຦ຨ-ຩຬຯ຺຾-຿໅໇໎-໏໚-༗༚-༟༪-༴༶༸༺-༽཈ཪ-཰྅ྌ-ྏྖ྘ྮ-ྰྸྺ-႟჆-჏ჷ-ჿᄁᄄᄈᄊᄍᄓ-ᄻᄽᄿᅁ-ᅋᅍᅏᅑ-ᅓᅖ-ᅘᅚ-ᅞᅢᅤᅦᅨᅪ-ᅬᅯ-ᅱᅴᅶ-ᆝᆟ-ᆧᆩ-ᆪᆬ-ᆭᆰ-ᆶᆹᆻᇃ-ᇪᇬ-ᇯᇱ-ᇸᇺ-᷿ẜ-ẟỺ-ỿ἖-἗἞-἟὆-὇὎-὏὘὚὜὞὾-὿᾵᾽᾿-῁῅῍-῏῔-῕῜-῟῭-῱῵´-⃏⃝-⃠⃢-℥℧-℩ℬ-ℭℯ-ⅿↃ-〄〆〈-〠〰〶-぀ゕ-゘゛-゜ゟ-゠・ヿ-㄄ㄭ-䷿龦-꯿힤-￿]u[-@\[-\^`\{-¿×÷IJ-ijĿ-ŀʼnſDŽ-njDZ-dzǶ-ǹȘ-ɏʩ-ʺ˂-΅·΋΍΢Ϗϗ-ϙϛϝϟϡϴ-ЀЍѐѝ҂-ҏӅ-ӆӉ-ӊӍ-ӏӬ-ӭӶ-ӷӺ-԰՗-՘՚-ՠև-׏׫-ׯ׳-ؠػ-ـً-ٰڸ-ڹڿۏ۔ۖ-ۤۧ-ऄऺ-़ा-ॗॢ-঄঍-঎঑-঒঩঱঳-঵঺-৛৞ৢ-৯৲-਄਋-਎਑-਒਩਱਴਷਺-੘੝੟-ੱੵ-઄ઌ઎઒઩઱઴઺-઼ા-૟ૡ-଄଍-଎଑-଒଩଱଴-ଵ଺-଼ା-୛୞ୢ-஄஋-஍஑஖-஘஛஝஠-஢஥-஧஫-஭ஶ஺-ఄ఍఑఩ఴ఺-౟ౢ-಄಍಑಩಴಺-ೝ೟ೢ-ഄ഍഑ഩഺ-ൟൢ-฀ฯัิ-฿ๆ-຀຃຅-ຆຉ຋-ຌຎ-ຓຘຠ຤຦ຨ-ຩຬຯັິ-ຼ຾-຿໅-༿཈ཪ-႟჆-჏ჷ-ჿᄁᄄᄈᄊᄍᄓ-ᄻᄽᄿᅁ-ᅋᅍᅏᅑ-ᅓᅖ-ᅘᅚ-ᅞᅢᅤᅦᅨᅪ-ᅬᅯ-ᅱᅴᅶ-ᆝᆟ-ᆧᆩ-ᆪᆬ-ᆭᆰ-ᆶᆹᆻᇃ-ᇪᇬ-ᇯᇱ-ᇸᇺ-᷿ẜ-ẟỺ-ỿ἖-἗἞-἟὆-὇὎-὏὘὚὜὞὾-὿᾵᾽᾿-῁῅῍-῏῔-῕῜-῟῭-῱῵´-℥℧-℩ℬ-ℭℯ-ⅿↃ-〆〈-〠〪-぀ゕ-゠・-㄄ㄭ-䷿龦-꯿힤-￿]z#[^ a-zA-Z0-9\-'()+,./:=?;!*#@$_%]c@sreZdZedZdddZdddZd d Zd d Z d dZ ddZ ddZ ddZ ddZddZddZdS) InfosetFilterz U[\dA-F]{5,5}FTcCs.||_||_||_||_||_||_i|_dSN)dropXmlnsLocalNamedropXmlnsAttrNspreventDoubleDashCommentspreventDashAtCommentEndreplaceFormFeedCharacterspreventSingleQuotePubid replaceCache)selfrBrCrDrErFrGr r r__init__szInfosetFilter.__init__NcCsL|jr |dr tdtdS|jr>|dkr>tdtdS||SdS)Nzxmlns:z"Attributes cannot begin with xmlnszhttp://www.w3.org/2000/xmlns/z)Attributes cannot be in the xml namespace)rB startswithwarningswarnrrC toXmlName)rIname namespacer r rcoerceAttributes  zInfosetFilter.coerceAttributecCs ||SrA)rN)rIrOr r r coerceElementszInfosetFilter.coerceElementcCsJ|jrFd|kr(tdt|dd}q|drFtdt|d7}|S)Nz--z'Comments cannot contain adjacent dashesz- -r zComments cannot end in a dash )rDrLrMrr=endswith)rIdatar r r coerceComments   zInfosetFilter.coerceCommentcCs6|jr2t|dD]}tdtq|dd}|S)N zText cannot contain U+000CrS)rFrangecountrLrMrr=)rIrUr r r rcoerceCharacterss  zInfosetFilter.coerceCharacterscCsl|}t|D]&}tdt||}|||}q|jrh|ddkrhtdt|d|d}|S)NzCoercing non-XML pubid'rz!Pubid cannot contain single quote) nonPubidCharRegexpfindallrLrMrgetReplacementCharacterr=rGfind)rIrUZ dataOutputr? replacementr r r coercePubids   zInfosetFilter.coercePubidc Cs|d}|dd}t|}|r:tdt||}n|}|}tt|}|D]&}tdt||} | || }qT||S)NrrzCoercing non-XML name) nonXmlNameFirstBMPRegexprrLrMrr^setnonXmlNameBMPRegexpr]r=) rIrO nameFirstZnameRestmZnameFirstOutputZnameRestOutputZ replaceCharsr?r`r r rrNs      zInfosetFilter.toXmlNamecCs$||jkr|j|}n ||}|SrA)rH escapeCharrIr?r`r r rr^s   z%InfosetFilter.getReplacementCharactercCs,t|j|D]}||||}q|SrA)rcreplacementRegexpr]r= unescapeChar)rIrOrr r r fromXmlNameszInfosetFilter.fromXmlNamecCsdt|}||j|<|S)NzU%05X)rrHrhr r rrgs  zInfosetFilter.escapeCharcCstt|dddS)Nrr&)r,r/)rIZcharcoder r rrjszInfosetFilter.unescapeChar)FFFFTF)N)__name__ __module__ __qualname__recompilerirJrQrRrVrZrarNr^rkrgrjr r r rr@s$     r@)!Z __future__rrrrorLZ constantsrZbaseCharZ ideographicZcombiningCharacterZdigitZextenderr-ZletterrOrerprrr!rr/r(r)r.rr+rdrbr\objectr@r r r rs4 0        PKd]7ţss/html5lib/__pycache__/html5parser.cpython-38.pycnu[U .e@sddlmZmZmZddlmZmZddlZddlm Z ddl m Z ddl m Z ddl m Z dd lmZdd l mZdd lmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"d!ddZ#d"ddZ$ddZ%Gddde&Z'ej(ddZ)ddZ*d#ddZ+Gdd d e,Z-dS)$)absolute_importdivisionunicode_literals)with_metaclassviewkeysN) OrderedDict) _inputstream) _tokenizer) treebuilders)Marker)_utils)spaceCharactersasciiUpper2LowerspecialElementsheadingElements cdataElementsrcdataElements tokenTypes tagTokenTypes namespaceshtmlIntegrationPointElements"mathmlTextIntegrationPointElementsadjustForeignAttributesadjustMathMLAttributesadjustSVGAttributesE_ReparseExceptionetreeTcKs$t|}t||d}|j|f|S)aParse an HTML document as a string or file-like object into a tree :arg doc: the document to parse as a string or file-like object :arg treebuilder: the treebuilder to use when parsing :arg namespaceHTMLElements: whether or not to namespace HTML elements :returns: parsed tree Example: >>> from html5lib.html5parser import parse >>> parse('

This is a doc

') namespaceHTMLElements)r getTreeBuilder HTMLParserparse)doc treebuilderr kwargstbpr)D/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/html5parser.pyr#s  r#divcKs,t|}t||d}|j|fd|i|S)a#Parse an HTML fragment as a string or file-like object into a tree :arg doc: the fragment to parse as a string or file-like object :arg container: the container context to parse the fragment in :arg treebuilder: the treebuilder to use when parsing :arg namespaceHTMLElements: whether or not to namespace HTML elements :returns: parsed tree Example: >>> from html5lib.html5libparser import parseFragment >>> parseFragment('this is a fragment') r container)r r!r" parseFragment)r$r,r%r r&r'r(r)r)r*r-2s  r-csGfdddt}|S)NcseZdZfddZdS)z-method_decorator_metaclass..Decoratedcs>|D]$\}}t|tjr$|}|||<qt||||SN)items isinstancetypes FunctionTypetype__new__)metaZ classnamebasesZ classDictZ attributeNameZ attributefunctionr)r*r4Ms   z5method_decorator_metaclass..Decorated.__new__N)__name__ __module__ __qualname__r4r)r7r)r* DecoratedLsr<)r3)r8r<r)r7r*method_decorator_metaclassKsr=c@seZdZdZd+ddZd,dd Zd d Zed d ZddZ ddZ ddZ ddZ ddZ ddZd-ddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*ZdS).r"z]HTML parser Generates a tree structure from a stream of (possibly malformed) HTML. NFTcsL|_|dkrtd}||_g_tfddt|D_dS)a :arg tree: a treebuilder class controlling the type of tree that will be returned. Built in treebuilders can be accessed through html5lib.treebuilders.getTreeBuilder(treeType) :arg strict: raise an exception when a parse error is encountered :arg namespaceHTMLElements: whether or not to namespace HTML elements :arg debug: whether or not to enable debug mode which logs things Example: >>> from html5lib.html5parser import HTMLParser >>> parser = HTMLParser() # generates parser with etree builder >>> parser = HTMLParser('lxml', strict=True) # generates parser with lxml builder which is strict Nrcs g|]\}}||jfqSr))tree).0nameclsselfr)r* zsz'HTMLParser.__init__..) strictr r!r>errorsdict getPhasesr/phases)rCr>rEr debugr)rBr*__init__^s    zHTMLParser.__init__r+cKsh||_||_||_tj|fd|i||_|z |Wn$tk rb||YnXdS)Nparser) innerHTMLModer, scriptingr Z HTMLTokenizer tokenizerresetmainLoopr)rCstream innerHTMLr,rNr&r)r)r*_parse}s zHTMLParser._parsecCs|jd|_g|_g|_d|_|jr|j|_ |j t krL|j j |j _ n0|j tkrd|j j|j _ n|j dkr||j j|j _ n|jd|_|j|nd|_ |jd|_d|_d|_d|_dS)NFz no quirks plaintext beforeHtmlinitialT)r>rP firstStartTagrFlog compatModerMr,lowerrSrrO rcdataStatestater rawtextStateplaintextStaterIphaseinsertHtmlElementresetInsertionModeZ lastPhaseZbeforeRCDataPhase framesetOKrBr)r)r*rPs*         zHTMLParser.resetcCst|dsdS|jjjdjS)zName of the character encoding that was used to decode the input stream, or :obj:`None` if that is not determined yet rONr)hasattrrOrR charEncodingr@rBr)r)r*documentEncodings zHTMLParser.documentEncodingcCsJ|jdkr6|jtdkr6d|jko4|jdtdkS|j|jftkSdS)Nannotation-xmlmathmlencoding)z text/htmlzapplication/xhtml+xml)r@ namespacer attributes translaterrrCelementr)r)r*isHTMLIntegrationPoints    z!HTMLParser.isHTMLIntegrationPointcCs|j|jftkSr.)rjr@rrmr)r)r*isMathMLTextIntegrationPointsz'HTMLParser.isMathMLTextIntegrationPointcCshtd}td}td}td}td}td}td}|D]}d} |} | dk r| } |jjrp|jjdnd} | r~| jnd} | r| jnd} | d }||kr|| d | d id} qNt|jjd ksd| |jj ksd| | r||kr |d t ddgksd|||fksd| t dkrH| dkrH||krH|d dksd| | rl||||fkrl|j}n |jd}||kr|| } qN||kr|| } qN||kr|| } qN||kr|| } qN||kr|| } qN||krN|| } qN||kr@| dr@| ds@|dd | d iq@d}g}|rd||j|j}|r.|j|ks.tq.dS)N CharactersZSpaceCharactersStartTagEndTagCommentZDoctype ParseErrorr3datadatavarsrr@ZmglyphZ malignmarkrhrgsvginForeignContent selfClosingselfClosingAcknowledgedz&non-void-element-with-trailing-solidusT)rnormalizedTokensr> openElementsrjr@ parseErrorgetlendefaultNamespacerp frozensetrror`rIprocessCharactersprocessSpaceCharactersprocessStartTag processEndTagprocessCommentprocessDoctypeappend processEOFAssertionError)rCZCharactersTokenZSpaceCharactersTokenZ StartTagTokenZ EndTagTokenZ CommentTokenZ DoctypeTokenZParseErrorTokentokenZ prev_token new_token currentNodeZcurrentNodeNamespaceZcurrentNodeNamer3r`Z reprocessrIr)r)r*rQs                       zHTMLParser.mainLoopccs|jD]}||VqdSr.)rOnormalizeTokenrCrr)r)r*r}s zHTMLParser.normalizedTokenscOs |j|ddf|||jS)aParse a HTML document into a well-formed tree :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element). :arg scripting: treat noscript elements as if JavaScript was turned on :returns: parsed tree Example: >>> from html5lib.html5parser import HTMLParser >>> parser = HTMLParser() >>> parser.parse('

This is a doc

') FN)rTr>Z getDocumentrCrRargsr&r)r)r*r# szHTMLParser.parsecOs|j|df|||jS)aZParse a HTML fragment into a well-formed tree fragment :arg container: name of the element we're setting the innerHTML property if set to None, default to 'div' :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element) :arg scripting: treat noscript elements as if JavaScript was turned on :returns: parsed tree Example: >>> from html5lib.html5libparser import HTMLParser >>> parser = HTMLParser() >>> parser.parseFragment('this is a fragment') T)rTr>Z getFragmentrr)r)r*r-$szHTMLParser.parseFragmentXXX-undefined-errorcCs@|dkr i}|j|jj||f|jrr~r@rSrrjrrIr`)rCZlastZnewModesnodeZnodeNameZ new_phaser)r)r*rb`sD   zHTMLParser.resetInsertionModecCsR|dks t|j||dkr.|jj|j_n |jj|j_|j|_|j d|_dS)N)RAWTEXTRCDATArtext) rr> insertElementrOr^r]r\r` originalPhaserI)rCrZ contentTyper)r)r*parseRCDataRawtexts   zHTMLParser.parseRCDataRawtext)NFTF)Fr+F)rN)r9r:r;__doc__rKrTrPpropertyrfrorprQr}r#r-rrrrrrrbrr)r)r)r*r"Ws(  "  C  ,r"cs"dd}dd}Gdddt|||Gddd}Gd d d }Gfd d d }Gfd dd}Gfddd}Gfddd}Gfddd} Gfddd} Gfddd} Gfddd} Gfddd} Gfddd}Gfdd d }Gfd!d"d"}Gfd#d$d$}Gfd%d&d&}Gfd'd(d(}Gfd)d*d*}Gfd+d,d,}Gfd-d.d.}Gfd/d0d0}Gfd1d2d2}Gfd3d4d4}||||||| | | | | ||||||||||||d5S)6Ncs(tddtDfdd}|S)z4Logger that records which phase processes each tokencss|]\}}||fVqdSr.r))r?keyvaluer)r)r* sz)getPhases..log..csjdrt|dkr|d}zd|di}WnYnX|dtkr\|d|d<|jj|jjjj|jj j j|j jj|f|f||S|f||SdS)NZprocessrr3r@) r9 startswithrrrLrYrrOr]r` __class__)rCrr&rinfor8Z type_namesr)r*wrappeds    z'getPhases..log..wrapped)rGrr/)r8rr)rr*rYs zgetPhases..logcSs|r t|StSdSr.)r=r3)Z use_metaclassZmetaclass_funcr)r)r* getMetaclassszgetPhases..getMetaclassc@sXeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ dS)zgetPhases..PhasezNBase class for helper object that implements each phase of processing cSs||_||_dSr.)rLr>rCrLr>r)r)r*rKsz!getPhases..Phase.__init__cSstdSr.)NotImplementedErrorrBr)r)r*rsz#getPhases..Phase.processEOFcSs|j||jjddS)Nrvr> insertCommentr~rr)r)r*rsz'getPhases..Phase.processCommentcSs|jddS)Nzunexpected-doctyperLrrr)r)r*rsz'getPhases..Phase.processDoctypecSs|j|ddSNrwr> insertTextrr)r)r*rsz*getPhases..Phase.processCharacterscSs|j|ddSrrrr)r)r*rsz/getPhases..Phase.processSpaceCharacterscSs|j|d|SNr@)startTagHandlerrr)r)r*rsz(getPhases..Phase.processStartTagcSsf|jjs |ddkr |jd|dD],\}}||jjdjkr,||jjdj|<q,d|j_dS)Nr@rz non-html-rootrwrF)rLrXrr/r>r~rkrCrattrrr)r)r* startTagHtmls  z%getPhases..Phase.startTagHtmlcSs|j|d|Sr) endTagHandlerrr)r)r*rsz&getPhases..Phase.processEndTagN) r9r:r;rrKrrrrrrrrr)r)r)r*Phases rc@sLeZdZddZddZddZddZd d Zd d Zd dZ ddZ dS)zgetPhases..InitialPhasecSsdSr.r)rr)r)r*rsz6getPhases..InitialPhase.processSpaceCharacterscSs|j||jjdSr.r>rZdocumentrr)r)r*rsz.getPhases..InitialPhase.processCommentcSs|d}|d}|d}|d}|dks@|dk s@|dk rL|dkrL|jd|dkrXd}|j||dkrv|t}|r|ddks|d s|d ks|d r|dks|r|d krd |j_n$|ds|d r|dk rd|j_|jj d|j_ dS)Nr@publicIdsystemIdcorrectrzabout:legacy-compatzunknown-doctype)7z*+//silmaril//dtd html pro v0r11 19970101//z4-//advasoft ltd//dtd html 3.0 aswedit + extensions//z*-//as//dtd html 3.0 aswedit + extensions//z-//ietf//dtd html 2.0 level 1//z-//ietf//dtd html 2.0 level 2//z&-//ietf//dtd html 2.0 strict level 1//z&-//ietf//dtd html 2.0 strict level 2//z-//ietf//dtd html 2.0 strict//z-//ietf//dtd html 2.0//z-//ietf//dtd html 2.1e//z-//ietf//dtd html 3.0//z-//ietf//dtd html 3.2 final//z-//ietf//dtd html 3.2//z-//ietf//dtd html 3//z-//ietf//dtd html level 0//z-//ietf//dtd html level 1//z-//ietf//dtd html level 2//z-//ietf//dtd html level 3//z"-//ietf//dtd html strict level 0//z"-//ietf//dtd html strict level 1//z"-//ietf//dtd html strict level 2//z"-//ietf//dtd html strict level 3//z-//ietf//dtd html strict//z-//ietf//dtd html//z(-//metrius//dtd metrius presentational//z5-//microsoft//dtd internet explorer 2.0 html strict//z.-//microsoft//dtd internet explorer 2.0 html//z0-//microsoft//dtd internet explorer 2.0 tables//z5-//microsoft//dtd internet explorer 3.0 html strict//z.-//microsoft//dtd internet explorer 3.0 html//z0-//microsoft//dtd internet explorer 3.0 tables//z#-//netscape comm. corp.//dtd html//z*-//netscape comm. corp.//dtd strict html//z*-//o'reilly and associates//dtd html 2.0//z3-//o'reilly and associates//dtd html extended 1.0//z;-//o'reilly and associates//dtd html extended relaxed 1.0//zN-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//zE-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//z$-//spyglass//dtd html 2.0 extended//z+-//sq//dtd html 2.0 hotmetal + extensions//z--//sun microsystems corp.//dtd hotjava html//z4-//sun microsystems corp.//dtd hotjava strict html//z-//w3c//dtd html 3 1995-03-24//z-//w3c//dtd html 3.2 draft//z-//w3c//dtd html 3.2 final//z-//w3c//dtd html 3.2//z-//w3c//dtd html 3.2s draft//z-//w3c//dtd html 4.0 frameset//z#-//w3c//dtd html 4.0 transitional//z(-//w3c//dtd html experimental 19960712//z&-//w3c//dtd html experimental 970421//z-//w3c//dtd w3 html//z-//w3o//dtd w3 html 3.0//z#-//webtechs//dtd mozilla html 2.0//z-//webtechs//dtd mozilla html//)z$-//w3o//dtd w3 html strict 3.0//en//z"-/w3c/dtd html 4.0 transitional/enr)z -//w3c//dtd html 4.01 frameset//z$-//w3c//dtd html 4.01 transitional//z:http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtdquirks)z -//w3c//dtd xhtml 1.0 frameset//z$-//w3c//dtd xhtml 1.0 transitional//zlimited quirksrV) rLrr>Z insertDoctyperlrrr[rZrIr`)rCrr@rrrr)r)r*rsX   9<?@@ A z.getPhases..InitialPhase.processDoctypecSsd|j_|jjd|j_dS)NrrV)rLrZrIr`rBr)r)r* anythingElseMsz,getPhases..InitialPhase.anythingElsecSs|jd||S)Nzexpected-doctype-but-got-charsrLrrrr)r)r*rQs z1getPhases..InitialPhase.processCharacterscSs"|jdd|di||S)Nz"expected-doctype-but-got-start-tagr@rrr)r)r*rVs  z/getPhases..InitialPhase.processStartTagcSs"|jdd|di||S)Nz expected-doctype-but-got-end-tagr@rrr)r)r*r\s  z-getPhases..InitialPhase.processEndTagcSs|jd|dS)Nzexpected-doctype-but-got-eofTrrBr)r)r*rbs z*getPhases..InitialPhase.processEOFN) r9r:r;rrrrrrrrr)r)r)r* InitialPhases_rc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)z"getPhases..BeforeHtmlPhasecSs&|jtdd|jjd|j_dS)Nrrrr)r>Z insertRootimpliedTagTokenrLrIr`rBr)r)r*raisz4getPhases..BeforeHtmlPhase.insertHtmlElementcSs |dSNTrarBr)r)r*rnsz-getPhases..BeforeHtmlPhase.processEOFcSs|j||jjdSr.rrr)r)r*rrsz1getPhases..BeforeHtmlPhase.processCommentcSsdSr.r)rr)r)r*rusz9getPhases..BeforeHtmlPhase.processSpaceCharacterscSs ||Sr.rrr)r)r*rxsz4getPhases..BeforeHtmlPhase.processCharacterscSs |ddkrd|j_||S)Nr@rT)rLrXrarr)r)r*r|s z2getPhases..BeforeHtmlPhase.processStartTagcSs4|ddkr$|jdd|din ||SdS)Nr@rrrbrzunexpected-end-tag-before-html)rLrrarr)r)r*rs   z0getPhases..BeforeHtmlPhase.processEndTagN) r9r:r;rarrrrrrr)r)r)r*BeforeHtmlPhasegsrcsXeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)z"getPhases..BeforeHeadPhasecsV|||td|jfd|jfg|_|j|j_td|jfg|_ |j |j _dS)Nrrr) rKr MethodDispatcherr startTagHeadr startTagOtherdefaultendTagImplyHeadr endTagOtherrrr)r*rKs z+getPhases..BeforeHeadPhase.__init__cSs|tdddS)NrrrTrrrBr)r)r*rsz-getPhases..BeforeHeadPhase.processEOFcSsdSr.r)rr)r)r*rsz9getPhases..BeforeHeadPhase.processSpaceCharacterscSs|tdd|SNrrrrrr)r)r*rsz4getPhases..BeforeHeadPhase.processCharacterscSs|jjd|SNrrLrIrrr)r)r*rsz/getPhases..BeforeHeadPhase.startTagHtmlcSs0|j||jjd|j_|jjd|j_dS)NrvinHead)r>rr~ headPointerrLrIr`rr)r)r*rs z/getPhases..BeforeHeadPhase.startTagHeadcSs|tdd|Srrrr)r)r*rsz0getPhases..BeforeHeadPhase.startTagOthercSs|tdd|Srrrr)r)r*rsz2getPhases..BeforeHeadPhase.endTagImplyHeadcSs|jdd|didS)Nzend-tag-after-implied-rootr@rrr)r)r*rs z.getPhases..BeforeHeadPhase.endTagOtherN) r9r:r;rKrrrrrrrrr)rr)r*BeforeHeadPhases rcseZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!S)"zgetPhases..InHeadPhasec s|||td|jfd|jfd|jfd|jfd|jfd|jfd|j fd|j fg|_ |j |j _ td|jfd |jfg|_|j|j_ dS) Nrtitle)noframesstylenoscriptscript)basebasefontbgsoundcommandlinkr5r)rrr)rKr rr startTagTitlestartTagNoFramesStylestartTagNoscriptstartTagScriptstartTagBaseLinkCommand startTagMetarrrr endTagHeadendTagHtmlBodyBrrrrrr)r*rKs& z'getPhases..InHeadPhase.__init__cSs |dSrrrBr)r)r*rsz)getPhases..InHeadPhase.processEOFcSs ||Sr.rrr)r)r*rsz0getPhases..InHeadPhase.processCharacterscSs|jjd|Srrrr)r)r*rsz+getPhases..InHeadPhase.startTagHtmlcSs|jddS)Nz!two-heads-are-not-better-than-onerrr)r)r*rsz+getPhases..InHeadPhase.startTagHeadcSs$|j||jjd|d<dSNTr|r>rr~poprr)r)r*rs  z6getPhases..InHeadPhase.startTagBaseLinkCommandcSs|j||jjd|d<|d}|jjjjddkrd|krZ|jjj|dnVd|krd|kr|d d krt |d d }t |}|}|jjj|dS) NTr|rwrZ tentativecharsetZcontentz http-equivz content-typezutf-8)r>rr~rrLrOrRreZchangeEncodingr[r Z EncodingBytesencodeZContentAttrParserr#)rCrrkrwrLcodecr)r)r*rs    z+getPhases..InHeadPhase.startTagMetacSs|j|ddS)NrrLrrr)r)r*rsz,getPhases..InHeadPhase.startTagTitlecSs|j|ddS)Nrr rr)r)r*rsz4getPhases..InHeadPhase.startTagNoFramesStylecSs8|jjr|j|dn|j||jjd|j_dS)NrinHeadNoscript)rLrNrr>rrIr`rr)r)r*rs z/getPhases..InHeadPhase.startTagNoscriptcSs<|j||jjj|jj_|jj|j_|jjd|j_dS)Nr) r>rrLrOZscriptDataStater]r`rrIrr)r)r*rs  z-getPhases..InHeadPhase.startTagScriptcSs ||Sr.rrr)r)r*r sz,getPhases..InHeadPhase.startTagOthercSs:|jjj}|jdks&td|j|jjd|j_dS)NrzExpected head got %s afterHeadrLr>r~rr@rrIr`rCrrr)r)r*rsz)getPhases..InHeadPhase.endTagHeadcSs ||Sr.rrr)r)r*rsz/getPhases..InHeadPhase.endTagHtmlBodyBrcSs|jdd|didSNunexpected-end-tagr@rrr)r)r*rsz*getPhases..InHeadPhase.endTagOthercSs|tddS)Nr)rrrBr)r)r*rsz+getPhases..InHeadPhase.anythingElseN)r9r:r;rKrrrrrrrrrrrrrrrr)rr)r* InHeadPhases  rcsxeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZdS)z&getPhases..InHeadNoscriptPhasecsf|||td|jfd|jfd|jfg|_|j|j_td|j fd|j fg|_ |j |j _dS)Nr)rrrr5rr)rrrr) rKr rrrstartTagHeadNoscriptrrrendTagNoscriptendTagBrrrrrr)r*rK s z/getPhases..InHeadNoscriptPhase.__init__cSs|jd|dS)Nzeof-in-head-noscriptTrrBr)r)r*r0s z1getPhases..InHeadNoscriptPhase.processEOFcSs|jjd|SNr)rLrIrrr)r)r*r5sz5getPhases..InHeadNoscriptPhase.processCommentcSs|jd||S)Nzchar-in-head-noscriptrrr)r)r*r8s z8getPhases..InHeadNoscriptPhase.processCharacterscSs|jjd|SrrLrIrrr)r)r*r=sz=getPhases..InHeadNoscriptPhase.processSpaceCharacterscSs|jjd|Srrrr)r)r*r@sz3getPhases..InHeadNoscriptPhase.startTagHtmlcSs|jjd|Srrrr)r)r*rCsz>getPhases..InHeadNoscriptPhase.startTagBaseLinkCommandcSs|jdd|didSNunexpected-start-tagr@rrr)r)r*rFsz;getPhases..InHeadNoscriptPhase.startTagHeadNoscriptcSs"|jdd|di||SNzunexpected-inhead-noscript-tagr@rrr)r)r*rIsz4getPhases..InHeadNoscriptPhase.startTagOthercSs:|jjj}|jdks&td|j|jjd|j_dS)NrzExpected noscript got %srr r r)r)r*rNsz5getPhases..InHeadNoscriptPhase.endTagNoscriptcSs"|jdd|di||Srrrr)r)r*rSsz/getPhases..InHeadNoscriptPhase.endTagBrcSs|jdd|didSrrrr)r)r*rXsz2getPhases..InHeadNoscriptPhase.endTagOthercSs|tddS)Nr)rrrBr)r)r*r[sz3getPhases..InHeadNoscriptPhase.anythingElseN)r9r:r;rKrrrrrrrrrrrrr)rr)r*InHeadNoscriptPhases rcspeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdS)z!getPhases..AfterHeadPhasecsn|||td|jfd|jfd|jfd|jfd|jfg|_|j |j_ td|j fg|_ |j |j _ dS)Nrrr) rrrrr5rrrrr)rrr)rKr rr startTagBodystartTagFramesetstartTagFromHeadrrrrrrrrrr)r*rK`s  z*getPhases..AfterHeadPhase.__init__cSs |dSrrrBr)r)r*rqsz,getPhases..AfterHeadPhase.processEOFcSs ||Sr.rrr)r)r*rusz3getPhases..AfterHeadPhase.processCharacterscSs|jjd|Srrrr)r)r*rysz.getPhases..AfterHeadPhase.startTagHtmlcSs(d|j_|j||jjd|j_dS)NFr)rLrcr>rrIr`rr)r)r*r|s z.getPhases..AfterHeadPhase.startTagBodycSs |j||jjd|j_dS)Nr)r>rrLrIr`rr)r)r*rs z2getPhases..AfterHeadPhase.startTagFramesetcSsr|jdd|di|jj|jj|jjd||jjdddD] }|jdkrL|jj |qnqLdS)Nz#unexpected-start-tag-out-of-my-headr@rrvr) rLrr>r~rrrIrr@remover r)r)r*rs  z2getPhases..AfterHeadPhase.startTagFromHeadcSs|jdd|didSrrrr)r)r*rsz.getPhases..AfterHeadPhase.startTagHeadcSs ||Sr.rrr)r)r*rsz/getPhases..AfterHeadPhase.startTagOthercSs ||Sr.rrr)r)r*rsz2getPhases..AfterHeadPhase.endTagHtmlBodyBrcSs|jdd|didSrrrr)r)r*rsz-getPhases..AfterHeadPhase.endTagOthercSs.|jtdd|jjd|j_d|j_dS)NrrrrT)r>rrrLrIr`rcrBr)r)r*rsz.getPhases..AfterHeadPhase.anythingElseN)r9r:r;rKrrrrrrrrrrrr)rr)r*AfterHeadPhase_s  rcseZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)dOdPZ*dQdRZ+dSdTZ,dUdVZ-dWdXZ.dYdZZ/d[d\Z0d]d^Z1d_d`Z2dadbZ3dcddZ4dedfZ5dgS)hzgetPhases..InBodyPhasec$s||||j|_td|jfd|jfd|jfd|jfd|j ft |j fd|j fd|j fd|jfd |jfd |jfd |jfd |jfd |jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|j fd|j!fd|j"fd|j#fd|j$fd|j%fd |j&fg!|_'|j(|j'_)td|j*fd|j+fd!|j,fd|j-fd"|j.fd#|j/ft |j0fd$|j1fd|j2fd%|j3fg |_4|j5|j4_)dS)&Nr) rrrrrr5rrrrr)addressarticleaside blockquotecenterdetailsdirr+dlfieldset figcaptionfigurefooterheaderhgroupmainmenunavolr(sectionsummaryul)prelistingform)lidddtrUa) bbigcodeemfontissmallstrikestrongttunobrbutton)ZappletZmarqueeobjectZxmpr)ZarearembedimgkeygenZwbr)ZparamsourceZtrackinputhrimageisindextextareaZiframer)Znoembedrr)rprt)optionoptgroupZmathry) rcolrframerrrrrrr)rr r!r"rHr#r$Zdialogr%r+r&r'r(r)r*r+r,r5r-r.r/r0r4r1r2r3r()r8r9r7)r:r;r<r=r>r?r@rGrArBrCrDrErFr)6rKprocessSpaceCharactersNonPrerr rrstartTagProcessInHeadrrstartTagClosePrstartTagHeadingstartTagPreListing startTagFormstartTagListItemstartTagPlaintext startTagAstartTagFormatting startTagNobrstartTagButtonstartTagAppletMarqueeObject startTagXmp startTagTablestartTagVoidFormattingstartTagParamSource startTagInput startTagHr startTagImagestartTagIsIndexstartTagTextareastartTagIFramerstartTagRawtextstartTagSelect startTagRpRt startTagOpt startTagMath startTagSvgstartTagMisplacedrrr endTagBody endTagHtml endTagBlock endTagFormendTagPendTagListItem endTagHeadingendTagFormattingendTagAppletMarqueeObjectrrrrrr)r*rKs- z'getPhases..InBodyPhase.__init__cSs$|j|jko"|j|jko"|j|jkSr.)r@rjrk)rCZnode1Znode2r)r)r*isMatchingFormattingElements    z:getPhases..InBodyPhase.isMatchingFormattingElementcSs|j||jjd}g}|jjdddD](}|tkr@qXq.|||r.||q.t|dkshtt|dkr|jj |d|jj|dS)Nrv) r>rr~activeFormattingElementsr rrrrr)rCrrnZmatchingElementsrr)r)r*addFormattingElements     z3getPhases..InBodyPhase.addFormattingElementcSs>td}|jjdddD]}|j|kr|jdq:qdS)N) r8r9r7r(rrrrrrrrrvz expected-closing-tag-but-got-eof)rr>r~r@rLr)rCZallowed_elementsrr)r)r*rs   z)getPhases..InBodyPhase.processEOFcSsf|d}|j|_|drH|jjdjdkrH|jjdsH|dd}|rb|j|j|dS)Nrw rv)r4r5rRr) rYrrr>r~r@Z hasContent#reconstructActiveFormattingElementsr)rCrrwr)r)r*!processSpaceCharactersDropNewline s   z@getPhases..InBodyPhase.processSpaceCharactersDropNewlinecSsT|ddkrdS|j|j|d|jjrPtdd|dDrPd|j_dS)NrwcSsg|] }|tkqSr)rr?charr)r)r*rD"szDgetPhases..InBodyPhase.processCharacters..F)r>rrrLrcanyrr)r)r*rs  z0getPhases..InBodyPhase.processCharacterscSs|j|j|ddSr)r>rrrr)r)r*rY&s z;getPhases..InBodyPhase.processSpaceCharactersNonPrecSs|jjd|Srrrr)r)r*rZ*sz4getPhases..InBodyPhase.startTagProcessInHeadcSs|jdddit|jjdks4|jjdjdkrB|jjstnBd|j_|d D],\}}||jjdj krV||jjdj |<qVdS)Nrr@rrFrw) rLrrr>r~r@rSrrcr/rkrr)r)r*r-sz+getPhases..InBodyPhase.startTagBodycSs|jdddit|jjdks4|jjdjdkrB|jjstnp|jjsLnf|jjdj rv|jjdj |jjd|jjdjdkr|jj qv|j ||jj d|j_dS) Nrr@rrrrvrr)rLrrr>r~r@rSrrcparent removeChildrrrIr`rr)r)r*r8s" z/getPhases..InBodyPhase.startTagFramesetcSs.|jjdddr|td|j|dSNr(rHvariant)r>elementInScoper{rrrr)r)r*r[Fsz-getPhases..InBodyPhase.startTagClosePcSs>|jjdddr|td|j|d|j_|j|_dS)Nr(rHrF) r>rr{rrrLrcrrrr)r)r*r]Ks  z1getPhases..InBodyPhase.startTagPreListingcSsZ|jjr|jdddin:|jjdddr:|td|j||jjd|j_dS)Nrr@r6r(rHrrv) r> formPointerrLrrr{rrr~rr)r)r*r^Rs  z+getPhases..InBodyPhase.startTagFormcSsd|j_dgddgddgd}||d}t|jjD]@}|j|kr^|jjt|jdqx|j t kr6|jdkr6qxq6|jj d d d r|jjtd d|j |dS) NFr7r9r8)r7r9r8r@rs)rr+r(r(rHr) rLrcreversedr>r~r@r`rr nameTuplerrr)rCrZ stopNamesMapZ stopNamesrr)r)r*r_[s*    z/getPhases..InBodyPhase.startTagListItemcSs>|jjdddr|td|j||jjj|jj_dSr) r>rr{rrrLrOr_r]rr)r)r*r`qs z0getPhases..InBodyPhase.startTagPlaintextcSsb|jjdddr|td|jjdjtkrR|jdd|di|jj |j |dS)Nr(rHrrvrr@) r>rr{rr~r@rrLrrrrr)r)r*r\ws  z.getPhases..InBodyPhase.startTagHeadingcSs~|jd}|rf|jdddd|td||jjkrL|jj|||jjkrf|jj||j | |dS)Nr:$unexpected-start-tag-implies-end-tagZ startNameZendName) r>!elementInActiveFormattingElementsrLrr~rr~rrrr)rCrZ afeAElementr)r)r*ras    z(getPhases..InBodyPhase.startTagAcSs|j||dSr.)r>rrrr)r)r*rbs z1getPhases..InBodyPhase.startTagFormattingcSsP|j|jdrB|jdddd|td|j||dS)NrGrr)r>rrrLrrrrrr)r)r*rcs   z+getPhases..InBodyPhase.startTagNobrcSsT|jdr2|jdddd|td|S|j|j|d|j_dS)NrHrrF) r>rrLrrrrrrcrr)r)r*rds   z-getPhases..InBodyPhase.startTagButtoncSs0|j|j||jjtd|j_dSNF)r>rrrrr rLrcrr)r)r*res  z:getPhases..InBodyPhase.startTagAppletMarqueeObjectcSsB|jjdddr|td|jd|j_|j|ddS)Nr(rHrFr)r>rr{rrrLrcrrr)r)r*rfs  z*getPhases..InBodyPhase.startTagXmpcSsR|jjdkr*|jjdddr*|td|j|d|j_|jjd|j_ dS)Nrr(rHrFr) rLrZr>rrrrrcrIr`rr)r)r*rgs   z,getPhases..InBodyPhase.startTagTablecSs6|j|j||jjd|d<d|j_dS)NTr|F)r>rrr~rrLrcrr)r)r*rhs    z5getPhases..InBodyPhase.startTagVoidFormattingcSs@|jj}||d|dkr<|ddtdkr<||j_dS)Nr3rwhidden)rLrcrhrlr)rCrrcr)r)r*rjs   z,getPhases..InBodyPhase.startTagInputcSs$|j||jjd|d<dSrrrr)r)r*ris  z2getPhases..InBodyPhase.startTagParamSourcecSsJ|jjdddr|td|j||jjd|d<d|j_dS)Nr(rHrTr|F) r>rr{rrr~rrLrcrr)r)r*rks   z)getPhases..InBodyPhase.startTagHrcSs6|jdddd|tdd|d|dddS) Nzunexpected-start-tag-treated-asrPrKZ originalNameZnewNamerrrwr{rkr{)rLrrrrr)r)r*rls z,getPhases..InBodyPhase.startTagImagecSs|jdddi|jjrdSi}d|dkr>|dd|d<|tdd|d|td d|td dd |dkr|dd }nd }|td |d|d}d|kr|d=d |kr|d =d|d<|tdd||dd| td |td d| tddS)Nzdeprecated-tagr@rQactionrwr6rr)rkrOZlabelpromptz3This is a searchable index. Enter search keywords: rqr3rwrNr{r) rLrr>rrrrrcopyr)rCrZ form_attrsrrkr)r)r*rms<      z.getPhases..InBodyPhase.startTagIsIndexcSs0|j||jjj|jj_|j|_d|j_dSr) r>rrLrOr\r]rrrcrr)r)r*rns z/getPhases..InBodyPhase.startTagTextareacSsd|j_||dSr)rLrcrprr)r)r*rosz-getPhases..InBodyPhase.startTagIFramecSs"|jjr||n ||dSr.)rLrNrprrr)r)r*rs z/getPhases..InBodyPhase.startTagNoscriptcSs|j|ddS)z8iframe, noembed noframes, noscript(if scripting enabled)rNr rr)r)r*rp sz.getPhases..InBodyPhase.startTagRawtextcSs@|jjdjdkr$|jjtd|j|jj|dSNrvrU) r>r~r@rLr`rrrrrr)r)r*rss z*getPhases..InBodyPhase.startTagOptcSs|j|j|d|j_|jj|jjd|jjd|jjd|jjd|jjd|jjdfkrx|jjd|j_n|jjd |j_dS) NFrrrrrrinSelectInTabler)r>rrrLrcr`rIrr)r)r*rqs       z-getPhases..InBodyPhase.startTagSelectcSsB|jdr2|j|jjdjdkr2|j|j|dS)Nrubyrv)r>rgenerateImpliedEndTagsr~r@rLrrrr)r)r*rr%s    z+getPhases..InBodyPhase.startTagRpRtcSsZ|j|j||j|td|d<|j||drV|jjd|d<dS)Nrhrjr{Tr|) r>rrLrrrrr~rrr)r)r*rt,s      z+getPhases..InBodyPhase.startTagMathcSsZ|j|j||j|td|d<|j||drV|jjd|d<dS)Nryrjr{Tr|) r>rrLrrrrr~rrr)r)r*ru8s      z*getPhases..InBodyPhase.startTagSvgcSs|jdd|didS)a5 Elements that should be children of other elements that have a different insertion mode; here they are ignored "caption", "col", "colgroup", "frame", "frameset", "head", "option", "optgroup", "tbody", "td", "tfoot", "th", "thead", "tr", "noscript" zunexpected-start-tag-ignoredr@Nrrr)r)r*rvDsz0getPhases..InBodyPhase.startTagMisplacedcSs|j|j|dSr.)r>rrrr)r)r*rMs z,getPhases..InBodyPhase.startTagOthercSs|jjdddsD|tdd|jdddi|tddnT|jd|jjdj dkrt|jdddi|jj }|j dkr|jj }qdS) Nr(rHrrrrr@rsrv) r>rr[rrLrr{rr~r@rr r)r)r*r{Qs   z&getPhases..InBodyPhase.endTagPcSs~|jds|jdS|jjdjdkrj|jjddD],}|jtdkr<|jdd|jdqjq<|jjd|j_dS)Nrrv)r8r9r7rVrUr(rSrTrrrrrrrr$expected-one-end-tag-but-got-anotherZgotNameZ expectedName afterBody) r>rrLrr~r@rrIr`r r)r)r*rw^s   z)getPhases..InBodyPhase.endTagBodycSs"|jdr|td|SdS)Nr)r>rrwrrr)r)r*rxps z)getPhases..InBodyPhase.endTagHtmlcSs|ddkr|j|_|j|d}|r2|j|jjdj|dkr^|jdd|di|r|jj }|j|dkr|jj }qndS)Nr@r4rvend-tag-too-early) rYrr>rrr~r@rLrr)rCrZinScoperr)r)r*ryvs   z*getPhases..InBodyPhase.endTagBlockcSsv|jj}d|j_|dks$|j|s8|jdddin:|j|jjd|krd|jdddi|jj|dS)Nrr@r6rvzend-tag-too-early-ignored)r>rrrLrrr~rr r)r)r*rzs z)getPhases..InBodyPhase.endTagFormcSs|ddkrd}nd}|jj|d|dsB|jdd|dinf|jj|dd|jjdj|dkr|jdd|di|jj}|j|dkr|jj}qdS) Nr@r7listrrexcludervr)r>rrLrrr~r@r)rCrrrr)r)r*r|s   z-getPhases..InBodyPhase.endTagListItemcSstD]}|j|r|jq$q|jjdj|dkrP|jdd|ditD]8}|j|rT|jj}|jtkr|jj}qpqqTdS)Nrvr@r) rr>rrr~r@rLrr)rCritemr)r)r*r}s     z,getPhases..InBodyPhase.endTagHeadingcSsd}|dkr |d7}|j|d}|rD||jjkrR|j|jsR||dS||jjkr|jdd|di|jj |dS|j|js|jdd|didS||jjdkr|jd d|di|jj |}d}|jj|dD]}|j t kr|}qq|dkrR|jj }||kr@|jj }q&|jj |dS|jj|d}|jj |}|} } d} |jj | } | d krX| d7} | d8} |jj| } | |jjkr|jj | q| |krސqX| |kr|jj | d}| } | |jj|jj | <| |jj|jj | <| } | jrF| j| | | | } q| jrl| j| |jtd kr|j\}}|| |n || |} || || |jj ||jj|| |jj ||jj|jj |d| qdS) z)The much-feared adoption agency algorithmrrr@Nzadoption-agency-1.2zadoption-agency-4.4rvzadoption-agency-1.3rrrrrr)r>rr~rr@rrLrrrindexrrrZ cloneNoderrZ appendChildrZgetTableMisnestedNodePosition insertBeforeZreparentChildreninsert)rCrZouterLoopCounterZformattingElementZafeIndexZ furthestBlockrnZcommonAncestorZbookmarkZlastNoderZinnerLoopCounterrZclonerrr)r)r*r~s                      z/getPhases..InBodyPhase.endTagFormattingcSs|j|dr|j|jjdj|dkrF|jdd|di|j|dr|jj}|j|dkr~|jj}qb|jdS)Nr@rvr) r>rrr~r@rLrrclearActiveFormattingElements)rCrrnr)r)r*rTs  z8getPhases..InBodyPhase.endTagAppletMarqueeObjectcSs@|jdddd|j|jtdd|jjdS)Nzunexpected-end-tag-treated-asrz br elementrrr)rLrr>rrrr~rrr)r)r*r`s  z'getPhases..InBodyPhase.endTagBrcSs|jjdddD]}|j|dkrz|jj|dd|jjdj|dkrb|jdd|di|jj|krtqbqq|jtkr|jdd|diqqdS)Nrvr@rr) r>r~r@rrLrrrrr r)r)r*rgs z*getPhases..InBodyPhase.endTagOtherN)6r9r:r;rKrrrrrrYrZrrr[r]r^r_r`r\rarbrcrdrerfrgrhrjrirkrlrmrnrorrprsrqrrrtrurvrr{rwrxryrzr|r}r~rrrr)rr)r* InBodyPhasesh G             $ rcs@eZdZfddZddZddZddZd d Zd d Zd S)zgetPhases..TextPhasecsF|||tg|_|j|j_td|jfg|_|j|j_dSNr) rKr rrrr endTagScriptrrrrr)r*rKvs  z%getPhases..TextPhase.__init__cSs|j|ddSrrrr)r)r*r~sz.getPhases..TextPhase.processCharacterscSs8|jdd|jjdji|jj|jj|j_dS)Nz&expected-named-closing-tag-but-got-eofr@rvT)rLrr>r~r@rrr`rBr)r)r*rs   z'getPhases..TextPhase.processEOFcSsdstd|ddS)NFz4Tried to process start tag %s in RCDATA/RAWTEXT moder@)rrr)r)r*rsz*getPhases..TextPhase.startTagOthercSs*|jj}|jdkst|jj|j_dSr)r>r~rr@rrLrr`r r)r)r*rs z)getPhases..TextPhase.endTagScriptcSs|jj|jj|j_dSr.)r>r~rrLrr`rr)r)r*rs z(getPhases..TextPhase.endTagOtherN) r9r:r;rKrrrrrr)rr)r* TextPhaseus  rcseZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'S)(zgetPhases..InTablePhasec s|||td|jfd|jfd|jfd|jfd|jfd|jfd|j fd|j fd |j fd |j fg |_ |j|j _td|jfd |jfg|_|j|j_dS) NrrrrWrrr)rrrr)rrrNr6) rrrWrrrrrrrr)rKr rrstartTagCaptionstartTagColgroup startTagColstartTagRowGroupstartTagImplyTbodyrgstartTagStyleScriptrjr^rrr endTagTable endTagIgnorerrrrr)r*rKs* z(getPhases..InTablePhase.__init__cSs$|jjdjdkr |jjqdS)Nrv)rr)r>r~r@rrBr)r)r*clearStackToTableContextsz8getPhases..InTablePhase.clearStackToTableContextcSs0|jjdjdkr |jdn |jjs,tdS)Nrvrz eof-in-tabler>r~r@rLrrSrrBr)r)r*rsz*getPhases..InTablePhase.processEOFcSs4|jj}|jjd|j_||jj_|jj|dSN inTableText)rLr`rIrrrCrrr)r)r*rs z6getPhases..InTablePhase.processSpaceCharacterscSs4|jj}|jjd|j_||jj_|jj|dSr)rLr`rIrrrr)r)r*rs z1getPhases..InTablePhase.processCharacterscSs&d|j_|jjd|d|j_dS)NTrF)r>insertFromTablerLrIrrr)r)r*rsz*getPhases..InTablePhase.insertTextcSs6||jjt|j||jjd|j_dS)Nr) rr>rrr rrLrIr`rr)r)r*rs z/getPhases..InTablePhase.startTagCaptioncSs(||j||jjd|j_dS)Nrrr>rrLrIr`rr)r)r*rs z0getPhases..InTablePhase.startTagColgroupcSs|tdd|S)Nrrr)rrrr)r)r*rsz+getPhases..InTablePhase.startTagColcSs(||j||jjd|j_dSNrrrr)r)r*rs z0getPhases..InTablePhase.startTagRowGroupcSs|tdd|S)Nrrr)rrrr)r)r*rsz2getPhases..InTablePhase.startTagImplyTbodycSs6|jdddd|jjtd|jjs2|SdS)Nrrr)rLrr`rrrSrr)r)r*rgs z-getPhases..InTablePhase.startTagTablecSs|jjd|Srrrr)r)r*rsz3getPhases..InTablePhase.startTagStyleScriptcSsVd|dkrH|ddtdkrH|jd|j||jjn ||dS)Nr3rwrz unexpected-hidden-input-in-table) rlrrLrr>rr~rrrr)r)r*rjs   z-getPhases..InTablePhase.startTagInputcSsD|jd|jjdkr@|j||jjd|j_|jjdS)Nzunexpected-form-in-tablerv)rLrr>rrr~rrr)r)r*r^s    z,getPhases..InTablePhase.startTagFormcSs<|jdd|did|j_|jjd|d|j_dS)Nz)unexpected-start-tag-implies-table-voodoor@TrF)rLrr>rrIrrr)r)r*rsz-getPhases..InTablePhase.startTagOthercSs|jjdddr|j|jjdjdkrJ|jdd|jjdjd|jjdjdkrj|jjqJ|jj|jn|jj st |jdS)Nrrrvzend-tag-too-early-namedr) r>rrr~r@rLrrrbrSrrr)r)r*r s     z+getPhases..InTablePhase.endTagTablecSs|jdd|didSrrrr)r)r*rsz,getPhases..InTablePhase.endTagIgnorecSs<|jdd|did|j_|jjd|d|j_dS)Nz'unexpected-end-tag-implies-table-voodoor@TrF)rLrr>rrIrrr)r)r*r sz+getPhases..InTablePhase.endTagOtherN)r9r:r;rKrrrrrrrrrrrgrrjr^rrrrr)rr)r* InTablePhases&   rcsPeZdZfddZddZddZddZd d Zd d Zd dZ ddZ dS)z#getPhases..InTableTextPhasecs|||d|_g|_dSr.)rKrcharacterTokensrrr)r*rK(sz,getPhases..InTableTextPhase.__init__cSsdddd|jD}tdd|DrJtd|d}|jjd|n|rZ|j|g|_dS)NrcSsg|] }|dqS)rwr)r?rr)r)r*rD.szGgetPhases..InTableTextPhase.flushCharacters..cSsg|] }|tkqSr)rrr)r)r*rD/srqrr)joinrrrrLrIrr>)rCrwrr)r)r*flushCharacters-s z3getPhases..InTableTextPhase.flushCharacterscSs||j|j_|Sr.rrrLr`rr)r)r*r6s z2getPhases..InTableTextPhase.processCommentcSs||j|j_dSrrrBr)r)r*r;s z.getPhases..InTableTextPhase.processEOFcSs |ddkrdS|j|dSNrwrrrrr)r)r*r@s z5getPhases..InTableTextPhase.processCharacterscSs|j|dSr.rrr)r)r*rEsz:getPhases..InTableTextPhase.processSpaceCharacterscSs||j|j_|Sr.rrr)r)r*rJs z3getPhases..InTableTextPhase.processStartTagcSs||j|j_|Sr.rrr)r)r*rOs z1getPhases..InTableTextPhase.processEndTagN) r9r:r;rKrrrrrrrr)rr)r*InTableTextPhase's  rcs`eZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ dS)z!getPhases..InCaptionPhasecsf|||td|jfd|jfg|_|j|j_td|jfd|j fd|j fg|_ |j |j _dS)Nr rrWrrrrrrrrr) rrWrrrrrrrr) rKr rrstartTagTableElementrrr endTagCaptionrrrrrrr)r*rKVs  z*getPhases..InCaptionPhase.__init__cSs|jjddd S)Nrrrr>rrBr)r)r*ignoreEndTagCaptionhsz5getPhases..InCaptionPhase.ignoreEndTagCaptioncSs|jjddSrrLrIrrBr)r)r*rksz,getPhases..InCaptionPhase.processEOFcSs|jjd|SrrLrIrrr)r)r*rnsz3getPhases..InCaptionPhase.processCharacterscSs0|j|}|jjtd|s,|SdSNrrLrrr`rrrCr ignoreEndTagr)r)r*rqs  z6getPhases..InCaptionPhase.startTagTableElementcSs|jjd|Srrrr)r)r*rysz/getPhases..InCaptionPhase.startTagOthercSs|s|j|jjdjdkrB|jdd|jjdjd|jjdjdkrb|jjqB|jj|j|jj d|j_ n|jj st |jdS)Nrvrrrr) rr>rr~r@rLrrrrIr`rSrrr)r)r*r|s     z/getPhases..InCaptionPhase.endTagCaptioncSs0|j|}|jjtd|s,|SdSrrrr)r)r*rs  z-getPhases..InCaptionPhase.endTagTablecSs|jdd|didSrrrr)r)r*rsz.getPhases..InCaptionPhase.endTagIgnorecSs|jjd|SrrLrIrrr)r)r*rsz-getPhases..InCaptionPhase.endTagOtherN) r9r:r;rKrrrrrrrrrr)rr)r*InCaptionPhaseTs rcsXeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)z%getPhases..InColumnGroupPhasecs^|||td|jfd|jfg|_|j|j_td|jfd|j fg|_ |j |j _dS)NrrWr) rKr rrrrrrendTagColgroup endTagColrrrrr)r*rKs z.getPhases..InColumnGroupPhase.__init__cSs|jjdjdkS)Nrvr)r>r~r@rBr)r)r*ignoreEndTagColgroupsz:getPhases..InColumnGroupPhase.ignoreEndTagColgroupcSsD|jjdjdkr"|jjstdS|}|td|s@dSdS)NrvrrT) r>r~r@rLrSrrrr)rCrr)r)r*rs z0getPhases..InColumnGroupPhase.processEOFcSs"|}|td|s|SdSNrrrrrr)r)r*rsz7getPhases..InColumnGroupPhase.processCharacterscSs$|j||jjd|d<dSrrrr)r)r*rs  z1getPhases..InColumnGroupPhase.startTagColcSs"|}|td|s|SdSrrrr)r)r*rsz3getPhases..InColumnGroupPhase.startTagOthercSs@|r |jjst|jn|jj|jjd|j_ dSNr) rrLrSrrr>r~rrIr`rr)r)r*rs    z4getPhases..InColumnGroupPhase.endTagColgroupcSs|jdddidS)Nz no-end-tagr@rWrrr)r)r*rsz/getPhases..InColumnGroupPhase.endTagColcSs"|}|td|s|SdSrrrr)r)r*rsz1getPhases..InColumnGroupPhase.endTagOtherN) r9r:r;rKrrrrrrrrr)rr)r*InColumnGroupPhases   rcsxeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZdS)z#getPhases..InTableBodyPhasecsv|||td|jfd|jfd|jfd|jfg|_|j|j_ td|j fd|j fd|j fg|_ |j|j _ dS)Nrrrr)rrWrrrrrr)rrrWrrrrr)rKr rr startTagTrstartTagTableCellstartTagTableOtherrrrendTagTableRowGrouprrrrrrr)r*rKs$ z,getPhases..InTableBodyPhase.__init__cSsB|jjdjdkr |jjq|jjdjdkr>|jjs>tdS)Nrv)rrrrr)r>r~r@rrLrSrrBr)r)r*clearStackToTableBodyContextsz@getPhases..InTableBodyPhase.clearStackToTableBodyContextcSs|jjddSrrrBr)r)r*rsz.getPhases..InTableBodyPhase.processEOFcSs|jjd|Srrrr)r)r*rsz:getPhases..InTableBodyPhase.processSpaceCharacterscSs|jjd|Srrrr)r)r*rsz5getPhases..InTableBodyPhase.processCharacterscSs(||j||jjd|j_dS)Nr)rr>rrLrIr`rr)r)r*rs z.getPhases..InTableBodyPhase.startTagTrcSs*|jdd|di|tdd|S)Nzunexpected-cell-in-table-bodyr@rrr)rLrrrrr)r)r*r s  z5getPhases..InTableBodyPhase.startTagTableCellcSsn|jjddds0|jjddds0|jjdddrT||t|jjdj|S|jjs`t |j dSNrrrrrrv r>rrrrr~r@rLrSrrrr)r)r*rs z6getPhases..InTableBodyPhase.startTagTableOthercSs|jjd|Srrrr)r)r*rsz1getPhases..InTableBodyPhase.startTagOthercSsT|jj|dddr:||jj|jjd|j_n|jdd|didS)Nr@rrr unexpected-end-tag-in-table-body) r>rrr~rrLrIr`rrr)r)r*r"s  z7getPhases..InTableBodyPhase.endTagTableRowGroupcSsn|jjddds0|jjddds0|jjdddrT||t|jjdj|S|jjs`t |j dSrrrr)r)r*r+s z/getPhases..InTableBodyPhase.endTagTablecSs|jdd|didS)Nrr@rrr)r)r*r8s z0getPhases..InTableBodyPhase.endTagIgnorecSs|jjd|Srrrr)r)r*r<sz/getPhases..InTableBodyPhase.endTagOtherN)r9r:r;rKrrrrrrrrrrrrr)rr)r*InTableBodyPhases    rcseZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)zgetPhases..InRowPhasecsv|||td|jfd|jfd|jfg|_|j|j_td|j fd|j fd|j fd|j fg|_ |j|j _dS)Nrr)rrWrrrrrrrr)rrrWrrrr)rKr rrrrrrrendTagTrrrrrrrrr)r*rKAs$ z&getPhases..InRowPhase.__init__cSs@|jjdjdkr<|jdd|jjdji|jjqdS)Nrv)rrz'unexpected-implied-end-tag-in-table-rowr@)r>r~r@rLrrrBr)r)r*clearStackToTableRowContextUs z9getPhases..InRowPhase.clearStackToTableRowContextcSs|jjddd S)NrrrrrBr)r)r*ignoreEndTagTr[sz,getPhases..InRowPhase.ignoreEndTagTrcSs|jjddSrrrBr)r)r*r_sz(getPhases..InRowPhase.processEOFcSs|jjd|Srrrr)r)r*rbsz4getPhases..InRowPhase.processSpaceCharacterscSs|jjd|Srrrr)r)r*resz/getPhases..InRowPhase.processCharacterscSs6||j||jjd|j_|jjtdS)Nr) rr>rrLrIr`rrr rr)r)r*rhs z/getPhases..InRowPhase.startTagTableCellcSs"|}|td|s|SdSNrrrrrr)r)r*rnsz0getPhases..InRowPhase.startTagTableOthercSs|jjd|Srrrr)r)r*rusz+getPhases..InRowPhase.startTagOthercSsH|s.||jj|jjd|j_n|jjs:t |j dSr) rrr>r~rrLrIr`rSrrrr)r)r*rxs   z&getPhases..InRowPhase.endTagTrcSs"|}|td|s|SdSrrrr)r)r*rsz)getPhases..InRowPhase.endTagTablecSs4|jj|dddr&|td|S|jdS)Nr@rrr)r>rrrrLrrr)r)r*rsz1getPhases..InRowPhase.endTagTableRowGroupcSs|jdd|didS)Nzunexpected-end-tag-in-table-rowr@rrr)r)r*rs z*getPhases..InRowPhase.endTagIgnorecSs|jjd|Srrrr)r)r*rsz)getPhases..InRowPhase.endTagOtherN)r9r:r;rKrrrrrrrrrrrrrr)rr)r* InRowPhase?s  rcs`eZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ dS)zgetPhases..InCellPhasecsf|||td|jfd|jfg|_|j|j_td|jfd|j fd|j fg|_ |j |j _dS)Nrrr)rrrWrrr) rKr rrrrrrendTagTableCellr endTagImplyrrrrr)r*rKs z'getPhases..InCellPhase.__init__cSsB|jjdddr |tdn|jjdddr>|tddSNrrrr)r>rrrrBr)r)r* closeCellsz(getPhases..InCellPhase.closeCellcSs|jjddSrrrBr)r)r*rsz)getPhases..InCellPhase.processEOFcSs|jjd|Srrrr)r)r*rsz0getPhases..InCellPhase.processCharacterscSsF|jjddds |jjdddr,||S|jjs8t|jdSr)r>rrrLrSrrrr)r)r*rs z1getPhases..InCellPhase.startTagTableOthercSs|jjd|Srrrr)r)r*rsz,getPhases..InCellPhase.startTagOthercSs|jj|dddr|j|d|jjdj|dkrp|jdd|di|jj}|j|dkrPq|qPn |jj|j|jj d|j_ n|jdd|didS)Nr@rrrvzunexpected-cell-end-tagrr) r>rrr~r@rLrrrrIr`r r)r)r*rs    z.getPhases..InCellPhase.endTagTableCellcSs|jdd|didSrrrr)r)r*rsz+getPhases..InCellPhase.endTagIgnorecSs.|jj|dddr ||S|jdS)Nr@rr)r>rrrLrrr)r)r*rsz*getPhases..InCellPhase.endTagImplycSs|jjd|Srrrr)r)r*rsz*getPhases..InCellPhase.endTagOtherN) r9r:r;rKrrrrrrrrrr)rr)r* InCellPhases  rcsxeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZdS)z getPhases..InSelectPhasec s|||td|jfd|jfd|jfd|jfd|jfd|jfg|_ |j |j _ td|j fd|j fd|jfg|_|j|j_ dS)NrrUrVr)rNrLrRr)rKr rrstartTagOptionstartTagOptgrouprqrjrrrr endTagOptionendTagOptgroup endTagSelectrrrrr)r*rKs  z)getPhases..InSelectPhase.__init__cSs0|jjdjdkr |jdn |jjs,tdS)Nrvrz eof-in-selectrrBr)r)r*rsz+getPhases..InSelectPhase.processEOFcSs$|ddkrdS|j|ddSrrrr)r)r*r s z2getPhases..InSelectPhase.processCharacterscSs.|jjdjdkr|jj|j|dSrr>r~r@rrrr)r)r*r s z/getPhases..InSelectPhase.startTagOptioncSsL|jjdjdkr|jj|jjdjdkr<|jj|j|dS)NrvrUrVrrr)r)r*r s   z1getPhases..InSelectPhase.startTagOptgroupcSs|jd|tddS)Nzunexpected-select-in-selectr)rLrrrrr)r)r*rq s z/getPhases..InSelectPhase.startTagSelectcSs>|jd|jjdddr.|td|S|jjs:tdS)Nzunexpected-input-in-selectrr)rLrr>rrrrSrrr)r)r*rj s  z.getPhases..InSelectPhase.startTagInputcSs|jjd|Srrrr)r)r*r sz/getPhases..InSelectPhase.startTagScriptcSs|jdd|didS)Nzunexpected-start-tag-in-selectr@rrr)r)r*r! s z.getPhases..InSelectPhase.startTagOthercSs6|jjdjdkr |jjn|jdddidS)NrvrUunexpected-end-tag-in-selectr@r>r~r@rrLrrr)r)r*r% s z-getPhases..InSelectPhase.endTagOptioncSsf|jjdjdkr0|jjdjdkr0|jj|jjdjdkrP|jjn|jdddidS)NrvrUrVrr@rrr)r)r*r, s z/getPhases..InSelectPhase.endTagOptgroupcSsZ|jjdddr@|jj}|jdkr4|jj}q|jn|jjsLt|j dS)Nrr) r>rr~rr@rLrbrSrrr r)r)r*r9 s    z-getPhases..InSelectPhase.endTagSelectcSs|jdd|didS)Nrr@rrr)r)r*rD s z,getPhases..InSelectPhase.endTagOtherN)r9r:r;rKrrrrrqrjrrrrrrr)rr)r* InSelectPhases   rcsHeZdZfddZddZddZddZd d Zd d Zd dZ dS)z'getPhases..InSelectInTablePhasecsN|||td|jfg|_|j|j_td|jfg|_|j |j_dS)N)rrrrrrrr) rKr rrgrrrrrrrrr)r*rKI s z0getPhases..InSelectInTablePhase.__init__cSs|jjddSNrrrBr)r)r*rX sz2getPhases..InSelectInTablePhase.processEOFcSs|jjd|Srrrr)r)r*r[ sz9getPhases..InSelectInTablePhase.processCharacterscSs(|jdd|di|td|S)Nz5unexpected-table-element-start-tag-in-select-in-tabler@r)rLrrrrr)r)r*rg^ sz5getPhases..InSelectInTablePhase.startTagTablecSs|jjd|Srrrr)r)r*rc sz5getPhases..InSelectInTablePhase.startTagOthercSs@|jdd|di|jj|dddr<|td|SdS)Nz3unexpected-table-element-end-tag-in-select-in-tabler@rrr)rLrr>rrrrr)r)r*rf sz3getPhases..InSelectInTablePhase.endTagTablecSs|jjd|Srrrr)r)r*rl sz3getPhases..InSelectInTablePhase.endTagOtherN) r9r:r;rKrrrgrrrr)rr)r*InSelectInTablePhaseH s rc-seZdZeddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,g,Zfd-d.Zd/d0Zfd1d2Zd3d4Zd5d6Z d7S)8z(getPhases..InForeignContentPhaser;r<r"rrr#r=r8r+r&r9r>rJZh1Zh2Zh3Zh4Zh5Zh6rrOr@rKr7r5r.r5rGr0r(r4rrArBspanrDrCsubZsuprrErFr3varcs|||dSr.)rKrrr)r*rKy sz1getPhases..InForeignContentPhase.__init__c%Ssnddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%$}|d&|krj||d&|d&<dS)'NZaltGlyphZ altGlyphDefZ altGlyphItemZ animateColorZ animateMotionZanimateTransformZclipPathZfeBlendZ feColorMatrixZfeComponentTransferZ feCompositeZfeConvolveMatrixZfeDiffuseLightingZfeDisplacementMapZfeDistantLightZfeFloodZfeFuncAZfeFuncBZfeFuncGZfeFuncRZfeGaussianBlurZfeImageZfeMergeZ feMergeNodeZ feMorphologyZfeOffsetZ fePointLightZfeSpecularLightingZ feSpotLightZfeTileZ feTurbulenceZ foreignObjectZglyphRefZlinearGradientZradialGradientZtextPath)$ZaltglyphZ altglyphdefZ altglyphitemZ animatecolorZ animatemotionZanimatetransformZclippathZfeblendZ fecolormatrixZfecomponenttransferZ fecompositeZfeconvolvematrixZfediffuselightingZfedisplacementmapZfedistantlightZfefloodZfefuncaZfefuncbZfefuncgZfefuncrZfegaussianblurZfeimageZfemergeZ femergenodeZ femorphologyZfeoffsetZ fepointlightZfespecularlightingZ fespotlightZfetileZ feturbulenceZ foreignobjectZglyphrefZlineargradientZradialgradientZtextpathr@r))rCr replacementsr)r)r*adjustSVGTagNames| sN% z:getPhases..InForeignContentPhase.adjustSVGTagNamescsL|ddkrd|d<n&|jjr.InForeignContentPhase.processCharacters..F)rLrcrrrrr)r*r s  z:getPhases..InForeignContentPhase.processCharacterscSs.|jjd}|d|jksD|ddkrt|dtdddg@r|jdd|di|jjdj|jjkr|j |jjds|j |jjds|jj qZ|S|jt d kr|j |n$|jt d kr|||j||j||j|d <|j||d r*|jj d |d<dS)Nrvr@r?rwZcolorZfacesizez*unexpected-html-element-in-foreign-contentrhryrjr{Tr|)r>r~breakoutElementssetkeysrLrrjrrorprrrr rrr)rCrrr)r)r*r s:           z8getPhases..InForeignContentPhase.processStartTagcSst|jjd}|jjd}|jt|dkrF|jdd|di|jt|dkr|jj|jj dkr|jj |jjj |j_|jj |kr|jjst qd}q|d8}|jj|}|j|jjkrqFqF|jj|}qqF|S)Nrrvr@rr)rr>r~r@rlrrLrr`rIrrrrrjrr)rCrZ nodeIndexrrr)r)r*r s&   z6getPhases..InForeignContentPhase.processEndTagN) r9r:r;rr rKr rrrr)rr)r*InForeignContentPhaseo s\  ) rcsPeZdZfddZddZddZddZd d Zd d Zd dZ ddZ dS)z!getPhases..AfterBodyPhasecsN|||td|jfg|_|j|j_td|jfg|_|j |j_dSNr) rKr rrrrrrxrrrrr)r*rK s z*getPhases..AfterBodyPhase.__init__cSsdSr.r)rBr)r)r*r sz,getPhases..AfterBodyPhase.processEOFcSs|j||jjddS)Nrrrr)r)r*r sz0getPhases..AfterBodyPhase.processCommentcSs |jd|jjd|j_|S)Nzunexpected-char-after-bodyrrLrrIr`rr)r)r*r s z3getPhases..AfterBodyPhase.processCharacterscSs|jjd|Srrrr)r)r*r sz.getPhases..AfterBodyPhase.startTagHtmlcSs*|jdd|di|jjd|j_|S)Nzunexpected-start-tag-after-bodyr@rrrr)r)r*r s  z/getPhases..AfterBodyPhase.startTagOthercSs*|jjr|jdn|jjd|j_dS)Nz'unexpected-end-tag-after-body-innerhtmlafterAfterBody)rLrSrrIr`)rCr@r)r)r*rx sz,getPhases..AfterBodyPhase.endTagHtmlcSs*|jdd|di|jjd|j_|S)Nzunexpected-end-tag-after-bodyr@rrrr)r)r*r s  z-getPhases..AfterBodyPhase.endTagOtherN) r9r:r;rKrrrrrrxrr)rr)r*AfterBodyPhase s rcsXeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)z"getPhases..InFramesetPhasecsf|||td|jfd|jfd|jfd|jfg|_|j|j_ td|j fg|_ |j |j _ dS)NrrrXr) rKr rrr startTagFramestartTagNoframesrrrendTagFramesetrrrrr)r*rK s z+getPhases..InFramesetPhase.__init__cSs0|jjdjdkr |jdn |jjs,tdS)Nrvrzeof-in-framesetrrBr)r)r*r# sz-getPhases..InFramesetPhase.processEOFcSs|jddS)Nzunexpected-char-in-framesetrrr)r)r*r) sz4getPhases..InFramesetPhase.processCharacterscSs|j|dSr.)r>rrr)r)r*r, sz3getPhases..InFramesetPhase.startTagFramesetcSs|j||jjdSr.rrr)r)r*r/ s z0getPhases..InFramesetPhase.startTagFramecSs|jjd|Srrrr)r)r*r3 sz3getPhases..InFramesetPhase.startTagNoframescSs|jdd|didS)Nz unexpected-start-tag-in-framesetr@rrr)r)r*r6 s z0getPhases..InFramesetPhase.startTagOthercSsZ|jjdjdkr |jdn |jj|jjsV|jjdjdkrV|jjd|j_dS)Nrvrz)unexpected-frameset-in-frameset-innerhtmlr afterFrameset) r>r~r@rLrrrSrIr`rr)r)r*r: s z1getPhases..InFramesetPhase.endTagFramesetcSs|jdd|didS)Nzunexpected-end-tag-in-framesetr@rrr)r)r*rF s z.getPhases..InFramesetPhase.endTagOtherN) r9r:r;rKrrrrrrrrr)rr)r*InFramesetPhase s  rcsHeZdZfddZddZddZddZd d Zd d Zd dZ dS)z%getPhases..AfterFramesetPhasecsV|||td|jfd|jfg|_|j|j_td|jfg|_ |j |j _dSNrr) rKr rrrrrrrxrrrrr)r*rKL s z.getPhases..AfterFramesetPhase.__init__cSsdSr.r)rBr)r)r*rZ sz0getPhases..AfterFramesetPhase.processEOFcSs|jddS)Nzunexpected-char-after-framesetrrr)r)r*r^ sz7getPhases..AfterFramesetPhase.processCharacterscSs|jjd|Srrrr)r)r*ra sz6getPhases..AfterFramesetPhase.startTagNoframescSs|jdd|didS)Nz#unexpected-start-tag-after-framesetr@rrr)r)r*rd s z3getPhases..AfterFramesetPhase.startTagOthercSs|jjd|j_dS)NafterAfterFrameset)rLrIr`rr)r)r*rxh sz0getPhases..AfterFramesetPhase.endTagHtmlcSs|jdd|didS)Nz!unexpected-end-tag-after-framesetr@rrr)r)r*rk s z1getPhases..AfterFramesetPhase.endTagOtherN) r9r:r;rKrrrrrxrr)rr)r*AfterFramesetPhaseJ s rcsPeZdZfddZddZddZddZd d Zd d Zd dZ ddZ dS)z&getPhases..AfterAfterBodyPhasecs0|||td|jfg|_|j|j_dSr)rKr rrrrrrrr)r*rKp s z/getPhases..AfterAfterBodyPhase.__init__cSsdSr.r)rBr)r)r*rx sz1getPhases..AfterAfterBodyPhase.processEOFcSs|j||jjdSr.rrr)r)r*r{ sz5getPhases..AfterAfterBodyPhase.processCommentcSs|jjd|Srrrr)r)r*r~ sz=getPhases..AfterAfterBodyPhase.processSpaceCharacterscSs |jd|jjd|j_|S)Nexpected-eof-but-got-charrrrr)r)r*r s z8getPhases..AfterAfterBodyPhase.processCharacterscSs|jjd|Srrrr)r)r*r sz3getPhases..AfterAfterBodyPhase.startTagHtmlcSs*|jdd|di|jjd|j_|S)Nexpected-eof-but-got-start-tagr@rrrr)r)r*r s  z4getPhases..AfterAfterBodyPhase.startTagOthercSs*|jdd|di|jjd|j_|S)Nexpected-eof-but-got-end-tagr@rrrr)r)r*r s  z4getPhases..AfterAfterBodyPhase.processEndTagN) r9r:r;rKrrrrrrrr)rr)r*AfterAfterBodyPhaseo s rcsXeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)z*getPhases..AfterAfterFramesetPhasecs8|||td|jfd|jfg|_|j|j_dSr)rKr rrstartTagNoFramesrrrrrr)r*rK s z3getPhases..AfterAfterFramesetPhase.__init__cSsdSr.r)rBr)r)r*r sz5getPhases..AfterAfterFramesetPhase.processEOFcSs|j||jjdSr.rrr)r)r*r sz9getPhases..AfterAfterFramesetPhase.processCommentcSs|jjd|Srrrr)r)r*r szAgetPhases..AfterAfterFramesetPhase.processSpaceCharacterscSs|jddS)Nrrrr)r)r*r sz.AfterAfterFramesetPhase.processCharacterscSs|jjd|Srrrr)r)r*r sz7getPhases..AfterAfterFramesetPhase.startTagHtmlcSs|jjd|Srrrr)r)r*r  sz;getPhases..AfterAfterFramesetPhase.startTagNoFramescSs|jdd|didS)Nrr@rrr)r)r*r s z8getPhases..AfterAfterFramesetPhase.startTagOthercSs|jdd|didS)Nrr@rrr)r)r*r s z8getPhases..AfterAfterFramesetPhase.processEndTagN) r9r:r;rKrrrrrr rrr)rr)r*AfterAfterFramesetPhase s r!)rWrVrrr r rrrrrrrrrrrrzrrrrr)r)rJrYrrrrrrrrrrrrrrrrrrrrrrrr!r)rr*rHsr)#.g@CX!-GBbYLd's/9%&&rHcs>t|dt@}|r:tfdd|dD|d<dS)Nrwc3s"|]\}}|||fVqdSr.)r)r?kvr r)r*r sz$adjust_attributes..)rrr/)rr Zneeds_adjustmentr)r$r*r s   rrsFcCs|dkr i}t||||dS)N)r3r@rwr{)r)r@r3rkr{r)r)r*r s  rc@seZdZdZdS)ruzError in parsed documentN)r9r:r;rr)r)r)r*ru sru)rT)r+rT)rsNF).Z __future__rrrZpip._vendor.sixrrr1 collectionsrrr r r Ztreebuilders.baser r Z constantsrrrrrrrrrrrrrrrrrr#r-r=rIr"ZmemoizerHrr Exceptionrur)r)r)r*sP      H   G K PKd]Wy  -html5lib/__pycache__/constants.cpython-38.pycnu[U .e>F@s-ddlmZmZmZddlZdZddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d,d,d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dddddZdddddddZeeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfgZ eeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfgZ eeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfgNZ eeddfeddfeddfeddfgZ eeddfeddfeddfeddfeddfgZ dddddddddddddddddddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.>Zd/d0iZd1d2ed1fd1d3ed1fd1d4ed1fd1d5ed1fd1d6ed1fd1ded1fd1d7ed1fd8ded8fd8d9ed8fd8d:ed8fdd;ed;fd;d1ed;fd< Zed=d>eDZed?d@dAdBdCgZedddddgZeejZeejZeejZeejZeejZedDd>ejDZdEZ edddFddddddddddԐdGdHgZ!eddgZ"edddddddgZ#edIdJgedKgedLgedMdNgedMdNgedOdPgedQgedRdSgedTdSdUdVgedWgedXgedSdYgedSdYdZgedSdYgedSd[gedSdYd\d[dUdLgedSdYd[dRgedSdYged]gd^Z$d_Z%ed`dadbdcddgZ&dededfdfdgdgdhdididjdkdldldmdndodpdqdrdsdsdtdudvdvdwdwdxdydzd{d|d}d~dddd}dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddÐdĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐddӐdԐdՐd֐d֐dאdאdؐdِdِdڐdېdܐdݐdݐdސdߐddddddddddddddddddddddddddddddddddddddddddddd d d d d dddddddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[ddd\d]d^d_d`dadbdcdddedfdgdhddddidjdkd?dldmdndodpdqdrdsdtdudrdvdwdxdydzd{d|d|d|d|d dnd@d}d~dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddÐdĐdŐdƐdǐdǐdȐdȐdɐdʐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐddՐd֐dאdؐdِdڐdېdܐddݐdސdߐdddddddddddddddddddddddddddddddddddddddddddddd d d d d dddddddddddƐdEdddddddddd d!d"d#d$d%d&d&d'd(d)d*d+dd,d-d.d/d-d0d0d1d2d3d?d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdEdFdGdHdIdJdJdKdLdMdNdNdOdPdQdRdSdTdUdVdWddXdYdZd[d\d]dÐdĐd^d_d`dadbdcdddededfdgdhdidjdkdldldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddd|ddddddddddddddddddrdddddddddfdfddddddddddddddddddddddsdddd@dddddd@dddddd@dddddddddÐdĐdŐdƐdǐdȐdɐdɐdRdʐdÐdːd̐d|d|d͐dĐd}dΐdϐdАdѐd!dҐdTdӐdԐdՐd֐dאdؐdِdڐdkdwdېdܐddݐdސdߐddddddddddd\d\ddddddddddddddddddddddddddddddddd d d d d dddddddddŐddddddƐdǐdddddddddddd d!d"d#d$d%d&d d'd(d)d)d*d+d,d-ddd.d/d/dd0d1d2d2d3d4d5d6d7d8d9dd:d;d<d=d7d>d?d@dAdAdBdududCdDdEddEdd?dFddGddddHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_dSdTd`dadbdbdUd^d`daddcddddedfdgdƐdhdPdiddjdkdddldmdndndodpdqdrdKddddsdsddtdudvdvdvdwdwdxdydzd{d|ddd}d~dddzdƐdldKdddddddddddސdȐdddddmd}dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddÐdĐdŐddƐdǐdȐdɐdɐdʐdːdːd̐d͐dΐdϐdАdѐdѐdҐdӐdԐdՐd֐dאdؐdِdڐddېdܐdݐdtdސdߐddddddddddddddddd ddddddddddddddddddddddddddddސddddېddddddqdɐdddNdddddddddddd d d d d ddddddhddd"ddddddddddddddddddd'ddd d!dސd"d#d$dd d%dd%d&d'd(d)d*d+d'd,d,d-dސd.d/d0d1dސd#d2d3d4d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFddddGdHd]dIdJdKdLd?dMdDdNdDdOdPdPdEdFdQdRd dSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdHd]dddedÐd̐dfdgdhdidEdVd̐dZdjdNdGdddkd\did]d`d`dldmdndodpdqdOdrd\dId^dadsdMdtd^dud̐dZdvdwdxdndjdydydzd{d|d|d}d~d~ddd}ddddIdfdgddhdSdddddddPdddܐdddGddddddddldaddd^dĐddd;d;dddrdkddddddUdߐdddddddddddddҐdQd]ddddddddddmddddddd~ddddtdddtddddddddddddddddddddddddddddddddÐdĐdŐddƐdǐdȐdɐddʐdːd_d_d̐dd͐ddddΐdddddddddddϐdАddѐdҐddӐddԐdՐd֐ddՐdϐddԐdddddddddאdؐdؐddِdڐddېdܐdddݐdސdddߐdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd^d^dd:ddd;d<dddd=dddddddd d d d d ddd8d ddːdddddddddddd9ddddddddddddd d d!d"d"dd#d$d$d%dŐd&d&dŐd'd(dϐd)d*d+d,d\d-d.d/d0drd1d2dƐd3dd4dd5d6d d7dd8d9dԐdԐd:d;dԐd<d=d>d>dאd?d@dِdؐdאd@dِdؐdAdBdCdڐdDdՐdBdAdCdܐdEdFdGdݐdݐdڐdHdIdJdKdLddMdNdOddPdQdddd ddRdidSdTdUddVddWdXddYdYddZdd[d\d]d dd^d_d`dadbdcddېdddedfdgdhdidjdkddedldmdndddodd dddpdddqddrdϐddsdtdudd`dϐddddvdadwdxddddydzdzd{d|d}dd~dddddddvddd dfdddwdddddddddd(dddd*d)ddddddd+dddddddkdkdddddxdxdddِddddmdŐdddddd=dd>d>ddddddddEdxdddmddddddddddddŐddd#ddd dd d!d"d!d"dddddddxdd%ddאdd0ddddd'ddddÐdĐdŐdd'ddÐddƐdǐdȐd(dd*d)dddd+d,dɐdʐdʐdːdːd̐d̐d.d͐dΐdϐd/dАdѐdҐdӐdԐdՐd֐dאd.d/d͐d֐dՐdؐdِdڐdېddjdjdܐdݐdݐdސdߐd͐ddddBddd9d9dddd@d=d<d@d=dddddd dddd͐dѐddddddd1ddddUdddddddddddddddАd@ddÐddddddddddYdd[dddddXdddddd d ddd d ddZdXddUd d`d dddddddddddݐdddddĐdddddd>dd0d3dݐdZdudddddddSddddd d!d"dndnd#dSddd$dݐdd%ddddd&d'd(dd)d*d+d,d*dpdpd-d!dҐdTdؐd.ddgd/ddfdd0dӐd1dԐdՐddhd2d֐dڐdِdkdwd3d3d4d5d6d7d7d8d9d:d;d<d=d=d>d?d@dAddBdCdDdEdFdGdHdIdJZ'dKdCddLddĐd̐ddfdd6d,ddddMddNdOdĐddÐdddɐddd1ddddPd?ddQ"Z(ddRdSdTdUdVdWdXdYZ)ee)dZe)d[e)d\gZ*ed]d>eDZ+d^e+d<Gd_d`d`e,Z-Gdadbdbe.Z/dS(c)absolute_importdivisionunicode_literalsNz5Null character in input stream, replaced with U+FFFD.zInvalid codepoint in stream.z&Solidus (/) incorrectly placed in tag.z.Incorrect CR newline entity, replaced with LF.z9Entity used with illegal number (windows-1252 reference).zPNumeric entity couldn't be converted to character (codepoint U+%(charAsInt)08x).zBNumeric entity represents an illegal codepoint: U+%(charAsInt)08x.z#Numeric entity didn't end with ';'.z1Numeric entity expected. Got end of file instead.z'Numeric entity expected but none found.z!Named entity didn't end with ';'.z Named entity expected. Got none.z'End tag contains unexpected attributes.z.End tag contains unexpected self-closing flag.z#Expected tag name. Got '>' instead.zSExpected tag name. Got '?' instead. (HTML doesn't support processing instructions.)z-Expected tag name. Got something else insteadz6Expected closing tag. Got '>' instead. Ignoring ''.z-Expected closing tag. Unexpected end of file.z' instead.z"Unexpected = in unquoted attributez*Unexpected character in unquoted attributez*Unexpected character after attribute name.z+Unexpected character after attribute value.z.Unexpected end of file in attribute value (").z.Unexpected end of file in attribute value (').z*Unexpected end of file in attribute value.z)Unexpected end of file in tag. Expected >z/Unexpected character after / in tag. Expected >z&Expected '--' or 'DOCTYPE'. Not found.z Unexpected ! after -- in commentz$Unexpected space after -- in commentzIncorrect comment.z"Unexpected end of file in comment.z%Unexpected end of file in comment (-)z+Unexpected '-' after '--' found in comment.z'Unexpected end of file in comment (--).z&Unexpected character in comment found.z(No space after literal string 'DOCTYPE'.z.Unexpected > character. Expected DOCTYPE name.z.Unexpected end of file. Expected DOCTYPE name.z'Unexpected end of file in DOCTYPE name.z"Unexpected end of file in DOCTYPE.z%Expected space or '>'. Got '%(data)s'zUnexpected end of DOCTYPE.z Unexpected character in DOCTYPE.zXXX innerHTML EOFzUnexpected DOCTYPE. Ignored.z%html needs to be the first start tag.z)Unexpected End of file. Expected DOCTYPE.zErroneous DOCTYPE.z2Unexpected non-space characters. Expected DOCTYPE.z2Unexpected start tag (%(name)s). Expected DOCTYPE.z0Unexpected end tag (%(name)s). Expected DOCTYPE.z?Unexpected end tag (%(name)s) after the (implied) root element.z4Unexpected end of file. Expected end tag (%(name)s).z4Unexpected start tag head in existing head. Ignored.z'Unexpected end tag (%(name)s). Ignored.z;Unexpected start tag (%(name)s) that can be in head. Moved.z Unexpected start tag (%(name)s).zMissing end tag (%(name)s).zMissing end tags (%(name)s).zCUnexpected start tag (%(startName)s) implies end tag (%(endName)s).z@Unexpected start tag (%(originalName)s). Treated as %(newName)s.z,Unexpected start tag %(name)s. Don't use it!z'Unexpected start tag %(name)s. Ignored.zEUnexpected end tag (%(gotName)s). Missing end tag (%(expectedName)s).z:End tag (%(name)s) seen too early. Expected other end tag.zFUnexpected end tag (%(gotName)s). Expected end tag (%(expectedName)s).z+End tag (%(name)s) seen too early. Ignored.zQEnd tag (%(name)s) violates step 1, paragraph 1 of the adoption agency algorithm.zQEnd tag (%(name)s) violates step 1, paragraph 2 of the adoption agency algorithm.zQEnd tag (%(name)s) violates step 1, paragraph 3 of the adoption agency algorithm.zQEnd tag (%(name)s) violates step 4, paragraph 4 of the adoption agency algorithm.z>Unexpected end tag (%(originalName)s). Treated as %(newName)s.z'This element (%(name)s) has no end tag.z9Unexpected implied end tag (%(name)s) in the table phase.z>Unexpected implied end tag (%(name)s) in the table body phase.zDUnexpected non-space characters in table context caused voodoo mode.z3Unexpected input with type hidden in table context.z!Unexpected form in table context.zDUnexpected start tag (%(name)s) in table context caused voodoo mode.zBUnexpected end tag (%(name)s) in table context caused voodoo mode.zCUnexpected table cell start tag (%(name)s) in the table body phase.zFGot table cell end tag (%(name)s) while required end tags are missing.z?Unexpected end tag (%(name)s) in the table body phase. Ignored.z=Unexpected implied end tag (%(name)s) in the table row phase.z>Unexpected end tag (%(name)s) in the table row phase. Ignored.zJUnexpected select start tag in the select phase treated as select end tag.z/Unexpected input start tag in the select phase.zBUnexpected start tag token (%(name)s in the select phase. Ignored.z;Unexpected end tag (%(name)s) in the select phase. Ignored.zKUnexpected table element start tag (%(name)s) in the select in table phase.zIUnexpected table element end tag (%(name)s) in the select in table phase.z8Unexpected non-space characters in the after body phase.z>Unexpected start tag token (%(name)s) in the after body phase.zZ attributenameZ attributetypeZ basefrequencyZ baseprofileZcalcmodeZ clippathunitsZcontentscripttypeZcontentstyletypeZdiffuseconstantZedgemodeZexternalresourcesrequiredZ filterresZ filterunitsZglyphrefZgradienttransformZ gradientunitsZ kernelmatrixZkernelunitlengthZ keypointsZ keysplinesZkeytimesZ lengthadjustZlimitingconeangleZ markerheightZ markerunitsZ markerwidthZmaskcontentunitsZ maskunitsZ numoctavesZ pathlengthZpatterncontentunitsZpatterntransformZ patternunitsZ pointsatxZ pointsatyZ pointsatzZ preservealphaZpreserveaspectratioZprimitiveunitsZrefxZrefyZ repeatcountZ repeatdurZrequiredextensionsZrequiredfeaturesZspecularconstantZspecularexponentZ spreadmethodZ startoffsetZ stddeviationZ stitchtilesZ surfacescaleZsystemlanguageZ tablevaluesZtargetxZtargetyZ textlengthZviewboxZ viewtargetZxchannelselectorZychannelselectorZ zoomandpanZ definitionurlZ definitionURLrZactuateZarcroleZhrefZroleZshowtyper ZlangZspacer ) z xlink:actuatez xlink:arcrolez xlink:hrefz xlink:rolez xlink:showz xlink:titlez xlink:typezxml:basezxml:langz xml:spacer z xmlns:xlinkcCs"g|]\}\}}}||f|fqSr4).0ZqnameprefixZlocalnsr4r4B/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/constants.py s r9     cCs g|]}t|t|fqSr4)ordlower)r5cr4r4r8r9#s)r r!r"r#r$r%z event-sourcesourceZtrackZ irrelevantZ itemscopeZscopedZismapZautoplayZcontrolsZdeferasyncopenZmultipleZdisabledZhiddencheckeddefaultZnoshadeZ autosubmitreadonlyZselectedZ autofocusZrequiredZseamless)r2r*ZaudioZvideor0rZdatagridrr(r-rZoptionZoptgrouprr+r1outputr)) i i ii i& i i! ii0 i`i9 iRrJi}rJrJi i i i i" i i ii"!iai: iSrJi~ixlt;gt;amp;apos;quot;Æ&ÁuĂÂuАu𝔄ÀuΑuĀu⩓uĄu𝔸u⁡Åu𝒜u≔ÃÄu∖u⫧u⌆uБu∵uℬuΒu𝔅u𝔹u˘u≎uЧ©uĆu⋒uⅅuℭuČÇuĈu∰uĊ¸·uΧu⊙u⊖u⊕u⊗u∲u”u’u∷u⩴u≡u∯u∮uℂu∐u∳u⨯u𝒞u⋓u≍u⤑uЂuЅuЏu‡u↡u⫤uĎuДu∇uΔu𝔇´u˙u˝`u˜u⋄uⅆu𝔻¨u⃜u≐u⇓u⇐u⇔u⟸u⟺u⟹u⇒u⊨u⇑u⇕u∥u↓u⤓u⇵ȗu⥐u⥞u↽u⥖u⥟u⇁u⥗u⊤u↧u𝒟uĐuŊÐÉuĚÊuЭuĖu𝔈Èu∈uĒu◻u▫uĘu𝔼uΕu⩵u≂u⇌uℰu⩳uΗËu∃uⅇuФu𝔉u◼u▪u𝔽u∀uℱuЃ>uΓuϜuĞuĢuĜuГuĠu𝔊u⋙u𝔾u≥u⋛u≧u⪢u≷u⩾u≳u𝒢u≫uЪuˇ^uĤuℌuℋuℍu─uĦu≏uЕuIJuЁÍÎuИuİuℑÌuĪuⅈu∬u∫u⋂u⁣u⁢uĮu𝕀uΙuℐuĨuІÏuĴuЙu𝔍u𝕁u𝒥uЈuЄuХuЌuΚuĶuКu𝔎u𝕂u𝒦uЉ⃒u⧞u⤂u≤⃒u<⃒u⊴⃒u⤃u⊵⃒u∼⃒u⇖u⤣u⤧óôuоuőu⨸u⦼uœu⦿u𝔬u˛òu⧁u⦵u⦾u⦻u⧀uōuωuοu⦶u𝕠u⦷u⦹u∨u⩝uℴªºu⊶u⩖u⩗u⩛øu⊘õu⨶öu⌽¶u⫳u⫽uп%.u‰u‱u𝔭uφuϕu☎uπuϖuℎ+u⨣u⨢u⨥u⩲u⨦u⨧u⨕u𝕡£u⪳u⪷u⪹u⪵u⋨u′u⌮u⌒u⌓u⊰u𝓅uψu u𝔮u𝕢u⁗u𝓆u⨖?u⤜u⥤u∽̱uŕu⦳u⦒u⦥»u⥵u⤠u⤳u⤞u⥅u⥴u↣u↝u⤚u∶u❳}]u⦌u⦎u⦐uřuŗuрu⤷u⥩u↳u▭u⥽u𝔯u⥬uρuϱu⇉u⋌u˚u‏u⎱u⫮u⟭u⇾u⦆u𝕣u⨮u⨵)u⦔u⨒u›u𝓇u⋊u▹u⧎u⥨u℞uśu⪴u⪸ušuşuŝu⪶u⪺u⋩u⨓uсu⋅u⩦u⇘§;u⤩u✶u𝔰u♯uщuш­uσuςu⩪u⪞u⪠u⪝u⪟u≆u⨤u⥲u⨳u⧤u⌣u⪪u⪬u⪬︀uь/u⧄u⌿u𝕤u♠u⊓︀u⊔︀u𝓈u☆u⊂u⫅u⪽u⫃u⫁u⫋u⊊u⪿u⥹u⫇u⫕u⫓u♪¹²³u⫆u⪾u⫘u⫄u⟉u⫗u⥻u⫂u⫌u⊋u⫀u⫈u⫔u⫖u⇙u⤪ßu⌖uτuťuţuтu⌕u𝔱uθuϑþ×u⨱u⨰u⌶u⫱u𝕥u⫚u‴u▵u≜u◬u⨺u⨹u⧍u⨻u⏢u𝓉uцuћuŧu⥣úuўuŭûuуuűu⥾u𝔲ùu▀u⌜u⌏u◸uūuųu𝕦uυu⇈u⌝u⌎uůu◹u𝓊u⋰uũüu⦧u⫨u⫩u⦜u⊊︀u⫋︀u⊋︀u⫌︀uвu⊻u≚u⋮u𝔳u𝕧u𝓋u⦚uŵu⩟u≙u℘u𝔴u𝕨u𝓌u𝔵uξu⋻u𝕩u𝓍ýuяuŷuы¥u𝔶uїu𝕪u𝓎uюÿuźužuзużuζu𝔷uжu⇝u𝕫u𝓏u‍u‌(ZAEligzAElig;ZAMPzAMP;ZAacutezAacute;zAbreve;ZAcirczAcirc;zAcy;zAfr;ZAgravezAgrave;zAlpha;zAmacr;zAnd;zAogon;zAopf;zApplyFunction;ZAringzAring;zAscr;zAssign;ZAtildezAtilde;ZAumlzAuml;z Backslash;zBarv;zBarwed;zBcy;zBecause;z Bernoullis;zBeta;zBfr;zBopf;zBreve;zBscr;zBumpeq;zCHcy;ZCOPYzCOPY;zCacute;zCap;zCapitalDifferentialD;zCayleys;zCcaron;ZCcedilzCcedil;zCcirc;zCconint;zCdot;zCedilla;z CenterDot;zCfr;zChi;z CircleDot;z CircleMinus;z CirclePlus;z CircleTimes;zClockwiseContourIntegral;zCloseCurlyDoubleQuote;zCloseCurlyQuote;zColon;zColone;z Congruent;zConint;zContourIntegral;zCopf;z Coproduct;z CounterClockwiseContourIntegral;zCross;zCscr;zCup;zCupCap;zDD;z DDotrahd;zDJcy;zDScy;zDZcy;zDagger;zDarr;zDashv;zDcaron;zDcy;zDel;zDelta;zDfr;zDiacriticalAcute;zDiacriticalDot;zDiacriticalDoubleAcute;zDiacriticalGrave;zDiacriticalTilde;zDiamond;zDifferentialD;zDopf;zDot;zDotDot;z DotEqual;zDoubleContourIntegral;z DoubleDot;zDoubleDownArrow;zDoubleLeftArrow;zDoubleLeftRightArrow;zDoubleLeftTee;zDoubleLongLeftArrow;zDoubleLongLeftRightArrow;zDoubleLongRightArrow;zDoubleRightArrow;zDoubleRightTee;zDoubleUpArrow;zDoubleUpDownArrow;zDoubleVerticalBar;z DownArrow;z DownArrowBar;zDownArrowUpArrow;z DownBreve;zDownLeftRightVector;zDownLeftTeeVector;zDownLeftVector;zDownLeftVectorBar;zDownRightTeeVector;zDownRightVector;zDownRightVectorBar;zDownTee;z DownTeeArrow;z Downarrow;zDscr;zDstrok;zENG;ZETHzETH;ZEacutezEacute;zEcaron;ZEcirczEcirc;zEcy;zEdot;zEfr;ZEgravezEgrave;zElement;zEmacr;zEmptySmallSquare;zEmptyVerySmallSquare;zEogon;zEopf;zEpsilon;zEqual;z EqualTilde;z Equilibrium;zEscr;zEsim;zEta;ZEumlzEuml;zExists;z ExponentialE;zFcy;zFfr;zFilledSmallSquare;zFilledVerySmallSquare;zFopf;zForAll;z Fouriertrf;zFscr;zGJcy;ZGTzGT;zGamma;zGammad;zGbreve;zGcedil;zGcirc;zGcy;zGdot;zGfr;zGg;zGopf;z GreaterEqual;zGreaterEqualLess;zGreaterFullEqual;zGreaterGreater;z GreaterLess;zGreaterSlantEqual;z GreaterTilde;zGscr;zGt;zHARDcy;zHacek;zHat;zHcirc;zHfr;z HilbertSpace;zHopf;zHorizontalLine;zHscr;zHstrok;z HumpDownHump;z HumpEqual;zIEcy;zIJlig;zIOcy;ZIacutezIacute;ZIcirczIcirc;zIcy;zIdot;zIfr;ZIgravezIgrave;zIm;zImacr;z ImaginaryI;zImplies;zInt;z Integral;z Intersection;zInvisibleComma;zInvisibleTimes;zIogon;zIopf;zIota;zIscr;zItilde;zIukcy;ZIumlzIuml;zJcirc;zJcy;zJfr;zJopf;zJscr;zJsercy;zJukcy;zKHcy;zKJcy;zKappa;zKcedil;zKcy;zKfr;zKopf;zKscr;zLJcy;ZLTzLT;zLacute;zLambda;zLang;z Laplacetrf;zLarr;zLcaron;zLcedil;zLcy;zLeftAngleBracket;z LeftArrow;z LeftArrowBar;zLeftArrowRightArrow;z LeftCeiling;zLeftDoubleBracket;zLeftDownTeeVector;zLeftDownVector;zLeftDownVectorBar;z LeftFloor;zLeftRightArrow;zLeftRightVector;zLeftTee;z LeftTeeArrow;zLeftTeeVector;z LeftTriangle;zLeftTriangleBar;zLeftTriangleEqual;zLeftUpDownVector;zLeftUpTeeVector;z LeftUpVector;zLeftUpVectorBar;z LeftVector;zLeftVectorBar;z Leftarrow;zLeftrightarrow;zLessEqualGreater;zLessFullEqual;z LessGreater;z LessLess;zLessSlantEqual;z LessTilde;zLfr;zLl;z Lleftarrow;zLmidot;zLongLeftArrow;zLongLeftRightArrow;zLongRightArrow;zLongleftarrow;zLongleftrightarrow;zLongrightarrow;zLopf;zLowerLeftArrow;zLowerRightArrow;zLscr;zLsh;zLstrok;zLt;zMap;zMcy;z MediumSpace;z Mellintrf;zMfr;z MinusPlus;zMopf;zMscr;zMu;zNJcy;zNacute;zNcaron;zNcedil;zNcy;zNegativeMediumSpace;zNegativeThickSpace;zNegativeThinSpace;zNegativeVeryThinSpace;zNestedGreaterGreater;zNestedLessLess;zNewLine;zNfr;zNoBreak;zNonBreakingSpace;zNopf;zNot;z NotCongruent;z NotCupCap;zNotDoubleVerticalBar;z NotElement;z NotEqual;zNotEqualTilde;z NotExists;z NotGreater;zNotGreaterEqual;zNotGreaterFullEqual;zNotGreaterGreater;zNotGreaterLess;zNotGreaterSlantEqual;zNotGreaterTilde;zNotHumpDownHump;z NotHumpEqual;zNotLeftTriangle;zNotLeftTriangleBar;zNotLeftTriangleEqual;zNotLess;z NotLessEqual;zNotLessGreater;z NotLessLess;zNotLessSlantEqual;z NotLessTilde;zNotNestedGreaterGreater;zNotNestedLessLess;z NotPrecedes;zNotPrecedesEqual;zNotPrecedesSlantEqual;zNotReverseElement;zNotRightTriangle;zNotRightTriangleBar;zNotRightTriangleEqual;zNotSquareSubset;zNotSquareSubsetEqual;zNotSquareSuperset;zNotSquareSupersetEqual;z NotSubset;zNotSubsetEqual;z NotSucceeds;zNotSucceedsEqual;zNotSucceedsSlantEqual;zNotSucceedsTilde;z NotSuperset;zNotSupersetEqual;z NotTilde;zNotTildeEqual;zNotTildeFullEqual;zNotTildeTilde;zNotVerticalBar;zNscr;ZNtildezNtilde;zNu;zOElig;ZOacutezOacute;ZOcirczOcirc;zOcy;zOdblac;zOfr;ZOgravezOgrave;zOmacr;zOmega;zOmicron;zOopf;zOpenCurlyDoubleQuote;zOpenCurlyQuote;zOr;zOscr;ZOslashzOslash;ZOtildezOtilde;zOtimes;ZOumlzOuml;zOverBar;z OverBrace;z OverBracket;zOverParenthesis;z PartialD;zPcy;zPfr;zPhi;zPi;z PlusMinus;zPoincareplane;zPopf;zPr;z Precedes;zPrecedesEqual;zPrecedesSlantEqual;zPrecedesTilde;zPrime;zProduct;z Proportion;z Proportional;zPscr;zPsi;ZQUOTzQUOT;zQfr;zQopf;zQscr;zRBarr;ZREGzREG;zRacute;zRang;zRarr;zRarrtl;zRcaron;zRcedil;zRcy;zRe;zReverseElement;zReverseEquilibrium;zReverseUpEquilibrium;zRfr;zRho;zRightAngleBracket;z RightArrow;zRightArrowBar;zRightArrowLeftArrow;z RightCeiling;zRightDoubleBracket;zRightDownTeeVector;zRightDownVector;zRightDownVectorBar;z RightFloor;z RightTee;zRightTeeArrow;zRightTeeVector;zRightTriangle;zRightTriangleBar;zRightTriangleEqual;zRightUpDownVector;zRightUpTeeVector;zRightUpVector;zRightUpVectorBar;z RightVector;zRightVectorBar;z Rightarrow;zRopf;z RoundImplies;z Rrightarrow;zRscr;zRsh;z RuleDelayed;zSHCHcy;zSHcy;zSOFTcy;zSacute;zSc;zScaron;zScedil;zScirc;zScy;zSfr;zShortDownArrow;zShortLeftArrow;zShortRightArrow;z ShortUpArrow;zSigma;z SmallCircle;zSopf;zSqrt;zSquare;zSquareIntersection;z SquareSubset;zSquareSubsetEqual;zSquareSuperset;zSquareSupersetEqual;z SquareUnion;zSscr;zStar;zSub;zSubset;z SubsetEqual;z Succeeds;zSucceedsEqual;zSucceedsSlantEqual;zSucceedsTilde;z SuchThat;zSum;zSup;z Superset;zSupersetEqual;zSupset;ZTHORNzTHORN;zTRADE;zTSHcy;zTScy;zTab;zTau;zTcaron;zTcedil;zTcy;zTfr;z Therefore;zTheta;z ThickSpace;z ThinSpace;zTilde;z TildeEqual;zTildeFullEqual;z TildeTilde;zTopf;z TripleDot;zTscr;zTstrok;ZUacutezUacute;zUarr;z Uarrocir;zUbrcy;zUbreve;ZUcirczUcirc;zUcy;zUdblac;zUfr;ZUgravezUgrave;zUmacr;z UnderBar;z UnderBrace;z UnderBracket;zUnderParenthesis;zUnion;z UnionPlus;zUogon;zUopf;zUpArrow;z UpArrowBar;zUpArrowDownArrow;z UpDownArrow;zUpEquilibrium;zUpTee;z UpTeeArrow;zUparrow;z Updownarrow;zUpperLeftArrow;zUpperRightArrow;zUpsi;zUpsilon;zUring;zUscr;zUtilde;ZUumlzUuml;zVDash;zVbar;zVcy;zVdash;zVdashl;zVee;zVerbar;zVert;z VerticalBar;z VerticalLine;zVerticalSeparator;zVerticalTilde;zVeryThinSpace;zVfr;zVopf;zVscr;zVvdash;zWcirc;zWedge;zWfr;zWopf;zWscr;zXfr;zXi;zXopf;zXscr;zYAcy;zYIcy;zYUcy;ZYacutezYacute;zYcirc;zYcy;zYfr;zYopf;zYscr;zYuml;zZHcy;zZacute;zZcaron;zZcy;zZdot;zZeroWidthSpace;zZeta;zZfr;zZopf;zZscr;Zaacutezaacute;zabreve;zac;zacE;zacd;Zacirczacirc;Zacutezacute;zacy;Zaeligzaelig;zaf;zafr;Zagravezagrave;zalefsym;zaleph;zalpha;zamacr;zamalg;ZamprMzand;zandand;zandd;z andslope;zandv;zang;zange;zangle;zangmsd;z angmsdaa;z angmsdab;z angmsdac;z angmsdad;z angmsdae;z angmsdaf;z angmsdag;z angmsdah;zangrt;zangrtvb;z angrtvbd;zangsph;zangst;zangzarr;zaogon;zaopf;zap;zapE;zapacir;zape;zapid;rNzapprox;z approxeq;Zaringzaring;zascr;zast;zasymp;zasympeq;Zatildezatilde;Zaumlzauml;z awconint;zawint;zbNot;z backcong;z backepsilon;z backprime;zbacksim;z backsimeq;zbarvee;zbarwed;z barwedge;zbbrk;z bbrktbrk;zbcong;zbcy;zbdquo;zbecaus;zbecause;zbemptyv;zbepsi;zbernou;zbeta;zbeth;zbetween;zbfr;zbigcap;zbigcirc;zbigcup;zbigodot;z bigoplus;z bigotimes;z bigsqcup;zbigstar;zbigtriangledown;zbigtriangleup;z biguplus;zbigvee;z bigwedge;zbkarow;z blacklozenge;z blacksquare;zblacktriangle;zblacktriangledown;zblacktriangleleft;zblacktriangleright;zblank;zblk12;zblk14;zblk34;zblock;zbne;zbnequiv;zbnot;zbopf;zbot;zbottom;zbowtie;zboxDL;zboxDR;zboxDl;zboxDr;zboxH;zboxHD;zboxHU;zboxHd;zboxHu;zboxUL;zboxUR;zboxUl;zboxUr;zboxV;zboxVH;zboxVL;zboxVR;zboxVh;zboxVl;zboxVr;zboxbox;zboxdL;zboxdR;zboxdl;zboxdr;zboxh;zboxhD;zboxhU;zboxhd;zboxhu;z boxminus;zboxplus;z boxtimes;zboxuL;zboxuR;zboxul;zboxur;zboxv;zboxvH;zboxvL;zboxvR;zboxvh;zboxvl;zboxvr;zbprime;zbreve;Zbrvbarzbrvbar;zbscr;zbsemi;zbsim;zbsime;zbsol;zbsolb;z bsolhsub;zbull;zbullet;zbump;zbumpE;zbumpe;zbumpeq;zcacute;zcap;zcapand;z capbrcup;zcapcap;zcapcup;zcapdot;zcaps;zcaret;zcaron;zccaps;zccaron;Zccedilzccedil;zccirc;zccups;zccupssm;zcdot;Zcedilzcedil;zcemptyv;Zcentzcent;z centerdot;zcfr;zchcy;zcheck;z checkmark;zchi;zcir;zcirE;zcirc;zcirceq;zcirclearrowleft;zcirclearrowright;z circledR;z circledS;z circledast;z circledcirc;z circleddash;zcire;z cirfnint;zcirmid;zcirscir;zclubs;z clubsuit;zcolon;zcolone;zcoloneq;zcomma;zcommat;zcomp;zcompfn;z complement;z complexes;zcong;zcongdot;zconint;zcopf;zcoprod;copyzcopy;zcopysr;zcrarr;zcross;zcscr;zcsub;zcsube;zcsup;zcsupe;zctdot;zcudarrl;zcudarrr;zcuepr;zcuesc;zcularr;zcularrp;zcup;z cupbrcap;zcupcap;zcupcup;zcupdot;zcupor;zcups;zcurarr;zcurarrm;z curlyeqprec;z curlyeqsucc;z curlyvee;z curlywedge;Zcurrenzcurren;zcurvearrowleft;zcurvearrowright;zcuvee;zcuwed;z cwconint;zcwint;zcylcty;zdArr;zdHar;zdagger;zdaleth;zdarr;zdash;zdashv;zdbkarow;zdblac;zdcaron;zdcy;zdd;zddagger;zddarr;zddotseq;Zdegzdeg;zdelta;zdemptyv;zdfisht;zdfr;zdharl;zdharr;zdiam;zdiamond;z diamondsuit;zdiams;zdie;zdigamma;zdisin;zdiv;Zdividezdivide;zdivideontimes;zdivonx;zdjcy;zdlcorn;zdlcrop;zdollar;zdopf;zdot;zdoteq;z doteqdot;z dotminus;zdotplus;z dotsquare;zdoublebarwedge;z downarrow;zdowndownarrows;zdownharpoonleft;zdownharpoonright;z drbkarow;zdrcorn;zdrcrop;zdscr;zdscy;zdsol;zdstrok;zdtdot;zdtri;zdtrif;zduarr;zduhar;zdwangle;zdzcy;z dzigrarr;zeDDot;zeDot;Zeacutezeacute;zeaster;zecaron;zecir;Zecirczecirc;zecolon;zecy;zedot;zee;zefDot;zefr;zeg;Zegravezegrave;zegs;zegsdot;zel;z elinters;zell;zels;zelsdot;zemacr;zempty;z emptyset;zemptyv;zemsp13;zemsp14;zemsp;zeng;zensp;zeogon;zeopf;zepar;zeparsl;zeplus;zepsi;zepsilon;zepsiv;zeqcirc;zeqcolon;zeqsim;z eqslantgtr;z eqslantless;zequals;zequest;zequiv;zequivDD;z eqvparsl;zerDot;zerarr;zescr;zesdot;zesim;zeta;Zethzeth;Zeumlzeuml;zeuro;zexcl;zexist;z expectation;z exponentiale;zfallingdotseq;zfcy;zfemale;zffilig;zfflig;zffllig;zffr;zfilig;zfjlig;zflat;zfllig;zfltns;zfnof;zfopf;zforall;zfork;zforkv;z fpartint;Zfrac12zfrac12;zfrac13;Zfrac14zfrac14;zfrac15;zfrac16;zfrac18;zfrac23;zfrac25;Zfrac34zfrac34;zfrac35;zfrac38;zfrac45;zfrac56;zfrac58;zfrac78;zfrasl;zfrown;zfscr;zgE;zgEl;zgacute;zgamma;zgammad;zgap;zgbreve;zgcirc;zgcy;zgdot;zge;zgel;zgeq;zgeqq;z geqslant;zges;zgescc;zgesdot;zgesdoto;z gesdotol;zgesl;zgesles;zgfr;zgg;zggg;zgimel;zgjcy;zgl;zglE;zgla;zglj;zgnE;zgnap;z gnapprox;zgne;zgneq;zgneqq;zgnsim;zgopf;zgrave;zgscr;zgsim;zgsime;zgsiml;gtrLzgtcc;zgtcir;zgtdot;zgtlPar;zgtquest;z gtrapprox;zgtrarr;zgtrdot;z gtreqless;z gtreqqless;zgtrless;zgtrsim;z gvertneqq;zgvnE;zhArr;zhairsp;zhalf;zhamilt;zhardcy;zharr;zharrcir;zharrw;zhbar;zhcirc;zhearts;z heartsuit;zhellip;zhercon;zhfr;z hksearow;z hkswarow;zhoarr;zhomtht;zhookleftarrow;zhookrightarrow;zhopf;zhorbar;zhscr;zhslash;zhstrok;zhybull;zhyphen;Ziacuteziacute;zic;Zicirczicirc;zicy;ziecy;Ziexclziexcl;ziff;zifr;Zigravezigrave;zii;ziiiint;ziiint;ziinfin;ziiota;zijlig;zimacr;zimage;z imagline;z imagpart;zimath;zimof;zimped;zin;zincare;zinfin;z infintie;zinodot;zint;zintcal;z integers;z intercal;z intlarhk;zintprod;ziocy;ziogon;ziopf;ziota;ziprod;Ziquestziquest;ziscr;zisin;zisinE;zisindot;zisins;zisinsv;zisinv;zit;zitilde;ziukcy;Ziumlziuml;zjcirc;zjcy;zjfr;zjmath;zjopf;zjscr;zjsercy;zjukcy;zkappa;zkappav;zkcedil;zkcy;zkfr;zkgreen;zkhcy;zkjcy;zkopf;zkscr;zlAarr;zlArr;zlAtail;zlBarr;zlE;zlEg;zlHar;zlacute;z laemptyv;zlagran;zlambda;zlang;zlangd;zlangle;zlap;Zlaquozlaquo;zlarr;zlarrb;zlarrbfs;zlarrfs;zlarrhk;zlarrlp;zlarrpl;zlarrsim;zlarrtl;zlat;zlatail;zlate;zlates;zlbarr;zlbbrk;zlbrace;zlbrack;zlbrke;zlbrksld;zlbrkslu;zlcaron;zlcedil;zlceil;zlcub;zlcy;zldca;zldquo;zldquor;zldrdhar;z ldrushar;zldsh;zle;z leftarrow;zleftarrowtail;zleftharpoondown;zleftharpoonup;zleftleftarrows;zleftrightarrow;zleftrightarrows;zleftrightharpoons;zleftrightsquigarrow;zleftthreetimes;zleg;zleq;zleqq;z leqslant;zles;zlescc;zlesdot;zlesdoto;z lesdotor;zlesg;zlesges;z lessapprox;zlessdot;z lesseqgtr;z lesseqqgtr;zlessgtr;zlesssim;zlfisht;zlfloor;zlfr;zlg;zlgE;zlhard;zlharu;zlharul;zlhblk;zljcy;zll;zllarr;z llcorner;zllhard;zlltri;zlmidot;zlmoust;z lmoustache;zlnE;zlnap;z lnapprox;zlne;zlneq;zlneqq;zlnsim;zloang;zloarr;zlobrk;zlongleftarrow;zlongleftrightarrow;z longmapsto;zlongrightarrow;zlooparrowleft;zlooparrowright;zlopar;zlopf;zloplus;zlotimes;zlowast;zlowbar;zloz;zlozenge;zlozf;zlpar;zlparlt;zlrarr;z lrcorner;zlrhar;zlrhard;zlrm;zlrtri;zlsaquo;zlscr;zlsh;zlsim;zlsime;zlsimg;zlsqb;zlsquo;zlsquor;zlstrok;ltrKzltcc;zltcir;zltdot;zlthree;zltimes;zltlarr;zltquest;zltrPar;zltri;zltrie;zltrif;z lurdshar;zluruhar;z lvertneqq;zlvnE;zmDDot;Zmacrzmacr;zmale;zmalt;zmaltese;zmap;zmapsto;z mapstodown;z mapstoleft;z mapstoup;zmarker;zmcomma;zmcy;zmdash;zmeasuredangle;zmfr;zmho;microzmicro;zmid;zmidast;zmidcir;Zmiddotzmiddot;zminus;zminusb;zminusd;zminusdu;zmlcp;zmldr;zmnplus;zmodels;zmopf;zmp;zmscr;zmstpos;zmu;z multimap;zmumap;znGg;znGt;znGtv;z nLeftarrow;znLeftrightarrow;znLl;znLt;znLtv;z nRightarrow;znVDash;znVdash;znabla;znacute;znang;znap;znapE;znapid;znapos;znapprox;znatur;znatural;z naturals;Znbspznbsp;znbump;znbumpe;zncap;zncaron;zncedil;zncong;z ncongdot;zncup;zncy;zndash;zne;zneArr;znearhk;znearr;znearrow;znedot;znequiv;znesear;znesim;znexist;znexists;znfr;zngE;znge;zngeq;zngeqq;z ngeqslant;znges;zngsim;zngt;zngtr;znhArr;znharr;znhpar;zni;znis;znisd;zniv;znjcy;znlArr;znlE;znlarr;znldr;znle;z nleftarrow;znleftrightarrow;znleq;znleqq;z nleqslant;znles;znless;znlsim;znlt;znltri;znltrie;znmid;znopf;notznot;znotin;znotinE;z notindot;znotinva;znotinvb;znotinvc;znotni;znotniva;znotnivb;znotnivc;znpar;z nparallel;znparsl;znpart;znpolint;znpr;znprcue;znpre;znprec;znpreceq;znrArr;znrarr;znrarrc;znrarrw;z nrightarrow;znrtri;znrtrie;znsc;znsccue;znsce;znscr;z nshortmid;znshortparallel;znsim;znsime;znsimeq;znsmid;znspar;znsqsube;znsqsupe;znsub;znsubE;znsube;znsubset;z nsubseteq;z nsubseteqq;znsucc;znsucceq;znsup;znsupE;znsupe;znsupset;z nsupseteq;z nsupseteqq;zntgl;Zntildezntilde;zntlg;zntriangleleft;zntrianglelefteq;zntriangleright;zntrianglerighteq;znu;znum;znumero;znumsp;znvDash;znvHarr;znvap;znvdash;znvge;znvgt;znvinfin;znvlArr;znvle;znvlt;znvltrie;znvrArr;znvrtrie;znvsim;znwArr;znwarhk;znwarr;znwarrow;znwnear;zoS;Zoacutezoacute;zoast;zocir;Zocirczocirc;zocy;zodash;zodblac;zodiv;zodot;zodsold;zoelig;zofcir;zofr;zogon;Zogravezograve;zogt;zohbar;zohm;zoint;zolarr;zolcir;zolcross;zoline;zolt;zomacr;zomega;zomicron;zomid;zominus;zoopf;zopar;zoperp;zoplus;zor;zorarr;zord;zorder;zorderof;Zordfzordf;Zordmzordm;zorigof;zoror;zorslope;zorv;zoscr;Zoslashzoslash;zosol;Zotildezotilde;zotimes;z otimesas;Zoumlzouml;zovbar;zpar;Zparazpara;z parallel;zparsim;zparsl;zpart;zpcy;zpercnt;zperiod;zpermil;zperp;zpertenk;zpfr;zphi;zphiv;zphmmat;zphone;zpi;z pitchfork;zpiv;zplanck;zplanckh;zplankv;zplus;z plusacir;zplusb;zpluscir;zplusdo;zplusdu;zpluse;Zplusmnzplusmn;zplussim;zplustwo;zpm;z pointint;zpopf;Zpoundzpound;zpr;zprE;zprap;zprcue;zpre;zprec;z precapprox;z preccurlyeq;zpreceq;z precnapprox;z precneqq;z precnsim;zprecsim;zprime;zprimes;zprnE;zprnap;zprnsim;zprod;z profalar;z profline;z profsurf;zprop;zpropto;zprsim;zprurel;zpscr;zpsi;zpuncsp;zqfr;zqint;zqopf;zqprime;zqscr;z quaternions;zquatint;zquest;zquesteq;ZquotrOzrAarr;zrArr;zrAtail;zrBarr;zrHar;zrace;zracute;zradic;z raemptyv;zrang;zrangd;zrange;zrangle;Zraquozraquo;zrarr;zrarrap;zrarrb;zrarrbfs;zrarrc;zrarrfs;zrarrhk;zrarrlp;zrarrpl;zrarrsim;zrarrtl;zrarrw;zratail;zratio;z rationals;zrbarr;zrbbrk;zrbrace;zrbrack;zrbrke;zrbrksld;zrbrkslu;zrcaron;zrcedil;zrceil;zrcub;zrcy;zrdca;zrdldhar;zrdquo;zrdquor;zrdsh;zreal;zrealine;z realpart;zreals;zrect;Zregzreg;zrfisht;zrfloor;zrfr;zrhard;zrharu;zrharul;zrho;zrhov;z rightarrow;zrightarrowtail;zrightharpoondown;zrightharpoonup;zrightleftarrows;zrightleftharpoons;zrightrightarrows;zrightsquigarrow;zrightthreetimes;zring;z risingdotseq;zrlarr;zrlhar;zrlm;zrmoust;z rmoustache;zrnmid;zroang;zroarr;zrobrk;zropar;zropf;zroplus;zrotimes;zrpar;zrpargt;z rppolint;zrrarr;zrsaquo;zrscr;zrsh;zrsqb;zrsquo;zrsquor;zrthree;zrtimes;zrtri;zrtrie;zrtrif;z rtriltri;zruluhar;zrx;zsacute;zsbquo;zsc;zscE;zscap;zscaron;zsccue;zsce;zscedil;zscirc;zscnE;zscnap;zscnsim;z scpolint;zscsim;zscy;zsdot;zsdotb;zsdote;zseArr;zsearhk;zsearr;zsearrow;Zsectzsect;zsemi;zseswar;z setminus;zsetmn;zsext;zsfr;zsfrown;zsharp;zshchcy;zshcy;z shortmid;zshortparallel;Zshyzshy;zsigma;zsigmaf;zsigmav;zsim;zsimdot;zsime;zsimeq;zsimg;zsimgE;zsiml;zsimlE;zsimne;zsimplus;zsimrarr;zslarr;zsmallsetminus;zsmashp;z smeparsl;zsmid;zsmile;zsmt;zsmte;zsmtes;zsoftcy;zsol;zsolb;zsolbar;zsopf;zspades;z spadesuit;zspar;zsqcap;zsqcaps;zsqcup;zsqcups;zsqsub;zsqsube;z sqsubset;z sqsubseteq;zsqsup;zsqsupe;z sqsupset;z sqsupseteq;zsqu;zsquare;zsquarf;zsquf;zsrarr;zsscr;zssetmn;zssmile;zsstarf;zstar;zstarf;zstraightepsilon;z straightphi;zstrns;zsub;zsubE;zsubdot;zsube;zsubedot;zsubmult;zsubnE;zsubne;zsubplus;zsubrarr;zsubset;z subseteq;z subseteqq;z subsetneq;z subsetneqq;zsubsim;zsubsub;zsubsup;zsucc;z succapprox;z succcurlyeq;zsucceq;z succnapprox;z succneqq;z succnsim;zsuccsim;zsum;zsung;Zsup1zsup1;Zsup2zsup2;Zsup3zsup3;zsup;zsupE;zsupdot;zsupdsub;zsupe;zsupedot;zsuphsol;zsuphsub;zsuplarr;zsupmult;zsupnE;zsupne;zsupplus;zsupset;z supseteq;z supseteqq;z supsetneq;z supsetneqq;zsupsim;zsupsub;zsupsup;zswArr;zswarhk;zswarr;zswarrow;zswnwar;Zszligzszlig;ztarget;ztau;ztbrk;ztcaron;ztcedil;ztcy;ztdot;ztelrec;ztfr;zthere4;z therefore;ztheta;z thetasym;zthetav;z thickapprox;z thicksim;zthinsp;zthkap;zthksim;Zthornzthorn;ztilde;timesztimes;ztimesb;z timesbar;ztimesd;ztint;ztoea;ztop;ztopbot;ztopcir;ztopf;ztopfork;ztosa;ztprime;ztrade;z triangle;z triangledown;z triangleleft;ztrianglelefteq;z triangleq;ztriangleright;ztrianglerighteq;ztridot;ztrie;z triminus;ztriplus;ztrisb;ztritime;z trpezium;ztscr;ztscy;ztshcy;ztstrok;ztwixt;ztwoheadleftarrow;ztwoheadrightarrow;zuArr;zuHar;Zuacutezuacute;zuarr;zubrcy;zubreve;Zucirczucirc;zucy;zudarr;zudblac;zudhar;zufisht;zufr;Zugravezugrave;zuharl;zuharr;zuhblk;zulcorn;z ulcorner;zulcrop;zultri;zumacr;Zumlzuml;zuogon;zuopf;zuparrow;z updownarrow;zupharpoonleft;zupharpoonright;zuplus;zupsi;zupsih;zupsilon;z upuparrows;zurcorn;z urcorner;zurcrop;zuring;zurtri;zuscr;zutdot;zutilde;zutri;zutrif;zuuarr;Zuumlzuuml;zuwangle;zvArr;zvBar;zvBarv;zvDash;zvangrt;z varepsilon;z varkappa;z varnothing;zvarphi;zvarpi;z varpropto;zvarr;zvarrho;z varsigma;z varsubsetneq;zvarsubsetneqq;z varsupsetneq;zvarsupsetneqq;z vartheta;zvartriangleleft;zvartriangleright;zvcy;zvdash;zvee;zveebar;zveeeq;zvellip;zverbar;zvert;zvfr;zvltri;zvnsub;zvnsup;zvopf;zvprop;zvrtri;zvscr;zvsubnE;zvsubne;zvsupnE;zvsupne;zvzigzag;zwcirc;zwedbar;zwedge;zwedgeq;zweierp;zwfr;zwopf;zwp;zwr;zwreath;zwscr;zxcap;zxcirc;zxcup;zxdtri;zxfr;zxhArr;zxharr;zxi;zxlArr;zxlarr;zxmap;zxnis;zxodot;zxopf;zxoplus;zxotime;zxrArr;zxrarr;zxscr;zxsqcup;zxuplus;zxutri;zxvee;zxwedge;Zyacutezyacute;zyacy;zycirc;zycy;Zyenzyen;zyfr;zyicy;zyopf;zyscr;zyucy;Zyumlzyuml;zzacute;zzcaron;zzcy;zzdot;zzeetrf;zzeta;zzfr;zzhcy;zzigrarr;zzopf;zzscr;zzwj;zzwnj;u�)"r )ZDoctypeZ CharactersZSpaceCharactersStartTagEndTagEmptyTagCommentZ ParseErrorrrrcCsg|]\}}||fqSr4r4)r5kvr4r4r8r9y sZmathc@seZdZdZdS)DataLossWarningzBRaised when the current tree is unable to represent the input dataN)__name__ __module__ __qualname____doc__r4r4r4r8r} src@s eZdZdS)_ReparseExceptionN)rr r r4r4r4r8r  sr )0Z __future__rrrstringZEOFEZ namespaces frozensetZscopingElementsZformattingElementsZspecialElementsZhtmlIntegrationPointElementsZ"mathmlTextIntegrationPointElementsZadjustSVGAttributesZadjustMathMLAttributesZadjustForeignAttributesdictitemsZunadjustForeignAttributesZspaceCharactersZtableInsertModeElementsZascii_lowercaseZasciiLowercaseZascii_uppercaseZasciiUppercaseZ ascii_lettersZ asciiLettersZdigitsZ hexdigitsZ hexDigitsZasciiUpper2LowerZheadingElementsZ voidElementsZ cdataElementsZrcdataElementsZbooleanAttributesZentitiesWindows1252Z xmlEntitiesZentitiesZreplacementCharactersZ tokenTypesZ tagTokenTypesprefixes UserWarningr Exceptionr r4r4r4r8sj$                                                                                                              S          A                 # L&  PKd].ƚƚ.html5lib/__pycache__/_tokenizer.cpython-38.pycnu[U .e$+@sddlmZmZmZddlmZddlmZddl m Z ddl m Z ddl m Z m Z ddl mZmZmZdd l mZmZdd l mZdd lmZdd lmZee ZGd ddeZdS))absolute_importdivisionunicode_literals)unichr)deque)spaceCharacters)entities) asciiLettersasciiUpper2Lower)digits hexDigitsEOF) tokenTypes tagTokenTypes)replacementCharacters)HTMLInputStream)TriecsdeZdZdZdfdd ZddZddZdd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'dLdMZ(dNdOZ)dPdQZ*dRdSZ+dTdUZ,dVdWZ-dXdYZ.dZd[Z/d\d]Z0d^d_Z1d`daZ2dbdcZ3dddeZ4dfdgZ5dhdiZ6djdkZ7dldmZ8dndoZ9dpdqZ:drdsZ;dtduZdzd{Z?d|d}Z@d~dZAddZBddZCddZDddZEddZFddZGddZHddZIddZJddZKddZLZMS) HTMLTokenizera  This class takes care of tokenizing HTML. * self.currentToken Holds the token that is currently being processed. * self.state Holds a reference to the method to be invoked... XXX * self.stream Points to HTMLInputStream object. Nc sFt|f||_||_d|_g|_|j|_d|_d|_t t | dS)NF) rstreamparserZ escapeFlagZ lastFourChars dataStatestateescape currentTokensuperr__init__)selfrrkwargs __class__C/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_tokenizer.pyr"szHTMLTokenizer.__init__ccsPtg|_|rL|jjr6td|jjddVq|jr |jVq6q dS)z This is where the magic happens. We do our usually processing through the states and when we have a token to return we yield the token which pauses processing until the next token is requested. ParseErrorrtypedataN)r tokenQueuerrerrorsrpoppopleftrr!r!r"__iter__1s  zHTMLTokenizer.__iter__c %Cst}d}|rt}d}g}|j}||krH|tk rH|||j}q"td||}|tkrt|}|j t ddd|idnbd|krd ksn|d krd }|j t ddd|idn d |krd ksnd|krdksnd|krdksnd|kr,dksn|t ddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d g#kr|j t ddd|idz t |}Wn>t k r|d6}t d|d?Bt d7|d8@B}YnX|d9kr|j t dd:d;|j||S)r#z'expected-tag-name-but-got-right-bracketr$rOz<>?z'expected-tag-name-but-got-question-markzexpected-tag-namerHT)rr:markupDeclarationOpenStatercloseTagOpenStater rr tagNameStater'r;rrAbogusCommentStaterpr!r!r"rcis@           zHTMLTokenizer.tagOpenStatecCs|j}|tkr0td|gdd|_|j|_n|dkrX|jtddd|j |_nn|t kr|jtddd|jtd d d|j |_n0|jtdd d |id |j ||j |_dS)NrZFr%rYr&r[rtr#z*expected-closing-tag-but-got-right-bracketr$z expected-closing-tag-but-got-eofrOr'r;rrrscriptDataDoubleEscapedStaterrr rArpr!r!r"rs    z.HTMLTokenizer.scriptDataDoubleEscapeStartStatecCs|j}|dkr2|jtddd|j|_n|dkrZ|jtddd|j|_nt|dkr|jtddd|jtdddn>|tkr|jtdd d|j |_n|jtd|dd S NrrOr$rHr_r#r`r2eof-in-script-in-scriptT) rr:r'r;r scriptDataDoubleEscapedDashStater(scriptDataDoubleEscapedLessThanSignStaterrrpr!r!r"rs*        z*HTMLTokenizer.scriptDataDoubleEscapedStatecCs|j}|dkr2|jtddd|j|_n|dkrZ|jtddd|j|_n|dkr|jtddd|jtddd|j|_nF|t kr|jtdd d|j |_n|jtd|d|j|_d Sr) rr:r'r;r$scriptDataDoubleEscapedDashDashStaterrrrrrpr!r!r"rs.        z.HTMLTokenizer.scriptDataDoubleEscapedDashStatecCs|j}|dkr*|jtdddn|dkrR|jtddd|j|_n|dkrz|jtddd|j|_n|dkr|jtddd|jtdd d|j|_nF|t kr|jtdd d|j |_n|jtd|d|j|_d S) NrrOr$rHrtr_r#r`r2rT) rr:r'r;rrrrorrrrpr!r!r"rs2        z2HTMLTokenizer.scriptDataDoubleEscapedDashDashStatecCsP|j}|dkr8|jtdddd|_|j|_n|j||j |_dS)NrsrOr$r/T) rr:r'r;rrscriptDataDoubleEscapeEndStaterrArrpr!r!r"r0s   z6HTMLTokenizer.scriptDataDoubleEscapedLessThanSignStatecCs|j}|ttdBkrR|jtd|d|jdkrH|j |_ q|j |_ nB|t kr|jtd|d|j|7_n|j ||j |_ dSr)rr:rr>r'r;rrrrrrr rArpr!r!r"r;s    z,HTMLTokenizer.scriptDataDoubleEscapeEndStatecCs0|j}|tkr$|jtdn|tkrJ|jd|dg|j|_n|dkr\| n|dkrn|j |_n|dkr|j t ddd |jd|dg|j|_n|d kr|j t dd d |jdd dg|j|_nF|t kr|j t dd d |j|_n|jd|dg|j|_dS)NTr&r/rtrs)'"rMrHr##invalid-character-in-attribute-namer$r_r`r2z#expected-attribute-name-but-got-eof)rr:rrdr rr;attributeNameStaterr^r}r'rrrrpr!r!r"r|Ks<           z&HTMLTokenizer.beforeAttributeNameStatecCs|j}d}d}|dkr&|j|_n.|tkr\|jddd||jtd7<d}n|dkrjd}n|tkr||j|_n|dkr|j |_n|d kr|j t d d d |jdddd 7<d}n|dkr |j t d dd |jddd|7<d}nH|t kr6|j t d dd |j|_n|jddd|7<d}|r|jdddt|jddd<|jdddD]>\}}|jddd|kr|j t d dd qҐq|r|dS)NTFrMr&rJrrtrsr_r#r`r$r2rrrHrzeof-in-attribute-namezduplicate-attribute)rr:beforeAttributeValueStaterr rrdrafterAttributeNameStater}r'r;rrrr\r r^)rr&ZleavingThisStateZ emitTokenrY_r!r!r"ris^             z HTMLTokenizer.attributeNameStatecCsD|j}|tkr$|jtdn|dkr8|j|_n|dkrJ|n|tkrp|jd |dg|j |_n|dkr|j |_n|dkr|j t dd d |jd d dg|j |_n|d kr|j t dd d |jd |dg|j |_nF|tkr$|j t ddd |j|_n|jd |dg|j |_dS)NTrMrtr&r/rsr_r#r`r$r2rz&invalid-character-after-attribute-namezexpected-end-of-tag-but-got-eof)rr:rrdrrr^r rr;rr}r'rrrrpr!r!r"rs@            z%HTMLTokenizer.afterAttributeNameStatecCsh|j}|tkr$|jtdn@|dkr8|j|_n,|dkrX|j|_|j|n |dkrj|j|_n|dkr|j t ddd| n|d kr|j t dd d|j d d d d7<|j|_n|dkr|j t ddd|j d d d |7<|j|_nL|tkrB|j t ddd|j|_n"|j d d d |7<|j|_dS)NTrrGrrtr#z.expected-attribute-value-but-got-right-bracketr$r_r`r&rJrr2)rMrH`z"equals-in-unquoted-attribute-valuez$expected-attribute-value-but-got-eof)rr:rrdattributeValueDoubleQuotedStaterattributeValueUnQuotedStaterAattributeValueSingleQuotedStater'r;rr^rrrrpr!r!r"rsF             z'HTMLTokenizer.beforeAttributeValueStatecCs|j}|dkr|j|_n|dkr0|dn|dkrj|jtddd|jddd d 7<nN|t kr|jtdd d|j |_n&|jddd ||j d 7<d S)NrrGr_r#r`r$r&rJrr2z#eof-in-attribute-value-double-quote)rrGr_T rr:afterAttributeValueStaterrXr'r;rrrrrdrpr!r!r"rs&       z-HTMLTokenizer.attributeValueDoubleQuotedStatecCs|j}|dkr|j|_n|dkr0|dn|dkrj|jtddd|jddd d 7<nN|t kr|jtdd d|j |_n&|jddd ||j d 7<d S)NrrGr_r#r`r$r&rJrr2z#eof-in-attribute-value-single-quote)rrGr_Trrpr!r!r"rs&       z-HTMLTokenizer.attributeValueSingleQuotedStatecCs|j}|tkr|j|_n|dkr0|dn|dkrB|n|dkr||jt ddd|j ddd |7<n|d kr|jt dd d|j ddd d 7<nV|t kr|jt dd d|j |_n.|j ddd ||j tdtB7<dS)NrGrt)rrrMrHrr#z0unexpected-character-in-unquoted-attribute-valuer$r&rJrr_r`r2z eof-in-attribute-value-no-quotes)rGrtrrrMrHrr_T)rr:rr|rrXr^r'r;rrrrrdr>rpr!r!r"rs4         z)HTMLTokenizer.attributeValueUnQuotedStatecCs|j}|tkr|j|_n|dkr.|np|dkr@|j|_n^|tkrt|j t ddd|j ||j |_n*|j t ddd|j ||j|_dS)Nrtrsr#z$unexpected-EOF-after-attribute-valuer$z*unexpected-character-after-attribute-valueT) rr:rr|rr^r}rr'r;rrArrpr!r!r"r s&         z&HTMLTokenizer.afterAttributeValueStatecCs|j}|dkr&d|jd<|n^|tkrZ|jtddd|j||j |_ n*|jtddd|j||j |_ dS)NrtTr[r#z#unexpected-EOF-after-solidus-in-tagr$z)unexpected-character-after-solidus-in-tag) rr:rr^rr'r;rrArrr|rpr!r!r"r}4s         z&HTMLTokenizer.selfClosingStartTagStatecCsD|jd}|dd}|jtd|d|j|j|_dS)Nrtr_r2Commentr$T) rrdreplacer'r;rr:rrrpr!r!r"ryFs    zHTMLTokenizer.bogusCommentStatecCs|jg}|ddkrR||j|ddkrPtddd|_|j|_dSn|ddkrd}dD](}||j|d|krfd }qqf|rtd ddddd |_|j|_dSn|dd krD|jdk rD|jj j rD|jj j dj |jj j krDd}d D].}||j|d|krd }q2q|rD|j |_dS|jtddd|rt|j|qZ|j|_dS)NrJrrr/r$T)dD))oOrDCtTyYpPeEFZDoctype)r%rYpublicIdsystemIdcorrect[)rrArrrr#zexpected-dashes-or-doctype)rr:r;rrcommentStartStater doctypeStaterZtreeZ openElements namespaceZdefaultNamespacecdataSectionStater'rAr)ry)rrCmatchedexpectedr!r!r"rvUs\       z(HTMLTokenizer.markupDeclarationOpenStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd d|j|j|j|_nP|t kr|jtdd d|j|j|j|_n|jd|7<|j |_d S) Nrr_r#r`r$r&r2rtincorrect-commenteof-in-commentT) rr:commentStartDashStaterr'r;rrrr commentStaterpr!r!r"rs.       zHTMLTokenizer.commentStartStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd d|j|j|j|_nT|t kr|jtdd d|j|j|j|_n|jdd|7<|j |_d S) Nrr_r#r`r$r&-�rtrrT) rr:commentEndStaterr'r;rrrrrrpr!r!r"rs.       z#HTMLTokenizer.commentStartDashStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<nT|tkr|jtddd|j|j|j |_n|jd||j d 7<d S) Nrr_r#r`r$r&r2r)rr_T) rr:commentEndDashStaterr'r;rrrrrdrpr!r!r"rs$       zHTMLTokenizer.commentStatecCs|j}|dkr|j|_n|dkrV|jtddd|jdd7<|j|_nT|t kr|jtddd|j|j|j |_n|jdd|7<|j|_d S) Nrr_r#r`r$r&rzeof-in-comment-end-dashT) rr:rrr'r;rrrrrrpr!r!r"rs$      z!HTMLTokenizer.commentEndDashStatecCs,|j}|dkr*|j|j|j|_n|dkrd|jtddd|jdd7<|j|_n|dkr|jtdd d|j |_n|d kr|jtdd d|jd|7<nj|t kr|jtdd d|j|j|j|_n4|jtdd d|jdd|7<|j|_dS)Nrtr_r#r`r$r&u--�rrz,unexpected-bang-after-double-dash-in-commentrz,unexpected-dash-after-double-dash-in-commentzeof-in-comment-double-dashzunexpected-char-in-commentz--T) rr:r'r;rrrrrcommentEndBangStaterrpr!r!r"rs@          zHTMLTokenizer.commentEndStatecCs|j}|dkr*|j|j|j|_n|dkrN|jdd7<|j|_n|dkr|jtddd|jdd 7<|j |_nT|t kr|jtdd d|j|j|j|_n|jdd|7<|j |_d S) Nrtrr&z--!r_r#r`r$u--!�zeof-in-comment-end-bang-stateT) rr:r'r;rrrrrrrrpr!r!r"rs,       z!HTMLTokenizer.commentEndBangStatecCs|j}|tkr|j|_nj|tkr\|jtdddd|j d<|j|j |j |_n*|jtddd|j ||j|_dS)Nr#!expected-doctype-name-but-got-eofr$Frzneed-space-after-doctypeT) rr:rbeforeDoctypeNameStaterrr'r;rrrrArpr!r!r"r s        zHTMLTokenizer.doctypeStatecCs|j}|tkrn|dkrT|jtdddd|jd<|j|j|j|_n|dkr|jtdddd |jd <|j |_nR|t kr|jtdd dd|jd<|j|j|j|_n||jd <|j |_d S) Nrtr#z+expected-doctype-name-but-got-right-bracketr$Frr_r`r2rYrT) rr:rr'r;rrrrdoctypeNameStaterrpr!r!r"rs4           z$HTMLTokenizer.beforeDoctypeNameStatecCs|j}|tkr2|jdt|jd<|j|_n|dkrh|jdt|jd<|j |j|j |_n|dkr|j t ddd|jdd7<|j |_nh|t kr|j t dddd |jd <|jdt|jd<|j |j|j |_n|jd|7<d S) NrYrtr_r#r`r$r2zeof-in-doctype-nameFrT)rr:rrr\r afterDoctypeNameStaterr'r;rrrrrpr!r!r"r6s0        zHTMLTokenizer.doctypeNameStatecCsH|j}|tkrn.|dkr8|j|j|j|_n |tkrd|jd<|j ||jt ddd|j|j|j|_n|dkrd}d D]}|j}||krd}qq|r|j |_dSnD|d kr d}d D]}|j}||krd}qq|r |j |_dS|j ||jt dd d |idd|jd<|j |_dS)NrtFrr#eof-in-doctyper$rT))uU)bB)lL)iIrsS)rrrr)mMz*expected-space-or-right-bracket-in-doctyper&r1)rr:rr'r;rrrrrArafterDoctypePublicKeywordStateafterDoctypeSystemKeywordStatebogusDoctypeState)rr&rrr!r!r"rOsT            z#HTMLTokenizer.afterDoctypeNameStatecCs|j}|tkr|j|_n|dkrP|jtddd|j||j|_nT|t kr|jtdddd|j d<|j|j |j |_n|j||j|_dS N)rrr#unexpected-char-in-doctyper$rFrT) rr:r"beforeDoctypePublicIdentifierStaterr'r;rrArrrrpr!r!r"rs&         z,HTMLTokenizer.afterDoctypePublicKeywordStatecCs|j}|tkrn|dkr0d|jd<|j|_n|dkrLd|jd<|j|_n|dkr|jt dddd |jd <|j|j|j |_nh|t kr|jt dd dd |jd <|j|j|j |_n(|jt dd dd |jd <|j |_d S)Nrr/rrrtr#unexpected-end-of-doctyper$FrrrT) rr:rr(doctypePublicIdentifierDoubleQuotedStater(doctypePublicIdentifierSingleQuotedStater'r;rrrrrpr!r!r"rs:             z0HTMLTokenizer.beforeDoctypePublicIdentifierStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd dd |jd <|j|j|j|_nR|t kr|jtdd dd |jd <|j|j|j|_n|jd|7<d S)Nrr_r#r`r$rr2rtrFrrT rr:!afterDoctypePublicIdentifierStaterr'r;rrrrrpr!r!r"rs0         z6HTMLTokenizer.doctypePublicIdentifierDoubleQuotedStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd dd |jd <|j|j|j|_nR|t kr|jtdd dd |jd <|j|j|j|_n|jd|7<d S)Nrr_r#r`r$rr2rtrFrrTrrpr!r!r"rs0         z6HTMLTokenizer.doctypePublicIdentifierSingleQuotedStatecCs |j}|tkr|j|_n|dkr<|j|j|j|_n|dkrn|jt dddd|jd<|j |_n|dkr|jt dddd|jd<|j |_nh|t kr|jt dd dd |jd <|j|j|j|_n(|jt dddd |jd <|j |_d S) Nrtrr#rr$r/rrrFrT)rr:r-betweenDoctypePublicAndSystemIdentifiersStaterr'r;rrr(doctypeSystemIdentifierDoubleQuotedState(doctypeSystemIdentifierSingleQuotedStaterrrpr!r!r"rs>              z/HTMLTokenizer.afterDoctypePublicIdentifierStatecCs|j}|tkrn|dkr4|j|j|j|_n|dkrPd|jd<|j|_n|dkrld|jd<|j |_nh|t kr|jt dddd |jd <|j|j|j|_n(|jt dd dd |jd <|j |_d S) Nrtrr/rrr#rr$FrrT) rr:rr'r;rrrrrrrrrpr!r!r"rs2           z;HTMLTokenizer.betweenDoctypePublicAndSystemIdentifiersStatecCs|j}|tkr|j|_n|dkrP|jtddd|j||j|_nT|t kr|jtdddd|j d<|j|j |j |_n|j||j|_dSr) rr:r"beforeDoctypeSystemIdentifierStaterr'r;rrArrrrpr!r!r"rs&         z,HTMLTokenizer.afterDoctypeSystemKeywordStatecCs|j}|tkrn|dkr0d|jd<|j|_n|dkrLd|jd<|j|_n|dkr|jt dddd |jd <|j|j|j |_nh|t kr|jt dd dd |jd <|j|j|j |_n(|jt dddd |jd <|j |_d S) Nrr/rrrtr#rr$FrrT) rr:rrrrrr'r;rrrrrpr!r!r"r/s:             z0HTMLTokenizer.beforeDoctypeSystemIdentifierStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd dd |jd <|j|j|j|_nR|t kr|jtdd dd |jd <|j|j|j|_n|jd|7<d S)Nrr_r#r`r$rr2rtrFrrT rr:!afterDoctypeSystemIdentifierStaterr'r;rrrrrpr!r!r"rLs0         z6HTMLTokenizer.doctypeSystemIdentifierDoubleQuotedStatecCs|j}|dkr|j|_n|dkrN|jtddd|jdd7<n|dkr|jtdd dd |jd <|j|j|j|_nR|t kr|jtdd dd |jd <|j|j|j|_n|jd|7<d S)Nrr_r#r`r$rr2rtrFrrTrrpr!r!r"rds0         z6HTMLTokenizer.doctypeSystemIdentifierSingleQuotedStatecCs|j}|tkrn~|dkr4|j|j|j|_n^|tkrt|jt dddd|jd<|j|j|j|_n|jt ddd|j |_dS) Nrtr#rr$FrrT) rr:rr'r;rrrrrrrpr!r!r"r|s$      z/HTMLTokenizer.afterDoctypeSystemIdentifierStatecCsZ|j}|dkr*|j|j|j|_n,|tkrV|j||j|j|j|_ndS)NrtT) rr:r'r;rrrrrArpr!r!r"rs    zHTMLTokenizer.bogusDoctypeStatecCsg}||jd||jd|j}|tkr>qq|dksJt|ddddkrv|ddd|d<qq||qd|}|d}|dkrt|D]}|j t d d d q| dd }|r|j t d |d |j |_ dS)N]rtrJz]]r/r_rr#r`r$r2rOT)r;rrdr:rAssertionErrorr=countranger'rrrr)rr&r:Z nullCountrr!r!r"rs2          zHTMLTokenizer.cdataSectionState)N)NF)N__name__ __module__ __qualname____doc__rr,rFrWrXr^rrbrjrhrmrorqrcrwrxrirrrlrrrnrrrrrrrrrrrrrrrrr|rrrrrrrr}ryrvrrrrrrrrrrrrrrrrrrrrrrr __classcell__r!r!rr"rs H P#         6 "-3rN)Z __future__rrrZpip._vendor.sixrr? collectionsrZ constantsrr r r r r rrrrZ _inputstreamrZ_trierrPobjectrr!r!r!r"s       PKd]Wy  3html5lib/__pycache__/constants.cpython-38.opt-1.pycnu[U .e>F@s-ddlmZmZmZddlZdZddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d,d,d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dddddZdddddddZeeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfgZ eeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfgZ eeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfeddfgNZ eeddfeddfeddfeddfgZ eeddfeddfeddfeddfeddfgZ dddddddddddddddddddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.>Zd/d0iZd1d2ed1fd1d3ed1fd1d4ed1fd1d5ed1fd1d6ed1fd1ded1fd1d7ed1fd8ded8fd8d9ed8fd8d:ed8fdd;ed;fd;d1ed;fd< Zed=d>eDZed?d@dAdBdCgZedddddgZeejZeejZeejZeejZeejZedDd>ejDZdEZ edddFddddddddddԐdGdHgZ!eddgZ"edddddddgZ#edIdJgedKgedLgedMdNgedMdNgedOdPgedQgedRdSgedTdSdUdVgedWgedXgedSdYgedSdYdZgedSdYgedSd[gedSdYd\d[dUdLgedSdYd[dRgedSdYged]gd^Z$d_Z%ed`dadbdcddgZ&dededfdfdgdgdhdididjdkdldldmdndodpdqdrdsdsdtdudvdvdwdwdxdydzd{d|d}d~dddd}dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddÐdĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐddӐdԐdՐd֐d֐dאdאdؐdِdِdڐdېdܐdݐdݐdސdߐddddddddddddddddddddddddddddddddddddddddddddd d d d d dddddddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[ddd\d]d^d_d`dadbdcdddedfdgdhddddidjdkd?dldmdndodpdqdrdsdtdudrdvdwdxdydzd{d|d|d|d|d dnd@d}d~dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddÐdĐdŐdƐdǐdǐdȐdȐdɐdʐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐddՐd֐dאdؐdِdڐdېdܐddݐdސdߐdddddddddddddddddddddddddddddddddddddddddddddd d d d d dddddddddddƐdEdddddddddd d!d"d#d$d%d&d&d'd(d)d*d+dd,d-d.d/d-d0d0d1d2d3d?d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdEdFdGdHdIdJdJdKdLdMdNdNdOdPdQdRdSdTdUdVdWddXdYdZd[d\d]dÐdĐd^d_d`dadbdcdddededfdgdhdidjdkdldldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddd|ddddddddddddddddddrdddddddddfdfddddddddddddddddddddddsdddd@dddddd@dddddd@dddddddddÐdĐdŐdƐdǐdȐdɐdɐdRdʐdÐdːd̐d|d|d͐dĐd}dΐdϐdАdѐd!dҐdTdӐdԐdՐd֐dאdؐdِdڐdkdwdېdܐddݐdސdߐddddddddddd\d\ddddddddddddddddddddddddddddddddd d d d d dddddddddŐddddddƐdǐdddddddddddd d!d"d#d$d%d&d d'd(d)d)d*d+d,d-ddd.d/d/dd0d1d2d2d3d4d5d6d7d8d9dd:d;d<d=d7d>d?d@dAdAdBdududCdDdEddEdd?dFddGddddHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_dSdTd`dadbdbdUd^d`daddcddddedfdgdƐdhdPdiddjdkdddldmdndndodpdqdrdKddddsdsddtdudvdvdvdwdwdxdydzd{d|ddd}d~dddzdƐdldKdddddddddddސdȐdddddmd}dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddÐdĐdŐddƐdǐdȐdɐdɐdʐdːdːd̐d͐dΐdϐdАdѐdѐdҐdӐdԐdՐd֐dאdؐdِdڐddېdܐdݐdtdސdߐddddddddddddddddd ddddddddddddddddddddddddddddސddddېddddddqdɐdddNdddddddddddd d d d d ddddddhddd"ddddddddddddddddddd'ddd d!dސd"d#d$dd d%dd%d&d'd(d)d*d+d'd,d,d-dސd.d/d0d1dސd#d2d3d4d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFddddGdHd]dIdJdKdLd?dMdDdNdDdOdPdPdEdFdQdRd dSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdHd]dddedÐd̐dfdgdhdidEdVd̐dZdjdNdGdddkd\did]d`d`dldmdndodpdqdOdrd\dId^dadsdMdtd^dud̐dZdvdwdxdndjdydydzd{d|d|d}d~d~ddd}ddddIdfdgddhdSdddddddPdddܐdddGddddddddldaddd^dĐddd;d;dddrdkddddddUdߐdddddddddddddҐdQd]ddddddddddmddddddd~ddddtdddtddddddddddddddddddddddddddddddddÐdĐdŐddƐdǐdȐdɐddʐdːd_d_d̐dd͐ddddΐdddddddddddϐdАddѐdҐddӐddԐdՐd֐ddՐdϐddԐdddddddddאdؐdؐddِdڐddېdܐdddݐdސdddߐdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd^d^dd:ddd;d<dddd=dddddddd d d d d ddd8d ddːdddddddddddd9ddddddddddddd d d!d"d"dd#d$d$d%dŐd&d&dŐd'd(dϐd)d*d+d,d\d-d.d/d0drd1d2dƐd3dd4dd5d6d d7dd8d9dԐdԐd:d;dԐd<d=d>d>dאd?d@dِdؐdאd@dِdؐdAdBdCdڐdDdՐdBdAdCdܐdEdFdGdݐdݐdڐdHdIdJdKdLddMdNdOddPdQdddd ddRdidSdTdUddVddWdXddYdYddZdd[d\d]d dd^d_d`dadbdcddېdddedfdgdhdidjdkddedldmdndddodd dddpdddqddrdϐddsdtdudd`dϐddddvdadwdxddddydzdzd{d|d}dd~dddddddvddd dfdddwdddddddddd(dddd*d)ddddddd+dddddddkdkdddddxdxdddِddddmdŐdddddd=dd>d>ddddddddEdxdddmddddddddddddŐddd#ddd dd d!d"d!d"dddddddxdd%ddאdd0ddddd'ddddÐdĐdŐdd'ddÐddƐdǐdȐd(dd*d)dddd+d,dɐdʐdʐdːdːd̐d̐d.d͐dΐdϐd/dАdѐdҐdӐdԐdՐd֐dאd.d/d͐d֐dՐdؐdِdڐdېddjdjdܐdݐdݐdސdߐd͐ddddBddd9d9dddd@d=d<d@d=dddddd dddd͐dѐddddddd1ddddUdddddddddddddddАd@ddÐddddddddddYdd[dddddXdddddd d ddd d ddZdXddUd d`d dddddddddddݐdddddĐdddddd>dd0d3dݐdZdudddddddSddddd d!d"dndnd#dSddd$dݐdd%ddddd&d'd(dd)d*d+d,d*dpdpd-d!dҐdTdؐd.ddgd/ddfdd0dӐd1dԐdՐddhd2d֐dڐdِdkdwd3d3d4d5d6d7d7d8d9d:d;d<d=d=d>d?d@dAddBdCdDdEdFdGdHdIdJZ'dKdCddLddĐd̐ddfdd6d,ddddMddNdOdĐddÐdddɐddd1ddddPd?ddQ"Z(ddRdSdTdUdVdWdXdYZ)ee)dZe)d[e)d\gZ*ed]d>eDZ+d^e+d<Gd_d`d`e,Z-Gdadbdbe.Z/dS(c)absolute_importdivisionunicode_literalsNz5Null character in input stream, replaced with U+FFFD.zInvalid codepoint in stream.z&Solidus (/) incorrectly placed in tag.z.Incorrect CR newline entity, replaced with LF.z9Entity used with illegal number (windows-1252 reference).zPNumeric entity couldn't be converted to character (codepoint U+%(charAsInt)08x).zBNumeric entity represents an illegal codepoint: U+%(charAsInt)08x.z#Numeric entity didn't end with ';'.z1Numeric entity expected. Got end of file instead.z'Numeric entity expected but none found.z!Named entity didn't end with ';'.z Named entity expected. Got none.z'End tag contains unexpected attributes.z.End tag contains unexpected self-closing flag.z#Expected tag name. Got '>' instead.zSExpected tag name. Got '?' instead. (HTML doesn't support processing instructions.)z-Expected tag name. Got something else insteadz6Expected closing tag. Got '>' instead. Ignoring ''.z-Expected closing tag. Unexpected end of file.z' instead.z"Unexpected = in unquoted attributez*Unexpected character in unquoted attributez*Unexpected character after attribute name.z+Unexpected character after attribute value.z.Unexpected end of file in attribute value (").z.Unexpected end of file in attribute value (').z*Unexpected end of file in attribute value.z)Unexpected end of file in tag. Expected >z/Unexpected character after / in tag. Expected >z&Expected '--' or 'DOCTYPE'. Not found.z Unexpected ! after -- in commentz$Unexpected space after -- in commentzIncorrect comment.z"Unexpected end of file in comment.z%Unexpected end of file in comment (-)z+Unexpected '-' after '--' found in comment.z'Unexpected end of file in comment (--).z&Unexpected character in comment found.z(No space after literal string 'DOCTYPE'.z.Unexpected > character. Expected DOCTYPE name.z.Unexpected end of file. Expected DOCTYPE name.z'Unexpected end of file in DOCTYPE name.z"Unexpected end of file in DOCTYPE.z%Expected space or '>'. Got '%(data)s'zUnexpected end of DOCTYPE.z Unexpected character in DOCTYPE.zXXX innerHTML EOFzUnexpected DOCTYPE. Ignored.z%html needs to be the first start tag.z)Unexpected End of file. Expected DOCTYPE.zErroneous DOCTYPE.z2Unexpected non-space characters. Expected DOCTYPE.z2Unexpected start tag (%(name)s). Expected DOCTYPE.z0Unexpected end tag (%(name)s). Expected DOCTYPE.z?Unexpected end tag (%(name)s) after the (implied) root element.z4Unexpected end of file. Expected end tag (%(name)s).z4Unexpected start tag head in existing head. Ignored.z'Unexpected end tag (%(name)s). Ignored.z;Unexpected start tag (%(name)s) that can be in head. Moved.z Unexpected start tag (%(name)s).zMissing end tag (%(name)s).zMissing end tags (%(name)s).zCUnexpected start tag (%(startName)s) implies end tag (%(endName)s).z@Unexpected start tag (%(originalName)s). Treated as %(newName)s.z,Unexpected start tag %(name)s. Don't use it!z'Unexpected start tag %(name)s. Ignored.zEUnexpected end tag (%(gotName)s). Missing end tag (%(expectedName)s).z:End tag (%(name)s) seen too early. Expected other end tag.zFUnexpected end tag (%(gotName)s). Expected end tag (%(expectedName)s).z+End tag (%(name)s) seen too early. Ignored.zQEnd tag (%(name)s) violates step 1, paragraph 1 of the adoption agency algorithm.zQEnd tag (%(name)s) violates step 1, paragraph 2 of the adoption agency algorithm.zQEnd tag (%(name)s) violates step 1, paragraph 3 of the adoption agency algorithm.zQEnd tag (%(name)s) violates step 4, paragraph 4 of the adoption agency algorithm.z>Unexpected end tag (%(originalName)s). Treated as %(newName)s.z'This element (%(name)s) has no end tag.z9Unexpected implied end tag (%(name)s) in the table phase.z>Unexpected implied end tag (%(name)s) in the table body phase.zDUnexpected non-space characters in table context caused voodoo mode.z3Unexpected input with type hidden in table context.z!Unexpected form in table context.zDUnexpected start tag (%(name)s) in table context caused voodoo mode.zBUnexpected end tag (%(name)s) in table context caused voodoo mode.zCUnexpected table cell start tag (%(name)s) in the table body phase.zFGot table cell end tag (%(name)s) while required end tags are missing.z?Unexpected end tag (%(name)s) in the table body phase. Ignored.z=Unexpected implied end tag (%(name)s) in the table row phase.z>Unexpected end tag (%(name)s) in the table row phase. Ignored.zJUnexpected select start tag in the select phase treated as select end tag.z/Unexpected input start tag in the select phase.zBUnexpected start tag token (%(name)s in the select phase. Ignored.z;Unexpected end tag (%(name)s) in the select phase. Ignored.zKUnexpected table element start tag (%(name)s) in the select in table phase.zIUnexpected table element end tag (%(name)s) in the select in table phase.z8Unexpected non-space characters in the after body phase.z>Unexpected start tag token (%(name)s) in the after body phase.zZ attributenameZ attributetypeZ basefrequencyZ baseprofileZcalcmodeZ clippathunitsZcontentscripttypeZcontentstyletypeZdiffuseconstantZedgemodeZexternalresourcesrequiredZ filterresZ filterunitsZglyphrefZgradienttransformZ gradientunitsZ kernelmatrixZkernelunitlengthZ keypointsZ keysplinesZkeytimesZ lengthadjustZlimitingconeangleZ markerheightZ markerunitsZ markerwidthZmaskcontentunitsZ maskunitsZ numoctavesZ pathlengthZpatterncontentunitsZpatterntransformZ patternunitsZ pointsatxZ pointsatyZ pointsatzZ preservealphaZpreserveaspectratioZprimitiveunitsZrefxZrefyZ repeatcountZ repeatdurZrequiredextensionsZrequiredfeaturesZspecularconstantZspecularexponentZ spreadmethodZ startoffsetZ stddeviationZ stitchtilesZ surfacescaleZsystemlanguageZ tablevaluesZtargetxZtargetyZ textlengthZviewboxZ viewtargetZxchannelselectorZychannelselectorZ zoomandpanZ definitionurlZ definitionURLrZactuateZarcroleZhrefZroleZshowtyper ZlangZspacer ) z xlink:actuatez xlink:arcrolez xlink:hrefz xlink:rolez xlink:showz xlink:titlez xlink:typezxml:basezxml:langz xml:spacer z xmlns:xlinkcCs"g|]\}\}}}||f|fqSr4).0ZqnameprefixZlocalnsr4r4B/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/constants.py s r9     cCs g|]}t|t|fqSr4)ordlower)r5cr4r4r8r9#s)r r!r"r#r$r%z event-sourcesourceZtrackZ irrelevantZ itemscopeZscopedZismapZautoplayZcontrolsZdeferasyncopenZmultipleZdisabledZhiddencheckeddefaultZnoshadeZ autosubmitreadonlyZselectedZ autofocusZrequiredZseamless)r2r*ZaudioZvideor0rZdatagridrr(r-rZoptionZoptgrouprr+r1outputr)) i i ii i& i i! ii0 i`i9 iRrJi}rJrJi i i i i" i i ii"!iai: iSrJi~ixlt;gt;amp;apos;quot;Æ&ÁuĂÂuАu𝔄ÀuΑuĀu⩓uĄu𝔸u⁡Åu𝒜u≔ÃÄu∖u⫧u⌆uБu∵uℬuΒu𝔅u𝔹u˘u≎uЧ©uĆu⋒uⅅuℭuČÇuĈu∰uĊ¸·uΧu⊙u⊖u⊕u⊗u∲u”u’u∷u⩴u≡u∯u∮uℂu∐u∳u⨯u𝒞u⋓u≍u⤑uЂuЅuЏu‡u↡u⫤uĎuДu∇uΔu𝔇´u˙u˝`u˜u⋄uⅆu𝔻¨u⃜u≐u⇓u⇐u⇔u⟸u⟺u⟹u⇒u⊨u⇑u⇕u∥u↓u⤓u⇵ȗu⥐u⥞u↽u⥖u⥟u⇁u⥗u⊤u↧u𝒟uĐuŊÐÉuĚÊuЭuĖu𝔈Èu∈uĒu◻u▫uĘu𝔼uΕu⩵u≂u⇌uℰu⩳uΗËu∃uⅇuФu𝔉u◼u▪u𝔽u∀uℱuЃ>uΓuϜuĞuĢuĜuГuĠu𝔊u⋙u𝔾u≥u⋛u≧u⪢u≷u⩾u≳u𝒢u≫uЪuˇ^uĤuℌuℋuℍu─uĦu≏uЕuIJuЁÍÎuИuİuℑÌuĪuⅈu∬u∫u⋂u⁣u⁢uĮu𝕀uΙuℐuĨuІÏuĴuЙu𝔍u𝕁u𝒥uЈuЄuХuЌuΚuĶuКu𝔎u𝕂u𝒦uЉ⃒u⧞u⤂u≤⃒u<⃒u⊴⃒u⤃u⊵⃒u∼⃒u⇖u⤣u⤧óôuоuőu⨸u⦼uœu⦿u𝔬u˛òu⧁u⦵u⦾u⦻u⧀uōuωuοu⦶u𝕠u⦷u⦹u∨u⩝uℴªºu⊶u⩖u⩗u⩛øu⊘õu⨶öu⌽¶u⫳u⫽uп%.u‰u‱u𝔭uφuϕu☎uπuϖuℎ+u⨣u⨢u⨥u⩲u⨦u⨧u⨕u𝕡£u⪳u⪷u⪹u⪵u⋨u′u⌮u⌒u⌓u⊰u𝓅uψu u𝔮u𝕢u⁗u𝓆u⨖?u⤜u⥤u∽̱uŕu⦳u⦒u⦥»u⥵u⤠u⤳u⤞u⥅u⥴u↣u↝u⤚u∶u❳}]u⦌u⦎u⦐uřuŗuрu⤷u⥩u↳u▭u⥽u𝔯u⥬uρuϱu⇉u⋌u˚u‏u⎱u⫮u⟭u⇾u⦆u𝕣u⨮u⨵)u⦔u⨒u›u𝓇u⋊u▹u⧎u⥨u℞uśu⪴u⪸ušuşuŝu⪶u⪺u⋩u⨓uсu⋅u⩦u⇘§;u⤩u✶u𝔰u♯uщuш­uσuςu⩪u⪞u⪠u⪝u⪟u≆u⨤u⥲u⨳u⧤u⌣u⪪u⪬u⪬︀uь/u⧄u⌿u𝕤u♠u⊓︀u⊔︀u𝓈u☆u⊂u⫅u⪽u⫃u⫁u⫋u⊊u⪿u⥹u⫇u⫕u⫓u♪¹²³u⫆u⪾u⫘u⫄u⟉u⫗u⥻u⫂u⫌u⊋u⫀u⫈u⫔u⫖u⇙u⤪ßu⌖uτuťuţuтu⌕u𝔱uθuϑþ×u⨱u⨰u⌶u⫱u𝕥u⫚u‴u▵u≜u◬u⨺u⨹u⧍u⨻u⏢u𝓉uцuћuŧu⥣úuўuŭûuуuűu⥾u𝔲ùu▀u⌜u⌏u◸uūuųu𝕦uυu⇈u⌝u⌎uůu◹u𝓊u⋰uũüu⦧u⫨u⫩u⦜u⊊︀u⫋︀u⊋︀u⫌︀uвu⊻u≚u⋮u𝔳u𝕧u𝓋u⦚uŵu⩟u≙u℘u𝔴u𝕨u𝓌u𝔵uξu⋻u𝕩u𝓍ýuяuŷuы¥u𝔶uїu𝕪u𝓎uюÿuźužuзużuζu𝔷uжu⇝u𝕫u𝓏u‍u‌(ZAEligzAElig;ZAMPzAMP;ZAacutezAacute;zAbreve;ZAcirczAcirc;zAcy;zAfr;ZAgravezAgrave;zAlpha;zAmacr;zAnd;zAogon;zAopf;zApplyFunction;ZAringzAring;zAscr;zAssign;ZAtildezAtilde;ZAumlzAuml;z Backslash;zBarv;zBarwed;zBcy;zBecause;z Bernoullis;zBeta;zBfr;zBopf;zBreve;zBscr;zBumpeq;zCHcy;ZCOPYzCOPY;zCacute;zCap;zCapitalDifferentialD;zCayleys;zCcaron;ZCcedilzCcedil;zCcirc;zCconint;zCdot;zCedilla;z CenterDot;zCfr;zChi;z CircleDot;z CircleMinus;z CirclePlus;z CircleTimes;zClockwiseContourIntegral;zCloseCurlyDoubleQuote;zCloseCurlyQuote;zColon;zColone;z Congruent;zConint;zContourIntegral;zCopf;z Coproduct;z CounterClockwiseContourIntegral;zCross;zCscr;zCup;zCupCap;zDD;z DDotrahd;zDJcy;zDScy;zDZcy;zDagger;zDarr;zDashv;zDcaron;zDcy;zDel;zDelta;zDfr;zDiacriticalAcute;zDiacriticalDot;zDiacriticalDoubleAcute;zDiacriticalGrave;zDiacriticalTilde;zDiamond;zDifferentialD;zDopf;zDot;zDotDot;z DotEqual;zDoubleContourIntegral;z DoubleDot;zDoubleDownArrow;zDoubleLeftArrow;zDoubleLeftRightArrow;zDoubleLeftTee;zDoubleLongLeftArrow;zDoubleLongLeftRightArrow;zDoubleLongRightArrow;zDoubleRightArrow;zDoubleRightTee;zDoubleUpArrow;zDoubleUpDownArrow;zDoubleVerticalBar;z DownArrow;z DownArrowBar;zDownArrowUpArrow;z DownBreve;zDownLeftRightVector;zDownLeftTeeVector;zDownLeftVector;zDownLeftVectorBar;zDownRightTeeVector;zDownRightVector;zDownRightVectorBar;zDownTee;z DownTeeArrow;z Downarrow;zDscr;zDstrok;zENG;ZETHzETH;ZEacutezEacute;zEcaron;ZEcirczEcirc;zEcy;zEdot;zEfr;ZEgravezEgrave;zElement;zEmacr;zEmptySmallSquare;zEmptyVerySmallSquare;zEogon;zEopf;zEpsilon;zEqual;z EqualTilde;z Equilibrium;zEscr;zEsim;zEta;ZEumlzEuml;zExists;z ExponentialE;zFcy;zFfr;zFilledSmallSquare;zFilledVerySmallSquare;zFopf;zForAll;z Fouriertrf;zFscr;zGJcy;ZGTzGT;zGamma;zGammad;zGbreve;zGcedil;zGcirc;zGcy;zGdot;zGfr;zGg;zGopf;z GreaterEqual;zGreaterEqualLess;zGreaterFullEqual;zGreaterGreater;z GreaterLess;zGreaterSlantEqual;z GreaterTilde;zGscr;zGt;zHARDcy;zHacek;zHat;zHcirc;zHfr;z HilbertSpace;zHopf;zHorizontalLine;zHscr;zHstrok;z HumpDownHump;z HumpEqual;zIEcy;zIJlig;zIOcy;ZIacutezIacute;ZIcirczIcirc;zIcy;zIdot;zIfr;ZIgravezIgrave;zIm;zImacr;z ImaginaryI;zImplies;zInt;z Integral;z Intersection;zInvisibleComma;zInvisibleTimes;zIogon;zIopf;zIota;zIscr;zItilde;zIukcy;ZIumlzIuml;zJcirc;zJcy;zJfr;zJopf;zJscr;zJsercy;zJukcy;zKHcy;zKJcy;zKappa;zKcedil;zKcy;zKfr;zKopf;zKscr;zLJcy;ZLTzLT;zLacute;zLambda;zLang;z Laplacetrf;zLarr;zLcaron;zLcedil;zLcy;zLeftAngleBracket;z LeftArrow;z LeftArrowBar;zLeftArrowRightArrow;z LeftCeiling;zLeftDoubleBracket;zLeftDownTeeVector;zLeftDownVector;zLeftDownVectorBar;z LeftFloor;zLeftRightArrow;zLeftRightVector;zLeftTee;z LeftTeeArrow;zLeftTeeVector;z LeftTriangle;zLeftTriangleBar;zLeftTriangleEqual;zLeftUpDownVector;zLeftUpTeeVector;z LeftUpVector;zLeftUpVectorBar;z LeftVector;zLeftVectorBar;z Leftarrow;zLeftrightarrow;zLessEqualGreater;zLessFullEqual;z LessGreater;z LessLess;zLessSlantEqual;z LessTilde;zLfr;zLl;z Lleftarrow;zLmidot;zLongLeftArrow;zLongLeftRightArrow;zLongRightArrow;zLongleftarrow;zLongleftrightarrow;zLongrightarrow;zLopf;zLowerLeftArrow;zLowerRightArrow;zLscr;zLsh;zLstrok;zLt;zMap;zMcy;z MediumSpace;z Mellintrf;zMfr;z MinusPlus;zMopf;zMscr;zMu;zNJcy;zNacute;zNcaron;zNcedil;zNcy;zNegativeMediumSpace;zNegativeThickSpace;zNegativeThinSpace;zNegativeVeryThinSpace;zNestedGreaterGreater;zNestedLessLess;zNewLine;zNfr;zNoBreak;zNonBreakingSpace;zNopf;zNot;z NotCongruent;z NotCupCap;zNotDoubleVerticalBar;z NotElement;z NotEqual;zNotEqualTilde;z NotExists;z NotGreater;zNotGreaterEqual;zNotGreaterFullEqual;zNotGreaterGreater;zNotGreaterLess;zNotGreaterSlantEqual;zNotGreaterTilde;zNotHumpDownHump;z NotHumpEqual;zNotLeftTriangle;zNotLeftTriangleBar;zNotLeftTriangleEqual;zNotLess;z NotLessEqual;zNotLessGreater;z NotLessLess;zNotLessSlantEqual;z NotLessTilde;zNotNestedGreaterGreater;zNotNestedLessLess;z NotPrecedes;zNotPrecedesEqual;zNotPrecedesSlantEqual;zNotReverseElement;zNotRightTriangle;zNotRightTriangleBar;zNotRightTriangleEqual;zNotSquareSubset;zNotSquareSubsetEqual;zNotSquareSuperset;zNotSquareSupersetEqual;z NotSubset;zNotSubsetEqual;z NotSucceeds;zNotSucceedsEqual;zNotSucceedsSlantEqual;zNotSucceedsTilde;z NotSuperset;zNotSupersetEqual;z NotTilde;zNotTildeEqual;zNotTildeFullEqual;zNotTildeTilde;zNotVerticalBar;zNscr;ZNtildezNtilde;zNu;zOElig;ZOacutezOacute;ZOcirczOcirc;zOcy;zOdblac;zOfr;ZOgravezOgrave;zOmacr;zOmega;zOmicron;zOopf;zOpenCurlyDoubleQuote;zOpenCurlyQuote;zOr;zOscr;ZOslashzOslash;ZOtildezOtilde;zOtimes;ZOumlzOuml;zOverBar;z OverBrace;z OverBracket;zOverParenthesis;z PartialD;zPcy;zPfr;zPhi;zPi;z PlusMinus;zPoincareplane;zPopf;zPr;z Precedes;zPrecedesEqual;zPrecedesSlantEqual;zPrecedesTilde;zPrime;zProduct;z Proportion;z Proportional;zPscr;zPsi;ZQUOTzQUOT;zQfr;zQopf;zQscr;zRBarr;ZREGzREG;zRacute;zRang;zRarr;zRarrtl;zRcaron;zRcedil;zRcy;zRe;zReverseElement;zReverseEquilibrium;zReverseUpEquilibrium;zRfr;zRho;zRightAngleBracket;z RightArrow;zRightArrowBar;zRightArrowLeftArrow;z RightCeiling;zRightDoubleBracket;zRightDownTeeVector;zRightDownVector;zRightDownVectorBar;z RightFloor;z RightTee;zRightTeeArrow;zRightTeeVector;zRightTriangle;zRightTriangleBar;zRightTriangleEqual;zRightUpDownVector;zRightUpTeeVector;zRightUpVector;zRightUpVectorBar;z RightVector;zRightVectorBar;z Rightarrow;zRopf;z RoundImplies;z Rrightarrow;zRscr;zRsh;z RuleDelayed;zSHCHcy;zSHcy;zSOFTcy;zSacute;zSc;zScaron;zScedil;zScirc;zScy;zSfr;zShortDownArrow;zShortLeftArrow;zShortRightArrow;z ShortUpArrow;zSigma;z SmallCircle;zSopf;zSqrt;zSquare;zSquareIntersection;z SquareSubset;zSquareSubsetEqual;zSquareSuperset;zSquareSupersetEqual;z SquareUnion;zSscr;zStar;zSub;zSubset;z SubsetEqual;z Succeeds;zSucceedsEqual;zSucceedsSlantEqual;zSucceedsTilde;z SuchThat;zSum;zSup;z Superset;zSupersetEqual;zSupset;ZTHORNzTHORN;zTRADE;zTSHcy;zTScy;zTab;zTau;zTcaron;zTcedil;zTcy;zTfr;z Therefore;zTheta;z ThickSpace;z ThinSpace;zTilde;z TildeEqual;zTildeFullEqual;z TildeTilde;zTopf;z TripleDot;zTscr;zTstrok;ZUacutezUacute;zUarr;z Uarrocir;zUbrcy;zUbreve;ZUcirczUcirc;zUcy;zUdblac;zUfr;ZUgravezUgrave;zUmacr;z UnderBar;z UnderBrace;z UnderBracket;zUnderParenthesis;zUnion;z UnionPlus;zUogon;zUopf;zUpArrow;z UpArrowBar;zUpArrowDownArrow;z UpDownArrow;zUpEquilibrium;zUpTee;z UpTeeArrow;zUparrow;z Updownarrow;zUpperLeftArrow;zUpperRightArrow;zUpsi;zUpsilon;zUring;zUscr;zUtilde;ZUumlzUuml;zVDash;zVbar;zVcy;zVdash;zVdashl;zVee;zVerbar;zVert;z VerticalBar;z VerticalLine;zVerticalSeparator;zVerticalTilde;zVeryThinSpace;zVfr;zVopf;zVscr;zVvdash;zWcirc;zWedge;zWfr;zWopf;zWscr;zXfr;zXi;zXopf;zXscr;zYAcy;zYIcy;zYUcy;ZYacutezYacute;zYcirc;zYcy;zYfr;zYopf;zYscr;zYuml;zZHcy;zZacute;zZcaron;zZcy;zZdot;zZeroWidthSpace;zZeta;zZfr;zZopf;zZscr;Zaacutezaacute;zabreve;zac;zacE;zacd;Zacirczacirc;Zacutezacute;zacy;Zaeligzaelig;zaf;zafr;Zagravezagrave;zalefsym;zaleph;zalpha;zamacr;zamalg;ZamprMzand;zandand;zandd;z andslope;zandv;zang;zange;zangle;zangmsd;z angmsdaa;z angmsdab;z angmsdac;z angmsdad;z angmsdae;z angmsdaf;z angmsdag;z angmsdah;zangrt;zangrtvb;z angrtvbd;zangsph;zangst;zangzarr;zaogon;zaopf;zap;zapE;zapacir;zape;zapid;rNzapprox;z approxeq;Zaringzaring;zascr;zast;zasymp;zasympeq;Zatildezatilde;Zaumlzauml;z awconint;zawint;zbNot;z backcong;z backepsilon;z backprime;zbacksim;z backsimeq;zbarvee;zbarwed;z barwedge;zbbrk;z bbrktbrk;zbcong;zbcy;zbdquo;zbecaus;zbecause;zbemptyv;zbepsi;zbernou;zbeta;zbeth;zbetween;zbfr;zbigcap;zbigcirc;zbigcup;zbigodot;z bigoplus;z bigotimes;z bigsqcup;zbigstar;zbigtriangledown;zbigtriangleup;z biguplus;zbigvee;z bigwedge;zbkarow;z blacklozenge;z blacksquare;zblacktriangle;zblacktriangledown;zblacktriangleleft;zblacktriangleright;zblank;zblk12;zblk14;zblk34;zblock;zbne;zbnequiv;zbnot;zbopf;zbot;zbottom;zbowtie;zboxDL;zboxDR;zboxDl;zboxDr;zboxH;zboxHD;zboxHU;zboxHd;zboxHu;zboxUL;zboxUR;zboxUl;zboxUr;zboxV;zboxVH;zboxVL;zboxVR;zboxVh;zboxVl;zboxVr;zboxbox;zboxdL;zboxdR;zboxdl;zboxdr;zboxh;zboxhD;zboxhU;zboxhd;zboxhu;z boxminus;zboxplus;z boxtimes;zboxuL;zboxuR;zboxul;zboxur;zboxv;zboxvH;zboxvL;zboxvR;zboxvh;zboxvl;zboxvr;zbprime;zbreve;Zbrvbarzbrvbar;zbscr;zbsemi;zbsim;zbsime;zbsol;zbsolb;z bsolhsub;zbull;zbullet;zbump;zbumpE;zbumpe;zbumpeq;zcacute;zcap;zcapand;z capbrcup;zcapcap;zcapcup;zcapdot;zcaps;zcaret;zcaron;zccaps;zccaron;Zccedilzccedil;zccirc;zccups;zccupssm;zcdot;Zcedilzcedil;zcemptyv;Zcentzcent;z centerdot;zcfr;zchcy;zcheck;z checkmark;zchi;zcir;zcirE;zcirc;zcirceq;zcirclearrowleft;zcirclearrowright;z circledR;z circledS;z circledast;z circledcirc;z circleddash;zcire;z cirfnint;zcirmid;zcirscir;zclubs;z clubsuit;zcolon;zcolone;zcoloneq;zcomma;zcommat;zcomp;zcompfn;z complement;z complexes;zcong;zcongdot;zconint;zcopf;zcoprod;copyzcopy;zcopysr;zcrarr;zcross;zcscr;zcsub;zcsube;zcsup;zcsupe;zctdot;zcudarrl;zcudarrr;zcuepr;zcuesc;zcularr;zcularrp;zcup;z cupbrcap;zcupcap;zcupcup;zcupdot;zcupor;zcups;zcurarr;zcurarrm;z curlyeqprec;z curlyeqsucc;z curlyvee;z curlywedge;Zcurrenzcurren;zcurvearrowleft;zcurvearrowright;zcuvee;zcuwed;z cwconint;zcwint;zcylcty;zdArr;zdHar;zdagger;zdaleth;zdarr;zdash;zdashv;zdbkarow;zdblac;zdcaron;zdcy;zdd;zddagger;zddarr;zddotseq;Zdegzdeg;zdelta;zdemptyv;zdfisht;zdfr;zdharl;zdharr;zdiam;zdiamond;z diamondsuit;zdiams;zdie;zdigamma;zdisin;zdiv;Zdividezdivide;zdivideontimes;zdivonx;zdjcy;zdlcorn;zdlcrop;zdollar;zdopf;zdot;zdoteq;z doteqdot;z dotminus;zdotplus;z dotsquare;zdoublebarwedge;z downarrow;zdowndownarrows;zdownharpoonleft;zdownharpoonright;z drbkarow;zdrcorn;zdrcrop;zdscr;zdscy;zdsol;zdstrok;zdtdot;zdtri;zdtrif;zduarr;zduhar;zdwangle;zdzcy;z dzigrarr;zeDDot;zeDot;Zeacutezeacute;zeaster;zecaron;zecir;Zecirczecirc;zecolon;zecy;zedot;zee;zefDot;zefr;zeg;Zegravezegrave;zegs;zegsdot;zel;z elinters;zell;zels;zelsdot;zemacr;zempty;z emptyset;zemptyv;zemsp13;zemsp14;zemsp;zeng;zensp;zeogon;zeopf;zepar;zeparsl;zeplus;zepsi;zepsilon;zepsiv;zeqcirc;zeqcolon;zeqsim;z eqslantgtr;z eqslantless;zequals;zequest;zequiv;zequivDD;z eqvparsl;zerDot;zerarr;zescr;zesdot;zesim;zeta;Zethzeth;Zeumlzeuml;zeuro;zexcl;zexist;z expectation;z exponentiale;zfallingdotseq;zfcy;zfemale;zffilig;zfflig;zffllig;zffr;zfilig;zfjlig;zflat;zfllig;zfltns;zfnof;zfopf;zforall;zfork;zforkv;z fpartint;Zfrac12zfrac12;zfrac13;Zfrac14zfrac14;zfrac15;zfrac16;zfrac18;zfrac23;zfrac25;Zfrac34zfrac34;zfrac35;zfrac38;zfrac45;zfrac56;zfrac58;zfrac78;zfrasl;zfrown;zfscr;zgE;zgEl;zgacute;zgamma;zgammad;zgap;zgbreve;zgcirc;zgcy;zgdot;zge;zgel;zgeq;zgeqq;z geqslant;zges;zgescc;zgesdot;zgesdoto;z gesdotol;zgesl;zgesles;zgfr;zgg;zggg;zgimel;zgjcy;zgl;zglE;zgla;zglj;zgnE;zgnap;z gnapprox;zgne;zgneq;zgneqq;zgnsim;zgopf;zgrave;zgscr;zgsim;zgsime;zgsiml;gtrLzgtcc;zgtcir;zgtdot;zgtlPar;zgtquest;z gtrapprox;zgtrarr;zgtrdot;z gtreqless;z gtreqqless;zgtrless;zgtrsim;z gvertneqq;zgvnE;zhArr;zhairsp;zhalf;zhamilt;zhardcy;zharr;zharrcir;zharrw;zhbar;zhcirc;zhearts;z heartsuit;zhellip;zhercon;zhfr;z hksearow;z hkswarow;zhoarr;zhomtht;zhookleftarrow;zhookrightarrow;zhopf;zhorbar;zhscr;zhslash;zhstrok;zhybull;zhyphen;Ziacuteziacute;zic;Zicirczicirc;zicy;ziecy;Ziexclziexcl;ziff;zifr;Zigravezigrave;zii;ziiiint;ziiint;ziinfin;ziiota;zijlig;zimacr;zimage;z imagline;z imagpart;zimath;zimof;zimped;zin;zincare;zinfin;z infintie;zinodot;zint;zintcal;z integers;z intercal;z intlarhk;zintprod;ziocy;ziogon;ziopf;ziota;ziprod;Ziquestziquest;ziscr;zisin;zisinE;zisindot;zisins;zisinsv;zisinv;zit;zitilde;ziukcy;Ziumlziuml;zjcirc;zjcy;zjfr;zjmath;zjopf;zjscr;zjsercy;zjukcy;zkappa;zkappav;zkcedil;zkcy;zkfr;zkgreen;zkhcy;zkjcy;zkopf;zkscr;zlAarr;zlArr;zlAtail;zlBarr;zlE;zlEg;zlHar;zlacute;z laemptyv;zlagran;zlambda;zlang;zlangd;zlangle;zlap;Zlaquozlaquo;zlarr;zlarrb;zlarrbfs;zlarrfs;zlarrhk;zlarrlp;zlarrpl;zlarrsim;zlarrtl;zlat;zlatail;zlate;zlates;zlbarr;zlbbrk;zlbrace;zlbrack;zlbrke;zlbrksld;zlbrkslu;zlcaron;zlcedil;zlceil;zlcub;zlcy;zldca;zldquo;zldquor;zldrdhar;z ldrushar;zldsh;zle;z leftarrow;zleftarrowtail;zleftharpoondown;zleftharpoonup;zleftleftarrows;zleftrightarrow;zleftrightarrows;zleftrightharpoons;zleftrightsquigarrow;zleftthreetimes;zleg;zleq;zleqq;z leqslant;zles;zlescc;zlesdot;zlesdoto;z lesdotor;zlesg;zlesges;z lessapprox;zlessdot;z lesseqgtr;z lesseqqgtr;zlessgtr;zlesssim;zlfisht;zlfloor;zlfr;zlg;zlgE;zlhard;zlharu;zlharul;zlhblk;zljcy;zll;zllarr;z llcorner;zllhard;zlltri;zlmidot;zlmoust;z lmoustache;zlnE;zlnap;z lnapprox;zlne;zlneq;zlneqq;zlnsim;zloang;zloarr;zlobrk;zlongleftarrow;zlongleftrightarrow;z longmapsto;zlongrightarrow;zlooparrowleft;zlooparrowright;zlopar;zlopf;zloplus;zlotimes;zlowast;zlowbar;zloz;zlozenge;zlozf;zlpar;zlparlt;zlrarr;z lrcorner;zlrhar;zlrhard;zlrm;zlrtri;zlsaquo;zlscr;zlsh;zlsim;zlsime;zlsimg;zlsqb;zlsquo;zlsquor;zlstrok;ltrKzltcc;zltcir;zltdot;zlthree;zltimes;zltlarr;zltquest;zltrPar;zltri;zltrie;zltrif;z lurdshar;zluruhar;z lvertneqq;zlvnE;zmDDot;Zmacrzmacr;zmale;zmalt;zmaltese;zmap;zmapsto;z mapstodown;z mapstoleft;z mapstoup;zmarker;zmcomma;zmcy;zmdash;zmeasuredangle;zmfr;zmho;microzmicro;zmid;zmidast;zmidcir;Zmiddotzmiddot;zminus;zminusb;zminusd;zminusdu;zmlcp;zmldr;zmnplus;zmodels;zmopf;zmp;zmscr;zmstpos;zmu;z multimap;zmumap;znGg;znGt;znGtv;z nLeftarrow;znLeftrightarrow;znLl;znLt;znLtv;z nRightarrow;znVDash;znVdash;znabla;znacute;znang;znap;znapE;znapid;znapos;znapprox;znatur;znatural;z naturals;Znbspznbsp;znbump;znbumpe;zncap;zncaron;zncedil;zncong;z ncongdot;zncup;zncy;zndash;zne;zneArr;znearhk;znearr;znearrow;znedot;znequiv;znesear;znesim;znexist;znexists;znfr;zngE;znge;zngeq;zngeqq;z ngeqslant;znges;zngsim;zngt;zngtr;znhArr;znharr;znhpar;zni;znis;znisd;zniv;znjcy;znlArr;znlE;znlarr;znldr;znle;z nleftarrow;znleftrightarrow;znleq;znleqq;z nleqslant;znles;znless;znlsim;znlt;znltri;znltrie;znmid;znopf;notznot;znotin;znotinE;z notindot;znotinva;znotinvb;znotinvc;znotni;znotniva;znotnivb;znotnivc;znpar;z nparallel;znparsl;znpart;znpolint;znpr;znprcue;znpre;znprec;znpreceq;znrArr;znrarr;znrarrc;znrarrw;z nrightarrow;znrtri;znrtrie;znsc;znsccue;znsce;znscr;z nshortmid;znshortparallel;znsim;znsime;znsimeq;znsmid;znspar;znsqsube;znsqsupe;znsub;znsubE;znsube;znsubset;z nsubseteq;z nsubseteqq;znsucc;znsucceq;znsup;znsupE;znsupe;znsupset;z nsupseteq;z nsupseteqq;zntgl;Zntildezntilde;zntlg;zntriangleleft;zntrianglelefteq;zntriangleright;zntrianglerighteq;znu;znum;znumero;znumsp;znvDash;znvHarr;znvap;znvdash;znvge;znvgt;znvinfin;znvlArr;znvle;znvlt;znvltrie;znvrArr;znvrtrie;znvsim;znwArr;znwarhk;znwarr;znwarrow;znwnear;zoS;Zoacutezoacute;zoast;zocir;Zocirczocirc;zocy;zodash;zodblac;zodiv;zodot;zodsold;zoelig;zofcir;zofr;zogon;Zogravezograve;zogt;zohbar;zohm;zoint;zolarr;zolcir;zolcross;zoline;zolt;zomacr;zomega;zomicron;zomid;zominus;zoopf;zopar;zoperp;zoplus;zor;zorarr;zord;zorder;zorderof;Zordfzordf;Zordmzordm;zorigof;zoror;zorslope;zorv;zoscr;Zoslashzoslash;zosol;Zotildezotilde;zotimes;z otimesas;Zoumlzouml;zovbar;zpar;Zparazpara;z parallel;zparsim;zparsl;zpart;zpcy;zpercnt;zperiod;zpermil;zperp;zpertenk;zpfr;zphi;zphiv;zphmmat;zphone;zpi;z pitchfork;zpiv;zplanck;zplanckh;zplankv;zplus;z plusacir;zplusb;zpluscir;zplusdo;zplusdu;zpluse;Zplusmnzplusmn;zplussim;zplustwo;zpm;z pointint;zpopf;Zpoundzpound;zpr;zprE;zprap;zprcue;zpre;zprec;z precapprox;z preccurlyeq;zpreceq;z precnapprox;z precneqq;z precnsim;zprecsim;zprime;zprimes;zprnE;zprnap;zprnsim;zprod;z profalar;z profline;z profsurf;zprop;zpropto;zprsim;zprurel;zpscr;zpsi;zpuncsp;zqfr;zqint;zqopf;zqprime;zqscr;z quaternions;zquatint;zquest;zquesteq;ZquotrOzrAarr;zrArr;zrAtail;zrBarr;zrHar;zrace;zracute;zradic;z raemptyv;zrang;zrangd;zrange;zrangle;Zraquozraquo;zrarr;zrarrap;zrarrb;zrarrbfs;zrarrc;zrarrfs;zrarrhk;zrarrlp;zrarrpl;zrarrsim;zrarrtl;zrarrw;zratail;zratio;z rationals;zrbarr;zrbbrk;zrbrace;zrbrack;zrbrke;zrbrksld;zrbrkslu;zrcaron;zrcedil;zrceil;zrcub;zrcy;zrdca;zrdldhar;zrdquo;zrdquor;zrdsh;zreal;zrealine;z realpart;zreals;zrect;Zregzreg;zrfisht;zrfloor;zrfr;zrhard;zrharu;zrharul;zrho;zrhov;z rightarrow;zrightarrowtail;zrightharpoondown;zrightharpoonup;zrightleftarrows;zrightleftharpoons;zrightrightarrows;zrightsquigarrow;zrightthreetimes;zring;z risingdotseq;zrlarr;zrlhar;zrlm;zrmoust;z rmoustache;zrnmid;zroang;zroarr;zrobrk;zropar;zropf;zroplus;zrotimes;zrpar;zrpargt;z rppolint;zrrarr;zrsaquo;zrscr;zrsh;zrsqb;zrsquo;zrsquor;zrthree;zrtimes;zrtri;zrtrie;zrtrif;z rtriltri;zruluhar;zrx;zsacute;zsbquo;zsc;zscE;zscap;zscaron;zsccue;zsce;zscedil;zscirc;zscnE;zscnap;zscnsim;z scpolint;zscsim;zscy;zsdot;zsdotb;zsdote;zseArr;zsearhk;zsearr;zsearrow;Zsectzsect;zsemi;zseswar;z setminus;zsetmn;zsext;zsfr;zsfrown;zsharp;zshchcy;zshcy;z shortmid;zshortparallel;Zshyzshy;zsigma;zsigmaf;zsigmav;zsim;zsimdot;zsime;zsimeq;zsimg;zsimgE;zsiml;zsimlE;zsimne;zsimplus;zsimrarr;zslarr;zsmallsetminus;zsmashp;z smeparsl;zsmid;zsmile;zsmt;zsmte;zsmtes;zsoftcy;zsol;zsolb;zsolbar;zsopf;zspades;z spadesuit;zspar;zsqcap;zsqcaps;zsqcup;zsqcups;zsqsub;zsqsube;z sqsubset;z sqsubseteq;zsqsup;zsqsupe;z sqsupset;z sqsupseteq;zsqu;zsquare;zsquarf;zsquf;zsrarr;zsscr;zssetmn;zssmile;zsstarf;zstar;zstarf;zstraightepsilon;z straightphi;zstrns;zsub;zsubE;zsubdot;zsube;zsubedot;zsubmult;zsubnE;zsubne;zsubplus;zsubrarr;zsubset;z subseteq;z subseteqq;z subsetneq;z subsetneqq;zsubsim;zsubsub;zsubsup;zsucc;z succapprox;z succcurlyeq;zsucceq;z succnapprox;z succneqq;z succnsim;zsuccsim;zsum;zsung;Zsup1zsup1;Zsup2zsup2;Zsup3zsup3;zsup;zsupE;zsupdot;zsupdsub;zsupe;zsupedot;zsuphsol;zsuphsub;zsuplarr;zsupmult;zsupnE;zsupne;zsupplus;zsupset;z supseteq;z supseteqq;z supsetneq;z supsetneqq;zsupsim;zsupsub;zsupsup;zswArr;zswarhk;zswarr;zswarrow;zswnwar;Zszligzszlig;ztarget;ztau;ztbrk;ztcaron;ztcedil;ztcy;ztdot;ztelrec;ztfr;zthere4;z therefore;ztheta;z thetasym;zthetav;z thickapprox;z thicksim;zthinsp;zthkap;zthksim;Zthornzthorn;ztilde;timesztimes;ztimesb;z timesbar;ztimesd;ztint;ztoea;ztop;ztopbot;ztopcir;ztopf;ztopfork;ztosa;ztprime;ztrade;z triangle;z triangledown;z triangleleft;ztrianglelefteq;z triangleq;ztriangleright;ztrianglerighteq;ztridot;ztrie;z triminus;ztriplus;ztrisb;ztritime;z trpezium;ztscr;ztscy;ztshcy;ztstrok;ztwixt;ztwoheadleftarrow;ztwoheadrightarrow;zuArr;zuHar;Zuacutezuacute;zuarr;zubrcy;zubreve;Zucirczucirc;zucy;zudarr;zudblac;zudhar;zufisht;zufr;Zugravezugrave;zuharl;zuharr;zuhblk;zulcorn;z ulcorner;zulcrop;zultri;zumacr;Zumlzuml;zuogon;zuopf;zuparrow;z updownarrow;zupharpoonleft;zupharpoonright;zuplus;zupsi;zupsih;zupsilon;z upuparrows;zurcorn;z urcorner;zurcrop;zuring;zurtri;zuscr;zutdot;zutilde;zutri;zutrif;zuuarr;Zuumlzuuml;zuwangle;zvArr;zvBar;zvBarv;zvDash;zvangrt;z varepsilon;z varkappa;z varnothing;zvarphi;zvarpi;z varpropto;zvarr;zvarrho;z varsigma;z varsubsetneq;zvarsubsetneqq;z varsupsetneq;zvarsupsetneqq;z vartheta;zvartriangleleft;zvartriangleright;zvcy;zvdash;zvee;zveebar;zveeeq;zvellip;zverbar;zvert;zvfr;zvltri;zvnsub;zvnsup;zvopf;zvprop;zvrtri;zvscr;zvsubnE;zvsubne;zvsupnE;zvsupne;zvzigzag;zwcirc;zwedbar;zwedge;zwedgeq;zweierp;zwfr;zwopf;zwp;zwr;zwreath;zwscr;zxcap;zxcirc;zxcup;zxdtri;zxfr;zxhArr;zxharr;zxi;zxlArr;zxlarr;zxmap;zxnis;zxodot;zxopf;zxoplus;zxotime;zxrArr;zxrarr;zxscr;zxsqcup;zxuplus;zxutri;zxvee;zxwedge;Zyacutezyacute;zyacy;zycirc;zycy;Zyenzyen;zyfr;zyicy;zyopf;zyscr;zyucy;Zyumlzyuml;zzacute;zzcaron;zzcy;zzdot;zzeetrf;zzeta;zzfr;zzhcy;zzigrarr;zzopf;zzscr;zzwj;zzwnj;u�)"r )ZDoctypeZ CharactersZSpaceCharactersStartTagEndTagEmptyTagCommentZ ParseErrorrrrcCsg|]\}}||fqSr4r4)r5kvr4r4r8r9y sZmathc@seZdZdZdS)DataLossWarningzBRaised when the current tree is unable to represent the input dataN)__name__ __module__ __qualname____doc__r4r4r4r8r} src@s eZdZdS)_ReparseExceptionN)rr r r4r4r4r8r  sr )0Z __future__rrrstringZEOFEZ namespaces frozensetZscopingElementsZformattingElementsZspecialElementsZhtmlIntegrationPointElementsZ"mathmlTextIntegrationPointElementsZadjustSVGAttributesZadjustMathMLAttributesZadjustForeignAttributesdictitemsZunadjustForeignAttributesZspaceCharactersZtableInsertModeElementsZascii_lowercaseZasciiLowercaseZascii_uppercaseZasciiUppercaseZ ascii_lettersZ asciiLettersZdigitsZ hexdigitsZ hexDigitsZasciiUpper2LowerZheadingElementsZ voidElementsZ cdataElementsZrcdataElementsZbooleanAttributesZentitiesWindows1252Z xmlEntitiesZentitiesZreplacementCharactersZ tokenTypesZ tagTokenTypesprefixes UserWarningr Exceptionr r4r4r4r8sj$                                                                                                              S          A                 # L&  PKd]t2html5lib/__pycache__/__init__.cpython-38.opt-1.pycnu[U .e@shdZddlmZmZmZddlmZmZmZddl m Z ddl m Z ddl mZdd d d d d gZdZdS)a HTML parsing library based on the `WHATWG HTML specification `_. The parser is designed to be compatible with existing HTML found in the wild and implements well-defined error recovery that is largely compatible with modern desktop web browsers. Example usage:: from pip._vendor import html5lib with open("my_document.html", "rb") as f: tree = html5lib.parse(f) For convenience, this module re-exports the following names: * :func:`~.html5parser.parse` * :func:`~.html5parser.parseFragment` * :class:`~.html5parser.HTMLParser` * :func:`~.treebuilders.getTreeBuilder` * :func:`~.treewalkers.getTreeWalker` * :func:`~.serializer.serialize` )absolute_importdivisionunicode_literals) HTMLParserparse parseFragment)getTreeBuilder) getTreeWalker) serializerrrr r r z1.0.1N)__doc__Z __future__rrrZ html5parserrrrZ treebuildersr Z treewalkersr Z serializerr __all__ __version__rrA/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/__init__.pys   PKd]Y/SS6html5lib/__pycache__/_inputstream.cpython-38.opt-1.pycnu[U .e(!@sddlmZmZmZddlmZmZddlmZm Z ddl Z ddl Z ddl m Z ddlmZmZmZmZddlmZdd lmZdd lmZzdd lmZWnek reZYnXed d eDZedd eDZedd eDZeeddgBZdZej r(e !edde"ddZ#n e !eZ#e$ddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5g Z%e !d6Z&iZ'Gd7d8d8e(Z)d9d:Z*Gd;d<dd>e+Z,Gd?d@d@e-Z.GdAdBdBe(Z/GdCdDdDe(Z0dEdFZ1dS)G)absolute_importdivisionunicode_literals) text_type binary_type) http_clienturllibN) webencodings)EOFspaceCharacters asciiLettersasciiUppercase)_ReparseException)_utils)StringIO)BytesIOcCsg|]}|dqSasciiencode.0itemrE/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_inputstream.py srcCsg|]}|dqSrrrrrrrscCsg|]}|dqSrrrrrrrs>.)sumr#r%rrr_bufferedBytes^szBufferedStream._bufferedBytescCs<|j|}|j||jdd7<t||jd<|Sr')r"r2r#appendr$r()r%r1datarrrr/as   zBufferedStream._readStreamcCs|}g}|jd}|jd}|t|jkr|dkr|j|}|t||kr`|}|||g|_n"t||}|t|g|_|d7}|||||||8}d}q|r|||d|S)Nrr )r$r(r#r6r/join)r%r1ZremainingBytesrvZ bufferIndexZ bufferOffsetZ bufferedDataZ bytesToReadrrrr0hs$    zBufferedStream._readFromBufferN) __name__ __module__ __qualname____doc__r&r+r.r2r5r/r0rrrrr!9s  r!cKst|tjs(t|tjjr.t|jtjr.d}n&t|drJt|dt }n t|t }|rdd|D}|rvt d|t |f|St |f|SdS)NFr2rcSsg|]}|dr|qS)Z _encoding)endswith)rxrrrrs z#HTMLInputStream..z3Cannot set an encoding with a unicode input, set %r) isinstancerZ HTTPResponserZresponseZaddbasefphasattrr2r TypeErrorHTMLUnicodeInputStreamHTMLBinaryInputStream)sourcekwargsZ isUnicodeZ encodingsrrrHTMLInputStreams       rIc@speZdZdZdZddZddZddZd d Zd d Z d dZ dddZ ddZ ddZ dddZddZdS)rEProvides a unicode stream of characters to the HTMLTokenizer. This class takes care of character encoding and removing or replacing incorrect byte-sequences and also provides column and line tracking. i(cCsZtjsd|_ntddkr$|j|_n|j|_dg|_tddf|_| ||_ | dS)Initialises the HTMLInputStream. HTMLInputStream(source, [encoding]) -> Normalized stream from source for use by html5lib. source can be either a file-object, local filename or a string. The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element) Nu􏿿r rutf-8certain) rsupports_lone_surrogatesreportCharacterErrorsr(characterErrorsUCS4characterErrorsUCS2ZnewLineslookupEncoding charEncoding openStream dataStreamreset)r%rGrrrr&s   zHTMLUnicodeInputStream.__init__cCs.d|_d|_d|_g|_d|_d|_d|_dS)Nr)r* chunkSize chunkOffseterrors prevNumLines prevNumCols_bufferedCharacterr4rrrrVszHTMLUnicodeInputStream.resetcCst|dr|}nt|}|SzvProduces a file object from source. source can be either a file object, local filename or a string. r2)rCrr%rGr"rrrrTs z!HTMLUnicodeInputStream.openStreamcCsT|j}|dd|}|j|}|dd|}|dkr@|j|}n ||d}||fS)N rrr )r*countr[rfindr\)r%r,r*ZnLinesZ positionLineZ lastLinePosZpositionColumnrrr _positions   z HTMLUnicodeInputStream._positioncCs||j\}}|d|fS)z:Returns (line, col) of the current position in the stream.r )rcrY)r%linecolrrrr$szHTMLUnicodeInputStream.positioncCs6|j|jkr|stS|j}|j|}|d|_|S)zo Read one character from the stream or queue if available. Return EOF when EOF is reached. r )rYrX readChunkr r*)r%rYcharrrrrgs   zHTMLUnicodeInputStream.charNcCs|dkr|j}||j\|_|_d|_d|_d|_|j|}|j rX|j |}d|_ n|s`dSt |dkrt |d}|dksd|krdkrnn|d|_ |dd}|j r| || d d }| d d }||_t ||_d S) NrWrFr r iz r` T)_defaultChunkSizercrXr[r\r*rYrUr2r]r(ordrOreplace)r%rXr7Zlastvrrrrfs0           z HTMLUnicodeInputStream.readChunkcCs(ttt|D]}|jdqdS)Ninvalid-codepoint)ranger(invalid_unicode_refindallrZr6)r%r7_rrrrP%sz*HTMLUnicodeInputStream.characterErrorsUCS4cCsd}t|D]}|rqt|}|}t|||drrt|||d}|tkrl|j dd}q|dkr|dkr|t |dkr|j dqd}|j dqdS)NFrnTriir ) rpfinditerrlgroupstartrZisSurrogatePairZsurrogatePairToCodepointnon_bmp_invalid_codepointsrZr6r()r%r7skipmatchZ codepointr)Zchar_valrrrrQ)s"  z*HTMLUnicodeInputStream.characterErrorsUCS2Fc Cszt||f}WnNtk r^ddd|D}|s@d|}td|}t||f<YnXg}||j|j}|dkr|j|jkrqn0| }||jkr| |j|j|||_q| |j|jd| sdqqdd|}|S)z Returns a string of characters from the stream up to but not including any character in 'characters' or EOF. 'characters' must be a container that supports the 'in' method and iteration over its characters. rWcSsg|]}dt|qS)z\x%02x)rl)rcrrrrNsz5HTMLUnicodeInputStream.charsUntil..z^%sz[%s]+N) charsUntilRegExKeyErrorr9recompileryr*rYrXendr6rf) r%Z charactersZoppositecharsZregexr:mrrrrr charsUntil@s,    z!HTMLUnicodeInputStream.charsUntilcCs@|dk r<|jdkr.||j|_|jd7_n|jd8_dSr')rYr*rX)r%rgrrrungetos   zHTMLUnicodeInputStream.unget)N)F)r;r<r=r>rkr&rVrTrcr$rgrfrPrQrrrrrrrEs   & /rEc@sLeZdZdZdddZddZd d Zdd d Zd dZddZ ddZ dS)rFrJN windows-1252TcCs\|||_t||jd|_d|_||_||_||_||_ ||_ | ||_ | dS)rKidN)rT rawStreamrEr& numBytesMetanumBytesChardetoverride_encodingtransport_encodingsame_origin_parent_encodinglikely_encodingdefault_encodingdetermineEncodingrSrV)r%rGrrrrrZ useChardetrrrr&s  zHTMLBinaryInputStream.__init__cCs&|jdj|jd|_t|dS)Nrrm)rSZ codec_info streamreaderrrUrErVr4rrrrVszHTMLBinaryInputStream.resetcCsDt|dr|}nt|}z||Wnt|}YnX|Sr^)rCrr.r+r!r_rrrrTs z HTMLBinaryInputStream.openStreamcCs|df}|ddk r|St|jdf}|ddk r:|St|jdf}|ddk rX|S|df}|ddk rt|St|jdf}|ddk r|djds|St|jdf}|ddk r|S|r`zddl m }Wnt k rYnvXg}|}|j s,|j |j}|sq,||||q|t|jd}|j d|dk r`|dfSt|jdf}|ddk r|StddfS)NrMrZ tentativezutf-16)UniversalDetectorencodingr) detectBOMrRrrdetectEncodingMetarname startswithrZ%pip._vendor.chardet.universaldetectorr ImportErrorZdonerr2rr6Zfeedcloseresultr.r)r%ZchardetrSrZbuffersZdetectorr#rrrrrsP           z'HTMLBinaryInputStream.determineEncodingcCst|}|dkrdS|jdkr(td}nT||jdkrH|jddf|_n4|jd|df|_|td|jd|fdS)Nutf-16beutf-16lerLrrMzEncoding changed from %s to %s)rRrrSrr.rVr)r%Z newEncodingrrrchangeEncodings   z$HTMLBinaryInputStream.changeEncodingc Cstjdtjdtjdtjdtjdi}|jd}||dd}d}|sp||}d}|sp||dd }d }|r|j |t |S|j d dSdS) zAttempts to detect at BOM at the start of the stream. If an encoding can be determined from the BOM return the name of the encoding otherwise return NonerLrrzutf-32lezutf-32beNrsr) codecsBOM_UTF8 BOM_UTF16_LE BOM_UTF16_BE BOM_UTF32_LE BOM_UTF32_BErr2getr.rR)r%ZbomDictstringrr.rrrrs2    zHTMLBinaryInputStream.detectBOMcCsH|j|j}t|}|jd|}|dk rD|jdkrDtd}|S)z9Report the encoding declared by the meta element rNrrL)rr2rEncodingParserr. getEncodingrrR)r%r#parserrrrrr9s z(HTMLBinaryInputStream.detectEncodingMeta)NNNNrT)T) r;r<r=r>r&rVrTrrrrrrrrrFs * >"rFc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ e e e Z ddZe eZefddZddZddZddZdS) EncodingByteszString-like object with an associated position and various extra methods If the position is ever greater than the string length then an exception is raisedcCst||SN)r1__new__lowerr%valuerrrrLszEncodingBytes.__new__cCs d|_dS)Nr)rcrrrrr&PszEncodingBytes.__init__cCs|Srrr4rrr__iter__TszEncodingBytes.__iter__cCs>|jd}|_|t|kr"tn |dkr.t|||dS)Nr rrcr( StopIterationrDr%prrr__next__Ws  zEncodingBytes.__next__cCs|Sr)rr4rrrnext_szEncodingBytes.nextcCsB|j}|t|krtn |dkr$t|d|_}|||dSr'rrrrrpreviouscs zEncodingBytes.previouscCs|jt|krt||_dSrrcr(r)r%r$rrr setPositionlszEncodingBytes.setPositioncCs*|jt|krt|jdkr"|jSdSdS)Nrrr4rrr getPositionqs  zEncodingBytes.getPositioncCs||j|jdSNr )r$r4rrrgetCurrentByte{szEncodingBytes.getCurrentBytecCsH|j}|t|kr>|||d}||kr4||_|S|d7}q||_dS)zSkip past a list of charactersr Nr$r(rcr%rrrzrrrrxs  zEncodingBytes.skipcCsH|j}|t|kr>|||d}||kr4||_|S|d7}q||_dSrrrrrr skipUntils  zEncodingBytes.skipUntilcCs>|j}|||t|}||}|r:|jt|7_|S)zLook for a sequence of bytes at the start of a string. If the bytes are found return True and advance the position to the byte after the match. Otherwise return False and leave the position alone)r$r(r)r%r1rr7r:rrr matchBytess  zEncodingBytes.matchBytescCsR||jd|}|dkrJ|jdkr,d|_|j|t|d7_dStdS)zLook for the next sequence of bytes matching a given sequence. If a match is found advance the position to the last byte of the matchNrrr T)r$findrcr(r)r%r1Z newPositionrrrjumpTos zEncodingBytes.jumpToN)r;r<r=r>rr&rrrrrrpropertyr$r currentBytespaceCharactersBytesrxrrrrrrrrHs      rc@sXeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ dS)rz?Mini parser for detecting character encoding from meta elementscCst||_d|_dS)z3string - the data to work on for encoding detectionN)rr7rr%r7rrrr&s zEncodingParser.__init__c Csd|jfd|jfd|jfd|jfd|jfd|jff}|jD]Z}d}|D]D\}}|j|rFz|}WqWqFtk rd}YqYqFXqF|s:qq:|jS) Nsr7rr4rrrrszEncodingParser.handleCommentcCs|jjtkrdSd}d}|}|dkr,dS|ddkr\|ddk}|r|dk r||_dSq|ddkr|d}t|}|dk r||_dSq|ddkrtt|d}|}|dk rt|}|dk r|r||_dS|}qdS) NTFrs http-equivr s content-typecharsetscontent) r7rr getAttributerrRContentAttrParserrparse)r%Z hasPragmaZpendingEncodingattrZtentativeEncodingcodecZ contentParserrrrrs8      zEncodingParser.handleMetacCs |dS)NF)handlePossibleTagr4rrrrsz%EncodingParser.handlePossibleStartTagcCst|j|dS)NT)rr7rr4rrrrs z#EncodingParser.handlePossibleEndTagcCsb|j}|jtkr(|r$||dS|t}|dkrD|n|}|dk r^|}qLdS)NTr)r7rasciiLettersBytesrrrspacesAngleBracketsr)r%ZendTagr7rzrrrrrs    z EncodingParser.handlePossibleTagcCs |jdS)Nrrr4rrrrszEncodingParser.handleOthercCs|j}|ttdgB}|dkr&dSg}g}|dkr>|r>qnX|tkrR|}qnD|dkrhd|dfS|tkr||n|dkrdS||t|}q.|dkr| d|dfSt||}|dkr2|}t|}||kr t|d|d|fS|tkr$||q||qnJ|dkrJd|dfS|tkrd||n|dkrrdS||t|}|t krd|d|fS|tkr||n|dkrdS||q|dS) z_Return a name,value pair for the next attribute in the stream, if one is found, or None/)rNN=)rrr8)'"r) r7rxr frozensetr9asciiUppercaseBytesr6rrrr)r%r7rzZattrNameZ attrValueZ quoteCharrrrrs`             zEncodingParser.getAttributeN) r;r<r=r>r&rrrrrrrrrrrrrs$rc@seZdZddZddZdS)rcCs ||_dSr)r7rrrrr&fszContentAttrParser.__init__cCsz|jd|jjd7_|j|jjdkss        JgIh6'PKd] -pp5html5lib/__pycache__/html5parser.cpython-38.opt-1.pycnu[U .e@sddlmZmZmZddlmZmZddlZddlm Z ddl m Z ddl m Z ddl m Z dd lmZdd l mZdd lmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"d!ddZ#d"ddZ$ddZ%Gddde&Z'ej(ddZ)ddZ*d#ddZ+Gdd d e,Z-dS)$)absolute_importdivisionunicode_literals)with_metaclassviewkeysN) OrderedDict) _inputstream) _tokenizer) treebuilders)Marker)_utils)spaceCharactersasciiUpper2LowerspecialElementsheadingElements cdataElementsrcdataElements tokenTypes tagTokenTypes namespaceshtmlIntegrationPointElements"mathmlTextIntegrationPointElementsadjustForeignAttributesadjustMathMLAttributesadjustSVGAttributesE_ReparseExceptionetreeTcKs$t|}t||d}|j|f|S)aParse an HTML document as a string or file-like object into a tree :arg doc: the document to parse as a string or file-like object :arg treebuilder: the treebuilder to use when parsing :arg namespaceHTMLElements: whether or not to namespace HTML elements :returns: parsed tree Example: >>> from html5lib.html5parser import parse >>> parse('

This is a doc

') namespaceHTMLElements)r getTreeBuilder HTMLParserparse)doc treebuilderr kwargstbpr)D/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/html5parser.pyr#s  r#divcKs,t|}t||d}|j|fd|i|S)a#Parse an HTML fragment as a string or file-like object into a tree :arg doc: the fragment to parse as a string or file-like object :arg container: the container context to parse the fragment in :arg treebuilder: the treebuilder to use when parsing :arg namespaceHTMLElements: whether or not to namespace HTML elements :returns: parsed tree Example: >>> from html5lib.html5libparser import parseFragment >>> parseFragment('this is a fragment') r container)r r!r" parseFragment)r$r,r%r r&r'r(r)r)r*r-2s  r-csGfdddt}|S)NcseZdZfddZdS)z-method_decorator_metaclass..Decoratedcs>|D]$\}}t|tjr$|}|||<qt||||SN)items isinstancetypes FunctionTypetype__new__)metaZ classnamebasesZ classDictZ attributeNameZ attributefunctionr)r*r4Ms   z5method_decorator_metaclass..Decorated.__new__N)__name__ __module__ __qualname__r4r)r7r)r* DecoratedLsr<)r3)r8r<r)r7r*method_decorator_metaclassKsr=c@seZdZdZd+ddZd,dd Zd d Zed d ZddZ ddZ ddZ ddZ ddZ ddZd-ddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*ZdS).r"z]HTML parser Generates a tree structure from a stream of (possibly malformed) HTML. NFTcsL|_|dkrtd}||_g_tfddt|D_dS)a :arg tree: a treebuilder class controlling the type of tree that will be returned. Built in treebuilders can be accessed through html5lib.treebuilders.getTreeBuilder(treeType) :arg strict: raise an exception when a parse error is encountered :arg namespaceHTMLElements: whether or not to namespace HTML elements :arg debug: whether or not to enable debug mode which logs things Example: >>> from html5lib.html5parser import HTMLParser >>> parser = HTMLParser() # generates parser with etree builder >>> parser = HTMLParser('lxml', strict=True) # generates parser with lxml builder which is strict Nrcs g|]\}}||jfqSr))tree).0nameclsselfr)r* zsz'HTMLParser.__init__..) strictr r!r>errorsdict getPhasesr/phases)rCr>rEr debugr)rBr*__init__^s    zHTMLParser.__init__r+cKsh||_||_||_tj|fd|i||_|z |Wn$tk rb||YnXdS)Nparser) innerHTMLModer, scriptingr Z HTMLTokenizer tokenizerresetmainLoopr)rCstream innerHTMLr,rNr&r)r)r*_parse}s zHTMLParser._parsecCs|jd|_g|_g|_d|_|jr|j|_ |j t krL|j j |j _ n0|j tkrd|j j|j _ n|j dkr||j j|j _ n|jd|_|j|nd|_ |jd|_d|_d|_d|_dS)NFz no quirks plaintext beforeHtmlinitialT)r>rP firstStartTagrFlog compatModerMr,lowerrSrrO rcdataStatestater rawtextStateplaintextStaterIphaseinsertHtmlElementresetInsertionModeZ lastPhaseZbeforeRCDataPhase framesetOKrBr)r)r*rPs*         zHTMLParser.resetcCst|dsdS|jjjdjS)zName of the character encoding that was used to decode the input stream, or :obj:`None` if that is not determined yet rONr)hasattrrOrR charEncodingr@rBr)r)r*documentEncodings zHTMLParser.documentEncodingcCsJ|jdkr6|jtdkr6d|jko4|jdtdkS|j|jftkSdS)Nannotation-xmlmathmlencoding)z text/htmlzapplication/xhtml+xml)r@ namespacer attributes translaterrrCelementr)r)r*isHTMLIntegrationPoints    z!HTMLParser.isHTMLIntegrationPointcCs|j|jftkSr.)rjr@rrmr)r)r*isMathMLTextIntegrationPointsz'HTMLParser.isMathMLTextIntegrationPointcCsXtd}td}td}td}td}td}td}|D]}d} |} | dk r| } |jjrp|jjdnd} | r~| jnd} | r| jnd} | d }||kr|| d | d id} qNt|jjd ksd| |jj ksd| | r||kr |d t ddgksd|||fksd| t dkrH| dkrH||krH|d dksd| | rl||||fkrl|j}n |jd}||kr|| } qN||kr|| } qN||kr|| } qN||kr|| } qN||kr|| } qN||krN|| } qN||kr@| dr@| ds@|dd | d iq@d}g}|rT||j|j}|r.q.dS)N CharactersZSpaceCharactersStartTagEndTagCommentZDoctype ParseErrorr3datadatavarsrr@ZmglyphZ malignmarkrhrgsvginForeignContent selfClosingselfClosingAcknowledgedz&non-void-element-with-trailing-solidusT)rnormalizedTokensr> openElementsrjr@ parseErrorgetlendefaultNamespacerp frozensetrror`rIprocessCharactersprocessSpaceCharactersprocessStartTag processEndTagprocessCommentprocessDoctypeappend processEOF)rCZCharactersTokenZSpaceCharactersTokenZ StartTagTokenZ EndTagTokenZ CommentTokenZ DoctypeTokenZParseErrorTokentokenZ prev_token new_token currentNodeZcurrentNodeNamespaceZcurrentNodeNamer3r`Z reprocessrIr)r)r*rQs                       zHTMLParser.mainLoopccs|jD]}||VqdSr.)rOnormalizeTokenrCrr)r)r*r}s zHTMLParser.normalizedTokenscOs |j|ddf|||jS)aParse a HTML document into a well-formed tree :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element). :arg scripting: treat noscript elements as if JavaScript was turned on :returns: parsed tree Example: >>> from html5lib.html5parser import HTMLParser >>> parser = HTMLParser() >>> parser.parse('

This is a doc

') FN)rTr>Z getDocumentrCrRargsr&r)r)r*r# szHTMLParser.parsecOs|j|df|||jS)aZParse a HTML fragment into a well-formed tree fragment :arg container: name of the element we're setting the innerHTML property if set to None, default to 'div' :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element) :arg scripting: treat noscript elements as if JavaScript was turned on :returns: parsed tree Example: >>> from html5lib.html5libparser import HTMLParser >>> parser = HTMLParser() >>> parser.parseFragment('this is a fragment') T)rTr>Z getFragmentrr)r)r*r-$szHTMLParser.parseFragmentXXX-undefined-errorcCs@|dkr i}|j|jj||f|jrr~r@rSrjrrIr`)rCZlastZnewModesnodeZnodeNameZ new_phaser)r)r*rb`s@ zHTMLParser.resetInsertionModecCsF|j||dkr"|jj|j_n |jj|j_|j|_|jd|_dS)NRAWTEXTtext) r> insertElementrOr^r]r\r` originalPhaserI)rCrZ contentTyper)r)r*parseRCDataRawtexts   zHTMLParser.parseRCDataRawtext)NFTF)Fr+F)rN)r9r:r;__doc__rKrTrPpropertyrfrorprQr}r#r-rrrrrrrbrr)r)r)r*r"Ws(  "  C  ,r"cs"dd}dd}Gdddt|||Gddd}Gd d d }Gfd d d }Gfd dd}Gfddd}Gfddd}Gfddd} Gfddd} Gfddd} Gfddd} Gfddd} Gfddd}Gfdd d }Gfd!d"d"}Gfd#d$d$}Gfd%d&d&}Gfd'd(d(}Gfd)d*d*}Gfd+d,d,}Gfd-d.d.}Gfd/d0d0}Gfd1d2d2}Gfd3d4d4}||||||| | | | | ||||||||||||d5S)6Ncs(tddtDfdd}|S)z4Logger that records which phase processes each tokencss|]\}}||fVqdSr.r))r?keyvaluer)r)r* sz)getPhases..log..csjdrt|dkr|d}zd|di}WnYnX|dtkr\|d|d<|jj|jjjj|jj j j|j jj|f|f||S|f||SdS)NZprocessrr3r@) r9 startswithrrrLrYrrOr]r` __class__)rCrr&rinfor8Z type_namesr)r*wrappeds    z'getPhases..log..wrapped)rGrr/)r8rr)rr*rYs zgetPhases..logcSs|r t|StSdSr.)r=r3)Z use_metaclassZmetaclass_funcr)r)r* getMetaclassszgetPhases..getMetaclassc@sXeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ dS)zgetPhases..PhasezNBase class for helper object that implements each phase of processing cSs||_||_dSr.)rLr>rCrLr>r)r)r*rKsz!getPhases..Phase.__init__cSstdSr.)NotImplementedErrorrBr)r)r*rsz#getPhases..Phase.processEOFcSs|j||jjddS)Nrvr> insertCommentr~rr)r)r*rsz'getPhases..Phase.processCommentcSs|jddS)Nzunexpected-doctyperLrrr)r)r*rsz'getPhases..Phase.processDoctypecSs|j|ddSNrwr> insertTextrr)r)r*rsz*getPhases..Phase.processCharacterscSs|j|ddSrrrr)r)r*rsz/getPhases..Phase.processSpaceCharacterscSs|j|d|SNr@)startTagHandlerrr)r)r*rsz(getPhases..Phase.processStartTagcSsf|jjs |ddkr |jd|dD],\}}||jjdjkr,||jjdj|<q,d|j_dS)Nr@rz non-html-rootrwrF)rLrXrr/r>r~rkrCrattrrr)r)r* startTagHtmls  z%getPhases..Phase.startTagHtmlcSs|j|d|Sr) endTagHandlerrr)r)r*rsz&getPhases..Phase.processEndTagN) r9r:r;rrKrrrrrrrrr)r)r)r*Phases rc@sLeZdZddZddZddZddZd d Zd d Zd dZ ddZ dS)zgetPhases..InitialPhasecSsdSr.r)rr)r)r*rsz6getPhases..InitialPhase.processSpaceCharacterscSs|j||jjdSr.r>rZdocumentrr)r)r*rsz.getPhases..InitialPhase.processCommentcSs|d}|d}|d}|d}|dks@|dk s@|dk rL|dkrL|jd|dkrXd}|j||dkrv|t}|r|ddks|d s|d ks|d r|dks|r|d krd |j_n$|ds|d r|dk rd|j_|jj d|j_ dS)Nr@publicIdsystemIdcorrectrzabout:legacy-compatzunknown-doctype)7z*+//silmaril//dtd html pro v0r11 19970101//z4-//advasoft ltd//dtd html 3.0 aswedit + extensions//z*-//as//dtd html 3.0 aswedit + extensions//z-//ietf//dtd html 2.0 level 1//z-//ietf//dtd html 2.0 level 2//z&-//ietf//dtd html 2.0 strict level 1//z&-//ietf//dtd html 2.0 strict level 2//z-//ietf//dtd html 2.0 strict//z-//ietf//dtd html 2.0//z-//ietf//dtd html 2.1e//z-//ietf//dtd html 3.0//z-//ietf//dtd html 3.2 final//z-//ietf//dtd html 3.2//z-//ietf//dtd html 3//z-//ietf//dtd html level 0//z-//ietf//dtd html level 1//z-//ietf//dtd html level 2//z-//ietf//dtd html level 3//z"-//ietf//dtd html strict level 0//z"-//ietf//dtd html strict level 1//z"-//ietf//dtd html strict level 2//z"-//ietf//dtd html strict level 3//z-//ietf//dtd html strict//z-//ietf//dtd html//z(-//metrius//dtd metrius presentational//z5-//microsoft//dtd internet explorer 2.0 html strict//z.-//microsoft//dtd internet explorer 2.0 html//z0-//microsoft//dtd internet explorer 2.0 tables//z5-//microsoft//dtd internet explorer 3.0 html strict//z.-//microsoft//dtd internet explorer 3.0 html//z0-//microsoft//dtd internet explorer 3.0 tables//z#-//netscape comm. corp.//dtd html//z*-//netscape comm. corp.//dtd strict html//z*-//o'reilly and associates//dtd html 2.0//z3-//o'reilly and associates//dtd html extended 1.0//z;-//o'reilly and associates//dtd html extended relaxed 1.0//zN-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//zE-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//z$-//spyglass//dtd html 2.0 extended//z+-//sq//dtd html 2.0 hotmetal + extensions//z--//sun microsystems corp.//dtd hotjava html//z4-//sun microsystems corp.//dtd hotjava strict html//z-//w3c//dtd html 3 1995-03-24//z-//w3c//dtd html 3.2 draft//z-//w3c//dtd html 3.2 final//z-//w3c//dtd html 3.2//z-//w3c//dtd html 3.2s draft//z-//w3c//dtd html 4.0 frameset//z#-//w3c//dtd html 4.0 transitional//z(-//w3c//dtd html experimental 19960712//z&-//w3c//dtd html experimental 970421//z-//w3c//dtd w3 html//z-//w3o//dtd w3 html 3.0//z#-//webtechs//dtd mozilla html 2.0//z-//webtechs//dtd mozilla html//)z$-//w3o//dtd w3 html strict 3.0//en//z"-/w3c/dtd html 4.0 transitional/enr)z -//w3c//dtd html 4.01 frameset//z$-//w3c//dtd html 4.01 transitional//z:http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtdquirks)z -//w3c//dtd xhtml 1.0 frameset//z$-//w3c//dtd xhtml 1.0 transitional//zlimited quirksrV) rLrr>Z insertDoctyperlrrr[rZrIr`)rCrr@rrrr)r)r*rsX   9<?@@ A z.getPhases..InitialPhase.processDoctypecSsd|j_|jjd|j_dS)NrrV)rLrZrIr`rBr)r)r* anythingElseMsz,getPhases..InitialPhase.anythingElsecSs|jd||S)Nzexpected-doctype-but-got-charsrLrrrr)r)r*rQs z1getPhases..InitialPhase.processCharacterscSs"|jdd|di||S)Nz"expected-doctype-but-got-start-tagr@rrr)r)r*rVs  z/getPhases..InitialPhase.processStartTagcSs"|jdd|di||S)Nz expected-doctype-but-got-end-tagr@rrr)r)r*r\s  z-getPhases..InitialPhase.processEndTagcSs|jd|dS)Nzexpected-doctype-but-got-eofTrrBr)r)r*rbs z*getPhases..InitialPhase.processEOFN) r9r:r;rrrrrrrrr)r)r)r* InitialPhases_rc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)z"getPhases..BeforeHtmlPhasecSs&|jtdd|jjd|j_dS)Nrrrr)r>Z insertRootimpliedTagTokenrLrIr`rBr)r)r*raisz4getPhases..BeforeHtmlPhase.insertHtmlElementcSs |dSNTrarBr)r)r*rnsz-getPhases..BeforeHtmlPhase.processEOFcSs|j||jjdSr.rrr)r)r*rrsz1getPhases..BeforeHtmlPhase.processCommentcSsdSr.r)rr)r)r*rusz9getPhases..BeforeHtmlPhase.processSpaceCharacterscSs ||Sr.rrr)r)r*rxsz4getPhases..BeforeHtmlPhase.processCharacterscSs |ddkrd|j_||S)Nr@rT)rLrXrarr)r)r*r|s z2getPhases..BeforeHtmlPhase.processStartTagcSs4|ddkr$|jdd|din ||SdS)Nr@rrrbrzunexpected-end-tag-before-html)rLrrarr)r)r*rs   z0getPhases..BeforeHtmlPhase.processEndTagN) r9r:r;rarrrrrrr)r)r)r*BeforeHtmlPhasegsrcsXeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)z"getPhases..BeforeHeadPhasecsV|||td|jfd|jfg|_|j|j_td|jfg|_ |j |j _dS)Nrrr) rKr MethodDispatcherr startTagHeadr startTagOtherdefaultendTagImplyHeadr endTagOtherrrr)r*rKs z+getPhases..BeforeHeadPhase.__init__cSs|tdddS)NrrrTrrrBr)r)r*rsz-getPhases..BeforeHeadPhase.processEOFcSsdSr.r)rr)r)r*rsz9getPhases..BeforeHeadPhase.processSpaceCharacterscSs|tdd|SNrrrrrr)r)r*rsz4getPhases..BeforeHeadPhase.processCharacterscSs|jjd|SNrrLrIrrr)r)r*rsz/getPhases..BeforeHeadPhase.startTagHtmlcSs0|j||jjd|j_|jjd|j_dS)NrvinHead)r>rr~ headPointerrLrIr`rr)r)r*rs z/getPhases..BeforeHeadPhase.startTagHeadcSs|tdd|Srrrr)r)r*rsz0getPhases..BeforeHeadPhase.startTagOthercSs|tdd|Srrrr)r)r*rsz2getPhases..BeforeHeadPhase.endTagImplyHeadcSs|jdd|didS)Nzend-tag-after-implied-rootr@rrr)r)r*rs z.getPhases..BeforeHeadPhase.endTagOtherN) r9r:r;rKrrrrrrrrr)rr)r*BeforeHeadPhases rcseZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!S)"zgetPhases..InHeadPhasec s|||td|jfd|jfd|jfd|jfd|jfd|jfd|j fd|j fg|_ |j |j _ td|jfd |jfg|_|j|j_ dS) Nrtitle)noframesstylenoscriptscript)basebasefontbgsoundcommandlinkr5r)rrr)rKr rr startTagTitlestartTagNoFramesStylestartTagNoscriptstartTagScriptstartTagBaseLinkCommand startTagMetarrrr endTagHeadendTagHtmlBodyBrrrrrr)r*rKs& z'getPhases..InHeadPhase.__init__cSs |dSrrrBr)r)r*rsz)getPhases..InHeadPhase.processEOFcSs ||Sr.rrr)r)r*rsz0getPhases..InHeadPhase.processCharacterscSs|jjd|Srrrr)r)r*rsz+getPhases..InHeadPhase.startTagHtmlcSs|jddS)Nz!two-heads-are-not-better-than-onerrr)r)r*rsz+getPhases..InHeadPhase.startTagHeadcSs$|j||jjd|d<dSNTr|r>rr~poprr)r)r*rs  z6getPhases..InHeadPhase.startTagBaseLinkCommandcSs|j||jjd|d<|d}|jjjjddkrd|krZ|jjj|dnVd|krd|kr|d d krt |d d }t |}|}|jjj|dS) NTr|rwrZ tentativecharsetZcontentz http-equivz content-typezutf-8)r>rr~rrLrOrRreZchangeEncodingr[r Z EncodingBytesencodeZContentAttrParserr#)rCrrkrwrLcodecr)r)r*rs    z+getPhases..InHeadPhase.startTagMetacSs|j|ddS)NZRCDATArLrrr)r)r*rsz,getPhases..InHeadPhase.startTagTitlecSs|j|ddS)Nrrrr)r)r*rsz4getPhases..InHeadPhase.startTagNoFramesStylecSs8|jjr|j|dn|j||jjd|j_dS)NrinHeadNoscript)rLrNrr>rrIr`rr)r)r*rs z/getPhases..InHeadPhase.startTagNoscriptcSs<|j||jjj|jj_|jj|j_|jjd|j_dS)Nr) r>rrLrOZscriptDataStater]r`rrIrr)r)r*rs  z-getPhases..InHeadPhase.startTagScriptcSs ||Sr.rrr)r)r*r sz,getPhases..InHeadPhase.startTagOthercSs"|jjj}|jjd|j_dS)N afterHeadrLr>r~rrIr`rCrrr)r)r*rsz)getPhases..InHeadPhase.endTagHeadcSs ||Sr.rrr)r)r*rsz/getPhases..InHeadPhase.endTagHtmlBodyBrcSs|jdd|didSNunexpected-end-tagr@rrr)r)r*rsz*getPhases..InHeadPhase.endTagOthercSs|tddS)Nr)rrrBr)r)r*rsz+getPhases..InHeadPhase.anythingElseN)r9r:r;rKrrrrrrrrrrrrrrrr)rr)r* InHeadPhases  rcsxeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZdS)z&getPhases..InHeadNoscriptPhasecsf|||td|jfd|jfd|jfg|_|j|j_td|j fd|j fg|_ |j |j _dS)Nr)rrrr5rr)rrrr) rKr rrrstartTagHeadNoscriptrrrendTagNoscriptendTagBrrrrrr)r*rK s z/getPhases..InHeadNoscriptPhase.__init__cSs|jd|dS)Nzeof-in-head-noscriptTrrBr)r)r*r0s z1getPhases..InHeadNoscriptPhase.processEOFcSs|jjd|SNr)rLrIrrr)r)r*r5sz5getPhases..InHeadNoscriptPhase.processCommentcSs|jd||S)Nzchar-in-head-noscriptrrr)r)r*r8s z8getPhases..InHeadNoscriptPhase.processCharacterscSs|jjd|SrrLrIrrr)r)r*r=sz=getPhases..InHeadNoscriptPhase.processSpaceCharacterscSs|jjd|Srrrr)r)r*r@sz3getPhases..InHeadNoscriptPhase.startTagHtmlcSs|jjd|Srrrr)r)r*rCsz>getPhases..InHeadNoscriptPhase.startTagBaseLinkCommandcSs|jdd|didSNunexpected-start-tagr@rrr)r)r*rFsz;getPhases..InHeadNoscriptPhase.startTagHeadNoscriptcSs"|jdd|di||SNzunexpected-inhead-noscript-tagr@rrr)r)r*rIsz4getPhases..InHeadNoscriptPhase.startTagOthercSs"|jjj}|jjd|j_dSrr r r)r)r*rNsz5getPhases..InHeadNoscriptPhase.endTagNoscriptcSs"|jdd|di||Srrrr)r)r*rSsz/getPhases..InHeadNoscriptPhase.endTagBrcSs|jdd|didSr rrr)r)r*rXsz2getPhases..InHeadNoscriptPhase.endTagOthercSs|tddS)Nr)rrrBr)r)r*r[sz3getPhases..InHeadNoscriptPhase.anythingElseN)r9r:r;rKrrrrrrrrrrrrr)rr)r*InHeadNoscriptPhases rcspeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdS)z!getPhases..AfterHeadPhasecsn|||td|jfd|jfd|jfd|jfd|jfg|_|j |j_ td|j fg|_ |j |j _ dS)Nrrr) rrrrr5rrrrr)rrr)rKr rr startTagBodystartTagFramesetstartTagFromHeadrrrrrrrrrr)r*rK`s  z*getPhases..AfterHeadPhase.__init__cSs |dSrrrBr)r)r*rqsz,getPhases..AfterHeadPhase.processEOFcSs ||Sr.rrr)r)r*rusz3getPhases..AfterHeadPhase.processCharacterscSs|jjd|Srrrr)r)r*rysz.getPhases..AfterHeadPhase.startTagHtmlcSs(d|j_|j||jjd|j_dS)NFr)rLrcr>rrIr`rr)r)r*r|s z.getPhases..AfterHeadPhase.startTagBodycSs |j||jjd|j_dS)Nr)r>rrLrIr`rr)r)r*rs z2getPhases..AfterHeadPhase.startTagFramesetcSsr|jdd|di|jj|jj|jjd||jjdddD] }|jdkrL|jj |qnqLdS)Nz#unexpected-start-tag-out-of-my-headr@rrvr) rLrr>r~rrrIrr@remover r)r)r*rs  z2getPhases..AfterHeadPhase.startTagFromHeadcSs|jdd|didSrrrr)r)r*rsz.getPhases..AfterHeadPhase.startTagHeadcSs ||Sr.rrr)r)r*rsz/getPhases..AfterHeadPhase.startTagOthercSs ||Sr.rrr)r)r*rsz2getPhases..AfterHeadPhase.endTagHtmlBodyBrcSs|jdd|didSr rrr)r)r*rsz-getPhases..AfterHeadPhase.endTagOthercSs.|jtdd|jjd|j_d|j_dS)NrrrrT)r>rrrLrIr`rcrBr)r)r*rsz.getPhases..AfterHeadPhase.anythingElseN)r9r:r;rKrrrrrrrrrrrr)rr)r*AfterHeadPhase_s  rcseZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)dOdPZ*dQdRZ+dSdTZ,dUdVZ-dWdXZ.dYdZZ/d[d\Z0d]d^Z1d_d`Z2dadbZ3dcddZ4dedfZ5dgS)hzgetPhases..InBodyPhasec$s||||j|_td|jfd|jfd|jfd|jfd|j ft |j fd|j fd|j fd|jfd |jfd |jfd |jfd |jfd |jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|jfd|j fd|j!fd|j"fd|j#fd|j$fd|j%fd |j&fg!|_'|j(|j'_)td|j*fd|j+fd!|j,fd|j-fd"|j.fd#|j/ft |j0fd$|j1fd|j2fd%|j3fg |_4|j5|j4_)dS)&Nr) rrrrrr5rrrrr)addressarticleaside blockquotecenterdetailsdirr+dlfieldset figcaptionfigurefooterheaderhgroupmainmenunavolr(sectionsummaryul)prelistingform)lidddtrUa) bbigcodeemfontissmallstrikestrongttunobrbutton)ZappletZmarqueeobjectZxmpr)ZarearembedimgkeygenZwbr)ZparamsourceZtrackinputhrimageisindextextareaZiframer)Znoembedrr)rprt)optionoptgroupZmathry) rcolrframerrrrrrr)rrrr rFr!r"Zdialogr#r+r$r%r&r'r(r)r*r3r+r,r-r.r2r/r0r1r()r6r7r5)r8r9r:r;r<r=r>rEr?r@rArBrCrDr)6rKprocessSpaceCharactersNonPrerr rrstartTagProcessInHeadrrstartTagClosePrstartTagHeadingstartTagPreListing startTagFormstartTagListItemstartTagPlaintext startTagAstartTagFormatting startTagNobrstartTagButtonstartTagAppletMarqueeObject startTagXmp startTagTablestartTagVoidFormattingstartTagParamSource startTagInput startTagHr startTagImagestartTagIsIndexstartTagTextareastartTagIFramerstartTagRawtextstartTagSelect startTagRpRt startTagOpt startTagMath startTagSvgstartTagMisplacedrrr endTagBody endTagHtml endTagBlock endTagFormendTagPendTagListItem endTagHeadingendTagFormattingendTagAppletMarqueeObjectrrrrrr)r*rKs- z'getPhases..InBodyPhase.__init__cSs$|j|jko"|j|jko"|j|jkSr.)r@rjrk)rCZnode1Znode2r)r)r*isMatchingFormattingElements    z:getPhases..InBodyPhase.isMatchingFormattingElementcSs|j||jjd}g}|jjdddD](}|tkr@qXq.|||r.||q.t|dkrv|jj|d|jj|dS)Nrv) r>rr~activeFormattingElementsr r~rrr)rCrrnZmatchingElementsrr)r)r*addFormattingElements     z3getPhases..InBodyPhase.addFormattingElementcSs>td}|jjdddD]}|j|kr|jdq:qdS)N) r6r7r5r(rrrrrrrrrvz expected-closing-tag-but-got-eof)rr>r~r@rLr)rCZallowed_elementsrr)r)r*rs   z)getPhases..InBodyPhase.processEOFcSsf|d}|j|_|drH|jjdjdkrH|jjdsH|dd}|rb|j|j|dS)Nrw rv)r2r3rPr) rWrrr>r~r@Z hasContent#reconstructActiveFormattingElementsr)rCrrwr)r)r*!processSpaceCharactersDropNewline s   z@getPhases..InBodyPhase.processSpaceCharactersDropNewlinecSsT|ddkrdS|j|j|d|jjrPtdd|dDrPd|j_dS)NrwcSsg|] }|tkqSr)rr?charr)r)r*rD"szDgetPhases..InBodyPhase.processCharacters..F)r>rrrLrcanyrr)r)r*rs  z0getPhases..InBodyPhase.processCharacterscSs|j|j|ddSr)r>rrrr)r)r*rW&s z;getPhases..InBodyPhase.processSpaceCharactersNonPrecSs|jjd|Srrrr)r)r*rX*sz4getPhases..InBodyPhase.startTagProcessInHeadcSs||jdddit|jjdksx|jjdjdkr6nBd|j_|dD],\}}||jjdjkrJ||jjdj|<qJdS)Nrr@rrFrw) rLrrr>r~r@rcr/rkrr)r)r*r-sz+getPhases..InBodyPhase.startTagBodycSs|jdddit|jjdks|jjdjdkr6np|jjs@nf|jjdjrj|jjdj|jjd|jjdjdkr|jj qj|j ||jj d|j_ dS) Nrr@rrrrvrr) rLrrr>r~r@rcparent removeChildrrrIr`rr)r)r*r8s" z/getPhases..InBodyPhase.startTagFramesetcSs.|jjdddr|td|j|dSNr(rFvariant)r>elementInScoperyrrrr)r)r*rYFsz-getPhases..InBodyPhase.startTagClosePcSs>|jjdddr|td|j|d|j_|j|_dS)Nr(rFrF) r>rryrrrLrcrrrr)r)r*r[Ks  z1getPhases..InBodyPhase.startTagPreListingcSsZ|jjr|jdddin:|jjdddr:|td|j||jjd|j_dS)Nrr@r4r(rFrrv) r> formPointerrLrrryrrr~rr)r)r*r\Rs  z+getPhases..InBodyPhase.startTagFormcSsd|j_dgddgddgd}||d}t|jjD]@}|j|kr^|jjt|jdqx|j t kr6|jdkr6qxq6|jj d d d r|jjtd d|j |dS) NFr5r7r6)r5r7r6r@rs)rr+r(r(rFr) rLrcreversedr>r~r@r`rr nameTuplerrr)rCrZ stopNamesMapZ stopNamesrr)r)r*r][s*    z/getPhases..InBodyPhase.startTagListItemcSs>|jjdddr|td|j||jjj|jj_dSr) r>rryrrrLrOr_r]rr)r)r*r^qs z0getPhases..InBodyPhase.startTagPlaintextcSsb|jjdddr|td|jjdjtkrR|jdd|di|jj |j |dS)Nr(rFrrvrr@) r>rryrr~r@rrLrrrrr)r)r*rZws  z.getPhases..InBodyPhase.startTagHeadingcSs~|jd}|rf|jdddd|td||jjkrL|jj|||jjkrf|jj||j | |dS)Nr8$unexpected-start-tag-implies-end-tagZ startNameZendName) r>!elementInActiveFormattingElementsrLrr|rr~rrrr)rCrZ afeAElementr)r)r*r_s    z(getPhases..InBodyPhase.startTagAcSs|j||dSr.)r>rrrr)r)r*r`s z1getPhases..InBodyPhase.startTagFormattingcSsP|j|jdrB|jdddd|td|j||dS)NrErr)r>rrrLrrrrrr)r)r*ras   z+getPhases..InBodyPhase.startTagNobrcSsT|jdr2|jdddd|td|S|j|j|d|j_dS)NrFrrF) r>rrLrrrrrrcrr)r)r*rbs   z-getPhases..InBodyPhase.startTagButtoncSs0|j|j||jjtd|j_dSNF)r>rrrrr rLrcrr)r)r*rcs  z:getPhases..InBodyPhase.startTagAppletMarqueeObjectcSsB|jjdddr|td|jd|j_|j|ddS)Nr(rFrFr)r>rryrrrLrcrrr)r)r*rds  z*getPhases..InBodyPhase.startTagXmpcSsR|jjdkr*|jjdddr*|td|j|d|j_|jjd|j_ dS)Nrr(rFrFr) rLrZr>rrrrrcrIr`rr)r)r*res   z,getPhases..InBodyPhase.startTagTablecSs6|j|j||jjd|d<d|j_dS)NTr|F)r>rrr~rrLrcrr)r)r*rfs    z5getPhases..InBodyPhase.startTagVoidFormattingcSs@|jj}||d|dkr<|ddtdkr<||j_dS)Nr3rwhidden)rLrcrfrlr)rCrrcr)r)r*rhs   z,getPhases..InBodyPhase.startTagInputcSs$|j||jjd|d<dSrrrr)r)r*rgs  z2getPhases..InBodyPhase.startTagParamSourcecSsJ|jjdddr|td|j||jjd|d<d|j_dS)Nr(rFrTr|F) r>rryrrr~rrLrcrr)r)r*ris   z)getPhases..InBodyPhase.startTagHrcSs6|jdddd|tdd|d|dddS) Nzunexpected-start-tag-treated-asrNrIZ originalNameZnewNamerrrwr{rkr{)rLrrrrr)r)r*rjs z,getPhases..InBodyPhase.startTagImagecSs|jdddi|jjrdSi}d|dkr>|dd|d<|tdd|d|td d|td dd |dkr|dd }nd }|td |d|d}d|kr|d=d |kr|d =d|d<|tdd||dd| td |td d| tddS)Nzdeprecated-tagr@rOactionrwr4rr)rkrMZlabelpromptz3This is a searchable index. Enter search keywords: rqr3rwrLr{r) rLrr>rrrrrcopyr)rCrZ form_attrsrrkr)r)r*rks<      z.getPhases..InBodyPhase.startTagIsIndexcSs0|j||jjj|jj_|j|_d|j_dSr) r>rrLrOr\r]rrrcrr)r)r*rls z/getPhases..InBodyPhase.startTagTextareacSsd|j_||dSr)rLrcrnrr)r)r*rmsz-getPhases..InBodyPhase.startTagIFramecSs"|jjr||n ||dSr.)rLrNrnrrr)r)r*rs z/getPhases..InBodyPhase.startTagNoscriptcSs|j|ddS)z8iframe, noembed noframes, noscript(if scripting enabled)rNrrr)r)r*rn sz.getPhases..InBodyPhase.startTagRawtextcSs@|jjdjdkr$|jjtd|j|jj|dSNrvrS) r>r~r@rLr`rrrrrr)r)r*rqs z*getPhases..InBodyPhase.startTagOptcSs|j|j|d|j_|jj|jjd|jjd|jjd|jjd|jjd|jjdfkrx|jjd|j_n|jjd |j_dS) NFrrrrrrinSelectInTabler)r>rrrLrcr`rIrr)r)r*ros       z-getPhases..InBodyPhase.startTagSelectcSsB|jdr2|j|jjdjdkr2|j|j|dS)Nrubyrv)r>rgenerateImpliedEndTagsr~r@rLrrrr)r)r*rp%s    z+getPhases..InBodyPhase.startTagRpRtcSsZ|j|j||j|td|d<|j||drV|jjd|d<dS)Nrhrjr{Tr|) r>rrLrrrrr~rrr)r)r*rr,s      z+getPhases..InBodyPhase.startTagMathcSsZ|j|j||j|td|d<|j||drV|jjd|d<dS)Nryrjr{Tr|) r>rrLrrrrr~rrr)r)r*rs8s      z*getPhases..InBodyPhase.startTagSvgcSs|jdd|didS)a5 Elements that should be children of other elements that have a different insertion mode; here they are ignored "caption", "col", "colgroup", "frame", "frameset", "head", "option", "optgroup", "tbody", "td", "tfoot", "th", "thead", "tr", "noscript" zunexpected-start-tag-ignoredr@Nrrr)r)r*rtDsz0getPhases..InBodyPhase.startTagMisplacedcSs|j|j|dSr.)r>rrrr)r)r*rMs z,getPhases..InBodyPhase.startTagOthercSs|jjdddsD|tdd|jdddi|tddnT|jd|jjdj dkrt|jdddi|jj }|j dkr|jj }qdS) Nr(rFrrrr r@rsrv) r>rrYrrLrryrr~r@rr r)r)r*ryQs   z&getPhases..InBodyPhase.endTagPcSs~|jds|jdS|jjdjdkrj|jjddD],}|jtdkr<|jdd|jdqjq<|jjd|j_dS)Nrrv)r6r7r5rTrSr(rQrRrrrrrrrr$expected-one-end-tag-but-got-anotherZgotNameZ expectedName afterBody) r>rrLrr~r@rrIr`r r)r)r*ru^s   z)getPhases..InBodyPhase.endTagBodycSs"|jdr|td|SdS)Nr)r>rrurrr)r)r*rvps z)getPhases..InBodyPhase.endTagHtmlcSs|ddkr|j|_|j|d}|r2|j|jjdj|dkr^|jdd|di|r|jj }|j|dkr|jj }qndS)Nr@r2rvend-tag-too-early) rWrr>rrr~r@rLrr)rCrZinScoperr)r)r*rwvs   z*getPhases..InBodyPhase.endTagBlockcSsv|jj}d|j_|dks$|j|s8|jdddin:|j|jjd|krd|jdddi|jj|dS)Nr r@r4rvzend-tag-too-early-ignored)r>rrrLrrr~rr r)r)r*rxs z)getPhases..InBodyPhase.endTagFormcSs|ddkrd}nd}|jj|d|dsB|jdd|dinf|jj|dd|jjdj|dkr|jdd|di|jj}|j|dkr|jj}qdS) Nr@r5listrr excludervr)r>rrLrrr~r@r)rCrrrr)r)r*rzs   z-getPhases..InBodyPhase.endTagListItemcSstD]}|j|r|jq$q|jjdj|dkrP|jdd|ditD]8}|j|rT|jj}|jtkr|jj}qpqqTdS)Nrvr@r) rr>rrr~r@rLrr)rCritemr)r)r*r{s     z,getPhases..InBodyPhase.endTagHeadingcSsd}|dkr |d7}|j|d}|rD||jjkrR|j|jsR||dS||jjkr|jdd|di|jj |dS|j|js|jdd|didS||jjdkr|jd d|di|jj |}d}|jj|dD]}|j t kr|}qq|dkrR|jj }||kr@|jj }q&|jj |dS|jj|d}|jj |}|} } d} |jj | } | d krX| d7} | d8} |jj| } | |jjkr|jj | q| |krސqX| |kr|jj | d}| } | |jj|jj | <| |jj|jj | <| } | jrF| j| | | | } q| jrl| j| |jtd kr|j\}}|| |n || |} || || |jj ||jj|| |jj ||jj|jj |d| qdS) z)The much-feared adoption agency algorithmrrr@Nzadoption-agency-1.2zadoption-agency-4.4rvzadoption-agency-1.3rrrrrr)r>rr~rr@rrLrrrindexrrrZ cloneNoderrZ appendChildrZgetTableMisnestedNodePosition insertBeforeZreparentChildreninsert)rCrZouterLoopCounterZformattingElementZafeIndexZ furthestBlockrnZcommonAncestorZbookmarkZlastNoderZinnerLoopCounterrZclonerrr)r)r*r|s                      z/getPhases..InBodyPhase.endTagFormattingcSs|j|dr|j|jjdj|dkrF|jdd|di|j|dr|jj}|j|dkr~|jj}qb|jdS)Nr@rvr) r>rrr~r@rLrrclearActiveFormattingElements)rCrrnr)r)r*r}Ts  z8getPhases..InBodyPhase.endTagAppletMarqueeObjectcSs@|jdddd|j|jtdd|jjdS)Nzunexpected-end-tag-treated-asrz br elementrrr)rLrr>rrrr~rrr)r)r*r`s  z'getPhases..InBodyPhase.endTagBrcSs|jjdddD]}|j|dkrz|jj|dd|jjdj|dkrb|jdd|di|jj|krtqbqq|jtkr|jdd|diqqdS)Nrvr@rr ) r>r~r@rrLrrrrr r)r)r*rgs z*getPhases..InBodyPhase.endTagOtherN)6r9r:r;rKr~rrrrrWrXrrrYr[r\r]r^rZr_r`rarbrcrdrerfrhrgrirjrkrlrmrrnrqrorprrrsrtrryrurvrwrxrzr{r|r}rrr)rr)r* InBodyPhasesh G             $ rcs@eZdZfddZddZddZddZd d Zd d Zd S)zgetPhases..TextPhasecsF|||tg|_|j|j_td|jfg|_|j|j_dS)Nr) rKr rrrr endTagScriptrrrrr)r*rKvs  z%getPhases..TextPhase.__init__cSs|j|ddSrrrr)r)r*r~sz.getPhases..TextPhase.processCharacterscSs8|jdd|jjdji|jj|jj|j_dS)Nz&expected-named-closing-tag-but-got-eofr@rvT)rLrr>r~r@rrr`rBr)r)r*rs   z'getPhases..TextPhase.processEOFcSsdSr.r)rr)r)r*rsz*getPhases..TextPhase.startTagOthercSs|jj}|jj|j_dSr.r>r~rrLrr`r r)r)r*rs z)getPhases..TextPhase.endTagScriptcSs|jj|jj|j_dSr.rrr)r)r*rs z(getPhases..TextPhase.endTagOtherN) r9r:r;rKrrrrrr)rr)r* TextPhaseus  rcseZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'S)(zgetPhases..InTablePhasec s|||td|jfd|jfd|jfd|jfd|jfd|jfd|j fd|j fd |j fd |j fg |_ |j|j _td|jfd |jfg|_|j|j_dS) NrrrrUrrr)rrrr)rrrLr4) rrrUrrrrrrrr)rKr rrstartTagCaptionstartTagColgroup startTagColstartTagRowGroupstartTagImplyTbodyrestartTagStyleScriptrhr\rrr endTagTable endTagIgnorerrrrr)r*rKs* z(getPhases..InTablePhase.__init__cSs$|jjdjdkr |jjqdS)Nrv)rrr>r~r@rrBr)r)r*clearStackToTableContextsz8getPhases..InTablePhase.clearStackToTableContextcSs$|jjdjdkr |jdndS)Nrvrz eof-in-tabler>r~r@rLrrBr)r)r*rsz*getPhases..InTablePhase.processEOFcSs4|jj}|jjd|j_||jj_|jj|dSN inTableText)rLr`rIrrrCrrr)r)r*rs z6getPhases..InTablePhase.processSpaceCharacterscSs4|jj}|jjd|j_||jj_|jj|dSr)rLr`rIrrrr)r)r*rs z1getPhases..InTablePhase.processCharacterscSs&d|j_|jjd|d|j_dS)NTrF)r>insertFromTablerLrIrrr)r)r*rsz*getPhases..InTablePhase.insertTextcSs6||jjt|j||jjd|j_dS)Nr) rr>rrr rrLrIr`rr)r)r*rs z/getPhases..InTablePhase.startTagCaptioncSs(||j||jjd|j_dS)Nrrr>rrLrIr`rr)r)r*rs z0getPhases..InTablePhase.startTagColgroupcSs|tdd|S)Nrrr)rrrr)r)r*rsz+getPhases..InTablePhase.startTagColcSs(||j||jjd|j_dSNrrrr)r)r*rs z0getPhases..InTablePhase.startTagRowGroupcSs|tdd|S)Nrrr)rrrr)r)r*rsz2getPhases..InTablePhase.startTagImplyTbodycSs6|jdddd|jjtd|jjs2|SdS)Nrrr)rLrr`rrrSrr)r)r*res z-getPhases..InTablePhase.startTagTablecSs|jjd|Srrrr)r)r*rsz3getPhases..InTablePhase.startTagStyleScriptcSsVd|dkrH|ddtdkrH|jd|j||jjn ||dS)Nr3rwrz unexpected-hidden-input-in-table) rlrrLrr>rr~rrrr)r)r*rhs   z-getPhases..InTablePhase.startTagInputcSsD|jd|jjdkr@|j||jjd|j_|jjdS)Nzunexpected-form-in-tablerv)rLrr>rrr~rrr)r)r*r\s    z,getPhases..InTablePhase.startTagFormcSs<|jdd|did|j_|jjd|d|j_dS)Nz)unexpected-start-tag-implies-table-voodoor@TrF)rLrr>rrIrrr)r)r*rsz-getPhases..InTablePhase.startTagOthercSs|jjdddr|j|jjdjdkrJ|jdd|jjdjd|jjdjdkrj|jjqJ|jj|jn |jdS)Nrrrvzend-tag-too-early-namedr) r>rrr~r@rLrrrbrr)r)r*r s    z+getPhases..InTablePhase.endTagTablecSs|jdd|didSr rrr)r)r*rsz,getPhases..InTablePhase.endTagIgnorecSs<|jdd|did|j_|jjd|d|j_dS)Nz'unexpected-end-tag-implies-table-voodoor@TrF)rLrr>rrIrrr)r)r*r sz+getPhases..InTablePhase.endTagOtherN)r9r:r;rKrrrrrrrrrrrerrhr\rrrrr)rr)r* InTablePhases&   rcsPeZdZfddZddZddZddZd d Zd d Zd dZ ddZ dS)z#getPhases..InTableTextPhasecs|||d|_g|_dSr.)rKrcharacterTokensrrr)r*rK(sz,getPhases..InTableTextPhase.__init__cSsdddd|jD}tdd|DrJtd|d}|jjd|n|rZ|j|g|_dS)NrcSsg|] }|dqS)rwr)r?rr)r)r*rD.szGgetPhases..InTableTextPhase.flushCharacters..cSsg|] }|tkqSr)rrr)r)r*rD/srqrr)joinrrrrLrIrr>)rCrwrr)r)r*flushCharacters-s z3getPhases..InTableTextPhase.flushCharacterscSs||j|j_|Sr.rrrLr`rr)r)r*r6s z2getPhases..InTableTextPhase.processCommentcSs||j|j_dSrrrBr)r)r*r;s z.getPhases..InTableTextPhase.processEOFcSs |ddkrdS|j|dSNrwrrrrr)r)r*r@s z5getPhases..InTableTextPhase.processCharacterscSs|j|dSr.rrr)r)r*rEsz:getPhases..InTableTextPhase.processSpaceCharacterscSs||j|j_|Sr.rrr)r)r*rJs z3getPhases..InTableTextPhase.processStartTagcSs||j|j_|Sr.rrr)r)r*rOs z1getPhases..InTableTextPhase.processEndTagN) r9r:r;rKrrrrrrrr)rr)r*InTableTextPhase's  rcs`eZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ dS)z!getPhases..InCaptionPhasecsf|||td|jfd|jfg|_|j|j_td|jfd|j fd|j fg|_ |j |j _dS)Nr rrUrrrrrrrrr) rrUrrrrrrrr) rKr rrstartTagTableElementrrr endTagCaptionrrrrrrr)r*rKVs  z*getPhases..InCaptionPhase.__init__cSs|jjddd S)Nrrrr>rrBr)r)r*ignoreEndTagCaptionhsz5getPhases..InCaptionPhase.ignoreEndTagCaptioncSs|jjddSrrLrIrrBr)r)r*rksz,getPhases..InCaptionPhase.processEOFcSs|jjd|SrrLrIrrr)r)r*rnsz3getPhases..InCaptionPhase.processCharacterscSs0|j|}|jjtd|s,|SdSNrrLrrr`rrrCr ignoreEndTagr)r)r*rqs  z6getPhases..InCaptionPhase.startTagTableElementcSs|jjd|Srrrr)r)r*rysz/getPhases..InCaptionPhase.startTagOthercSs|s|j|jjdjdkrB|jdd|jjdjd|jjdjdkrb|jjqB|jj|j|jj d|j_ n |jdS)Nrvrrrr) rr>rr~r@rLrrrrIr`rr)r)r*r|s    z/getPhases..InCaptionPhase.endTagCaptioncSs0|j|}|jjtd|s,|SdSrrrr)r)r*rs  z-getPhases..InCaptionPhase.endTagTablecSs|jdd|didSr rrr)r)r*rsz.getPhases..InCaptionPhase.endTagIgnorecSs|jjd|SrrLrIrrr)r)r*rsz-getPhases..InCaptionPhase.endTagOtherN) r9r:r;rKrrrrrrrrrr)rr)r*InCaptionPhaseTs rcsXeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)z%getPhases..InColumnGroupPhasecs^|||td|jfd|jfg|_|j|j_td|jfd|j fg|_ |j |j _dS)NrrUr) rKr rrrrrrendTagColgroup endTagColrrrrr)r*rKs z.getPhases..InColumnGroupPhase.__init__cSs|jjdjdkS)Nrvr)r>r~r@rBr)r)r*ignoreEndTagColgroupsz:getPhases..InColumnGroupPhase.ignoreEndTagColgroupcSs8|jjdjdkrdS|}|td|s4dSdS)NrvrrT)r>r~r@rrr)rCrr)r)r*rs z0getPhases..InColumnGroupPhase.processEOFcSs"|}|td|s|SdSNrrrrrr)r)r*rsz7getPhases..InColumnGroupPhase.processCharacterscSs$|j||jjd|d<dSrrrr)r)r*rs  z1getPhases..InColumnGroupPhase.startTagColcSs"|}|td|s|SdSrrrr)r)r*rsz3getPhases..InColumnGroupPhase.startTagOthercSs4|r|jn|jj|jjd|j_dSNr)rrLrr>r~rrIr`rr)r)r*rs  z4getPhases..InColumnGroupPhase.endTagColgroupcSs|jdddidS)Nz no-end-tagr@rUrrr)r)r*rsz/getPhases..InColumnGroupPhase.endTagColcSs"|}|td|s|SdSrrrr)r)r*rsz1getPhases..InColumnGroupPhase.endTagOtherN) r9r:r;rKrrrrrrrrr)rr)r*InColumnGroupPhases   rcsxeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZdS)z#getPhases..InTableBodyPhasecsv|||td|jfd|jfd|jfd|jfg|_|j|j_ td|j fd|j fd|j fg|_ |j|j _ dS)Nrrrr)rrUrrrrrr)rrrUrrrrr)rKr rr startTagTrstartTagTableCellstartTagTableOtherrrrendTagTableRowGrouprrrrrrr)r*rKs$ z,getPhases..InTableBodyPhase.__init__cSs6|jjdjdkr |jjq|jjdjdkr2dS)Nrv)rrrrrrrBr)r)r*clearStackToTableBodyContextsz@getPhases..InTableBodyPhase.clearStackToTableBodyContextcSs|jjddSrrrBr)r)r*rsz.getPhases..InTableBodyPhase.processEOFcSs|jjd|Srrrr)r)r*rsz:getPhases..InTableBodyPhase.processSpaceCharacterscSs|jjd|Srrrr)r)r*rsz5getPhases..InTableBodyPhase.processCharacterscSs(||j||jjd|j_dS)Nr)rr>rrLrIr`rr)r)r*rs z.getPhases..InTableBodyPhase.startTagTrcSs*|jdd|di|tdd|S)Nzunexpected-cell-in-table-bodyr@rrr)rLrrrrr)r)r*r s  z5getPhases..InTableBodyPhase.startTagTableCellcSsb|jjddds0|jjddds0|jjdddrT||t|jjdj|S|jdSNrrrrrrv r>rrrrr~r@rLrrr)r)r*rsz6getPhases..InTableBodyPhase.startTagTableOthercSs|jjd|Srrrr)r)r*rsz1getPhases..InTableBodyPhase.startTagOthercSsT|jj|dddr:||jj|jjd|j_n|jdd|didS)Nr@rrr unexpected-end-tag-in-table-body) r>rrr~rrLrIr`rrr)r)r*r"s  z7getPhases..InTableBodyPhase.endTagTableRowGroupcSsb|jjddds0|jjddds0|jjdddrT||t|jjdj|S|jdSrrrr)r)r*r+sz/getPhases..InTableBodyPhase.endTagTablecSs|jdd|didS)Nrr@rrr)r)r*r8s z0getPhases..InTableBodyPhase.endTagIgnorecSs|jjd|Srrrr)r)r*r<sz/getPhases..InTableBodyPhase.endTagOtherN)r9r:r;rKrrrrrrrrrrrrr)rr)r*InTableBodyPhases    rcseZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)zgetPhases..InRowPhasecsv|||td|jfd|jfd|jfg|_|j|j_td|j fd|j fd|j fd|j fg|_ |j|j _dS)Nrr)rrUrrrrrrrr)rrrUrrrr)rKr rrrrrrrendTagTrrrrrrrrr)r*rKAs$ z&getPhases..InRowPhase.__init__cSs@|jjdjdkr<|jdd|jjdji|jjqdS)Nrv)rrz'unexpected-implied-end-tag-in-table-rowr@)r>r~r@rLrrrBr)r)r*clearStackToTableRowContextUs z9getPhases..InRowPhase.clearStackToTableRowContextcSs|jjddd S)NrrrrrBr)r)r*ignoreEndTagTr[sz,getPhases..InRowPhase.ignoreEndTagTrcSs|jjddSrrrBr)r)r*r_sz(getPhases..InRowPhase.processEOFcSs|jjd|Srrrr)r)r*rbsz4getPhases..InRowPhase.processSpaceCharacterscSs|jjd|Srrrr)r)r*resz/getPhases..InRowPhase.processCharacterscSs6||j||jjd|j_|jjtdS)Nr) rr>rrLrIr`rrr rr)r)r*rhs z/getPhases..InRowPhase.startTagTableCellcSs"|}|td|s|SdSNrrrrrr)r)r*rnsz0getPhases..InRowPhase.startTagTableOthercSs|jjd|Srrrr)r)r*rusz+getPhases..InRowPhase.startTagOthercSs<|s.||jj|jjd|j_n |jdSr) rrr>r~rrLrIr`rrr)r)r*rxs  z&getPhases..InRowPhase.endTagTrcSs"|}|td|s|SdSrrrr)r)r*rsz)getPhases..InRowPhase.endTagTablecSs4|jj|dddr&|td|S|jdS)Nr@rrr)r>rrrrLrrr)r)r*rsz1getPhases..InRowPhase.endTagTableRowGroupcSs|jdd|didS)Nzunexpected-end-tag-in-table-rowr@rrr)r)r*rs z*getPhases..InRowPhase.endTagIgnorecSs|jjd|Srrrr)r)r*rsz)getPhases..InRowPhase.endTagOtherN)r9r:r;rKrrrrrrrrrrrrrr)rr)r* InRowPhase?s  rcs`eZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ dS)zgetPhases..InCellPhasecsf|||td|jfd|jfg|_|j|j_td|jfd|j fd|j fg|_ |j |j _dS)Nrrr)rrrUrrr) rKr rrrrrrendTagTableCellr endTagImplyrrrrr)r*rKs z'getPhases..InCellPhase.__init__cSsB|jjdddr |tdn|jjdddr>|tddSNrrrr)r>rrrrBr)r)r* closeCellsz(getPhases..InCellPhase.closeCellcSs|jjddSrrrBr)r)r*rsz)getPhases..InCellPhase.processEOFcSs|jjd|Srrrr)r)r*rsz0getPhases..InCellPhase.processCharacterscSs:|jjddds |jjdddr,||S|jdSrr>rrrLrrr)r)r*rs z1getPhases..InCellPhase.startTagTableOthercSs|jjd|Srrrr)r)r*rsz,getPhases..InCellPhase.startTagOthercSs|jj|dddr|j|d|jjdj|dkrp|jdd|di|jj}|j|dkrPq|qPn |jj|j|jj d|j_ n|jdd|didS)Nr@rrrvzunexpected-cell-end-tagrr ) r>rrr~r@rLrrrrIr`r r)r)r*rs    z.getPhases..InCellPhase.endTagTableCellcSs|jdd|didSr rrr)r)r*rsz+getPhases..InCellPhase.endTagIgnorecSs.|jj|dddr ||S|jdS)Nr@rrrrr)r)r*rsz*getPhases..InCellPhase.endTagImplycSs|jjd|Srrrr)r)r*rsz*getPhases..InCellPhase.endTagOtherN) r9r:r;rKrrrrrrrrrr)rr)r* InCellPhases  rcsxeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZdS)z getPhases..InSelectPhasec s|||td|jfd|jfd|jfd|jfd|jfd|jfg|_ |j |j _ td|j fd|j fd|jfg|_|j|j_ dS)NrrSrTr)rLrJrPr)rKr rrstartTagOptionstartTagOptgrouprorhrrrr endTagOptionendTagOptgroup endTagSelectrrrrr)r*rKs  z)getPhases..InSelectPhase.__init__cSs$|jjdjdkr |jdndS)Nrvrz eof-in-selectrrBr)r)r*rsz+getPhases..InSelectPhase.processEOFcSs$|ddkrdS|j|ddSrrrr)r)r*r s z2getPhases..InSelectPhase.processCharacterscSs.|jjdjdkr|jj|j|dSrr>r~r@rrrr)r)r*r s z/getPhases..InSelectPhase.startTagOptioncSsL|jjdjdkr|jj|jjdjdkr<|jj|j|dS)NrvrSrTrrr)r)r*r s   z1getPhases..InSelectPhase.startTagOptgroupcSs|jd|tddS)Nzunexpected-select-in-selectr)rLrrrrr)r)r*ro s z/getPhases..InSelectPhase.startTagSelectcSs2|jd|jjdddr.|td|SdS)Nzunexpected-input-in-selectrr)rLrr>rrrrr)r)r*rh s  z.getPhases..InSelectPhase.startTagInputcSs|jjd|Srrrr)r)r*r sz/getPhases..InSelectPhase.startTagScriptcSs|jdd|didS)Nzunexpected-start-tag-in-selectr@rrr)r)r*r! s z.getPhases..InSelectPhase.startTagOthercSs6|jjdjdkr |jjn|jdddidS)NrvrSunexpected-end-tag-in-selectr@r>r~r@rrLrrr)r)r*r% s z-getPhases..InSelectPhase.endTagOptioncSsf|jjdjdkr0|jjdjdkr0|jj|jjdjdkrP|jjn|jdddidS)NrvrSrTrr@rrr)r)r*r, s z/getPhases..InSelectPhase.endTagOptgroupcSsN|jjdddr@|jj}|jdkr4|jj}q|jn |jdS)Nrr)r>rr~rr@rLrbrr r)r)r*r9 s    z-getPhases..InSelectPhase.endTagSelectcSs|jdd|didS)Nrr@rrr)r)r*rD s z,getPhases..InSelectPhase.endTagOtherN)r9r:r;rKrrrrrorhrrrrrrr)rr)r* InSelectPhases   rcsHeZdZfddZddZddZddZd d Zd d Zd dZ dS)z'getPhases..InSelectInTablePhasecsN|||td|jfg|_|j|j_td|jfg|_|j |j_dS)N)rrrrrrrr) rKr rrerrrrrrrrr)r*rKI s z0getPhases..InSelectInTablePhase.__init__cSs|jjddSNrrrBr)r)r*rX sz2getPhases..InSelectInTablePhase.processEOFcSs|jjd|Srrrr)r)r*r[ sz9getPhases..InSelectInTablePhase.processCharacterscSs(|jdd|di|td|S)Nz5unexpected-table-element-start-tag-in-select-in-tabler@r)rLrrrrr)r)r*re^ sz5getPhases..InSelectInTablePhase.startTagTablecSs|jjd|Srrrr)r)r*rc sz5getPhases..InSelectInTablePhase.startTagOthercSs@|jdd|di|jj|dddr<|td|SdS)Nz3unexpected-table-element-end-tag-in-select-in-tabler@rrr)rLrr>rrrrr)r)r*rf sz3getPhases..InSelectInTablePhase.endTagTablecSs|jjd|Srrrr)r)r*rl sz3getPhases..InSelectInTablePhase.endTagOtherN) r9r:r;rKrrrerrrr)rr)r*InSelectInTablePhaseH s rc-seZdZeddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,g,Zfd-d.Zd/d0Zfd1d2Zd3d4Zd5d6Z d7S)8z(getPhases..InForeignContentPhaser9r:r rrr!r;r6r+r$r7r<rHZh1Zh2Zh3Zh4Zh5Zh6rrMr>rIr5r3r,r5rEr.r(r2rr?r@spanrBrAsubZsuprrCrDr1varcs|||dSr.)rKrrr)r*rKy sz1getPhases..InForeignContentPhase.__init__c%Ssnddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%$}|d&|krj||d&|d&<dS)'NZaltGlyphZ altGlyphDefZ altGlyphItemZ animateColorZ animateMotionZanimateTransformZclipPathZfeBlendZ feColorMatrixZfeComponentTransferZ feCompositeZfeConvolveMatrixZfeDiffuseLightingZfeDisplacementMapZfeDistantLightZfeFloodZfeFuncAZfeFuncBZfeFuncGZfeFuncRZfeGaussianBlurZfeImageZfeMergeZ feMergeNodeZ feMorphologyZfeOffsetZ fePointLightZfeSpecularLightingZ feSpotLightZfeTileZ feTurbulenceZ foreignObjectZglyphRefZlinearGradientZradialGradientZtextPath)$ZaltglyphZ altglyphdefZ altglyphitemZ animatecolorZ animatemotionZanimatetransformZclippathZfeblendZ fecolormatrixZfecomponenttransferZ fecompositeZfeconvolvematrixZfediffuselightingZfedisplacementmapZfedistantlightZfefloodZfefuncaZfefuncbZfefuncgZfefuncrZfegaussianblurZfeimageZfemergeZ femergenodeZ femorphologyZfeoffsetZ fepointlightZfespecularlightingZ fespotlightZfetileZ feturbulenceZ foreignobjectZglyphrefZlineargradientZradialgradientZtextpathr@r))rCr replacementsr)r)r*adjustSVGTagNames| sN% z:getPhases..InForeignContentPhase.adjustSVGTagNamescsL|ddkrd|d<n&|jjr.InForeignContentPhase.processCharacters..F)rLrcrrrrr)r*r s  z:getPhases..InForeignContentPhase.processCharacterscSs.|jjd}|d|jksD|ddkrt|dtdddg@r|jdd|di|jjdj|jjkr|j |jjds|j |jjds|jj qZ|S|jt d kr|j |n$|jt d kr|||j||j||j|d <|j||d r*|jj d |d<dS)Nrvr@r=rwZcolorZfacesizez*unexpected-html-element-in-foreign-contentrhryrjr{Tr|)r>r~breakoutElementssetkeysrLrrjrrorprrrr rrr)rCrrr)r)r*r s:           z8getPhases..InForeignContentPhase.processStartTagcSst|jjd}|jjd}|jt|dkrF|jdd|di|jt|dkr|jj|jj dkr|jj |jjj |j_|jj |krqd}q|d8}|jj|}|j |jjkrqFqF|jj|}qqF|S)Nrrvr@r r)rr>r~r@rlrrLrr`rIrrrrjrr)rCrZ nodeIndexrrr)r)r*r s&   z6getPhases..InForeignContentPhase.processEndTagN) r9r:r;rr rKr rrrr)rr)r*InForeignContentPhaseo s\  ) rcsPeZdZfddZddZddZddZd d Zd d Zd dZ ddZ dS)z!getPhases..AfterBodyPhasecsN|||td|jfg|_|j|j_td|jfg|_|j |j_dSNr) rKr rrrrrrvrrrrr)r*rK s z*getPhases..AfterBodyPhase.__init__cSsdSr.r)rBr)r)r*r sz,getPhases..AfterBodyPhase.processEOFcSs|j||jjddS)Nrrrr)r)r*r sz0getPhases..AfterBodyPhase.processCommentcSs |jd|jjd|j_|S)Nzunexpected-char-after-bodyrrLrrIr`rr)r)r*r s z3getPhases..AfterBodyPhase.processCharacterscSs|jjd|Srrrr)r)r*r sz.getPhases..AfterBodyPhase.startTagHtmlcSs*|jdd|di|jjd|j_|S)Nzunexpected-start-tag-after-bodyr@rrrr)r)r*r s  z/getPhases..AfterBodyPhase.startTagOthercSs*|jjr|jdn|jjd|j_dS)Nz'unexpected-end-tag-after-body-innerhtmlafterAfterBody)rLrSrrIr`)rCr@r)r)r*rv sz,getPhases..AfterBodyPhase.endTagHtmlcSs*|jdd|di|jjd|j_|S)Nzunexpected-end-tag-after-bodyr@rrrr)r)r*r s  z-getPhases..AfterBodyPhase.endTagOtherN) r9r:r;rKrrrrrrvrr)rr)r*AfterBodyPhase s rcsXeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)z"getPhases..InFramesetPhasecsf|||td|jfd|jfd|jfd|jfg|_|j|j_ td|j fg|_ |j |j _ dS)NrrrVr) rKr rrr startTagFramestartTagNoframesrrrendTagFramesetrrrrr)r*rK s z+getPhases..InFramesetPhase.__init__cSs$|jjdjdkr |jdndS)Nrvrzeof-in-framesetrrBr)r)r*r# sz-getPhases..InFramesetPhase.processEOFcSs|jddS)Nzunexpected-char-in-framesetrrr)r)r*r) sz4getPhases..InFramesetPhase.processCharacterscSs|j|dSr.)r>rrr)r)r*r, sz3getPhases..InFramesetPhase.startTagFramesetcSs|j||jjdSr.rrr)r)r*r/ s z0getPhases..InFramesetPhase.startTagFramecSs|jjd|Srrrr)r)r*r3 sz3getPhases..InFramesetPhase.startTagNoframescSs|jdd|didS)Nz unexpected-start-tag-in-framesetr@rrr)r)r*r6 s z0getPhases..InFramesetPhase.startTagOthercSsZ|jjdjdkr |jdn |jj|jjsV|jjdjdkrV|jjd|j_dS)Nrvrz)unexpected-frameset-in-frameset-innerhtmlr afterFrameset) r>r~r@rLrrrSrIr`rr)r)r*r: s z1getPhases..InFramesetPhase.endTagFramesetcSs|jdd|didS)Nzunexpected-end-tag-in-framesetr@rrr)r)r*rF s z.getPhases..InFramesetPhase.endTagOtherN) r9r:r;rKrrrrrrrrr)rr)r*InFramesetPhase s  rcsHeZdZfddZddZddZddZd d Zd d Zd dZ dS)z%getPhases..AfterFramesetPhasecsV|||td|jfd|jfg|_|j|j_td|jfg|_ |j |j _dSNrr) rKr rrrrrrrvrrrrr)r*rKL s z.getPhases..AfterFramesetPhase.__init__cSsdSr.r)rBr)r)r*rZ sz0getPhases..AfterFramesetPhase.processEOFcSs|jddS)Nzunexpected-char-after-framesetrrr)r)r*r^ sz7getPhases..AfterFramesetPhase.processCharacterscSs|jjd|Srrrr)r)r*ra sz6getPhases..AfterFramesetPhase.startTagNoframescSs|jdd|didS)Nz#unexpected-start-tag-after-framesetr@rrr)r)r*rd s z3getPhases..AfterFramesetPhase.startTagOthercSs|jjd|j_dS)NafterAfterFrameset)rLrIr`rr)r)r*rvh sz0getPhases..AfterFramesetPhase.endTagHtmlcSs|jdd|didS)Nz!unexpected-end-tag-after-framesetr@rrr)r)r*rk s z1getPhases..AfterFramesetPhase.endTagOtherN) r9r:r;rKrrrrrvrr)rr)r*AfterFramesetPhaseJ s rcsPeZdZfddZddZddZddZd d Zd d Zd dZ ddZ dS)z&getPhases..AfterAfterBodyPhasecs0|||td|jfg|_|j|j_dSr)rKr rrrrrrrr)r*rKp s z/getPhases..AfterAfterBodyPhase.__init__cSsdSr.r)rBr)r)r*rx sz1getPhases..AfterAfterBodyPhase.processEOFcSs|j||jjdSr.rrr)r)r*r{ sz5getPhases..AfterAfterBodyPhase.processCommentcSs|jjd|Srrrr)r)r*r~ sz=getPhases..AfterAfterBodyPhase.processSpaceCharacterscSs |jd|jjd|j_|S)Nexpected-eof-but-got-charrrrr)r)r*r s z8getPhases..AfterAfterBodyPhase.processCharacterscSs|jjd|Srrrr)r)r*r sz3getPhases..AfterAfterBodyPhase.startTagHtmlcSs*|jdd|di|jjd|j_|S)Nexpected-eof-but-got-start-tagr@rrrr)r)r*r s  z4getPhases..AfterAfterBodyPhase.startTagOthercSs*|jdd|di|jjd|j_|S)Nexpected-eof-but-got-end-tagr@rrrr)r)r*r s  z4getPhases..AfterAfterBodyPhase.processEndTagN) r9r:r;rKrrrrrrrr)rr)r*AfterAfterBodyPhaseo s rcsXeZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)z*getPhases..AfterAfterFramesetPhasecs8|||td|jfd|jfg|_|j|j_dSr)rKr rrstartTagNoFramesrrrrrr)r*rK s z3getPhases..AfterAfterFramesetPhase.__init__cSsdSr.r)rBr)r)r*r sz5getPhases..AfterAfterFramesetPhase.processEOFcSs|j||jjdSr.rrr)r)r*r sz9getPhases..AfterAfterFramesetPhase.processCommentcSs|jjd|Srrrr)r)r*r szAgetPhases..AfterAfterFramesetPhase.processSpaceCharacterscSs|jddS)Nrrrr)r)r*r sz.AfterAfterFramesetPhase.processCharacterscSs|jjd|Srrrr)r)r*r sz7getPhases..AfterAfterFramesetPhase.startTagHtmlcSs|jjd|Srrrr)r)r*r  sz;getPhases..AfterAfterFramesetPhase.startTagNoFramescSs|jdd|didS)Nrr@rrr)r)r*r s z8getPhases..AfterAfterFramesetPhase.startTagOthercSs|jdd|didS)Nrr@rrr)r)r*r s z8getPhases..AfterAfterFramesetPhase.processEndTagN) r9r:r;rKrrrrrr rrr)rr)r*AfterAfterFramesetPhase s r!)rWrVrrrr rrrrrrrrrrrrzrrrrr)r)rJrYrrrrrrrrrrrrrrrrrrrrrrrr!r)rr*rHsr)#.g@CX!-GBbYLd's/9%&&rHcs>t|dt@}|r:tfdd|dD|d<dS)Nrwc3s"|]\}}|||fVqdSr.)r)r?kvr r)r*r sz$adjust_attributes..)rrr/)rr Zneeds_adjustmentr)r$r*r s   rrsFcCs|dkr i}t||||dS)N)r3r@rwr{)r)r@r3rkr{r)r)r*r s  rc@seZdZdZdS)ruzError in parsed documentN)r9r:r;rr)r)r)r*ru sru)rT)r+rT)rsNF).Z __future__rrrZpip._vendor.sixrrr1 collectionsrrr r r Ztreebuilders.baser r Z constantsrrrrrrrrrrrrrrrrrr#r-r=rGr"ZmemoizerHrr Exceptionrur)r)r)r*sP      H   G K PKd][2&FFhtml5lib/constants.pynu[from __future__ import absolute_import, division, unicode_literals import string EOF = None E = { "null-character": "Null character in input stream, replaced with U+FFFD.", "invalid-codepoint": "Invalid codepoint in stream.", "incorrectly-placed-solidus": "Solidus (/) incorrectly placed in tag.", "incorrect-cr-newline-entity": "Incorrect CR newline entity, replaced with LF.", "illegal-windows-1252-entity": "Entity used with illegal number (windows-1252 reference).", "cant-convert-numeric-entity": "Numeric entity couldn't be converted to character " "(codepoint U+%(charAsInt)08x).", "illegal-codepoint-for-numeric-entity": "Numeric entity represents an illegal codepoint: " "U+%(charAsInt)08x.", "numeric-entity-without-semicolon": "Numeric entity didn't end with ';'.", "expected-numeric-entity-but-got-eof": "Numeric entity expected. Got end of file instead.", "expected-numeric-entity": "Numeric entity expected but none found.", "named-entity-without-semicolon": "Named entity didn't end with ';'.", "expected-named-entity": "Named entity expected. Got none.", "attributes-in-end-tag": "End tag contains unexpected attributes.", 'self-closing-flag-on-end-tag': "End tag contains unexpected self-closing flag.", "expected-tag-name-but-got-right-bracket": "Expected tag name. Got '>' instead.", "expected-tag-name-but-got-question-mark": "Expected tag name. Got '?' instead. (HTML doesn't " "support processing instructions.)", "expected-tag-name": "Expected tag name. Got something else instead", "expected-closing-tag-but-got-right-bracket": "Expected closing tag. Got '>' instead. Ignoring ''.", "expected-closing-tag-but-got-eof": "Expected closing tag. Unexpected end of file.", "expected-closing-tag-but-got-char": "Expected closing tag. Unexpected character '%(data)s' found.", "eof-in-tag-name": "Unexpected end of file in the tag name.", "expected-attribute-name-but-got-eof": "Unexpected end of file. Expected attribute name instead.", "eof-in-attribute-name": "Unexpected end of file in attribute name.", "invalid-character-in-attribute-name": "Invalid character in attribute name", "duplicate-attribute": "Dropped duplicate attribute on tag.", "expected-end-of-tag-name-but-got-eof": "Unexpected end of file. Expected = or end of tag.", "expected-attribute-value-but-got-eof": "Unexpected end of file. Expected attribute value.", "expected-attribute-value-but-got-right-bracket": "Expected attribute value. Got '>' instead.", 'equals-in-unquoted-attribute-value': "Unexpected = in unquoted attribute", 'unexpected-character-in-unquoted-attribute-value': "Unexpected character in unquoted attribute", "invalid-character-after-attribute-name": "Unexpected character after attribute name.", "unexpected-character-after-attribute-value": "Unexpected character after attribute value.", "eof-in-attribute-value-double-quote": "Unexpected end of file in attribute value (\").", "eof-in-attribute-value-single-quote": "Unexpected end of file in attribute value (').", "eof-in-attribute-value-no-quotes": "Unexpected end of file in attribute value.", "unexpected-EOF-after-solidus-in-tag": "Unexpected end of file in tag. Expected >", "unexpected-character-after-solidus-in-tag": "Unexpected character after / in tag. Expected >", "expected-dashes-or-doctype": "Expected '--' or 'DOCTYPE'. Not found.", "unexpected-bang-after-double-dash-in-comment": "Unexpected ! after -- in comment", "unexpected-space-after-double-dash-in-comment": "Unexpected space after -- in comment", "incorrect-comment": "Incorrect comment.", "eof-in-comment": "Unexpected end of file in comment.", "eof-in-comment-end-dash": "Unexpected end of file in comment (-)", "unexpected-dash-after-double-dash-in-comment": "Unexpected '-' after '--' found in comment.", "eof-in-comment-double-dash": "Unexpected end of file in comment (--).", "eof-in-comment-end-space-state": "Unexpected end of file in comment.", "eof-in-comment-end-bang-state": "Unexpected end of file in comment.", "unexpected-char-in-comment": "Unexpected character in comment found.", "need-space-after-doctype": "No space after literal string 'DOCTYPE'.", "expected-doctype-name-but-got-right-bracket": "Unexpected > character. Expected DOCTYPE name.", "expected-doctype-name-but-got-eof": "Unexpected end of file. Expected DOCTYPE name.", "eof-in-doctype-name": "Unexpected end of file in DOCTYPE name.", "eof-in-doctype": "Unexpected end of file in DOCTYPE.", "expected-space-or-right-bracket-in-doctype": "Expected space or '>'. Got '%(data)s'", "unexpected-end-of-doctype": "Unexpected end of DOCTYPE.", "unexpected-char-in-doctype": "Unexpected character in DOCTYPE.", "eof-in-innerhtml": "XXX innerHTML EOF", "unexpected-doctype": "Unexpected DOCTYPE. Ignored.", "non-html-root": "html needs to be the first start tag.", "expected-doctype-but-got-eof": "Unexpected End of file. Expected DOCTYPE.", "unknown-doctype": "Erroneous DOCTYPE.", "expected-doctype-but-got-chars": "Unexpected non-space characters. Expected DOCTYPE.", "expected-doctype-but-got-start-tag": "Unexpected start tag (%(name)s). Expected DOCTYPE.", "expected-doctype-but-got-end-tag": "Unexpected end tag (%(name)s). Expected DOCTYPE.", "end-tag-after-implied-root": "Unexpected end tag (%(name)s) after the (implied) root element.", "expected-named-closing-tag-but-got-eof": "Unexpected end of file. Expected end tag (%(name)s).", "two-heads-are-not-better-than-one": "Unexpected start tag head in existing head. Ignored.", "unexpected-end-tag": "Unexpected end tag (%(name)s). Ignored.", "unexpected-start-tag-out-of-my-head": "Unexpected start tag (%(name)s) that can be in head. Moved.", "unexpected-start-tag": "Unexpected start tag (%(name)s).", "missing-end-tag": "Missing end tag (%(name)s).", "missing-end-tags": "Missing end tags (%(name)s).", "unexpected-start-tag-implies-end-tag": "Unexpected start tag (%(startName)s) " "implies end tag (%(endName)s).", "unexpected-start-tag-treated-as": "Unexpected start tag (%(originalName)s). Treated as %(newName)s.", "deprecated-tag": "Unexpected start tag %(name)s. Don't use it!", "unexpected-start-tag-ignored": "Unexpected start tag %(name)s. Ignored.", "expected-one-end-tag-but-got-another": "Unexpected end tag (%(gotName)s). " "Missing end tag (%(expectedName)s).", "end-tag-too-early": "End tag (%(name)s) seen too early. Expected other end tag.", "end-tag-too-early-named": "Unexpected end tag (%(gotName)s). Expected end tag (%(expectedName)s).", "end-tag-too-early-ignored": "End tag (%(name)s) seen too early. Ignored.", "adoption-agency-1.1": "End tag (%(name)s) violates step 1, " "paragraph 1 of the adoption agency algorithm.", "adoption-agency-1.2": "End tag (%(name)s) violates step 1, " "paragraph 2 of the adoption agency algorithm.", "adoption-agency-1.3": "End tag (%(name)s) violates step 1, " "paragraph 3 of the adoption agency algorithm.", "adoption-agency-4.4": "End tag (%(name)s) violates step 4, " "paragraph 4 of the adoption agency algorithm.", "unexpected-end-tag-treated-as": "Unexpected end tag (%(originalName)s). Treated as %(newName)s.", "no-end-tag": "This element (%(name)s) has no end tag.", "unexpected-implied-end-tag-in-table": "Unexpected implied end tag (%(name)s) in the table phase.", "unexpected-implied-end-tag-in-table-body": "Unexpected implied end tag (%(name)s) in the table body phase.", "unexpected-char-implies-table-voodoo": "Unexpected non-space characters in " "table context caused voodoo mode.", "unexpected-hidden-input-in-table": "Unexpected input with type hidden in table context.", "unexpected-form-in-table": "Unexpected form in table context.", "unexpected-start-tag-implies-table-voodoo": "Unexpected start tag (%(name)s) in " "table context caused voodoo mode.", "unexpected-end-tag-implies-table-voodoo": "Unexpected end tag (%(name)s) in " "table context caused voodoo mode.", "unexpected-cell-in-table-body": "Unexpected table cell start tag (%(name)s) " "in the table body phase.", "unexpected-cell-end-tag": "Got table cell end tag (%(name)s) " "while required end tags are missing.", "unexpected-end-tag-in-table-body": "Unexpected end tag (%(name)s) in the table body phase. Ignored.", "unexpected-implied-end-tag-in-table-row": "Unexpected implied end tag (%(name)s) in the table row phase.", "unexpected-end-tag-in-table-row": "Unexpected end tag (%(name)s) in the table row phase. Ignored.", "unexpected-select-in-select": "Unexpected select start tag in the select phase " "treated as select end tag.", "unexpected-input-in-select": "Unexpected input start tag in the select phase.", "unexpected-start-tag-in-select": "Unexpected start tag token (%(name)s in the select phase. " "Ignored.", "unexpected-end-tag-in-select": "Unexpected end tag (%(name)s) in the select phase. Ignored.", "unexpected-table-element-start-tag-in-select-in-table": "Unexpected table element start tag (%(name)s) in the select in table phase.", "unexpected-table-element-end-tag-in-select-in-table": "Unexpected table element end tag (%(name)s) in the select in table phase.", "unexpected-char-after-body": "Unexpected non-space characters in the after body phase.", "unexpected-start-tag-after-body": "Unexpected start tag token (%(name)s)" " in the after body phase.", "unexpected-end-tag-after-body": "Unexpected end tag token (%(name)s)" " in the after body phase.", "unexpected-char-in-frameset": "Unexpected characters in the frameset phase. Characters ignored.", "unexpected-start-tag-in-frameset": "Unexpected start tag token (%(name)s)" " in the frameset phase. Ignored.", "unexpected-frameset-in-frameset-innerhtml": "Unexpected end tag token (frameset) " "in the frameset phase (innerHTML).", "unexpected-end-tag-in-frameset": "Unexpected end tag token (%(name)s)" " in the frameset phase. Ignored.", "unexpected-char-after-frameset": "Unexpected non-space characters in the " "after frameset phase. Ignored.", "unexpected-start-tag-after-frameset": "Unexpected start tag (%(name)s)" " in the after frameset phase. Ignored.", "unexpected-end-tag-after-frameset": "Unexpected end tag (%(name)s)" " in the after frameset phase. Ignored.", "unexpected-end-tag-after-body-innerhtml": "Unexpected end tag after body(innerHtml)", "expected-eof-but-got-char": "Unexpected non-space characters. Expected end of file.", "expected-eof-but-got-start-tag": "Unexpected start tag (%(name)s)" ". Expected end of file.", "expected-eof-but-got-end-tag": "Unexpected end tag (%(name)s)" ". Expected end of file.", "eof-in-table": "Unexpected end of file. Expected table content.", "eof-in-select": "Unexpected end of file. Expected select content.", "eof-in-frameset": "Unexpected end of file. Expected frameset content.", "eof-in-script-in-script": "Unexpected end of file. Expected script content.", "eof-in-foreign-lands": "Unexpected end of file. Expected foreign content", "non-void-element-with-trailing-solidus": "Trailing solidus not allowed on element %(name)s", "unexpected-html-element-in-foreign-content": "Element %(name)s not allowed in a non-html context", "unexpected-end-tag-before-html": "Unexpected end tag (%(name)s) before html.", "unexpected-inhead-noscript-tag": "Element %(name)s not allowed in a inhead-noscript context", "eof-in-head-noscript": "Unexpected end of file. Expected inhead-noscript content", "char-in-head-noscript": "Unexpected non-space character. Expected inhead-noscript content", "XXX-undefined-error": "Undefined error (this sucks and should be fixed)", } namespaces = { "html": "http://www.w3.org/1999/xhtml", "mathml": "http://www.w3.org/1998/Math/MathML", "svg": "http://www.w3.org/2000/svg", "xlink": "http://www.w3.org/1999/xlink", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/" } scopingElements = frozenset([ (namespaces["html"], "applet"), (namespaces["html"], "caption"), (namespaces["html"], "html"), (namespaces["html"], "marquee"), (namespaces["html"], "object"), (namespaces["html"], "table"), (namespaces["html"], "td"), (namespaces["html"], "th"), (namespaces["mathml"], "mi"), (namespaces["mathml"], "mo"), (namespaces["mathml"], "mn"), (namespaces["mathml"], "ms"), (namespaces["mathml"], "mtext"), (namespaces["mathml"], "annotation-xml"), (namespaces["svg"], "foreignObject"), (namespaces["svg"], "desc"), (namespaces["svg"], "title"), ]) formattingElements = frozenset([ (namespaces["html"], "a"), (namespaces["html"], "b"), (namespaces["html"], "big"), (namespaces["html"], "code"), (namespaces["html"], "em"), (namespaces["html"], "font"), (namespaces["html"], "i"), (namespaces["html"], "nobr"), (namespaces["html"], "s"), (namespaces["html"], "small"), (namespaces["html"], "strike"), (namespaces["html"], "strong"), (namespaces["html"], "tt"), (namespaces["html"], "u") ]) specialElements = frozenset([ (namespaces["html"], "address"), (namespaces["html"], "applet"), (namespaces["html"], "area"), (namespaces["html"], "article"), (namespaces["html"], "aside"), (namespaces["html"], "base"), (namespaces["html"], "basefont"), (namespaces["html"], "bgsound"), (namespaces["html"], "blockquote"), (namespaces["html"], "body"), (namespaces["html"], "br"), (namespaces["html"], "button"), (namespaces["html"], "caption"), (namespaces["html"], "center"), (namespaces["html"], "col"), (namespaces["html"], "colgroup"), (namespaces["html"], "command"), (namespaces["html"], "dd"), (namespaces["html"], "details"), (namespaces["html"], "dir"), (namespaces["html"], "div"), (namespaces["html"], "dl"), (namespaces["html"], "dt"), (namespaces["html"], "embed"), (namespaces["html"], "fieldset"), (namespaces["html"], "figure"), (namespaces["html"], "footer"), (namespaces["html"], "form"), (namespaces["html"], "frame"), (namespaces["html"], "frameset"), (namespaces["html"], "h1"), (namespaces["html"], "h2"), (namespaces["html"], "h3"), (namespaces["html"], "h4"), (namespaces["html"], "h5"), (namespaces["html"], "h6"), (namespaces["html"], "head"), (namespaces["html"], "header"), (namespaces["html"], "hr"), (namespaces["html"], "html"), (namespaces["html"], "iframe"), # Note that image is commented out in the spec as "this isn't an # element that can end up on the stack, so it doesn't matter," (namespaces["html"], "image"), (namespaces["html"], "img"), (namespaces["html"], "input"), (namespaces["html"], "isindex"), (namespaces["html"], "li"), (namespaces["html"], "link"), (namespaces["html"], "listing"), (namespaces["html"], "marquee"), (namespaces["html"], "menu"), (namespaces["html"], "meta"), (namespaces["html"], "nav"), (namespaces["html"], "noembed"), (namespaces["html"], "noframes"), (namespaces["html"], "noscript"), (namespaces["html"], "object"), (namespaces["html"], "ol"), (namespaces["html"], "p"), (namespaces["html"], "param"), (namespaces["html"], "plaintext"), (namespaces["html"], "pre"), (namespaces["html"], "script"), (namespaces["html"], "section"), (namespaces["html"], "select"), (namespaces["html"], "style"), (namespaces["html"], "table"), (namespaces["html"], "tbody"), (namespaces["html"], "td"), (namespaces["html"], "textarea"), (namespaces["html"], "tfoot"), (namespaces["html"], "th"), (namespaces["html"], "thead"), (namespaces["html"], "title"), (namespaces["html"], "tr"), (namespaces["html"], "ul"), (namespaces["html"], "wbr"), (namespaces["html"], "xmp"), (namespaces["svg"], "foreignObject") ]) htmlIntegrationPointElements = frozenset([ (namespaces["mathml"], "annotation-xml"), (namespaces["svg"], "foreignObject"), (namespaces["svg"], "desc"), (namespaces["svg"], "title") ]) mathmlTextIntegrationPointElements = frozenset([ (namespaces["mathml"], "mi"), (namespaces["mathml"], "mo"), (namespaces["mathml"], "mn"), (namespaces["mathml"], "ms"), (namespaces["mathml"], "mtext") ]) adjustSVGAttributes = { "attributename": "attributeName", "attributetype": "attributeType", "basefrequency": "baseFrequency", "baseprofile": "baseProfile", "calcmode": "calcMode", "clippathunits": "clipPathUnits", "contentscripttype": "contentScriptType", "contentstyletype": "contentStyleType", "diffuseconstant": "diffuseConstant", "edgemode": "edgeMode", "externalresourcesrequired": "externalResourcesRequired", "filterres": "filterRes", "filterunits": "filterUnits", "glyphref": "glyphRef", "gradienttransform": "gradientTransform", "gradientunits": "gradientUnits", "kernelmatrix": "kernelMatrix", "kernelunitlength": "kernelUnitLength", "keypoints": "keyPoints", "keysplines": "keySplines", "keytimes": "keyTimes", "lengthadjust": "lengthAdjust", "limitingconeangle": "limitingConeAngle", "markerheight": "markerHeight", "markerunits": "markerUnits", "markerwidth": "markerWidth", "maskcontentunits": "maskContentUnits", "maskunits": "maskUnits", "numoctaves": "numOctaves", "pathlength": "pathLength", "patterncontentunits": "patternContentUnits", "patterntransform": "patternTransform", "patternunits": "patternUnits", "pointsatx": "pointsAtX", "pointsaty": "pointsAtY", "pointsatz": "pointsAtZ", "preservealpha": "preserveAlpha", "preserveaspectratio": "preserveAspectRatio", "primitiveunits": "primitiveUnits", "refx": "refX", "refy": "refY", "repeatcount": "repeatCount", "repeatdur": "repeatDur", "requiredextensions": "requiredExtensions", "requiredfeatures": "requiredFeatures", "specularconstant": "specularConstant", "specularexponent": "specularExponent", "spreadmethod": "spreadMethod", "startoffset": "startOffset", "stddeviation": "stdDeviation", "stitchtiles": "stitchTiles", "surfacescale": "surfaceScale", "systemlanguage": "systemLanguage", "tablevalues": "tableValues", "targetx": "targetX", "targety": "targetY", "textlength": "textLength", "viewbox": "viewBox", "viewtarget": "viewTarget", "xchannelselector": "xChannelSelector", "ychannelselector": "yChannelSelector", "zoomandpan": "zoomAndPan" } adjustMathMLAttributes = {"definitionurl": "definitionURL"} adjustForeignAttributes = { "xlink:actuate": ("xlink", "actuate", namespaces["xlink"]), "xlink:arcrole": ("xlink", "arcrole", namespaces["xlink"]), "xlink:href": ("xlink", "href", namespaces["xlink"]), "xlink:role": ("xlink", "role", namespaces["xlink"]), "xlink:show": ("xlink", "show", namespaces["xlink"]), "xlink:title": ("xlink", "title", namespaces["xlink"]), "xlink:type": ("xlink", "type", namespaces["xlink"]), "xml:base": ("xml", "base", namespaces["xml"]), "xml:lang": ("xml", "lang", namespaces["xml"]), "xml:space": ("xml", "space", namespaces["xml"]), "xmlns": (None, "xmlns", namespaces["xmlns"]), "xmlns:xlink": ("xmlns", "xlink", namespaces["xmlns"]) } unadjustForeignAttributes = {(ns, local): qname for qname, (prefix, local, ns) in adjustForeignAttributes.items()} spaceCharacters = frozenset([ "\t", "\n", "\u000C", " ", "\r" ]) tableInsertModeElements = frozenset([ "table", "tbody", "tfoot", "thead", "tr" ]) asciiLowercase = frozenset(string.ascii_lowercase) asciiUppercase = frozenset(string.ascii_uppercase) asciiLetters = frozenset(string.ascii_letters) digits = frozenset(string.digits) hexDigits = frozenset(string.hexdigits) asciiUpper2Lower = {ord(c): ord(c.lower()) for c in string.ascii_uppercase} # Heading elements need to be ordered headingElements = ( "h1", "h2", "h3", "h4", "h5", "h6" ) voidElements = frozenset([ "base", "command", "event-source", "link", "meta", "hr", "br", "img", "embed", "param", "area", "col", "input", "source", "track" ]) cdataElements = frozenset(['title', 'textarea']) rcdataElements = frozenset([ 'style', 'script', 'xmp', 'iframe', 'noembed', 'noframes', 'noscript' ]) booleanAttributes = { "": frozenset(["irrelevant", "itemscope"]), "style": frozenset(["scoped"]), "img": frozenset(["ismap"]), "audio": frozenset(["autoplay", "controls"]), "video": frozenset(["autoplay", "controls"]), "script": frozenset(["defer", "async"]), "details": frozenset(["open"]), "datagrid": frozenset(["multiple", "disabled"]), "command": frozenset(["hidden", "disabled", "checked", "default"]), "hr": frozenset(["noshade"]), "menu": frozenset(["autosubmit"]), "fieldset": frozenset(["disabled", "readonly"]), "option": frozenset(["disabled", "readonly", "selected"]), "optgroup": frozenset(["disabled", "readonly"]), "button": frozenset(["disabled", "autofocus"]), "input": frozenset(["disabled", "readonly", "required", "autofocus", "checked", "ismap"]), "select": frozenset(["disabled", "readonly", "autofocus", "multiple"]), "output": frozenset(["disabled", "readonly"]), "iframe": frozenset(["seamless"]), } # entitiesWindows1252 has to be _ordered_ and needs to have an index. It # therefore can't be a frozenset. entitiesWindows1252 = ( 8364, # 0x80 0x20AC EURO SIGN 65533, # 0x81 UNDEFINED 8218, # 0x82 0x201A SINGLE LOW-9 QUOTATION MARK 402, # 0x83 0x0192 LATIN SMALL LETTER F WITH HOOK 8222, # 0x84 0x201E DOUBLE LOW-9 QUOTATION MARK 8230, # 0x85 0x2026 HORIZONTAL ELLIPSIS 8224, # 0x86 0x2020 DAGGER 8225, # 0x87 0x2021 DOUBLE DAGGER 710, # 0x88 0x02C6 MODIFIER LETTER CIRCUMFLEX ACCENT 8240, # 0x89 0x2030 PER MILLE SIGN 352, # 0x8A 0x0160 LATIN CAPITAL LETTER S WITH CARON 8249, # 0x8B 0x2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK 338, # 0x8C 0x0152 LATIN CAPITAL LIGATURE OE 65533, # 0x8D UNDEFINED 381, # 0x8E 0x017D LATIN CAPITAL LETTER Z WITH CARON 65533, # 0x8F UNDEFINED 65533, # 0x90 UNDEFINED 8216, # 0x91 0x2018 LEFT SINGLE QUOTATION MARK 8217, # 0x92 0x2019 RIGHT SINGLE QUOTATION MARK 8220, # 0x93 0x201C LEFT DOUBLE QUOTATION MARK 8221, # 0x94 0x201D RIGHT DOUBLE QUOTATION MARK 8226, # 0x95 0x2022 BULLET 8211, # 0x96 0x2013 EN DASH 8212, # 0x97 0x2014 EM DASH 732, # 0x98 0x02DC SMALL TILDE 8482, # 0x99 0x2122 TRADE MARK SIGN 353, # 0x9A 0x0161 LATIN SMALL LETTER S WITH CARON 8250, # 0x9B 0x203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK 339, # 0x9C 0x0153 LATIN SMALL LIGATURE OE 65533, # 0x9D UNDEFINED 382, # 0x9E 0x017E LATIN SMALL LETTER Z WITH CARON 376 # 0x9F 0x0178 LATIN CAPITAL LETTER Y WITH DIAERESIS ) xmlEntities = frozenset(['lt;', 'gt;', 'amp;', 'apos;', 'quot;']) entities = { "AElig": "\xc6", "AElig;": "\xc6", "AMP": "&", "AMP;": "&", "Aacute": "\xc1", "Aacute;": "\xc1", "Abreve;": "\u0102", "Acirc": "\xc2", "Acirc;": "\xc2", "Acy;": "\u0410", "Afr;": "\U0001d504", "Agrave": "\xc0", "Agrave;": "\xc0", "Alpha;": "\u0391", "Amacr;": "\u0100", "And;": "\u2a53", "Aogon;": "\u0104", "Aopf;": "\U0001d538", "ApplyFunction;": "\u2061", "Aring": "\xc5", "Aring;": "\xc5", "Ascr;": "\U0001d49c", "Assign;": "\u2254", "Atilde": "\xc3", "Atilde;": "\xc3", "Auml": "\xc4", "Auml;": "\xc4", "Backslash;": "\u2216", "Barv;": "\u2ae7", "Barwed;": "\u2306", "Bcy;": "\u0411", "Because;": "\u2235", "Bernoullis;": "\u212c", "Beta;": "\u0392", "Bfr;": "\U0001d505", "Bopf;": "\U0001d539", "Breve;": "\u02d8", "Bscr;": "\u212c", "Bumpeq;": "\u224e", "CHcy;": "\u0427", "COPY": "\xa9", "COPY;": "\xa9", "Cacute;": "\u0106", "Cap;": "\u22d2", "CapitalDifferentialD;": "\u2145", "Cayleys;": "\u212d", "Ccaron;": "\u010c", "Ccedil": "\xc7", "Ccedil;": "\xc7", "Ccirc;": "\u0108", "Cconint;": "\u2230", "Cdot;": "\u010a", "Cedilla;": "\xb8", "CenterDot;": "\xb7", "Cfr;": "\u212d", "Chi;": "\u03a7", "CircleDot;": "\u2299", "CircleMinus;": "\u2296", "CirclePlus;": "\u2295", "CircleTimes;": "\u2297", "ClockwiseContourIntegral;": "\u2232", "CloseCurlyDoubleQuote;": "\u201d", "CloseCurlyQuote;": "\u2019", "Colon;": "\u2237", "Colone;": "\u2a74", "Congruent;": "\u2261", "Conint;": "\u222f", "ContourIntegral;": "\u222e", "Copf;": "\u2102", "Coproduct;": "\u2210", "CounterClockwiseContourIntegral;": "\u2233", "Cross;": "\u2a2f", "Cscr;": "\U0001d49e", "Cup;": "\u22d3", "CupCap;": "\u224d", "DD;": "\u2145", "DDotrahd;": "\u2911", "DJcy;": "\u0402", "DScy;": "\u0405", "DZcy;": "\u040f", "Dagger;": "\u2021", "Darr;": "\u21a1", "Dashv;": "\u2ae4", "Dcaron;": "\u010e", "Dcy;": "\u0414", "Del;": "\u2207", "Delta;": "\u0394", "Dfr;": "\U0001d507", "DiacriticalAcute;": "\xb4", "DiacriticalDot;": "\u02d9", "DiacriticalDoubleAcute;": "\u02dd", "DiacriticalGrave;": "`", "DiacriticalTilde;": "\u02dc", "Diamond;": "\u22c4", "DifferentialD;": "\u2146", "Dopf;": "\U0001d53b", "Dot;": "\xa8", "DotDot;": "\u20dc", "DotEqual;": "\u2250", "DoubleContourIntegral;": "\u222f", "DoubleDot;": "\xa8", "DoubleDownArrow;": "\u21d3", "DoubleLeftArrow;": "\u21d0", "DoubleLeftRightArrow;": "\u21d4", "DoubleLeftTee;": "\u2ae4", "DoubleLongLeftArrow;": "\u27f8", "DoubleLongLeftRightArrow;": "\u27fa", "DoubleLongRightArrow;": "\u27f9", "DoubleRightArrow;": "\u21d2", "DoubleRightTee;": "\u22a8", "DoubleUpArrow;": "\u21d1", "DoubleUpDownArrow;": "\u21d5", "DoubleVerticalBar;": "\u2225", "DownArrow;": "\u2193", "DownArrowBar;": "\u2913", "DownArrowUpArrow;": "\u21f5", "DownBreve;": "\u0311", "DownLeftRightVector;": "\u2950", "DownLeftTeeVector;": "\u295e", "DownLeftVector;": "\u21bd", "DownLeftVectorBar;": "\u2956", "DownRightTeeVector;": "\u295f", "DownRightVector;": "\u21c1", "DownRightVectorBar;": "\u2957", "DownTee;": "\u22a4", "DownTeeArrow;": "\u21a7", "Downarrow;": "\u21d3", "Dscr;": "\U0001d49f", "Dstrok;": "\u0110", "ENG;": "\u014a", "ETH": "\xd0", "ETH;": "\xd0", "Eacute": "\xc9", "Eacute;": "\xc9", "Ecaron;": "\u011a", "Ecirc": "\xca", "Ecirc;": "\xca", "Ecy;": "\u042d", "Edot;": "\u0116", "Efr;": "\U0001d508", "Egrave": "\xc8", "Egrave;": "\xc8", "Element;": "\u2208", "Emacr;": "\u0112", "EmptySmallSquare;": "\u25fb", "EmptyVerySmallSquare;": "\u25ab", "Eogon;": "\u0118", "Eopf;": "\U0001d53c", "Epsilon;": "\u0395", "Equal;": "\u2a75", "EqualTilde;": "\u2242", "Equilibrium;": "\u21cc", "Escr;": "\u2130", "Esim;": "\u2a73", "Eta;": "\u0397", "Euml": "\xcb", "Euml;": "\xcb", "Exists;": "\u2203", "ExponentialE;": "\u2147", "Fcy;": "\u0424", "Ffr;": "\U0001d509", "FilledSmallSquare;": "\u25fc", "FilledVerySmallSquare;": "\u25aa", "Fopf;": "\U0001d53d", "ForAll;": "\u2200", "Fouriertrf;": "\u2131", "Fscr;": "\u2131", "GJcy;": "\u0403", "GT": ">", "GT;": ">", "Gamma;": "\u0393", "Gammad;": "\u03dc", "Gbreve;": "\u011e", "Gcedil;": "\u0122", "Gcirc;": "\u011c", "Gcy;": "\u0413", "Gdot;": "\u0120", "Gfr;": "\U0001d50a", "Gg;": "\u22d9", "Gopf;": "\U0001d53e", "GreaterEqual;": "\u2265", "GreaterEqualLess;": "\u22db", "GreaterFullEqual;": "\u2267", "GreaterGreater;": "\u2aa2", "GreaterLess;": "\u2277", "GreaterSlantEqual;": "\u2a7e", "GreaterTilde;": "\u2273", "Gscr;": "\U0001d4a2", "Gt;": "\u226b", "HARDcy;": "\u042a", "Hacek;": "\u02c7", "Hat;": "^", "Hcirc;": "\u0124", "Hfr;": "\u210c", "HilbertSpace;": "\u210b", "Hopf;": "\u210d", "HorizontalLine;": "\u2500", "Hscr;": "\u210b", "Hstrok;": "\u0126", "HumpDownHump;": "\u224e", "HumpEqual;": "\u224f", "IEcy;": "\u0415", "IJlig;": "\u0132", "IOcy;": "\u0401", "Iacute": "\xcd", "Iacute;": "\xcd", "Icirc": "\xce", "Icirc;": "\xce", "Icy;": "\u0418", "Idot;": "\u0130", "Ifr;": "\u2111", "Igrave": "\xcc", "Igrave;": "\xcc", "Im;": "\u2111", "Imacr;": "\u012a", "ImaginaryI;": "\u2148", "Implies;": "\u21d2", "Int;": "\u222c", "Integral;": "\u222b", "Intersection;": "\u22c2", "InvisibleComma;": "\u2063", "InvisibleTimes;": "\u2062", "Iogon;": "\u012e", "Iopf;": "\U0001d540", "Iota;": "\u0399", "Iscr;": "\u2110", "Itilde;": "\u0128", "Iukcy;": "\u0406", "Iuml": "\xcf", "Iuml;": "\xcf", "Jcirc;": "\u0134", "Jcy;": "\u0419", "Jfr;": "\U0001d50d", "Jopf;": "\U0001d541", "Jscr;": "\U0001d4a5", "Jsercy;": "\u0408", "Jukcy;": "\u0404", "KHcy;": "\u0425", "KJcy;": "\u040c", "Kappa;": "\u039a", "Kcedil;": "\u0136", "Kcy;": "\u041a", "Kfr;": "\U0001d50e", "Kopf;": "\U0001d542", "Kscr;": "\U0001d4a6", "LJcy;": "\u0409", "LT": "<", "LT;": "<", "Lacute;": "\u0139", "Lambda;": "\u039b", "Lang;": "\u27ea", "Laplacetrf;": "\u2112", "Larr;": "\u219e", "Lcaron;": "\u013d", "Lcedil;": "\u013b", "Lcy;": "\u041b", "LeftAngleBracket;": "\u27e8", "LeftArrow;": "\u2190", "LeftArrowBar;": "\u21e4", "LeftArrowRightArrow;": "\u21c6", "LeftCeiling;": "\u2308", "LeftDoubleBracket;": "\u27e6", "LeftDownTeeVector;": "\u2961", "LeftDownVector;": "\u21c3", "LeftDownVectorBar;": "\u2959", "LeftFloor;": "\u230a", "LeftRightArrow;": "\u2194", "LeftRightVector;": "\u294e", "LeftTee;": "\u22a3", "LeftTeeArrow;": "\u21a4", "LeftTeeVector;": "\u295a", "LeftTriangle;": "\u22b2", "LeftTriangleBar;": "\u29cf", "LeftTriangleEqual;": "\u22b4", "LeftUpDownVector;": "\u2951", "LeftUpTeeVector;": "\u2960", "LeftUpVector;": "\u21bf", "LeftUpVectorBar;": "\u2958", "LeftVector;": "\u21bc", "LeftVectorBar;": "\u2952", "Leftarrow;": "\u21d0", "Leftrightarrow;": "\u21d4", "LessEqualGreater;": "\u22da", "LessFullEqual;": "\u2266", "LessGreater;": "\u2276", "LessLess;": "\u2aa1", "LessSlantEqual;": "\u2a7d", "LessTilde;": "\u2272", "Lfr;": "\U0001d50f", "Ll;": "\u22d8", "Lleftarrow;": "\u21da", "Lmidot;": "\u013f", "LongLeftArrow;": "\u27f5", "LongLeftRightArrow;": "\u27f7", "LongRightArrow;": "\u27f6", "Longleftarrow;": "\u27f8", "Longleftrightarrow;": "\u27fa", "Longrightarrow;": "\u27f9", "Lopf;": "\U0001d543", "LowerLeftArrow;": "\u2199", "LowerRightArrow;": "\u2198", "Lscr;": "\u2112", "Lsh;": "\u21b0", "Lstrok;": "\u0141", "Lt;": "\u226a", "Map;": "\u2905", "Mcy;": "\u041c", "MediumSpace;": "\u205f", "Mellintrf;": "\u2133", "Mfr;": "\U0001d510", "MinusPlus;": "\u2213", "Mopf;": "\U0001d544", "Mscr;": "\u2133", "Mu;": "\u039c", "NJcy;": "\u040a", "Nacute;": "\u0143", "Ncaron;": "\u0147", "Ncedil;": "\u0145", "Ncy;": "\u041d", "NegativeMediumSpace;": "\u200b", "NegativeThickSpace;": "\u200b", "NegativeThinSpace;": "\u200b", "NegativeVeryThinSpace;": "\u200b", "NestedGreaterGreater;": "\u226b", "NestedLessLess;": "\u226a", "NewLine;": "\n", "Nfr;": "\U0001d511", "NoBreak;": "\u2060", "NonBreakingSpace;": "\xa0", "Nopf;": "\u2115", "Not;": "\u2aec", "NotCongruent;": "\u2262", "NotCupCap;": "\u226d", "NotDoubleVerticalBar;": "\u2226", "NotElement;": "\u2209", "NotEqual;": "\u2260", "NotEqualTilde;": "\u2242\u0338", "NotExists;": "\u2204", "NotGreater;": "\u226f", "NotGreaterEqual;": "\u2271", "NotGreaterFullEqual;": "\u2267\u0338", "NotGreaterGreater;": "\u226b\u0338", "NotGreaterLess;": "\u2279", "NotGreaterSlantEqual;": "\u2a7e\u0338", "NotGreaterTilde;": "\u2275", "NotHumpDownHump;": "\u224e\u0338", "NotHumpEqual;": "\u224f\u0338", "NotLeftTriangle;": "\u22ea", "NotLeftTriangleBar;": "\u29cf\u0338", "NotLeftTriangleEqual;": "\u22ec", "NotLess;": "\u226e", "NotLessEqual;": "\u2270", "NotLessGreater;": "\u2278", "NotLessLess;": "\u226a\u0338", "NotLessSlantEqual;": "\u2a7d\u0338", "NotLessTilde;": "\u2274", "NotNestedGreaterGreater;": "\u2aa2\u0338", "NotNestedLessLess;": "\u2aa1\u0338", "NotPrecedes;": "\u2280", "NotPrecedesEqual;": "\u2aaf\u0338", "NotPrecedesSlantEqual;": "\u22e0", "NotReverseElement;": "\u220c", "NotRightTriangle;": "\u22eb", "NotRightTriangleBar;": "\u29d0\u0338", "NotRightTriangleEqual;": "\u22ed", "NotSquareSubset;": "\u228f\u0338", "NotSquareSubsetEqual;": "\u22e2", "NotSquareSuperset;": "\u2290\u0338", "NotSquareSupersetEqual;": "\u22e3", "NotSubset;": "\u2282\u20d2", "NotSubsetEqual;": "\u2288", "NotSucceeds;": "\u2281", "NotSucceedsEqual;": "\u2ab0\u0338", "NotSucceedsSlantEqual;": "\u22e1", "NotSucceedsTilde;": "\u227f\u0338", "NotSuperset;": "\u2283\u20d2", "NotSupersetEqual;": "\u2289", "NotTilde;": "\u2241", "NotTildeEqual;": "\u2244", "NotTildeFullEqual;": "\u2247", "NotTildeTilde;": "\u2249", "NotVerticalBar;": "\u2224", "Nscr;": "\U0001d4a9", "Ntilde": "\xd1", "Ntilde;": "\xd1", "Nu;": "\u039d", "OElig;": "\u0152", "Oacute": "\xd3", "Oacute;": "\xd3", "Ocirc": "\xd4", "Ocirc;": "\xd4", "Ocy;": "\u041e", "Odblac;": "\u0150", "Ofr;": "\U0001d512", "Ograve": "\xd2", "Ograve;": "\xd2", "Omacr;": "\u014c", "Omega;": "\u03a9", "Omicron;": "\u039f", "Oopf;": "\U0001d546", "OpenCurlyDoubleQuote;": "\u201c", "OpenCurlyQuote;": "\u2018", "Or;": "\u2a54", "Oscr;": "\U0001d4aa", "Oslash": "\xd8", "Oslash;": "\xd8", "Otilde": "\xd5", "Otilde;": "\xd5", "Otimes;": "\u2a37", "Ouml": "\xd6", "Ouml;": "\xd6", "OverBar;": "\u203e", "OverBrace;": "\u23de", "OverBracket;": "\u23b4", "OverParenthesis;": "\u23dc", "PartialD;": "\u2202", "Pcy;": "\u041f", "Pfr;": "\U0001d513", "Phi;": "\u03a6", "Pi;": "\u03a0", "PlusMinus;": "\xb1", "Poincareplane;": "\u210c", "Popf;": "\u2119", "Pr;": "\u2abb", "Precedes;": "\u227a", "PrecedesEqual;": "\u2aaf", "PrecedesSlantEqual;": "\u227c", "PrecedesTilde;": "\u227e", "Prime;": "\u2033", "Product;": "\u220f", "Proportion;": "\u2237", "Proportional;": "\u221d", "Pscr;": "\U0001d4ab", "Psi;": "\u03a8", "QUOT": "\"", "QUOT;": "\"", "Qfr;": "\U0001d514", "Qopf;": "\u211a", "Qscr;": "\U0001d4ac", "RBarr;": "\u2910", "REG": "\xae", "REG;": "\xae", "Racute;": "\u0154", "Rang;": "\u27eb", "Rarr;": "\u21a0", "Rarrtl;": "\u2916", "Rcaron;": "\u0158", "Rcedil;": "\u0156", "Rcy;": "\u0420", "Re;": "\u211c", "ReverseElement;": "\u220b", "ReverseEquilibrium;": "\u21cb", "ReverseUpEquilibrium;": "\u296f", "Rfr;": "\u211c", "Rho;": "\u03a1", "RightAngleBracket;": "\u27e9", "RightArrow;": "\u2192", "RightArrowBar;": "\u21e5", "RightArrowLeftArrow;": "\u21c4", "RightCeiling;": "\u2309", "RightDoubleBracket;": "\u27e7", "RightDownTeeVector;": "\u295d", "RightDownVector;": "\u21c2", "RightDownVectorBar;": "\u2955", "RightFloor;": "\u230b", "RightTee;": "\u22a2", "RightTeeArrow;": "\u21a6", "RightTeeVector;": "\u295b", "RightTriangle;": "\u22b3", "RightTriangleBar;": "\u29d0", "RightTriangleEqual;": "\u22b5", "RightUpDownVector;": "\u294f", "RightUpTeeVector;": "\u295c", "RightUpVector;": "\u21be", "RightUpVectorBar;": "\u2954", "RightVector;": "\u21c0", "RightVectorBar;": "\u2953", "Rightarrow;": "\u21d2", "Ropf;": "\u211d", "RoundImplies;": "\u2970", "Rrightarrow;": "\u21db", "Rscr;": "\u211b", "Rsh;": "\u21b1", "RuleDelayed;": "\u29f4", "SHCHcy;": "\u0429", "SHcy;": "\u0428", "SOFTcy;": "\u042c", "Sacute;": "\u015a", "Sc;": "\u2abc", "Scaron;": "\u0160", "Scedil;": "\u015e", "Scirc;": "\u015c", "Scy;": "\u0421", "Sfr;": "\U0001d516", "ShortDownArrow;": "\u2193", "ShortLeftArrow;": "\u2190", "ShortRightArrow;": "\u2192", "ShortUpArrow;": "\u2191", "Sigma;": "\u03a3", "SmallCircle;": "\u2218", "Sopf;": "\U0001d54a", "Sqrt;": "\u221a", "Square;": "\u25a1", "SquareIntersection;": "\u2293", "SquareSubset;": "\u228f", "SquareSubsetEqual;": "\u2291", "SquareSuperset;": "\u2290", "SquareSupersetEqual;": "\u2292", "SquareUnion;": "\u2294", "Sscr;": "\U0001d4ae", "Star;": "\u22c6", "Sub;": "\u22d0", "Subset;": "\u22d0", "SubsetEqual;": "\u2286", "Succeeds;": "\u227b", "SucceedsEqual;": "\u2ab0", "SucceedsSlantEqual;": "\u227d", "SucceedsTilde;": "\u227f", "SuchThat;": "\u220b", "Sum;": "\u2211", "Sup;": "\u22d1", "Superset;": "\u2283", "SupersetEqual;": "\u2287", "Supset;": "\u22d1", "THORN": "\xde", "THORN;": "\xde", "TRADE;": "\u2122", "TSHcy;": "\u040b", "TScy;": "\u0426", "Tab;": "\t", "Tau;": "\u03a4", "Tcaron;": "\u0164", "Tcedil;": "\u0162", "Tcy;": "\u0422", "Tfr;": "\U0001d517", "Therefore;": "\u2234", "Theta;": "\u0398", "ThickSpace;": "\u205f\u200a", "ThinSpace;": "\u2009", "Tilde;": "\u223c", "TildeEqual;": "\u2243", "TildeFullEqual;": "\u2245", "TildeTilde;": "\u2248", "Topf;": "\U0001d54b", "TripleDot;": "\u20db", "Tscr;": "\U0001d4af", "Tstrok;": "\u0166", "Uacute": "\xda", "Uacute;": "\xda", "Uarr;": "\u219f", "Uarrocir;": "\u2949", "Ubrcy;": "\u040e", "Ubreve;": "\u016c", "Ucirc": "\xdb", "Ucirc;": "\xdb", "Ucy;": "\u0423", "Udblac;": "\u0170", "Ufr;": "\U0001d518", "Ugrave": "\xd9", "Ugrave;": "\xd9", "Umacr;": "\u016a", "UnderBar;": "_", "UnderBrace;": "\u23df", "UnderBracket;": "\u23b5", "UnderParenthesis;": "\u23dd", "Union;": "\u22c3", "UnionPlus;": "\u228e", "Uogon;": "\u0172", "Uopf;": "\U0001d54c", "UpArrow;": "\u2191", "UpArrowBar;": "\u2912", "UpArrowDownArrow;": "\u21c5", "UpDownArrow;": "\u2195", "UpEquilibrium;": "\u296e", "UpTee;": "\u22a5", "UpTeeArrow;": "\u21a5", "Uparrow;": "\u21d1", "Updownarrow;": "\u21d5", "UpperLeftArrow;": "\u2196", "UpperRightArrow;": "\u2197", "Upsi;": "\u03d2", "Upsilon;": "\u03a5", "Uring;": "\u016e", "Uscr;": "\U0001d4b0", "Utilde;": "\u0168", "Uuml": "\xdc", "Uuml;": "\xdc", "VDash;": "\u22ab", "Vbar;": "\u2aeb", "Vcy;": "\u0412", "Vdash;": "\u22a9", "Vdashl;": "\u2ae6", "Vee;": "\u22c1", "Verbar;": "\u2016", "Vert;": "\u2016", "VerticalBar;": "\u2223", "VerticalLine;": "|", "VerticalSeparator;": "\u2758", "VerticalTilde;": "\u2240", "VeryThinSpace;": "\u200a", "Vfr;": "\U0001d519", "Vopf;": "\U0001d54d", "Vscr;": "\U0001d4b1", "Vvdash;": "\u22aa", "Wcirc;": "\u0174", "Wedge;": "\u22c0", "Wfr;": "\U0001d51a", "Wopf;": "\U0001d54e", "Wscr;": "\U0001d4b2", "Xfr;": "\U0001d51b", "Xi;": "\u039e", "Xopf;": "\U0001d54f", "Xscr;": "\U0001d4b3", "YAcy;": "\u042f", "YIcy;": "\u0407", "YUcy;": "\u042e", "Yacute": "\xdd", "Yacute;": "\xdd", "Ycirc;": "\u0176", "Ycy;": "\u042b", "Yfr;": "\U0001d51c", "Yopf;": "\U0001d550", "Yscr;": "\U0001d4b4", "Yuml;": "\u0178", "ZHcy;": "\u0416", "Zacute;": "\u0179", "Zcaron;": "\u017d", "Zcy;": "\u0417", "Zdot;": "\u017b", "ZeroWidthSpace;": "\u200b", "Zeta;": "\u0396", "Zfr;": "\u2128", "Zopf;": "\u2124", "Zscr;": "\U0001d4b5", "aacute": "\xe1", "aacute;": "\xe1", "abreve;": "\u0103", "ac;": "\u223e", "acE;": "\u223e\u0333", "acd;": "\u223f", "acirc": "\xe2", "acirc;": "\xe2", "acute": "\xb4", "acute;": "\xb4", "acy;": "\u0430", "aelig": "\xe6", "aelig;": "\xe6", "af;": "\u2061", "afr;": "\U0001d51e", "agrave": "\xe0", "agrave;": "\xe0", "alefsym;": "\u2135", "aleph;": "\u2135", "alpha;": "\u03b1", "amacr;": "\u0101", "amalg;": "\u2a3f", "amp": "&", "amp;": "&", "and;": "\u2227", "andand;": "\u2a55", "andd;": "\u2a5c", "andslope;": "\u2a58", "andv;": "\u2a5a", "ang;": "\u2220", "ange;": "\u29a4", "angle;": "\u2220", "angmsd;": "\u2221", "angmsdaa;": "\u29a8", "angmsdab;": "\u29a9", "angmsdac;": "\u29aa", "angmsdad;": "\u29ab", "angmsdae;": "\u29ac", "angmsdaf;": "\u29ad", "angmsdag;": "\u29ae", "angmsdah;": "\u29af", "angrt;": "\u221f", "angrtvb;": "\u22be", "angrtvbd;": "\u299d", "angsph;": "\u2222", "angst;": "\xc5", "angzarr;": "\u237c", "aogon;": "\u0105", "aopf;": "\U0001d552", "ap;": "\u2248", "apE;": "\u2a70", "apacir;": "\u2a6f", "ape;": "\u224a", "apid;": "\u224b", "apos;": "'", "approx;": "\u2248", "approxeq;": "\u224a", "aring": "\xe5", "aring;": "\xe5", "ascr;": "\U0001d4b6", "ast;": "*", "asymp;": "\u2248", "asympeq;": "\u224d", "atilde": "\xe3", "atilde;": "\xe3", "auml": "\xe4", "auml;": "\xe4", "awconint;": "\u2233", "awint;": "\u2a11", "bNot;": "\u2aed", "backcong;": "\u224c", "backepsilon;": "\u03f6", "backprime;": "\u2035", "backsim;": "\u223d", "backsimeq;": "\u22cd", "barvee;": "\u22bd", "barwed;": "\u2305", "barwedge;": "\u2305", "bbrk;": "\u23b5", "bbrktbrk;": "\u23b6", "bcong;": "\u224c", "bcy;": "\u0431", "bdquo;": "\u201e", "becaus;": "\u2235", "because;": "\u2235", "bemptyv;": "\u29b0", "bepsi;": "\u03f6", "bernou;": "\u212c", "beta;": "\u03b2", "beth;": "\u2136", "between;": "\u226c", "bfr;": "\U0001d51f", "bigcap;": "\u22c2", "bigcirc;": "\u25ef", "bigcup;": "\u22c3", "bigodot;": "\u2a00", "bigoplus;": "\u2a01", "bigotimes;": "\u2a02", "bigsqcup;": "\u2a06", "bigstar;": "\u2605", "bigtriangledown;": "\u25bd", "bigtriangleup;": "\u25b3", "biguplus;": "\u2a04", "bigvee;": "\u22c1", "bigwedge;": "\u22c0", "bkarow;": "\u290d", "blacklozenge;": "\u29eb", "blacksquare;": "\u25aa", "blacktriangle;": "\u25b4", "blacktriangledown;": "\u25be", "blacktriangleleft;": "\u25c2", "blacktriangleright;": "\u25b8", "blank;": "\u2423", "blk12;": "\u2592", "blk14;": "\u2591", "blk34;": "\u2593", "block;": "\u2588", "bne;": "=\u20e5", "bnequiv;": "\u2261\u20e5", "bnot;": "\u2310", "bopf;": "\U0001d553", "bot;": "\u22a5", "bottom;": "\u22a5", "bowtie;": "\u22c8", "boxDL;": "\u2557", "boxDR;": "\u2554", "boxDl;": "\u2556", "boxDr;": "\u2553", "boxH;": "\u2550", "boxHD;": "\u2566", "boxHU;": "\u2569", "boxHd;": "\u2564", "boxHu;": "\u2567", "boxUL;": "\u255d", "boxUR;": "\u255a", "boxUl;": "\u255c", "boxUr;": "\u2559", "boxV;": "\u2551", "boxVH;": "\u256c", "boxVL;": "\u2563", "boxVR;": "\u2560", "boxVh;": "\u256b", "boxVl;": "\u2562", "boxVr;": "\u255f", "boxbox;": "\u29c9", "boxdL;": "\u2555", "boxdR;": "\u2552", "boxdl;": "\u2510", "boxdr;": "\u250c", "boxh;": "\u2500", "boxhD;": "\u2565", "boxhU;": "\u2568", "boxhd;": "\u252c", "boxhu;": "\u2534", "boxminus;": "\u229f", "boxplus;": "\u229e", "boxtimes;": "\u22a0", "boxuL;": "\u255b", "boxuR;": "\u2558", "boxul;": "\u2518", "boxur;": "\u2514", "boxv;": "\u2502", "boxvH;": "\u256a", "boxvL;": "\u2561", "boxvR;": "\u255e", "boxvh;": "\u253c", "boxvl;": "\u2524", "boxvr;": "\u251c", "bprime;": "\u2035", "breve;": "\u02d8", "brvbar": "\xa6", "brvbar;": "\xa6", "bscr;": "\U0001d4b7", "bsemi;": "\u204f", "bsim;": "\u223d", "bsime;": "\u22cd", "bsol;": "\\", "bsolb;": "\u29c5", "bsolhsub;": "\u27c8", "bull;": "\u2022", "bullet;": "\u2022", "bump;": "\u224e", "bumpE;": "\u2aae", "bumpe;": "\u224f", "bumpeq;": "\u224f", "cacute;": "\u0107", "cap;": "\u2229", "capand;": "\u2a44", "capbrcup;": "\u2a49", "capcap;": "\u2a4b", "capcup;": "\u2a47", "capdot;": "\u2a40", "caps;": "\u2229\ufe00", "caret;": "\u2041", "caron;": "\u02c7", "ccaps;": "\u2a4d", "ccaron;": "\u010d", "ccedil": "\xe7", "ccedil;": "\xe7", "ccirc;": "\u0109", "ccups;": "\u2a4c", "ccupssm;": "\u2a50", "cdot;": "\u010b", "cedil": "\xb8", "cedil;": "\xb8", "cemptyv;": "\u29b2", "cent": "\xa2", "cent;": "\xa2", "centerdot;": "\xb7", "cfr;": "\U0001d520", "chcy;": "\u0447", "check;": "\u2713", "checkmark;": "\u2713", "chi;": "\u03c7", "cir;": "\u25cb", "cirE;": "\u29c3", "circ;": "\u02c6", "circeq;": "\u2257", "circlearrowleft;": "\u21ba", "circlearrowright;": "\u21bb", "circledR;": "\xae", "circledS;": "\u24c8", "circledast;": "\u229b", "circledcirc;": "\u229a", "circleddash;": "\u229d", "cire;": "\u2257", "cirfnint;": "\u2a10", "cirmid;": "\u2aef", "cirscir;": "\u29c2", "clubs;": "\u2663", "clubsuit;": "\u2663", "colon;": ":", "colone;": "\u2254", "coloneq;": "\u2254", "comma;": ",", "commat;": "@", "comp;": "\u2201", "compfn;": "\u2218", "complement;": "\u2201", "complexes;": "\u2102", "cong;": "\u2245", "congdot;": "\u2a6d", "conint;": "\u222e", "copf;": "\U0001d554", "coprod;": "\u2210", "copy": "\xa9", "copy;": "\xa9", "copysr;": "\u2117", "crarr;": "\u21b5", "cross;": "\u2717", "cscr;": "\U0001d4b8", "csub;": "\u2acf", "csube;": "\u2ad1", "csup;": "\u2ad0", "csupe;": "\u2ad2", "ctdot;": "\u22ef", "cudarrl;": "\u2938", "cudarrr;": "\u2935", "cuepr;": "\u22de", "cuesc;": "\u22df", "cularr;": "\u21b6", "cularrp;": "\u293d", "cup;": "\u222a", "cupbrcap;": "\u2a48", "cupcap;": "\u2a46", "cupcup;": "\u2a4a", "cupdot;": "\u228d", "cupor;": "\u2a45", "cups;": "\u222a\ufe00", "curarr;": "\u21b7", "curarrm;": "\u293c", "curlyeqprec;": "\u22de", "curlyeqsucc;": "\u22df", "curlyvee;": "\u22ce", "curlywedge;": "\u22cf", "curren": "\xa4", "curren;": "\xa4", "curvearrowleft;": "\u21b6", "curvearrowright;": "\u21b7", "cuvee;": "\u22ce", "cuwed;": "\u22cf", "cwconint;": "\u2232", "cwint;": "\u2231", "cylcty;": "\u232d", "dArr;": "\u21d3", "dHar;": "\u2965", "dagger;": "\u2020", "daleth;": "\u2138", "darr;": "\u2193", "dash;": "\u2010", "dashv;": "\u22a3", "dbkarow;": "\u290f", "dblac;": "\u02dd", "dcaron;": "\u010f", "dcy;": "\u0434", "dd;": "\u2146", "ddagger;": "\u2021", "ddarr;": "\u21ca", "ddotseq;": "\u2a77", "deg": "\xb0", "deg;": "\xb0", "delta;": "\u03b4", "demptyv;": "\u29b1", "dfisht;": "\u297f", "dfr;": "\U0001d521", "dharl;": "\u21c3", "dharr;": "\u21c2", "diam;": "\u22c4", "diamond;": "\u22c4", "diamondsuit;": "\u2666", "diams;": "\u2666", "die;": "\xa8", "digamma;": "\u03dd", "disin;": "\u22f2", "div;": "\xf7", "divide": "\xf7", "divide;": "\xf7", "divideontimes;": "\u22c7", "divonx;": "\u22c7", "djcy;": "\u0452", "dlcorn;": "\u231e", "dlcrop;": "\u230d", "dollar;": "$", "dopf;": "\U0001d555", "dot;": "\u02d9", "doteq;": "\u2250", "doteqdot;": "\u2251", "dotminus;": "\u2238", "dotplus;": "\u2214", "dotsquare;": "\u22a1", "doublebarwedge;": "\u2306", "downarrow;": "\u2193", "downdownarrows;": "\u21ca", "downharpoonleft;": "\u21c3", "downharpoonright;": "\u21c2", "drbkarow;": "\u2910", "drcorn;": "\u231f", "drcrop;": "\u230c", "dscr;": "\U0001d4b9", "dscy;": "\u0455", "dsol;": "\u29f6", "dstrok;": "\u0111", "dtdot;": "\u22f1", "dtri;": "\u25bf", "dtrif;": "\u25be", "duarr;": "\u21f5", "duhar;": "\u296f", "dwangle;": "\u29a6", "dzcy;": "\u045f", "dzigrarr;": "\u27ff", "eDDot;": "\u2a77", "eDot;": "\u2251", "eacute": "\xe9", "eacute;": "\xe9", "easter;": "\u2a6e", "ecaron;": "\u011b", "ecir;": "\u2256", "ecirc": "\xea", "ecirc;": "\xea", "ecolon;": "\u2255", "ecy;": "\u044d", "edot;": "\u0117", "ee;": "\u2147", "efDot;": "\u2252", "efr;": "\U0001d522", "eg;": "\u2a9a", "egrave": "\xe8", "egrave;": "\xe8", "egs;": "\u2a96", "egsdot;": "\u2a98", "el;": "\u2a99", "elinters;": "\u23e7", "ell;": "\u2113", "els;": "\u2a95", "elsdot;": "\u2a97", "emacr;": "\u0113", "empty;": "\u2205", "emptyset;": "\u2205", "emptyv;": "\u2205", "emsp13;": "\u2004", "emsp14;": "\u2005", "emsp;": "\u2003", "eng;": "\u014b", "ensp;": "\u2002", "eogon;": "\u0119", "eopf;": "\U0001d556", "epar;": "\u22d5", "eparsl;": "\u29e3", "eplus;": "\u2a71", "epsi;": "\u03b5", "epsilon;": "\u03b5", "epsiv;": "\u03f5", "eqcirc;": "\u2256", "eqcolon;": "\u2255", "eqsim;": "\u2242", "eqslantgtr;": "\u2a96", "eqslantless;": "\u2a95", "equals;": "=", "equest;": "\u225f", "equiv;": "\u2261", "equivDD;": "\u2a78", "eqvparsl;": "\u29e5", "erDot;": "\u2253", "erarr;": "\u2971", "escr;": "\u212f", "esdot;": "\u2250", "esim;": "\u2242", "eta;": "\u03b7", "eth": "\xf0", "eth;": "\xf0", "euml": "\xeb", "euml;": "\xeb", "euro;": "\u20ac", "excl;": "!", "exist;": "\u2203", "expectation;": "\u2130", "exponentiale;": "\u2147", "fallingdotseq;": "\u2252", "fcy;": "\u0444", "female;": "\u2640", "ffilig;": "\ufb03", "fflig;": "\ufb00", "ffllig;": "\ufb04", "ffr;": "\U0001d523", "filig;": "\ufb01", "fjlig;": "fj", "flat;": "\u266d", "fllig;": "\ufb02", "fltns;": "\u25b1", "fnof;": "\u0192", "fopf;": "\U0001d557", "forall;": "\u2200", "fork;": "\u22d4", "forkv;": "\u2ad9", "fpartint;": "\u2a0d", "frac12": "\xbd", "frac12;": "\xbd", "frac13;": "\u2153", "frac14": "\xbc", "frac14;": "\xbc", "frac15;": "\u2155", "frac16;": "\u2159", "frac18;": "\u215b", "frac23;": "\u2154", "frac25;": "\u2156", "frac34": "\xbe", "frac34;": "\xbe", "frac35;": "\u2157", "frac38;": "\u215c", "frac45;": "\u2158", "frac56;": "\u215a", "frac58;": "\u215d", "frac78;": "\u215e", "frasl;": "\u2044", "frown;": "\u2322", "fscr;": "\U0001d4bb", "gE;": "\u2267", "gEl;": "\u2a8c", "gacute;": "\u01f5", "gamma;": "\u03b3", "gammad;": "\u03dd", "gap;": "\u2a86", "gbreve;": "\u011f", "gcirc;": "\u011d", "gcy;": "\u0433", "gdot;": "\u0121", "ge;": "\u2265", "gel;": "\u22db", "geq;": "\u2265", "geqq;": "\u2267", "geqslant;": "\u2a7e", "ges;": "\u2a7e", "gescc;": "\u2aa9", "gesdot;": "\u2a80", "gesdoto;": "\u2a82", "gesdotol;": "\u2a84", "gesl;": "\u22db\ufe00", "gesles;": "\u2a94", "gfr;": "\U0001d524", "gg;": "\u226b", "ggg;": "\u22d9", "gimel;": "\u2137", "gjcy;": "\u0453", "gl;": "\u2277", "glE;": "\u2a92", "gla;": "\u2aa5", "glj;": "\u2aa4", "gnE;": "\u2269", "gnap;": "\u2a8a", "gnapprox;": "\u2a8a", "gne;": "\u2a88", "gneq;": "\u2a88", "gneqq;": "\u2269", "gnsim;": "\u22e7", "gopf;": "\U0001d558", "grave;": "`", "gscr;": "\u210a", "gsim;": "\u2273", "gsime;": "\u2a8e", "gsiml;": "\u2a90", "gt": ">", "gt;": ">", "gtcc;": "\u2aa7", "gtcir;": "\u2a7a", "gtdot;": "\u22d7", "gtlPar;": "\u2995", "gtquest;": "\u2a7c", "gtrapprox;": "\u2a86", "gtrarr;": "\u2978", "gtrdot;": "\u22d7", "gtreqless;": "\u22db", "gtreqqless;": "\u2a8c", "gtrless;": "\u2277", "gtrsim;": "\u2273", "gvertneqq;": "\u2269\ufe00", "gvnE;": "\u2269\ufe00", "hArr;": "\u21d4", "hairsp;": "\u200a", "half;": "\xbd", "hamilt;": "\u210b", "hardcy;": "\u044a", "harr;": "\u2194", "harrcir;": "\u2948", "harrw;": "\u21ad", "hbar;": "\u210f", "hcirc;": "\u0125", "hearts;": "\u2665", "heartsuit;": "\u2665", "hellip;": "\u2026", "hercon;": "\u22b9", "hfr;": "\U0001d525", "hksearow;": "\u2925", "hkswarow;": "\u2926", "hoarr;": "\u21ff", "homtht;": "\u223b", "hookleftarrow;": "\u21a9", "hookrightarrow;": "\u21aa", "hopf;": "\U0001d559", "horbar;": "\u2015", "hscr;": "\U0001d4bd", "hslash;": "\u210f", "hstrok;": "\u0127", "hybull;": "\u2043", "hyphen;": "\u2010", "iacute": "\xed", "iacute;": "\xed", "ic;": "\u2063", "icirc": "\xee", "icirc;": "\xee", "icy;": "\u0438", "iecy;": "\u0435", "iexcl": "\xa1", "iexcl;": "\xa1", "iff;": "\u21d4", "ifr;": "\U0001d526", "igrave": "\xec", "igrave;": "\xec", "ii;": "\u2148", "iiiint;": "\u2a0c", "iiint;": "\u222d", "iinfin;": "\u29dc", "iiota;": "\u2129", "ijlig;": "\u0133", "imacr;": "\u012b", "image;": "\u2111", "imagline;": "\u2110", "imagpart;": "\u2111", "imath;": "\u0131", "imof;": "\u22b7", "imped;": "\u01b5", "in;": "\u2208", "incare;": "\u2105", "infin;": "\u221e", "infintie;": "\u29dd", "inodot;": "\u0131", "int;": "\u222b", "intcal;": "\u22ba", "integers;": "\u2124", "intercal;": "\u22ba", "intlarhk;": "\u2a17", "intprod;": "\u2a3c", "iocy;": "\u0451", "iogon;": "\u012f", "iopf;": "\U0001d55a", "iota;": "\u03b9", "iprod;": "\u2a3c", "iquest": "\xbf", "iquest;": "\xbf", "iscr;": "\U0001d4be", "isin;": "\u2208", "isinE;": "\u22f9", "isindot;": "\u22f5", "isins;": "\u22f4", "isinsv;": "\u22f3", "isinv;": "\u2208", "it;": "\u2062", "itilde;": "\u0129", "iukcy;": "\u0456", "iuml": "\xef", "iuml;": "\xef", "jcirc;": "\u0135", "jcy;": "\u0439", "jfr;": "\U0001d527", "jmath;": "\u0237", "jopf;": "\U0001d55b", "jscr;": "\U0001d4bf", "jsercy;": "\u0458", "jukcy;": "\u0454", "kappa;": "\u03ba", "kappav;": "\u03f0", "kcedil;": "\u0137", "kcy;": "\u043a", "kfr;": "\U0001d528", "kgreen;": "\u0138", "khcy;": "\u0445", "kjcy;": "\u045c", "kopf;": "\U0001d55c", "kscr;": "\U0001d4c0", "lAarr;": "\u21da", "lArr;": "\u21d0", "lAtail;": "\u291b", "lBarr;": "\u290e", "lE;": "\u2266", "lEg;": "\u2a8b", "lHar;": "\u2962", "lacute;": "\u013a", "laemptyv;": "\u29b4", "lagran;": "\u2112", "lambda;": "\u03bb", "lang;": "\u27e8", "langd;": "\u2991", "langle;": "\u27e8", "lap;": "\u2a85", "laquo": "\xab", "laquo;": "\xab", "larr;": "\u2190", "larrb;": "\u21e4", "larrbfs;": "\u291f", "larrfs;": "\u291d", "larrhk;": "\u21a9", "larrlp;": "\u21ab", "larrpl;": "\u2939", "larrsim;": "\u2973", "larrtl;": "\u21a2", "lat;": "\u2aab", "latail;": "\u2919", "late;": "\u2aad", "lates;": "\u2aad\ufe00", "lbarr;": "\u290c", "lbbrk;": "\u2772", "lbrace;": "{", "lbrack;": "[", "lbrke;": "\u298b", "lbrksld;": "\u298f", "lbrkslu;": "\u298d", "lcaron;": "\u013e", "lcedil;": "\u013c", "lceil;": "\u2308", "lcub;": "{", "lcy;": "\u043b", "ldca;": "\u2936", "ldquo;": "\u201c", "ldquor;": "\u201e", "ldrdhar;": "\u2967", "ldrushar;": "\u294b", "ldsh;": "\u21b2", "le;": "\u2264", "leftarrow;": "\u2190", "leftarrowtail;": "\u21a2", "leftharpoondown;": "\u21bd", "leftharpoonup;": "\u21bc", "leftleftarrows;": "\u21c7", "leftrightarrow;": "\u2194", "leftrightarrows;": "\u21c6", "leftrightharpoons;": "\u21cb", "leftrightsquigarrow;": "\u21ad", "leftthreetimes;": "\u22cb", "leg;": "\u22da", "leq;": "\u2264", "leqq;": "\u2266", "leqslant;": "\u2a7d", "les;": "\u2a7d", "lescc;": "\u2aa8", "lesdot;": "\u2a7f", "lesdoto;": "\u2a81", "lesdotor;": "\u2a83", "lesg;": "\u22da\ufe00", "lesges;": "\u2a93", "lessapprox;": "\u2a85", "lessdot;": "\u22d6", "lesseqgtr;": "\u22da", "lesseqqgtr;": "\u2a8b", "lessgtr;": "\u2276", "lesssim;": "\u2272", "lfisht;": "\u297c", "lfloor;": "\u230a", "lfr;": "\U0001d529", "lg;": "\u2276", "lgE;": "\u2a91", "lhard;": "\u21bd", "lharu;": "\u21bc", "lharul;": "\u296a", "lhblk;": "\u2584", "ljcy;": "\u0459", "ll;": "\u226a", "llarr;": "\u21c7", "llcorner;": "\u231e", "llhard;": "\u296b", "lltri;": "\u25fa", "lmidot;": "\u0140", "lmoust;": "\u23b0", "lmoustache;": "\u23b0", "lnE;": "\u2268", "lnap;": "\u2a89", "lnapprox;": "\u2a89", "lne;": "\u2a87", "lneq;": "\u2a87", "lneqq;": "\u2268", "lnsim;": "\u22e6", "loang;": "\u27ec", "loarr;": "\u21fd", "lobrk;": "\u27e6", "longleftarrow;": "\u27f5", "longleftrightarrow;": "\u27f7", "longmapsto;": "\u27fc", "longrightarrow;": "\u27f6", "looparrowleft;": "\u21ab", "looparrowright;": "\u21ac", "lopar;": "\u2985", "lopf;": "\U0001d55d", "loplus;": "\u2a2d", "lotimes;": "\u2a34", "lowast;": "\u2217", "lowbar;": "_", "loz;": "\u25ca", "lozenge;": "\u25ca", "lozf;": "\u29eb", "lpar;": "(", "lparlt;": "\u2993", "lrarr;": "\u21c6", "lrcorner;": "\u231f", "lrhar;": "\u21cb", "lrhard;": "\u296d", "lrm;": "\u200e", "lrtri;": "\u22bf", "lsaquo;": "\u2039", "lscr;": "\U0001d4c1", "lsh;": "\u21b0", "lsim;": "\u2272", "lsime;": "\u2a8d", "lsimg;": "\u2a8f", "lsqb;": "[", "lsquo;": "\u2018", "lsquor;": "\u201a", "lstrok;": "\u0142", "lt": "<", "lt;": "<", "ltcc;": "\u2aa6", "ltcir;": "\u2a79", "ltdot;": "\u22d6", "lthree;": "\u22cb", "ltimes;": "\u22c9", "ltlarr;": "\u2976", "ltquest;": "\u2a7b", "ltrPar;": "\u2996", "ltri;": "\u25c3", "ltrie;": "\u22b4", "ltrif;": "\u25c2", "lurdshar;": "\u294a", "luruhar;": "\u2966", "lvertneqq;": "\u2268\ufe00", "lvnE;": "\u2268\ufe00", "mDDot;": "\u223a", "macr": "\xaf", "macr;": "\xaf", "male;": "\u2642", "malt;": "\u2720", "maltese;": "\u2720", "map;": "\u21a6", "mapsto;": "\u21a6", "mapstodown;": "\u21a7", "mapstoleft;": "\u21a4", "mapstoup;": "\u21a5", "marker;": "\u25ae", "mcomma;": "\u2a29", "mcy;": "\u043c", "mdash;": "\u2014", "measuredangle;": "\u2221", "mfr;": "\U0001d52a", "mho;": "\u2127", "micro": "\xb5", "micro;": "\xb5", "mid;": "\u2223", "midast;": "*", "midcir;": "\u2af0", "middot": "\xb7", "middot;": "\xb7", "minus;": "\u2212", "minusb;": "\u229f", "minusd;": "\u2238", "minusdu;": "\u2a2a", "mlcp;": "\u2adb", "mldr;": "\u2026", "mnplus;": "\u2213", "models;": "\u22a7", "mopf;": "\U0001d55e", "mp;": "\u2213", "mscr;": "\U0001d4c2", "mstpos;": "\u223e", "mu;": "\u03bc", "multimap;": "\u22b8", "mumap;": "\u22b8", "nGg;": "\u22d9\u0338", "nGt;": "\u226b\u20d2", "nGtv;": "\u226b\u0338", "nLeftarrow;": "\u21cd", "nLeftrightarrow;": "\u21ce", "nLl;": "\u22d8\u0338", "nLt;": "\u226a\u20d2", "nLtv;": "\u226a\u0338", "nRightarrow;": "\u21cf", "nVDash;": "\u22af", "nVdash;": "\u22ae", "nabla;": "\u2207", "nacute;": "\u0144", "nang;": "\u2220\u20d2", "nap;": "\u2249", "napE;": "\u2a70\u0338", "napid;": "\u224b\u0338", "napos;": "\u0149", "napprox;": "\u2249", "natur;": "\u266e", "natural;": "\u266e", "naturals;": "\u2115", "nbsp": "\xa0", "nbsp;": "\xa0", "nbump;": "\u224e\u0338", "nbumpe;": "\u224f\u0338", "ncap;": "\u2a43", "ncaron;": "\u0148", "ncedil;": "\u0146", "ncong;": "\u2247", "ncongdot;": "\u2a6d\u0338", "ncup;": "\u2a42", "ncy;": "\u043d", "ndash;": "\u2013", "ne;": "\u2260", "neArr;": "\u21d7", "nearhk;": "\u2924", "nearr;": "\u2197", "nearrow;": "\u2197", "nedot;": "\u2250\u0338", "nequiv;": "\u2262", "nesear;": "\u2928", "nesim;": "\u2242\u0338", "nexist;": "\u2204", "nexists;": "\u2204", "nfr;": "\U0001d52b", "ngE;": "\u2267\u0338", "nge;": "\u2271", "ngeq;": "\u2271", "ngeqq;": "\u2267\u0338", "ngeqslant;": "\u2a7e\u0338", "nges;": "\u2a7e\u0338", "ngsim;": "\u2275", "ngt;": "\u226f", "ngtr;": "\u226f", "nhArr;": "\u21ce", "nharr;": "\u21ae", "nhpar;": "\u2af2", "ni;": "\u220b", "nis;": "\u22fc", "nisd;": "\u22fa", "niv;": "\u220b", "njcy;": "\u045a", "nlArr;": "\u21cd", "nlE;": "\u2266\u0338", "nlarr;": "\u219a", "nldr;": "\u2025", "nle;": "\u2270", "nleftarrow;": "\u219a", "nleftrightarrow;": "\u21ae", "nleq;": "\u2270", "nleqq;": "\u2266\u0338", "nleqslant;": "\u2a7d\u0338", "nles;": "\u2a7d\u0338", "nless;": "\u226e", "nlsim;": "\u2274", "nlt;": "\u226e", "nltri;": "\u22ea", "nltrie;": "\u22ec", "nmid;": "\u2224", "nopf;": "\U0001d55f", "not": "\xac", "not;": "\xac", "notin;": "\u2209", "notinE;": "\u22f9\u0338", "notindot;": "\u22f5\u0338", "notinva;": "\u2209", "notinvb;": "\u22f7", "notinvc;": "\u22f6", "notni;": "\u220c", "notniva;": "\u220c", "notnivb;": "\u22fe", "notnivc;": "\u22fd", "npar;": "\u2226", "nparallel;": "\u2226", "nparsl;": "\u2afd\u20e5", "npart;": "\u2202\u0338", "npolint;": "\u2a14", "npr;": "\u2280", "nprcue;": "\u22e0", "npre;": "\u2aaf\u0338", "nprec;": "\u2280", "npreceq;": "\u2aaf\u0338", "nrArr;": "\u21cf", "nrarr;": "\u219b", "nrarrc;": "\u2933\u0338", "nrarrw;": "\u219d\u0338", "nrightarrow;": "\u219b", "nrtri;": "\u22eb", "nrtrie;": "\u22ed", "nsc;": "\u2281", "nsccue;": "\u22e1", "nsce;": "\u2ab0\u0338", "nscr;": "\U0001d4c3", "nshortmid;": "\u2224", "nshortparallel;": "\u2226", "nsim;": "\u2241", "nsime;": "\u2244", "nsimeq;": "\u2244", "nsmid;": "\u2224", "nspar;": "\u2226", "nsqsube;": "\u22e2", "nsqsupe;": "\u22e3", "nsub;": "\u2284", "nsubE;": "\u2ac5\u0338", "nsube;": "\u2288", "nsubset;": "\u2282\u20d2", "nsubseteq;": "\u2288", "nsubseteqq;": "\u2ac5\u0338", "nsucc;": "\u2281", "nsucceq;": "\u2ab0\u0338", "nsup;": "\u2285", "nsupE;": "\u2ac6\u0338", "nsupe;": "\u2289", "nsupset;": "\u2283\u20d2", "nsupseteq;": "\u2289", "nsupseteqq;": "\u2ac6\u0338", "ntgl;": "\u2279", "ntilde": "\xf1", "ntilde;": "\xf1", "ntlg;": "\u2278", "ntriangleleft;": "\u22ea", "ntrianglelefteq;": "\u22ec", "ntriangleright;": "\u22eb", "ntrianglerighteq;": "\u22ed", "nu;": "\u03bd", "num;": "#", "numero;": "\u2116", "numsp;": "\u2007", "nvDash;": "\u22ad", "nvHarr;": "\u2904", "nvap;": "\u224d\u20d2", "nvdash;": "\u22ac", "nvge;": "\u2265\u20d2", "nvgt;": ">\u20d2", "nvinfin;": "\u29de", "nvlArr;": "\u2902", "nvle;": "\u2264\u20d2", "nvlt;": "<\u20d2", "nvltrie;": "\u22b4\u20d2", "nvrArr;": "\u2903", "nvrtrie;": "\u22b5\u20d2", "nvsim;": "\u223c\u20d2", "nwArr;": "\u21d6", "nwarhk;": "\u2923", "nwarr;": "\u2196", "nwarrow;": "\u2196", "nwnear;": "\u2927", "oS;": "\u24c8", "oacute": "\xf3", "oacute;": "\xf3", "oast;": "\u229b", "ocir;": "\u229a", "ocirc": "\xf4", "ocirc;": "\xf4", "ocy;": "\u043e", "odash;": "\u229d", "odblac;": "\u0151", "odiv;": "\u2a38", "odot;": "\u2299", "odsold;": "\u29bc", "oelig;": "\u0153", "ofcir;": "\u29bf", "ofr;": "\U0001d52c", "ogon;": "\u02db", "ograve": "\xf2", "ograve;": "\xf2", "ogt;": "\u29c1", "ohbar;": "\u29b5", "ohm;": "\u03a9", "oint;": "\u222e", "olarr;": "\u21ba", "olcir;": "\u29be", "olcross;": "\u29bb", "oline;": "\u203e", "olt;": "\u29c0", "omacr;": "\u014d", "omega;": "\u03c9", "omicron;": "\u03bf", "omid;": "\u29b6", "ominus;": "\u2296", "oopf;": "\U0001d560", "opar;": "\u29b7", "operp;": "\u29b9", "oplus;": "\u2295", "or;": "\u2228", "orarr;": "\u21bb", "ord;": "\u2a5d", "order;": "\u2134", "orderof;": "\u2134", "ordf": "\xaa", "ordf;": "\xaa", "ordm": "\xba", "ordm;": "\xba", "origof;": "\u22b6", "oror;": "\u2a56", "orslope;": "\u2a57", "orv;": "\u2a5b", "oscr;": "\u2134", "oslash": "\xf8", "oslash;": "\xf8", "osol;": "\u2298", "otilde": "\xf5", "otilde;": "\xf5", "otimes;": "\u2297", "otimesas;": "\u2a36", "ouml": "\xf6", "ouml;": "\xf6", "ovbar;": "\u233d", "par;": "\u2225", "para": "\xb6", "para;": "\xb6", "parallel;": "\u2225", "parsim;": "\u2af3", "parsl;": "\u2afd", "part;": "\u2202", "pcy;": "\u043f", "percnt;": "%", "period;": ".", "permil;": "\u2030", "perp;": "\u22a5", "pertenk;": "\u2031", "pfr;": "\U0001d52d", "phi;": "\u03c6", "phiv;": "\u03d5", "phmmat;": "\u2133", "phone;": "\u260e", "pi;": "\u03c0", "pitchfork;": "\u22d4", "piv;": "\u03d6", "planck;": "\u210f", "planckh;": "\u210e", "plankv;": "\u210f", "plus;": "+", "plusacir;": "\u2a23", "plusb;": "\u229e", "pluscir;": "\u2a22", "plusdo;": "\u2214", "plusdu;": "\u2a25", "pluse;": "\u2a72", "plusmn": "\xb1", "plusmn;": "\xb1", "plussim;": "\u2a26", "plustwo;": "\u2a27", "pm;": "\xb1", "pointint;": "\u2a15", "popf;": "\U0001d561", "pound": "\xa3", "pound;": "\xa3", "pr;": "\u227a", "prE;": "\u2ab3", "prap;": "\u2ab7", "prcue;": "\u227c", "pre;": "\u2aaf", "prec;": "\u227a", "precapprox;": "\u2ab7", "preccurlyeq;": "\u227c", "preceq;": "\u2aaf", "precnapprox;": "\u2ab9", "precneqq;": "\u2ab5", "precnsim;": "\u22e8", "precsim;": "\u227e", "prime;": "\u2032", "primes;": "\u2119", "prnE;": "\u2ab5", "prnap;": "\u2ab9", "prnsim;": "\u22e8", "prod;": "\u220f", "profalar;": "\u232e", "profline;": "\u2312", "profsurf;": "\u2313", "prop;": "\u221d", "propto;": "\u221d", "prsim;": "\u227e", "prurel;": "\u22b0", "pscr;": "\U0001d4c5", "psi;": "\u03c8", "puncsp;": "\u2008", "qfr;": "\U0001d52e", "qint;": "\u2a0c", "qopf;": "\U0001d562", "qprime;": "\u2057", "qscr;": "\U0001d4c6", "quaternions;": "\u210d", "quatint;": "\u2a16", "quest;": "?", "questeq;": "\u225f", "quot": "\"", "quot;": "\"", "rAarr;": "\u21db", "rArr;": "\u21d2", "rAtail;": "\u291c", "rBarr;": "\u290f", "rHar;": "\u2964", "race;": "\u223d\u0331", "racute;": "\u0155", "radic;": "\u221a", "raemptyv;": "\u29b3", "rang;": "\u27e9", "rangd;": "\u2992", "range;": "\u29a5", "rangle;": "\u27e9", "raquo": "\xbb", "raquo;": "\xbb", "rarr;": "\u2192", "rarrap;": "\u2975", "rarrb;": "\u21e5", "rarrbfs;": "\u2920", "rarrc;": "\u2933", "rarrfs;": "\u291e", "rarrhk;": "\u21aa", "rarrlp;": "\u21ac", "rarrpl;": "\u2945", "rarrsim;": "\u2974", "rarrtl;": "\u21a3", "rarrw;": "\u219d", "ratail;": "\u291a", "ratio;": "\u2236", "rationals;": "\u211a", "rbarr;": "\u290d", "rbbrk;": "\u2773", "rbrace;": "}", "rbrack;": "]", "rbrke;": "\u298c", "rbrksld;": "\u298e", "rbrkslu;": "\u2990", "rcaron;": "\u0159", "rcedil;": "\u0157", "rceil;": "\u2309", "rcub;": "}", "rcy;": "\u0440", "rdca;": "\u2937", "rdldhar;": "\u2969", "rdquo;": "\u201d", "rdquor;": "\u201d", "rdsh;": "\u21b3", "real;": "\u211c", "realine;": "\u211b", "realpart;": "\u211c", "reals;": "\u211d", "rect;": "\u25ad", "reg": "\xae", "reg;": "\xae", "rfisht;": "\u297d", "rfloor;": "\u230b", "rfr;": "\U0001d52f", "rhard;": "\u21c1", "rharu;": "\u21c0", "rharul;": "\u296c", "rho;": "\u03c1", "rhov;": "\u03f1", "rightarrow;": "\u2192", "rightarrowtail;": "\u21a3", "rightharpoondown;": "\u21c1", "rightharpoonup;": "\u21c0", "rightleftarrows;": "\u21c4", "rightleftharpoons;": "\u21cc", "rightrightarrows;": "\u21c9", "rightsquigarrow;": "\u219d", "rightthreetimes;": "\u22cc", "ring;": "\u02da", "risingdotseq;": "\u2253", "rlarr;": "\u21c4", "rlhar;": "\u21cc", "rlm;": "\u200f", "rmoust;": "\u23b1", "rmoustache;": "\u23b1", "rnmid;": "\u2aee", "roang;": "\u27ed", "roarr;": "\u21fe", "robrk;": "\u27e7", "ropar;": "\u2986", "ropf;": "\U0001d563", "roplus;": "\u2a2e", "rotimes;": "\u2a35", "rpar;": ")", "rpargt;": "\u2994", "rppolint;": "\u2a12", "rrarr;": "\u21c9", "rsaquo;": "\u203a", "rscr;": "\U0001d4c7", "rsh;": "\u21b1", "rsqb;": "]", "rsquo;": "\u2019", "rsquor;": "\u2019", "rthree;": "\u22cc", "rtimes;": "\u22ca", "rtri;": "\u25b9", "rtrie;": "\u22b5", "rtrif;": "\u25b8", "rtriltri;": "\u29ce", "ruluhar;": "\u2968", "rx;": "\u211e", "sacute;": "\u015b", "sbquo;": "\u201a", "sc;": "\u227b", "scE;": "\u2ab4", "scap;": "\u2ab8", "scaron;": "\u0161", "sccue;": "\u227d", "sce;": "\u2ab0", "scedil;": "\u015f", "scirc;": "\u015d", "scnE;": "\u2ab6", "scnap;": "\u2aba", "scnsim;": "\u22e9", "scpolint;": "\u2a13", "scsim;": "\u227f", "scy;": "\u0441", "sdot;": "\u22c5", "sdotb;": "\u22a1", "sdote;": "\u2a66", "seArr;": "\u21d8", "searhk;": "\u2925", "searr;": "\u2198", "searrow;": "\u2198", "sect": "\xa7", "sect;": "\xa7", "semi;": ";", "seswar;": "\u2929", "setminus;": "\u2216", "setmn;": "\u2216", "sext;": "\u2736", "sfr;": "\U0001d530", "sfrown;": "\u2322", "sharp;": "\u266f", "shchcy;": "\u0449", "shcy;": "\u0448", "shortmid;": "\u2223", "shortparallel;": "\u2225", "shy": "\xad", "shy;": "\xad", "sigma;": "\u03c3", "sigmaf;": "\u03c2", "sigmav;": "\u03c2", "sim;": "\u223c", "simdot;": "\u2a6a", "sime;": "\u2243", "simeq;": "\u2243", "simg;": "\u2a9e", "simgE;": "\u2aa0", "siml;": "\u2a9d", "simlE;": "\u2a9f", "simne;": "\u2246", "simplus;": "\u2a24", "simrarr;": "\u2972", "slarr;": "\u2190", "smallsetminus;": "\u2216", "smashp;": "\u2a33", "smeparsl;": "\u29e4", "smid;": "\u2223", "smile;": "\u2323", "smt;": "\u2aaa", "smte;": "\u2aac", "smtes;": "\u2aac\ufe00", "softcy;": "\u044c", "sol;": "/", "solb;": "\u29c4", "solbar;": "\u233f", "sopf;": "\U0001d564", "spades;": "\u2660", "spadesuit;": "\u2660", "spar;": "\u2225", "sqcap;": "\u2293", "sqcaps;": "\u2293\ufe00", "sqcup;": "\u2294", "sqcups;": "\u2294\ufe00", "sqsub;": "\u228f", "sqsube;": "\u2291", "sqsubset;": "\u228f", "sqsubseteq;": "\u2291", "sqsup;": "\u2290", "sqsupe;": "\u2292", "sqsupset;": "\u2290", "sqsupseteq;": "\u2292", "squ;": "\u25a1", "square;": "\u25a1", "squarf;": "\u25aa", "squf;": "\u25aa", "srarr;": "\u2192", "sscr;": "\U0001d4c8", "ssetmn;": "\u2216", "ssmile;": "\u2323", "sstarf;": "\u22c6", "star;": "\u2606", "starf;": "\u2605", "straightepsilon;": "\u03f5", "straightphi;": "\u03d5", "strns;": "\xaf", "sub;": "\u2282", "subE;": "\u2ac5", "subdot;": "\u2abd", "sube;": "\u2286", "subedot;": "\u2ac3", "submult;": "\u2ac1", "subnE;": "\u2acb", "subne;": "\u228a", "subplus;": "\u2abf", "subrarr;": "\u2979", "subset;": "\u2282", "subseteq;": "\u2286", "subseteqq;": "\u2ac5", "subsetneq;": "\u228a", "subsetneqq;": "\u2acb", "subsim;": "\u2ac7", "subsub;": "\u2ad5", "subsup;": "\u2ad3", "succ;": "\u227b", "succapprox;": "\u2ab8", "succcurlyeq;": "\u227d", "succeq;": "\u2ab0", "succnapprox;": "\u2aba", "succneqq;": "\u2ab6", "succnsim;": "\u22e9", "succsim;": "\u227f", "sum;": "\u2211", "sung;": "\u266a", "sup1": "\xb9", "sup1;": "\xb9", "sup2": "\xb2", "sup2;": "\xb2", "sup3": "\xb3", "sup3;": "\xb3", "sup;": "\u2283", "supE;": "\u2ac6", "supdot;": "\u2abe", "supdsub;": "\u2ad8", "supe;": "\u2287", "supedot;": "\u2ac4", "suphsol;": "\u27c9", "suphsub;": "\u2ad7", "suplarr;": "\u297b", "supmult;": "\u2ac2", "supnE;": "\u2acc", "supne;": "\u228b", "supplus;": "\u2ac0", "supset;": "\u2283", "supseteq;": "\u2287", "supseteqq;": "\u2ac6", "supsetneq;": "\u228b", "supsetneqq;": "\u2acc", "supsim;": "\u2ac8", "supsub;": "\u2ad4", "supsup;": "\u2ad6", "swArr;": "\u21d9", "swarhk;": "\u2926", "swarr;": "\u2199", "swarrow;": "\u2199", "swnwar;": "\u292a", "szlig": "\xdf", "szlig;": "\xdf", "target;": "\u2316", "tau;": "\u03c4", "tbrk;": "\u23b4", "tcaron;": "\u0165", "tcedil;": "\u0163", "tcy;": "\u0442", "tdot;": "\u20db", "telrec;": "\u2315", "tfr;": "\U0001d531", "there4;": "\u2234", "therefore;": "\u2234", "theta;": "\u03b8", "thetasym;": "\u03d1", "thetav;": "\u03d1", "thickapprox;": "\u2248", "thicksim;": "\u223c", "thinsp;": "\u2009", "thkap;": "\u2248", "thksim;": "\u223c", "thorn": "\xfe", "thorn;": "\xfe", "tilde;": "\u02dc", "times": "\xd7", "times;": "\xd7", "timesb;": "\u22a0", "timesbar;": "\u2a31", "timesd;": "\u2a30", "tint;": "\u222d", "toea;": "\u2928", "top;": "\u22a4", "topbot;": "\u2336", "topcir;": "\u2af1", "topf;": "\U0001d565", "topfork;": "\u2ada", "tosa;": "\u2929", "tprime;": "\u2034", "trade;": "\u2122", "triangle;": "\u25b5", "triangledown;": "\u25bf", "triangleleft;": "\u25c3", "trianglelefteq;": "\u22b4", "triangleq;": "\u225c", "triangleright;": "\u25b9", "trianglerighteq;": "\u22b5", "tridot;": "\u25ec", "trie;": "\u225c", "triminus;": "\u2a3a", "triplus;": "\u2a39", "trisb;": "\u29cd", "tritime;": "\u2a3b", "trpezium;": "\u23e2", "tscr;": "\U0001d4c9", "tscy;": "\u0446", "tshcy;": "\u045b", "tstrok;": "\u0167", "twixt;": "\u226c", "twoheadleftarrow;": "\u219e", "twoheadrightarrow;": "\u21a0", "uArr;": "\u21d1", "uHar;": "\u2963", "uacute": "\xfa", "uacute;": "\xfa", "uarr;": "\u2191", "ubrcy;": "\u045e", "ubreve;": "\u016d", "ucirc": "\xfb", "ucirc;": "\xfb", "ucy;": "\u0443", "udarr;": "\u21c5", "udblac;": "\u0171", "udhar;": "\u296e", "ufisht;": "\u297e", "ufr;": "\U0001d532", "ugrave": "\xf9", "ugrave;": "\xf9", "uharl;": "\u21bf", "uharr;": "\u21be", "uhblk;": "\u2580", "ulcorn;": "\u231c", "ulcorner;": "\u231c", "ulcrop;": "\u230f", "ultri;": "\u25f8", "umacr;": "\u016b", "uml": "\xa8", "uml;": "\xa8", "uogon;": "\u0173", "uopf;": "\U0001d566", "uparrow;": "\u2191", "updownarrow;": "\u2195", "upharpoonleft;": "\u21bf", "upharpoonright;": "\u21be", "uplus;": "\u228e", "upsi;": "\u03c5", "upsih;": "\u03d2", "upsilon;": "\u03c5", "upuparrows;": "\u21c8", "urcorn;": "\u231d", "urcorner;": "\u231d", "urcrop;": "\u230e", "uring;": "\u016f", "urtri;": "\u25f9", "uscr;": "\U0001d4ca", "utdot;": "\u22f0", "utilde;": "\u0169", "utri;": "\u25b5", "utrif;": "\u25b4", "uuarr;": "\u21c8", "uuml": "\xfc", "uuml;": "\xfc", "uwangle;": "\u29a7", "vArr;": "\u21d5", "vBar;": "\u2ae8", "vBarv;": "\u2ae9", "vDash;": "\u22a8", "vangrt;": "\u299c", "varepsilon;": "\u03f5", "varkappa;": "\u03f0", "varnothing;": "\u2205", "varphi;": "\u03d5", "varpi;": "\u03d6", "varpropto;": "\u221d", "varr;": "\u2195", "varrho;": "\u03f1", "varsigma;": "\u03c2", "varsubsetneq;": "\u228a\ufe00", "varsubsetneqq;": "\u2acb\ufe00", "varsupsetneq;": "\u228b\ufe00", "varsupsetneqq;": "\u2acc\ufe00", "vartheta;": "\u03d1", "vartriangleleft;": "\u22b2", "vartriangleright;": "\u22b3", "vcy;": "\u0432", "vdash;": "\u22a2", "vee;": "\u2228", "veebar;": "\u22bb", "veeeq;": "\u225a", "vellip;": "\u22ee", "verbar;": "|", "vert;": "|", "vfr;": "\U0001d533", "vltri;": "\u22b2", "vnsub;": "\u2282\u20d2", "vnsup;": "\u2283\u20d2", "vopf;": "\U0001d567", "vprop;": "\u221d", "vrtri;": "\u22b3", "vscr;": "\U0001d4cb", "vsubnE;": "\u2acb\ufe00", "vsubne;": "\u228a\ufe00", "vsupnE;": "\u2acc\ufe00", "vsupne;": "\u228b\ufe00", "vzigzag;": "\u299a", "wcirc;": "\u0175", "wedbar;": "\u2a5f", "wedge;": "\u2227", "wedgeq;": "\u2259", "weierp;": "\u2118", "wfr;": "\U0001d534", "wopf;": "\U0001d568", "wp;": "\u2118", "wr;": "\u2240", "wreath;": "\u2240", "wscr;": "\U0001d4cc", "xcap;": "\u22c2", "xcirc;": "\u25ef", "xcup;": "\u22c3", "xdtri;": "\u25bd", "xfr;": "\U0001d535", "xhArr;": "\u27fa", "xharr;": "\u27f7", "xi;": "\u03be", "xlArr;": "\u27f8", "xlarr;": "\u27f5", "xmap;": "\u27fc", "xnis;": "\u22fb", "xodot;": "\u2a00", "xopf;": "\U0001d569", "xoplus;": "\u2a01", "xotime;": "\u2a02", "xrArr;": "\u27f9", "xrarr;": "\u27f6", "xscr;": "\U0001d4cd", "xsqcup;": "\u2a06", "xuplus;": "\u2a04", "xutri;": "\u25b3", "xvee;": "\u22c1", "xwedge;": "\u22c0", "yacute": "\xfd", "yacute;": "\xfd", "yacy;": "\u044f", "ycirc;": "\u0177", "ycy;": "\u044b", "yen": "\xa5", "yen;": "\xa5", "yfr;": "\U0001d536", "yicy;": "\u0457", "yopf;": "\U0001d56a", "yscr;": "\U0001d4ce", "yucy;": "\u044e", "yuml": "\xff", "yuml;": "\xff", "zacute;": "\u017a", "zcaron;": "\u017e", "zcy;": "\u0437", "zdot;": "\u017c", "zeetrf;": "\u2128", "zeta;": "\u03b6", "zfr;": "\U0001d537", "zhcy;": "\u0436", "zigrarr;": "\u21dd", "zopf;": "\U0001d56b", "zscr;": "\U0001d4cf", "zwj;": "\u200d", "zwnj;": "\u200c", } replacementCharacters = { 0x0: "\uFFFD", 0x0d: "\u000D", 0x80: "\u20AC", 0x81: "\u0081", 0x82: "\u201A", 0x83: "\u0192", 0x84: "\u201E", 0x85: "\u2026", 0x86: "\u2020", 0x87: "\u2021", 0x88: "\u02C6", 0x89: "\u2030", 0x8A: "\u0160", 0x8B: "\u2039", 0x8C: "\u0152", 0x8D: "\u008D", 0x8E: "\u017D", 0x8F: "\u008F", 0x90: "\u0090", 0x91: "\u2018", 0x92: "\u2019", 0x93: "\u201C", 0x94: "\u201D", 0x95: "\u2022", 0x96: "\u2013", 0x97: "\u2014", 0x98: "\u02DC", 0x99: "\u2122", 0x9A: "\u0161", 0x9B: "\u203A", 0x9C: "\u0153", 0x9D: "\u009D", 0x9E: "\u017E", 0x9F: "\u0178", } tokenTypes = { "Doctype": 0, "Characters": 1, "SpaceCharacters": 2, "StartTag": 3, "EndTag": 4, "EmptyTag": 5, "Comment": 6, "ParseError": 7 } tagTokenTypes = frozenset([tokenTypes["StartTag"], tokenTypes["EndTag"], tokenTypes["EmptyTag"]]) prefixes = {v: k for k, v in namespaces.items()} prefixes["http://www.w3.org/1998/Math/MathML"] = "math" class DataLossWarning(UserWarning): """Raised when the current tree is unable to represent the input data""" pass class _ReparseException(Exception): pass PKd]5m,,html5lib/_tokenizer.pynu[from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import unichr as chr from collections import deque, OrderedDict from sys import version_info from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, hexDigits, EOF from .constants import tokenTypes, tagTokenTypes from .constants import replacementCharacters from ._inputstream import HTMLInputStream from ._trie import Trie entitiesTrie = Trie(entities) if version_info >= (3, 7): attributeMap = dict else: attributeMap = OrderedDict class HTMLTokenizer(object): """ This class takes care of tokenizing HTML. * self.currentToken Holds the token that is currently being processed. * self.state Holds a reference to the method to be invoked... XXX * self.stream Points to HTMLInputStream object. """ def __init__(self, stream, parser=None, **kwargs): self.stream = HTMLInputStream(stream, **kwargs) self.parser = parser # Setup the initial tokenizer state self.escapeFlag = False self.lastFourChars = [] self.state = self.dataState self.escape = False # The current token being created self.currentToken = None super(HTMLTokenizer, self).__init__() def __iter__(self): """ This is where the magic happens. We do our usually processing through the states and when we have a token to return we yield the token which pauses processing until the next token is requested. """ self.tokenQueue = deque([]) # Start processing. When EOF is reached self.state will return False # instead of True and the loop will terminate. while self.state(): while self.stream.errors: yield {"type": tokenTypes["ParseError"], "data": self.stream.errors.pop(0)} while self.tokenQueue: yield self.tokenQueue.popleft() def consumeNumberEntity(self, isHex): """This function returns either U+FFFD or the character based on the decimal or hexadecimal representation. It also discards ";" if present. If not present self.tokenQueue.append({"type": tokenTypes["ParseError"]}) is invoked. """ allowed = digits radix = 10 if isHex: allowed = hexDigits radix = 16 charStack = [] # Consume all the characters that are in range while making sure we # don't hit an EOF. c = self.stream.char() while c in allowed and c is not EOF: charStack.append(c) c = self.stream.char() # Convert the set of characters consumed to an int. charAsInt = int("".join(charStack), radix) # Certain characters get replaced with others if charAsInt in replacementCharacters: char = replacementCharacters[charAsInt] self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "illegal-codepoint-for-numeric-entity", "datavars": {"charAsInt": charAsInt}}) elif ((0xD800 <= charAsInt <= 0xDFFF) or (charAsInt > 0x10FFFF)): char = "\uFFFD" self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "illegal-codepoint-for-numeric-entity", "datavars": {"charAsInt": charAsInt}}) else: # Should speed up this check somehow (e.g. move the set to a constant) if ((0x0001 <= charAsInt <= 0x0008) or (0x000E <= charAsInt <= 0x001F) or (0x007F <= charAsInt <= 0x009F) or (0xFDD0 <= charAsInt <= 0xFDEF) or charAsInt in frozenset([0x000B, 0xFFFE, 0xFFFF, 0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE, 0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE, 0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE, 0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, 0x10FFFF])): self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "illegal-codepoint-for-numeric-entity", "datavars": {"charAsInt": charAsInt}}) try: # Try/except needed as UCS-2 Python builds' unichar only works # within the BMP. char = chr(charAsInt) except ValueError: v = charAsInt - 0x10000 char = chr(0xD800 | (v >> 10)) + chr(0xDC00 | (v & 0x3FF)) # Discard the ; if present. Otherwise, put it back on the queue and # invoke parseError on parser. if c != ";": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "numeric-entity-without-semicolon"}) self.stream.unget(c) return char def consumeEntity(self, allowedChar=None, fromAttribute=False): # Initialise to the default output for when no entity is matched output = "&" charStack = [self.stream.char()] if (charStack[0] in spaceCharacters or charStack[0] in (EOF, "<", "&") or (allowedChar is not None and allowedChar == charStack[0])): self.stream.unget(charStack[0]) elif charStack[0] == "#": # Read the next character to see if it's hex or decimal hex = False charStack.append(self.stream.char()) if charStack[-1] in ("x", "X"): hex = True charStack.append(self.stream.char()) # charStack[-1] should be the first digit if (hex and charStack[-1] in hexDigits) \ or (not hex and charStack[-1] in digits): # At least one digit found, so consume the whole number self.stream.unget(charStack[-1]) output = self.consumeNumberEntity(hex) else: # No digits found self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-numeric-entity"}) self.stream.unget(charStack.pop()) output = "&" + "".join(charStack) else: # At this point in the process might have named entity. Entities # are stored in the global variable "entities". # # Consume characters and compare to these to a substring of the # entity names in the list until the substring no longer matches. while (charStack[-1] is not EOF): if not entitiesTrie.has_keys_with_prefix("".join(charStack)): break charStack.append(self.stream.char()) # At this point we have a string that starts with some characters # that may match an entity # Try to find the longest entity the string will match to take care # of ¬i for instance. try: entityName = entitiesTrie.longest_prefix("".join(charStack[:-1])) entityLength = len(entityName) except KeyError: entityName = None if entityName is not None: if entityName[-1] != ";": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "named-entity-without-semicolon"}) if (entityName[-1] != ";" and fromAttribute and (charStack[entityLength] in asciiLetters or charStack[entityLength] in digits or charStack[entityLength] == "=")): self.stream.unget(charStack.pop()) output = "&" + "".join(charStack) else: output = entities[entityName] self.stream.unget(charStack.pop()) output += "".join(charStack[entityLength:]) else: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-named-entity"}) self.stream.unget(charStack.pop()) output = "&" + "".join(charStack) if fromAttribute: self.currentToken["data"][-1][1] += output else: if output in spaceCharacters: tokenType = "SpaceCharacters" else: tokenType = "Characters" self.tokenQueue.append({"type": tokenTypes[tokenType], "data": output}) def processEntityInAttribute(self, allowedChar): """This method replaces the need for "entityInAttributeValueState". """ self.consumeEntity(allowedChar=allowedChar, fromAttribute=True) def emitCurrentToken(self): """This method is a generic handler for emitting the tags. It also sets the state to "data" because that's what's needed after a token has been emitted. """ token = self.currentToken # Add token to the queue to be yielded if (token["type"] in tagTokenTypes): token["name"] = token["name"].translate(asciiUpper2Lower) if token["type"] == tokenTypes["StartTag"]: raw = token["data"] data = attributeMap(raw) if len(raw) > len(data): # we had some duplicated attribute, fix so first wins data.update(raw[::-1]) token["data"] = data if token["type"] == tokenTypes["EndTag"]: if token["data"]: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "attributes-in-end-tag"}) if token["selfClosing"]: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "self-closing-flag-on-end-tag"}) self.tokenQueue.append(token) self.state = self.dataState # Below are the various tokenizer states worked out. def dataState(self): data = self.stream.char() if data == "&": self.state = self.entityDataState elif data == "<": self.state = self.tagOpenState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "\u0000"}) elif data is EOF: # Tokenization ends. return False elif data in spaceCharacters: # Directly after emitting a token you switch back to the "data # state". At that point spaceCharacters are important so they are # emitted separately. self.tokenQueue.append({"type": tokenTypes["SpaceCharacters"], "data": data + self.stream.charsUntil(spaceCharacters, True)}) # No need to update lastFourChars here, since the first space will # have already been appended to lastFourChars and will have broken # any sequences else: chars = self.stream.charsUntil(("&", "<", "\u0000")) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data + chars}) return True def entityDataState(self): self.consumeEntity() self.state = self.dataState return True def rcdataState(self): data = self.stream.char() if data == "&": self.state = self.characterReferenceInRcdata elif data == "<": self.state = self.rcdataLessThanSignState elif data == EOF: # Tokenization ends. return False elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "\uFFFD"}) elif data in spaceCharacters: # Directly after emitting a token you switch back to the "data # state". At that point spaceCharacters are important so they are # emitted separately. self.tokenQueue.append({"type": tokenTypes["SpaceCharacters"], "data": data + self.stream.charsUntil(spaceCharacters, True)}) # No need to update lastFourChars here, since the first space will # have already been appended to lastFourChars and will have broken # any sequences else: chars = self.stream.charsUntil(("&", "<", "\u0000")) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data + chars}) return True def characterReferenceInRcdata(self): self.consumeEntity() self.state = self.rcdataState return True def rawtextState(self): data = self.stream.char() if data == "<": self.state = self.rawtextLessThanSignState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "\uFFFD"}) elif data == EOF: # Tokenization ends. return False else: chars = self.stream.charsUntil(("<", "\u0000")) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data + chars}) return True def scriptDataState(self): data = self.stream.char() if data == "<": self.state = self.scriptDataLessThanSignState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "\uFFFD"}) elif data == EOF: # Tokenization ends. return False else: chars = self.stream.charsUntil(("<", "\u0000")) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data + chars}) return True def plaintextState(self): data = self.stream.char() if data == EOF: # Tokenization ends. return False elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "\uFFFD"}) else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data + self.stream.charsUntil("\u0000")}) return True def tagOpenState(self): data = self.stream.char() if data == "!": self.state = self.markupDeclarationOpenState elif data == "/": self.state = self.closeTagOpenState elif data in asciiLetters: self.currentToken = {"type": tokenTypes["StartTag"], "name": data, "data": [], "selfClosing": False, "selfClosingAcknowledged": False} self.state = self.tagNameState elif data == ">": # XXX In theory it could be something besides a tag name. But # do we really care? self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-tag-name-but-got-right-bracket"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<>"}) self.state = self.dataState elif data == "?": # XXX In theory it could be something besides a tag name. But # do we really care? self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-tag-name-but-got-question-mark"}) self.stream.unget(data) self.state = self.bogusCommentState else: # XXX self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-tag-name"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"}) self.stream.unget(data) self.state = self.dataState return True def closeTagOpenState(self): data = self.stream.char() if data in asciiLetters: self.currentToken = {"type": tokenTypes["EndTag"], "name": data, "data": [], "selfClosing": False} self.state = self.tagNameState elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-closing-tag-but-got-right-bracket"}) self.state = self.dataState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-closing-tag-but-got-eof"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "": self.emitCurrentToken() elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-tag-name"}) self.state = self.dataState elif data == "/": self.state = self.selfClosingStartTagState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["name"] += "\uFFFD" else: self.currentToken["name"] += data # (Don't use charsUntil here, because tag names are # very short and it's faster to not do anything fancy) return True def rcdataLessThanSignState(self): data = self.stream.char() if data == "/": self.temporaryBuffer = "" self.state = self.rcdataEndTagOpenState else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"}) self.stream.unget(data) self.state = self.rcdataState return True def rcdataEndTagOpenState(self): data = self.stream.char() if data in asciiLetters: self.temporaryBuffer += data self.state = self.rcdataEndTagNameState else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "" and appropriate: self.currentToken = {"type": tokenTypes["EndTag"], "name": self.temporaryBuffer, "data": [], "selfClosing": False} self.emitCurrentToken() self.state = self.dataState elif data in asciiLetters: self.temporaryBuffer += data else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "" and appropriate: self.currentToken = {"type": tokenTypes["EndTag"], "name": self.temporaryBuffer, "data": [], "selfClosing": False} self.emitCurrentToken() self.state = self.dataState elif data in asciiLetters: self.temporaryBuffer += data else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "" and appropriate: self.currentToken = {"type": tokenTypes["EndTag"], "name": self.temporaryBuffer, "data": [], "selfClosing": False} self.emitCurrentToken() self.state = self.dataState elif data in asciiLetters: self.temporaryBuffer += data else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "": self.tokenQueue.append({"type": tokenTypes["Characters"], "data": ">"}) self.state = self.scriptDataState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "\uFFFD"}) self.state = self.scriptDataEscapedState elif data == EOF: self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data}) self.state = self.scriptDataEscapedState return True def scriptDataEscapedLessThanSignState(self): data = self.stream.char() if data == "/": self.temporaryBuffer = "" self.state = self.scriptDataEscapedEndTagOpenState elif data in asciiLetters: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<" + data}) self.temporaryBuffer = data self.state = self.scriptDataDoubleEscapeStartState else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"}) self.stream.unget(data) self.state = self.scriptDataEscapedState return True def scriptDataEscapedEndTagOpenState(self): data = self.stream.char() if data in asciiLetters: self.temporaryBuffer = data self.state = self.scriptDataEscapedEndTagNameState else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "" and appropriate: self.currentToken = {"type": tokenTypes["EndTag"], "name": self.temporaryBuffer, "data": [], "selfClosing": False} self.emitCurrentToken() self.state = self.dataState elif data in asciiLetters: self.temporaryBuffer += data else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": ""))): self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data}) if self.temporaryBuffer.lower() == "script": self.state = self.scriptDataDoubleEscapedState else: self.state = self.scriptDataEscapedState elif data in asciiLetters: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data}) self.temporaryBuffer += data else: self.stream.unget(data) self.state = self.scriptDataEscapedState return True def scriptDataDoubleEscapedState(self): data = self.stream.char() if data == "-": self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"}) self.state = self.scriptDataDoubleEscapedDashState elif data == "<": self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"}) self.state = self.scriptDataDoubleEscapedLessThanSignState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "\uFFFD"}) elif data == EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-script-in-script"}) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data}) return True def scriptDataDoubleEscapedDashState(self): data = self.stream.char() if data == "-": self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"}) self.state = self.scriptDataDoubleEscapedDashDashState elif data == "<": self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"}) self.state = self.scriptDataDoubleEscapedLessThanSignState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "\uFFFD"}) self.state = self.scriptDataDoubleEscapedState elif data == EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-script-in-script"}) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data}) self.state = self.scriptDataDoubleEscapedState return True def scriptDataDoubleEscapedDashDashState(self): data = self.stream.char() if data == "-": self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"}) elif data == "<": self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"}) self.state = self.scriptDataDoubleEscapedLessThanSignState elif data == ">": self.tokenQueue.append({"type": tokenTypes["Characters"], "data": ">"}) self.state = self.scriptDataState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "\uFFFD"}) self.state = self.scriptDataDoubleEscapedState elif data == EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-script-in-script"}) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data}) self.state = self.scriptDataDoubleEscapedState return True def scriptDataDoubleEscapedLessThanSignState(self): data = self.stream.char() if data == "/": self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "/"}) self.temporaryBuffer = "" self.state = self.scriptDataDoubleEscapeEndState else: self.stream.unget(data) self.state = self.scriptDataDoubleEscapedState return True def scriptDataDoubleEscapeEndState(self): data = self.stream.char() if data in (spaceCharacters | frozenset(("/", ">"))): self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data}) if self.temporaryBuffer.lower() == "script": self.state = self.scriptDataEscapedState else: self.state = self.scriptDataDoubleEscapedState elif data in asciiLetters: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data}) self.temporaryBuffer += data else: self.stream.unget(data) self.state = self.scriptDataDoubleEscapedState return True def beforeAttributeNameState(self): data = self.stream.char() if data in spaceCharacters: self.stream.charsUntil(spaceCharacters, True) elif data in asciiLetters: self.currentToken["data"].append([data, ""]) self.state = self.attributeNameState elif data == ">": self.emitCurrentToken() elif data == "/": self.state = self.selfClosingStartTagState elif data in ("'", '"', "=", "<"): self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-character-in-attribute-name"}) self.currentToken["data"].append([data, ""]) self.state = self.attributeNameState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"].append(["\uFFFD", ""]) self.state = self.attributeNameState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-attribute-name-but-got-eof"}) self.state = self.dataState else: self.currentToken["data"].append([data, ""]) self.state = self.attributeNameState return True def attributeNameState(self): data = self.stream.char() leavingThisState = True emitToken = False if data == "=": self.state = self.beforeAttributeValueState elif data in asciiLetters: self.currentToken["data"][-1][0] += data +\ self.stream.charsUntil(asciiLetters, True) leavingThisState = False elif data == ">": # XXX If we emit here the attributes are converted to a dict # without being checked and when the code below runs we error # because data is a dict not a list emitToken = True elif data in spaceCharacters: self.state = self.afterAttributeNameState elif data == "/": self.state = self.selfClosingStartTagState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"][-1][0] += "\uFFFD" leavingThisState = False elif data in ("'", '"', "<"): self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-character-in-attribute-name"}) self.currentToken["data"][-1][0] += data leavingThisState = False elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-attribute-name"}) self.state = self.dataState else: self.currentToken["data"][-1][0] += data leavingThisState = False if leavingThisState: # Attributes are not dropped at this stage. That happens when the # start tag token is emitted so values can still be safely appended # to attributes, but we do want to report the parse error in time. self.currentToken["data"][-1][0] = ( self.currentToken["data"][-1][0].translate(asciiUpper2Lower)) for name, _ in self.currentToken["data"][:-1]: if self.currentToken["data"][-1][0] == name: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "duplicate-attribute"}) break # XXX Fix for above XXX if emitToken: self.emitCurrentToken() return True def afterAttributeNameState(self): data = self.stream.char() if data in spaceCharacters: self.stream.charsUntil(spaceCharacters, True) elif data == "=": self.state = self.beforeAttributeValueState elif data == ">": self.emitCurrentToken() elif data in asciiLetters: self.currentToken["data"].append([data, ""]) self.state = self.attributeNameState elif data == "/": self.state = self.selfClosingStartTagState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"].append(["\uFFFD", ""]) self.state = self.attributeNameState elif data in ("'", '"', "<"): self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-character-after-attribute-name"}) self.currentToken["data"].append([data, ""]) self.state = self.attributeNameState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-end-of-tag-but-got-eof"}) self.state = self.dataState else: self.currentToken["data"].append([data, ""]) self.state = self.attributeNameState return True def beforeAttributeValueState(self): data = self.stream.char() if data in spaceCharacters: self.stream.charsUntil(spaceCharacters, True) elif data == "\"": self.state = self.attributeValueDoubleQuotedState elif data == "&": self.state = self.attributeValueUnQuotedState self.stream.unget(data) elif data == "'": self.state = self.attributeValueSingleQuotedState elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-attribute-value-but-got-right-bracket"}) self.emitCurrentToken() elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"][-1][1] += "\uFFFD" self.state = self.attributeValueUnQuotedState elif data in ("=", "<", "`"): self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "equals-in-unquoted-attribute-value"}) self.currentToken["data"][-1][1] += data self.state = self.attributeValueUnQuotedState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-attribute-value-but-got-eof"}) self.state = self.dataState else: self.currentToken["data"][-1][1] += data self.state = self.attributeValueUnQuotedState return True def attributeValueDoubleQuotedState(self): data = self.stream.char() if data == "\"": self.state = self.afterAttributeValueState elif data == "&": self.processEntityInAttribute('"') elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"][-1][1] += "\uFFFD" elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-attribute-value-double-quote"}) self.state = self.dataState else: self.currentToken["data"][-1][1] += data +\ self.stream.charsUntil(("\"", "&", "\u0000")) return True def attributeValueSingleQuotedState(self): data = self.stream.char() if data == "'": self.state = self.afterAttributeValueState elif data == "&": self.processEntityInAttribute("'") elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"][-1][1] += "\uFFFD" elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-attribute-value-single-quote"}) self.state = self.dataState else: self.currentToken["data"][-1][1] += data +\ self.stream.charsUntil(("'", "&", "\u0000")) return True def attributeValueUnQuotedState(self): data = self.stream.char() if data in spaceCharacters: self.state = self.beforeAttributeNameState elif data == "&": self.processEntityInAttribute(">") elif data == ">": self.emitCurrentToken() elif data in ('"', "'", "=", "<", "`"): self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-character-in-unquoted-attribute-value"}) self.currentToken["data"][-1][1] += data elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"][-1][1] += "\uFFFD" elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-attribute-value-no-quotes"}) self.state = self.dataState else: self.currentToken["data"][-1][1] += data + self.stream.charsUntil( frozenset(("&", ">", '"', "'", "=", "<", "`", "\u0000")) | spaceCharacters) return True def afterAttributeValueState(self): data = self.stream.char() if data in spaceCharacters: self.state = self.beforeAttributeNameState elif data == ">": self.emitCurrentToken() elif data == "/": self.state = self.selfClosingStartTagState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-EOF-after-attribute-value"}) self.stream.unget(data) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-character-after-attribute-value"}) self.stream.unget(data) self.state = self.beforeAttributeNameState return True def selfClosingStartTagState(self): data = self.stream.char() if data == ">": self.currentToken["selfClosing"] = True self.emitCurrentToken() elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-EOF-after-solidus-in-tag"}) self.stream.unget(data) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-character-after-solidus-in-tag"}) self.stream.unget(data) self.state = self.beforeAttributeNameState return True def bogusCommentState(self): # Make a new comment token and give it as value all the characters # until the first > or EOF (charsUntil checks for EOF automatically) # and emit it. data = self.stream.charsUntil(">") data = data.replace("\u0000", "\uFFFD") self.tokenQueue.append( {"type": tokenTypes["Comment"], "data": data}) # Eat the character directly after the bogus comment which is either a # ">" or an EOF. self.stream.char() self.state = self.dataState return True def markupDeclarationOpenState(self): charStack = [self.stream.char()] if charStack[-1] == "-": charStack.append(self.stream.char()) if charStack[-1] == "-": self.currentToken = {"type": tokenTypes["Comment"], "data": ""} self.state = self.commentStartState return True elif charStack[-1] in ('d', 'D'): matched = True for expected in (('o', 'O'), ('c', 'C'), ('t', 'T'), ('y', 'Y'), ('p', 'P'), ('e', 'E')): charStack.append(self.stream.char()) if charStack[-1] not in expected: matched = False break if matched: self.currentToken = {"type": tokenTypes["Doctype"], "name": "", "publicId": None, "systemId": None, "correct": True} self.state = self.doctypeState return True elif (charStack[-1] == "[" and self.parser is not None and self.parser.tree.openElements and self.parser.tree.openElements[-1].namespace != self.parser.tree.defaultNamespace): matched = True for expected in ["C", "D", "A", "T", "A", "["]: charStack.append(self.stream.char()) if charStack[-1] != expected: matched = False break if matched: self.state = self.cdataSectionState return True self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-dashes-or-doctype"}) while charStack: self.stream.unget(charStack.pop()) self.state = self.bogusCommentState return True def commentStartState(self): data = self.stream.char() if data == "-": self.state = self.commentStartDashState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"] += "\uFFFD" elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "incorrect-comment"}) self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-comment"}) self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["data"] += data self.state = self.commentState return True def commentStartDashState(self): data = self.stream.char() if data == "-": self.state = self.commentEndState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"] += "-\uFFFD" elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "incorrect-comment"}) self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-comment"}) self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["data"] += "-" + data self.state = self.commentState return True def commentState(self): data = self.stream.char() if data == "-": self.state = self.commentEndDashState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"] += "\uFFFD" elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-comment"}) self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["data"] += data + \ self.stream.charsUntil(("-", "\u0000")) return True def commentEndDashState(self): data = self.stream.char() if data == "-": self.state = self.commentEndState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"] += "-\uFFFD" self.state = self.commentState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-comment-end-dash"}) self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["data"] += "-" + data self.state = self.commentState return True def commentEndState(self): data = self.stream.char() if data == ">": self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"] += "--\uFFFD" self.state = self.commentState elif data == "!": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-bang-after-double-dash-in-comment"}) self.state = self.commentEndBangState elif data == "-": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-dash-after-double-dash-in-comment"}) self.currentToken["data"] += data elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-comment-double-dash"}) self.tokenQueue.append(self.currentToken) self.state = self.dataState else: # XXX self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-comment"}) self.currentToken["data"] += "--" + data self.state = self.commentState return True def commentEndBangState(self): data = self.stream.char() if data == ">": self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data == "-": self.currentToken["data"] += "--!" self.state = self.commentEndDashState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["data"] += "--!\uFFFD" self.state = self.commentState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-comment-end-bang-state"}) self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["data"] += "--!" + data self.state = self.commentState return True def doctypeState(self): data = self.stream.char() if data in spaceCharacters: self.state = self.beforeDoctypeNameState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-doctype-name-but-got-eof"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "need-space-after-doctype"}) self.stream.unget(data) self.state = self.beforeDoctypeNameState return True def beforeDoctypeNameState(self): data = self.stream.char() if data in spaceCharacters: pass elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-doctype-name-but-got-right-bracket"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["name"] = "\uFFFD" self.state = self.doctypeNameState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-doctype-name-but-got-eof"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["name"] = data self.state = self.doctypeNameState return True def doctypeNameState(self): data = self.stream.char() if data in spaceCharacters: self.currentToken["name"] = self.currentToken["name"].translate(asciiUpper2Lower) self.state = self.afterDoctypeNameState elif data == ">": self.currentToken["name"] = self.currentToken["name"].translate(asciiUpper2Lower) self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["name"] += "\uFFFD" self.state = self.doctypeNameState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype-name"}) self.currentToken["correct"] = False self.currentToken["name"] = self.currentToken["name"].translate(asciiUpper2Lower) self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["name"] += data return True def afterDoctypeNameState(self): data = self.stream.char() if data in spaceCharacters: pass elif data == ">": self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: self.currentToken["correct"] = False self.stream.unget(data) self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.tokenQueue.append(self.currentToken) self.state = self.dataState else: if data in ("p", "P"): matched = True for expected in (("u", "U"), ("b", "B"), ("l", "L"), ("i", "I"), ("c", "C")): data = self.stream.char() if data not in expected: matched = False break if matched: self.state = self.afterDoctypePublicKeywordState return True elif data in ("s", "S"): matched = True for expected in (("y", "Y"), ("s", "S"), ("t", "T"), ("e", "E"), ("m", "M")): data = self.stream.char() if data not in expected: matched = False break if matched: self.state = self.afterDoctypeSystemKeywordState return True # All the characters read before the current 'data' will be # [a-zA-Z], so they're garbage in the bogus doctype and can be # discarded; only the latest character might be '>' or EOF # and needs to be ungetted self.stream.unget(data) self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "expected-space-or-right-bracket-in-doctype", "datavars": {"data": data}}) self.currentToken["correct"] = False self.state = self.bogusDoctypeState return True def afterDoctypePublicKeywordState(self): data = self.stream.char() if data in spaceCharacters: self.state = self.beforeDoctypePublicIdentifierState elif data in ("'", '"'): self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-doctype"}) self.stream.unget(data) self.state = self.beforeDoctypePublicIdentifierState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.stream.unget(data) self.state = self.beforeDoctypePublicIdentifierState return True def beforeDoctypePublicIdentifierState(self): data = self.stream.char() if data in spaceCharacters: pass elif data == "\"": self.currentToken["publicId"] = "" self.state = self.doctypePublicIdentifierDoubleQuotedState elif data == "'": self.currentToken["publicId"] = "" self.state = self.doctypePublicIdentifierSingleQuotedState elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-end-of-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-doctype"}) self.currentToken["correct"] = False self.state = self.bogusDoctypeState return True def doctypePublicIdentifierDoubleQuotedState(self): data = self.stream.char() if data == "\"": self.state = self.afterDoctypePublicIdentifierState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["publicId"] += "\uFFFD" elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-end-of-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["publicId"] += data return True def doctypePublicIdentifierSingleQuotedState(self): data = self.stream.char() if data == "'": self.state = self.afterDoctypePublicIdentifierState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["publicId"] += "\uFFFD" elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-end-of-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["publicId"] += data return True def afterDoctypePublicIdentifierState(self): data = self.stream.char() if data in spaceCharacters: self.state = self.betweenDoctypePublicAndSystemIdentifiersState elif data == ">": self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data == '"': self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-doctype"}) self.currentToken["systemId"] = "" self.state = self.doctypeSystemIdentifierDoubleQuotedState elif data == "'": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-doctype"}) self.currentToken["systemId"] = "" self.state = self.doctypeSystemIdentifierSingleQuotedState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-doctype"}) self.currentToken["correct"] = False self.state = self.bogusDoctypeState return True def betweenDoctypePublicAndSystemIdentifiersState(self): data = self.stream.char() if data in spaceCharacters: pass elif data == ">": self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data == '"': self.currentToken["systemId"] = "" self.state = self.doctypeSystemIdentifierDoubleQuotedState elif data == "'": self.currentToken["systemId"] = "" self.state = self.doctypeSystemIdentifierSingleQuotedState elif data == EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-doctype"}) self.currentToken["correct"] = False self.state = self.bogusDoctypeState return True def afterDoctypeSystemKeywordState(self): data = self.stream.char() if data in spaceCharacters: self.state = self.beforeDoctypeSystemIdentifierState elif data in ("'", '"'): self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-doctype"}) self.stream.unget(data) self.state = self.beforeDoctypeSystemIdentifierState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.stream.unget(data) self.state = self.beforeDoctypeSystemIdentifierState return True def beforeDoctypeSystemIdentifierState(self): data = self.stream.char() if data in spaceCharacters: pass elif data == "\"": self.currentToken["systemId"] = "" self.state = self.doctypeSystemIdentifierDoubleQuotedState elif data == "'": self.currentToken["systemId"] = "" self.state = self.doctypeSystemIdentifierSingleQuotedState elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-doctype"}) self.currentToken["correct"] = False self.state = self.bogusDoctypeState return True def doctypeSystemIdentifierDoubleQuotedState(self): data = self.stream.char() if data == "\"": self.state = self.afterDoctypeSystemIdentifierState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["systemId"] += "\uFFFD" elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-end-of-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["systemId"] += data return True def doctypeSystemIdentifierSingleQuotedState(self): data = self.stream.char() if data == "'": self.state = self.afterDoctypeSystemIdentifierState elif data == "\u0000": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) self.currentToken["systemId"] += "\uFFFD" elif data == ">": self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-end-of-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.currentToken["systemId"] += data return True def afterDoctypeSystemIdentifierState(self): data = self.stream.char() if data in spaceCharacters: pass elif data == ">": self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "eof-in-doctype"}) self.currentToken["correct"] = False self.tokenQueue.append(self.currentToken) self.state = self.dataState else: self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "unexpected-char-in-doctype"}) self.state = self.bogusDoctypeState return True def bogusDoctypeState(self): data = self.stream.char() if data == ">": self.tokenQueue.append(self.currentToken) self.state = self.dataState elif data is EOF: # XXX EMIT self.stream.unget(data) self.tokenQueue.append(self.currentToken) self.state = self.dataState else: pass return True def cdataSectionState(self): data = [] while True: data.append(self.stream.charsUntil("]")) data.append(self.stream.charsUntil(">")) char = self.stream.char() if char == EOF: break else: assert char == ">" if data[-1][-2:] == "]]": data[-1] = data[-1][:-2] break else: data.append(char) data = "".join(data) # pylint:disable=redefined-variable-type # Deal with null here rather than in the parser nullCount = data.count("\u0000") if nullCount > 0: for _ in range(nullCount): self.tokenQueue.append({"type": tokenTypes["ParseError"], "data": "invalid-codepoint"}) data = data.replace("\u0000", "\uFFFD") if data: self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data}) self.state = self.dataState return True PKd]ʧ-XAXAhtml5lib/_ihatexml.pynu[from __future__ import absolute_import, division, unicode_literals import re import warnings from .constants import DataLossWarning baseChar = """ [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5] | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386 | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE] | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0 | [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F] | [#x0451-#x045C] | [#x045E-#x0481] | [#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC] | [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] | #x0559 | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2] | [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] | [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5 | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D | [#x0958-#x0961] | [#x0985-#x098C] | [#x098F-#x0990] | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9] | [#x09DC-#x09DD] | [#x09DF-#x09E1] | [#x09F0-#x09F1] | [#x0A05-#x0A0A] | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30] | [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39] | [#x0A59-#x0A5C] | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B] | #x0A8D | [#x0A8F-#x0A91] | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0 | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] | [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A] | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C] | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33] | [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] | #x0CDE | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C] | [#x0D0E-#x0D10] | [#x0D12-#x0D28] | [#x0D2A-#x0D39] | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33] | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88] | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F] | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB] | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] | [#x0F49-#x0F69] | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103] | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] | [#x110E-#x1112] | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150 | [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165 | #x1167 | #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175 | #x119E | #x11A8 | #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8] | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9 | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15] | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D] | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D] | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4] | [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126 | [#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094] | [#x30A1-#x30FA] | [#x3105-#x312C] | [#xAC00-#xD7A3]""" ideographic = """[#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]""" combiningCharacter = """ [#x0300-#x0345] | [#x0360-#x0361] | [#x0483-#x0486] | [#x0591-#x05A1] | [#x05A3-#x05B9] | [#x05BB-#x05BD] | #x05BF | [#x05C1-#x05C2] | #x05C4 | [#x064B-#x0652] | #x0670 | [#x06D6-#x06DC] | [#x06DD-#x06DF] | [#x06E0-#x06E4] | [#x06E7-#x06E8] | [#x06EA-#x06ED] | [#x0901-#x0903] | #x093C | [#x093E-#x094C] | #x094D | [#x0951-#x0954] | [#x0962-#x0963] | [#x0981-#x0983] | #x09BC | #x09BE | #x09BF | [#x09C0-#x09C4] | [#x09C7-#x09C8] | [#x09CB-#x09CD] | #x09D7 | [#x09E2-#x09E3] | #x0A02 | #x0A3C | #x0A3E | #x0A3F | [#x0A40-#x0A42] | [#x0A47-#x0A48] | [#x0A4B-#x0A4D] | [#x0A70-#x0A71] | [#x0A81-#x0A83] | #x0ABC | [#x0ABE-#x0AC5] | [#x0AC7-#x0AC9] | [#x0ACB-#x0ACD] | [#x0B01-#x0B03] | #x0B3C | [#x0B3E-#x0B43] | [#x0B47-#x0B48] | [#x0B4B-#x0B4D] | [#x0B56-#x0B57] | [#x0B82-#x0B83] | [#x0BBE-#x0BC2] | [#x0BC6-#x0BC8] | [#x0BCA-#x0BCD] | #x0BD7 | [#x0C01-#x0C03] | [#x0C3E-#x0C44] | [#x0C46-#x0C48] | [#x0C4A-#x0C4D] | [#x0C55-#x0C56] | [#x0C82-#x0C83] | [#x0CBE-#x0CC4] | [#x0CC6-#x0CC8] | [#x0CCA-#x0CCD] | [#x0CD5-#x0CD6] | [#x0D02-#x0D03] | [#x0D3E-#x0D43] | [#x0D46-#x0D48] | [#x0D4A-#x0D4D] | #x0D57 | #x0E31 | [#x0E34-#x0E3A] | [#x0E47-#x0E4E] | #x0EB1 | [#x0EB4-#x0EB9] | [#x0EBB-#x0EBC] | [#x0EC8-#x0ECD] | [#x0F18-#x0F19] | #x0F35 | #x0F37 | #x0F39 | #x0F3E | #x0F3F | [#x0F71-#x0F84] | [#x0F86-#x0F8B] | [#x0F90-#x0F95] | #x0F97 | [#x0F99-#x0FAD] | [#x0FB1-#x0FB7] | #x0FB9 | [#x20D0-#x20DC] | #x20E1 | [#x302A-#x302F] | #x3099 | #x309A""" digit = """ [#x0030-#x0039] | [#x0660-#x0669] | [#x06F0-#x06F9] | [#x0966-#x096F] | [#x09E6-#x09EF] | [#x0A66-#x0A6F] | [#x0AE6-#x0AEF] | [#x0B66-#x0B6F] | [#x0BE7-#x0BEF] | [#x0C66-#x0C6F] | [#x0CE6-#x0CEF] | [#x0D66-#x0D6F] | [#x0E50-#x0E59] | [#x0ED0-#x0ED9] | [#x0F20-#x0F29]""" extender = """ #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46 | #x0EC6 | #x3005 | #[#x3031-#x3035] | [#x309D-#x309E] | [#x30FC-#x30FE]""" letter = " | ".join([baseChar, ideographic]) # Without the name = " | ".join([letter, digit, ".", "-", "_", combiningCharacter, extender]) nameFirst = " | ".join([letter, "_"]) reChar = re.compile(r"#x([\d|A-F]{4,4})") reCharRange = re.compile(r"\[#x([\d|A-F]{4,4})-#x([\d|A-F]{4,4})\]") def charStringToList(chars): charRanges = [item.strip() for item in chars.split(" | ")] rv = [] for item in charRanges: foundMatch = False for regexp in (reChar, reCharRange): match = regexp.match(item) if match is not None: rv.append([hexToInt(item) for item in match.groups()]) if len(rv[-1]) == 1: rv[-1] = rv[-1] * 2 foundMatch = True break if not foundMatch: assert len(item) == 1 rv.append([ord(item)] * 2) rv = normaliseCharList(rv) return rv def normaliseCharList(charList): charList = sorted(charList) for item in charList: assert item[1] >= item[0] rv = [] i = 0 while i < len(charList): j = 1 rv.append(charList[i]) while i + j < len(charList) and charList[i + j][0] <= rv[-1][1] + 1: rv[-1][1] = charList[i + j][1] j += 1 i += j return rv # We don't really support characters above the BMP :( max_unicode = int("FFFF", 16) def missingRanges(charList): rv = [] if charList[0] != 0: rv.append([0, charList[0][0] - 1]) for i, item in enumerate(charList[:-1]): rv.append([item[1] + 1, charList[i + 1][0] - 1]) if charList[-1][1] != max_unicode: rv.append([charList[-1][1] + 1, max_unicode]) return rv def listToRegexpStr(charList): rv = [] for item in charList: if item[0] == item[1]: rv.append(escapeRegexp(chr(item[0]))) else: rv.append(escapeRegexp(chr(item[0])) + "-" + escapeRegexp(chr(item[1]))) return "[%s]" % "".join(rv) def hexToInt(hex_str): return int(hex_str, 16) def escapeRegexp(string): specialCharacters = (".", "^", "$", "*", "+", "?", "{", "}", "[", "]", "|", "(", ")", "-") for char in specialCharacters: string = string.replace(char, "\\" + char) return string # output from the above nonXmlNameBMPRegexp = re.compile('[\x00-,/:-@\\[-\\^`\\{-\xb6\xb8-\xbf\xd7\xf7\u0132-\u0133\u013f-\u0140\u0149\u017f\u01c4-\u01cc\u01f1-\u01f3\u01f6-\u01f9\u0218-\u024f\u02a9-\u02ba\u02c2-\u02cf\u02d2-\u02ff\u0346-\u035f\u0362-\u0385\u038b\u038d\u03a2\u03cf\u03d7-\u03d9\u03db\u03dd\u03df\u03e1\u03f4-\u0400\u040d\u0450\u045d\u0482\u0487-\u048f\u04c5-\u04c6\u04c9-\u04ca\u04cd-\u04cf\u04ec-\u04ed\u04f6-\u04f7\u04fa-\u0530\u0557-\u0558\u055a-\u0560\u0587-\u0590\u05a2\u05ba\u05be\u05c0\u05c3\u05c5-\u05cf\u05eb-\u05ef\u05f3-\u0620\u063b-\u063f\u0653-\u065f\u066a-\u066f\u06b8-\u06b9\u06bf\u06cf\u06d4\u06e9\u06ee-\u06ef\u06fa-\u0900\u0904\u093a-\u093b\u094e-\u0950\u0955-\u0957\u0964-\u0965\u0970-\u0980\u0984\u098d-\u098e\u0991-\u0992\u09a9\u09b1\u09b3-\u09b5\u09ba-\u09bb\u09bd\u09c5-\u09c6\u09c9-\u09ca\u09ce-\u09d6\u09d8-\u09db\u09de\u09e4-\u09e5\u09f2-\u0a01\u0a03-\u0a04\u0a0b-\u0a0e\u0a11-\u0a12\u0a29\u0a31\u0a34\u0a37\u0a3a-\u0a3b\u0a3d\u0a43-\u0a46\u0a49-\u0a4a\u0a4e-\u0a58\u0a5d\u0a5f-\u0a65\u0a75-\u0a80\u0a84\u0a8c\u0a8e\u0a92\u0aa9\u0ab1\u0ab4\u0aba-\u0abb\u0ac6\u0aca\u0ace-\u0adf\u0ae1-\u0ae5\u0af0-\u0b00\u0b04\u0b0d-\u0b0e\u0b11-\u0b12\u0b29\u0b31\u0b34-\u0b35\u0b3a-\u0b3b\u0b44-\u0b46\u0b49-\u0b4a\u0b4e-\u0b55\u0b58-\u0b5b\u0b5e\u0b62-\u0b65\u0b70-\u0b81\u0b84\u0b8b-\u0b8d\u0b91\u0b96-\u0b98\u0b9b\u0b9d\u0ba0-\u0ba2\u0ba5-\u0ba7\u0bab-\u0bad\u0bb6\u0bba-\u0bbd\u0bc3-\u0bc5\u0bc9\u0bce-\u0bd6\u0bd8-\u0be6\u0bf0-\u0c00\u0c04\u0c0d\u0c11\u0c29\u0c34\u0c3a-\u0c3d\u0c45\u0c49\u0c4e-\u0c54\u0c57-\u0c5f\u0c62-\u0c65\u0c70-\u0c81\u0c84\u0c8d\u0c91\u0ca9\u0cb4\u0cba-\u0cbd\u0cc5\u0cc9\u0cce-\u0cd4\u0cd7-\u0cdd\u0cdf\u0ce2-\u0ce5\u0cf0-\u0d01\u0d04\u0d0d\u0d11\u0d29\u0d3a-\u0d3d\u0d44-\u0d45\u0d49\u0d4e-\u0d56\u0d58-\u0d5f\u0d62-\u0d65\u0d70-\u0e00\u0e2f\u0e3b-\u0e3f\u0e4f\u0e5a-\u0e80\u0e83\u0e85-\u0e86\u0e89\u0e8b-\u0e8c\u0e8e-\u0e93\u0e98\u0ea0\u0ea4\u0ea6\u0ea8-\u0ea9\u0eac\u0eaf\u0eba\u0ebe-\u0ebf\u0ec5\u0ec7\u0ece-\u0ecf\u0eda-\u0f17\u0f1a-\u0f1f\u0f2a-\u0f34\u0f36\u0f38\u0f3a-\u0f3d\u0f48\u0f6a-\u0f70\u0f85\u0f8c-\u0f8f\u0f96\u0f98\u0fae-\u0fb0\u0fb8\u0fba-\u109f\u10c6-\u10cf\u10f7-\u10ff\u1101\u1104\u1108\u110a\u110d\u1113-\u113b\u113d\u113f\u1141-\u114b\u114d\u114f\u1151-\u1153\u1156-\u1158\u115a-\u115e\u1162\u1164\u1166\u1168\u116a-\u116c\u116f-\u1171\u1174\u1176-\u119d\u119f-\u11a7\u11a9-\u11aa\u11ac-\u11ad\u11b0-\u11b6\u11b9\u11bb\u11c3-\u11ea\u11ec-\u11ef\u11f1-\u11f8\u11fa-\u1dff\u1e9c-\u1e9f\u1efa-\u1eff\u1f16-\u1f17\u1f1e-\u1f1f\u1f46-\u1f47\u1f4e-\u1f4f\u1f58\u1f5a\u1f5c\u1f5e\u1f7e-\u1f7f\u1fb5\u1fbd\u1fbf-\u1fc1\u1fc5\u1fcd-\u1fcf\u1fd4-\u1fd5\u1fdc-\u1fdf\u1fed-\u1ff1\u1ff5\u1ffd-\u20cf\u20dd-\u20e0\u20e2-\u2125\u2127-\u2129\u212c-\u212d\u212f-\u217f\u2183-\u3004\u3006\u3008-\u3020\u3030\u3036-\u3040\u3095-\u3098\u309b-\u309c\u309f-\u30a0\u30fb\u30ff-\u3104\u312d-\u4dff\u9fa6-\uabff\ud7a4-\uffff]') # noqa nonXmlNameFirstBMPRegexp = re.compile('[\x00-@\\[-\\^`\\{-\xbf\xd7\xf7\u0132-\u0133\u013f-\u0140\u0149\u017f\u01c4-\u01cc\u01f1-\u01f3\u01f6-\u01f9\u0218-\u024f\u02a9-\u02ba\u02c2-\u0385\u0387\u038b\u038d\u03a2\u03cf\u03d7-\u03d9\u03db\u03dd\u03df\u03e1\u03f4-\u0400\u040d\u0450\u045d\u0482-\u048f\u04c5-\u04c6\u04c9-\u04ca\u04cd-\u04cf\u04ec-\u04ed\u04f6-\u04f7\u04fa-\u0530\u0557-\u0558\u055a-\u0560\u0587-\u05cf\u05eb-\u05ef\u05f3-\u0620\u063b-\u0640\u064b-\u0670\u06b8-\u06b9\u06bf\u06cf\u06d4\u06d6-\u06e4\u06e7-\u0904\u093a-\u093c\u093e-\u0957\u0962-\u0984\u098d-\u098e\u0991-\u0992\u09a9\u09b1\u09b3-\u09b5\u09ba-\u09db\u09de\u09e2-\u09ef\u09f2-\u0a04\u0a0b-\u0a0e\u0a11-\u0a12\u0a29\u0a31\u0a34\u0a37\u0a3a-\u0a58\u0a5d\u0a5f-\u0a71\u0a75-\u0a84\u0a8c\u0a8e\u0a92\u0aa9\u0ab1\u0ab4\u0aba-\u0abc\u0abe-\u0adf\u0ae1-\u0b04\u0b0d-\u0b0e\u0b11-\u0b12\u0b29\u0b31\u0b34-\u0b35\u0b3a-\u0b3c\u0b3e-\u0b5b\u0b5e\u0b62-\u0b84\u0b8b-\u0b8d\u0b91\u0b96-\u0b98\u0b9b\u0b9d\u0ba0-\u0ba2\u0ba5-\u0ba7\u0bab-\u0bad\u0bb6\u0bba-\u0c04\u0c0d\u0c11\u0c29\u0c34\u0c3a-\u0c5f\u0c62-\u0c84\u0c8d\u0c91\u0ca9\u0cb4\u0cba-\u0cdd\u0cdf\u0ce2-\u0d04\u0d0d\u0d11\u0d29\u0d3a-\u0d5f\u0d62-\u0e00\u0e2f\u0e31\u0e34-\u0e3f\u0e46-\u0e80\u0e83\u0e85-\u0e86\u0e89\u0e8b-\u0e8c\u0e8e-\u0e93\u0e98\u0ea0\u0ea4\u0ea6\u0ea8-\u0ea9\u0eac\u0eaf\u0eb1\u0eb4-\u0ebc\u0ebe-\u0ebf\u0ec5-\u0f3f\u0f48\u0f6a-\u109f\u10c6-\u10cf\u10f7-\u10ff\u1101\u1104\u1108\u110a\u110d\u1113-\u113b\u113d\u113f\u1141-\u114b\u114d\u114f\u1151-\u1153\u1156-\u1158\u115a-\u115e\u1162\u1164\u1166\u1168\u116a-\u116c\u116f-\u1171\u1174\u1176-\u119d\u119f-\u11a7\u11a9-\u11aa\u11ac-\u11ad\u11b0-\u11b6\u11b9\u11bb\u11c3-\u11ea\u11ec-\u11ef\u11f1-\u11f8\u11fa-\u1dff\u1e9c-\u1e9f\u1efa-\u1eff\u1f16-\u1f17\u1f1e-\u1f1f\u1f46-\u1f47\u1f4e-\u1f4f\u1f58\u1f5a\u1f5c\u1f5e\u1f7e-\u1f7f\u1fb5\u1fbd\u1fbf-\u1fc1\u1fc5\u1fcd-\u1fcf\u1fd4-\u1fd5\u1fdc-\u1fdf\u1fed-\u1ff1\u1ff5\u1ffd-\u2125\u2127-\u2129\u212c-\u212d\u212f-\u217f\u2183-\u3006\u3008-\u3020\u302a-\u3040\u3095-\u30a0\u30fb-\u3104\u312d-\u4dff\u9fa6-\uabff\ud7a4-\uffff]') # noqa # Simpler things nonPubidCharRegexp = re.compile("[^\x20\x0D\x0Aa-zA-Z0-9\\-'()+,./:=?;!*#@$_%]") class InfosetFilter(object): replacementRegexp = re.compile(r"U[\dA-F]{5,5}") def __init__(self, dropXmlnsLocalName=False, dropXmlnsAttrNs=False, preventDoubleDashComments=False, preventDashAtCommentEnd=False, replaceFormFeedCharacters=True, preventSingleQuotePubid=False): self.dropXmlnsLocalName = dropXmlnsLocalName self.dropXmlnsAttrNs = dropXmlnsAttrNs self.preventDoubleDashComments = preventDoubleDashComments self.preventDashAtCommentEnd = preventDashAtCommentEnd self.replaceFormFeedCharacters = replaceFormFeedCharacters self.preventSingleQuotePubid = preventSingleQuotePubid self.replaceCache = {} def coerceAttribute(self, name, namespace=None): if self.dropXmlnsLocalName and name.startswith("xmlns:"): warnings.warn("Attributes cannot begin with xmlns", DataLossWarning) return None elif (self.dropXmlnsAttrNs and namespace == "http://www.w3.org/2000/xmlns/"): warnings.warn("Attributes cannot be in the xml namespace", DataLossWarning) return None else: return self.toXmlName(name) def coerceElement(self, name): return self.toXmlName(name) def coerceComment(self, data): if self.preventDoubleDashComments: while "--" in data: warnings.warn("Comments cannot contain adjacent dashes", DataLossWarning) data = data.replace("--", "- -") if data.endswith("-"): warnings.warn("Comments cannot end in a dash", DataLossWarning) data += " " return data def coerceCharacters(self, data): if self.replaceFormFeedCharacters: for _ in range(data.count("\x0C")): warnings.warn("Text cannot contain U+000C", DataLossWarning) data = data.replace("\x0C", " ") # Other non-xml characters return data def coercePubid(self, data): dataOutput = data for char in nonPubidCharRegexp.findall(data): warnings.warn("Coercing non-XML pubid", DataLossWarning) replacement = self.getReplacementCharacter(char) dataOutput = dataOutput.replace(char, replacement) if self.preventSingleQuotePubid and dataOutput.find("'") >= 0: warnings.warn("Pubid cannot contain single quote", DataLossWarning) dataOutput = dataOutput.replace("'", self.getReplacementCharacter("'")) return dataOutput def toXmlName(self, name): nameFirst = name[0] nameRest = name[1:] m = nonXmlNameFirstBMPRegexp.match(nameFirst) if m: warnings.warn("Coercing non-XML name: %s" % name, DataLossWarning) nameFirstOutput = self.getReplacementCharacter(nameFirst) else: nameFirstOutput = nameFirst nameRestOutput = nameRest replaceChars = set(nonXmlNameBMPRegexp.findall(nameRest)) for char in replaceChars: warnings.warn("Coercing non-XML name: %s" % name, DataLossWarning) replacement = self.getReplacementCharacter(char) nameRestOutput = nameRestOutput.replace(char, replacement) return nameFirstOutput + nameRestOutput def getReplacementCharacter(self, char): if char in self.replaceCache: replacement = self.replaceCache[char] else: replacement = self.escapeChar(char) return replacement def fromXmlName(self, name): for item in set(self.replacementRegexp.findall(name)): name = name.replace(item, self.unescapeChar(item)) return name def escapeChar(self, char): replacement = "U%05X" % ord(char) self.replaceCache[char] = replacement return replacement def unescapeChar(self, charcode): return chr(int(charcode[1:], 16)) PKd]6=a~a~html5lib/_inputstream.pynu[from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from pip._vendor.six.moves import http_client, urllib import codecs import re from io import BytesIO, StringIO from pip._vendor import webencodings from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase from .constants import _ReparseException from . import _utils # Non-unicode versions of constants for use in the pre-parser spaceCharactersBytes = frozenset([item.encode("ascii") for item in spaceCharacters]) asciiLettersBytes = frozenset([item.encode("ascii") for item in asciiLetters]) asciiUppercaseBytes = frozenset([item.encode("ascii") for item in asciiUppercase]) spacesAngleBrackets = spaceCharactersBytes | frozenset([b">", b"<"]) invalid_unicode_no_surrogate = "[\u0001-\u0008\u000B\u000E-\u001F\u007F-\u009F\uFDD0-\uFDEF\uFFFE\uFFFF\U0001FFFE\U0001FFFF\U0002FFFE\U0002FFFF\U0003FFFE\U0003FFFF\U0004FFFE\U0004FFFF\U0005FFFE\U0005FFFF\U0006FFFE\U0006FFFF\U0007FFFE\U0007FFFF\U0008FFFE\U0008FFFF\U0009FFFE\U0009FFFF\U000AFFFE\U000AFFFF\U000BFFFE\U000BFFFF\U000CFFFE\U000CFFFF\U000DFFFE\U000DFFFF\U000EFFFE\U000EFFFF\U000FFFFE\U000FFFFF\U0010FFFE\U0010FFFF]" # noqa if _utils.supports_lone_surrogates: # Use one extra step of indirection and create surrogates with # eval. Not using this indirection would introduce an illegal # unicode literal on platforms not supporting such lone # surrogates. assert invalid_unicode_no_surrogate[-1] == "]" and invalid_unicode_no_surrogate.count("]") == 1 invalid_unicode_re = re.compile(invalid_unicode_no_surrogate[:-1] + eval('"\\uD800-\\uDFFF"') + # pylint:disable=eval-used "]") else: invalid_unicode_re = re.compile(invalid_unicode_no_surrogate) non_bmp_invalid_codepoints = {0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE, 0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE, 0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE, 0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, 0x10FFFF} ascii_punctuation_re = re.compile("[\u0009-\u000D\u0020-\u002F\u003A-\u0040\u005C\u005B-\u0060\u007B-\u007E]") # Cache for charsUntil() charsUntilRegEx = {} class BufferedStream(object): """Buffering for streams that do not have buffering of their own The buffer is implemented as a list of chunks on the assumption that joining many strings will be slow since it is O(n**2) """ def __init__(self, stream): self.stream = stream self.buffer = [] self.position = [-1, 0] # chunk number, offset def tell(self): pos = 0 for chunk in self.buffer[:self.position[0]]: pos += len(chunk) pos += self.position[1] return pos def seek(self, pos): assert pos <= self._bufferedBytes() offset = pos i = 0 while len(self.buffer[i]) < offset: offset -= len(self.buffer[i]) i += 1 self.position = [i, offset] def read(self, bytes): if not self.buffer: return self._readStream(bytes) elif (self.position[0] == len(self.buffer) and self.position[1] == len(self.buffer[-1])): return self._readStream(bytes) else: return self._readFromBuffer(bytes) def _bufferedBytes(self): return sum([len(item) for item in self.buffer]) def _readStream(self, bytes): data = self.stream.read(bytes) self.buffer.append(data) self.position[0] += 1 self.position[1] = len(data) return data def _readFromBuffer(self, bytes): remainingBytes = bytes rv = [] bufferIndex = self.position[0] bufferOffset = self.position[1] while bufferIndex < len(self.buffer) and remainingBytes != 0: assert remainingBytes > 0 bufferedData = self.buffer[bufferIndex] if remainingBytes <= len(bufferedData) - bufferOffset: bytesToRead = remainingBytes self.position = [bufferIndex, bufferOffset + bytesToRead] else: bytesToRead = len(bufferedData) - bufferOffset self.position = [bufferIndex, len(bufferedData)] bufferIndex += 1 rv.append(bufferedData[bufferOffset:bufferOffset + bytesToRead]) remainingBytes -= bytesToRead bufferOffset = 0 if remainingBytes: rv.append(self._readStream(remainingBytes)) return b"".join(rv) def HTMLInputStream(source, **kwargs): # Work around Python bug #20007: read(0) closes the connection. # http://bugs.python.org/issue20007 if (isinstance(source, http_client.HTTPResponse) or # Also check for addinfourl wrapping HTTPResponse (isinstance(source, urllib.response.addbase) and isinstance(source.fp, http_client.HTTPResponse))): isUnicode = False elif hasattr(source, "read"): isUnicode = isinstance(source.read(0), text_type) else: isUnicode = isinstance(source, text_type) if isUnicode: encodings = [x for x in kwargs if x.endswith("_encoding")] if encodings: raise TypeError("Cannot set an encoding with a unicode input, set %r" % encodings) return HTMLUnicodeInputStream(source, **kwargs) else: return HTMLBinaryInputStream(source, **kwargs) class HTMLUnicodeInputStream(object): """Provides a unicode stream of characters to the HTMLTokenizer. This class takes care of character encoding and removing or replacing incorrect byte-sequences and also provides column and line tracking. """ _defaultChunkSize = 10240 def __init__(self, source): """Initialises the HTMLInputStream. HTMLInputStream(source, [encoding]) -> Normalized stream from source for use by html5lib. source can be either a file-object, local filename or a string. The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element) """ if not _utils.supports_lone_surrogates: # Such platforms will have already checked for such # surrogate errors, so no need to do this checking. self.reportCharacterErrors = None elif len("\U0010FFFF") == 1: self.reportCharacterErrors = self.characterErrorsUCS4 else: self.reportCharacterErrors = self.characterErrorsUCS2 # List of where new lines occur self.newLines = [0] self.charEncoding = (lookupEncoding("utf-8"), "certain") self.dataStream = self.openStream(source) self.reset() def reset(self): self.chunk = "" self.chunkSize = 0 self.chunkOffset = 0 self.errors = [] # number of (complete) lines in previous chunks self.prevNumLines = 0 # number of columns in the last line of the previous chunk self.prevNumCols = 0 # Deal with CR LF and surrogates split over chunk boundaries self._bufferedCharacter = None def openStream(self, source): """Produces a file object from source. source can be either a file object, local filename or a string. """ # Already a file object if hasattr(source, 'read'): stream = source else: stream = StringIO(source) return stream def _position(self, offset): chunk = self.chunk nLines = chunk.count('\n', 0, offset) positionLine = self.prevNumLines + nLines lastLinePos = chunk.rfind('\n', 0, offset) if lastLinePos == -1: positionColumn = self.prevNumCols + offset else: positionColumn = offset - (lastLinePos + 1) return (positionLine, positionColumn) def position(self): """Returns (line, col) of the current position in the stream.""" line, col = self._position(self.chunkOffset) return (line + 1, col) def char(self): """ Read one character from the stream or queue if available. Return EOF when EOF is reached. """ # Read a new chunk from the input stream if necessary if self.chunkOffset >= self.chunkSize: if not self.readChunk(): return EOF chunkOffset = self.chunkOffset char = self.chunk[chunkOffset] self.chunkOffset = chunkOffset + 1 return char def readChunk(self, chunkSize=None): if chunkSize is None: chunkSize = self._defaultChunkSize self.prevNumLines, self.prevNumCols = self._position(self.chunkSize) self.chunk = "" self.chunkSize = 0 self.chunkOffset = 0 data = self.dataStream.read(chunkSize) # Deal with CR LF and surrogates broken across chunks if self._bufferedCharacter: data = self._bufferedCharacter + data self._bufferedCharacter = None elif not data: # We have no more data, bye-bye stream return False if len(data) > 1: lastv = ord(data[-1]) if lastv == 0x0D or 0xD800 <= lastv <= 0xDBFF: self._bufferedCharacter = data[-1] data = data[:-1] if self.reportCharacterErrors: self.reportCharacterErrors(data) # Replace invalid characters data = data.replace("\r\n", "\n") data = data.replace("\r", "\n") self.chunk = data self.chunkSize = len(data) return True def characterErrorsUCS4(self, data): for _ in range(len(invalid_unicode_re.findall(data))): self.errors.append("invalid-codepoint") def characterErrorsUCS2(self, data): # Someone picked the wrong compile option # You lose skip = False for match in invalid_unicode_re.finditer(data): if skip: continue codepoint = ord(match.group()) pos = match.start() # Pretty sure there should be endianness issues here if _utils.isSurrogatePair(data[pos:pos + 2]): # We have a surrogate pair! char_val = _utils.surrogatePairToCodepoint(data[pos:pos + 2]) if char_val in non_bmp_invalid_codepoints: self.errors.append("invalid-codepoint") skip = True elif (codepoint >= 0xD800 and codepoint <= 0xDFFF and pos == len(data) - 1): self.errors.append("invalid-codepoint") else: skip = False self.errors.append("invalid-codepoint") def charsUntil(self, characters, opposite=False): """ Returns a string of characters from the stream up to but not including any character in 'characters' or EOF. 'characters' must be a container that supports the 'in' method and iteration over its characters. """ # Use a cache of regexps to find the required characters try: chars = charsUntilRegEx[(characters, opposite)] except KeyError: if __debug__: for c in characters: assert(ord(c) < 128) regex = "".join(["\\x%02x" % ord(c) for c in characters]) if not opposite: regex = "^%s" % regex chars = charsUntilRegEx[(characters, opposite)] = re.compile("[%s]+" % regex) rv = [] while True: # Find the longest matching prefix m = chars.match(self.chunk, self.chunkOffset) if m is None: # If nothing matched, and it wasn't because we ran out of chunk, # then stop if self.chunkOffset != self.chunkSize: break else: end = m.end() # If not the whole chunk matched, return everything # up to the part that didn't match if end != self.chunkSize: rv.append(self.chunk[self.chunkOffset:end]) self.chunkOffset = end break # If the whole remainder of the chunk matched, # use it all and read the next chunk rv.append(self.chunk[self.chunkOffset:]) if not self.readChunk(): # Reached EOF break r = "".join(rv) return r def unget(self, char): # Only one character is allowed to be ungotten at once - it must # be consumed again before any further call to unget if char is not EOF: if self.chunkOffset == 0: # unget is called quite rarely, so it's a good idea to do # more work here if it saves a bit of work in the frequently # called char and charsUntil. # So, just prepend the ungotten character onto the current # chunk: self.chunk = char + self.chunk self.chunkSize += 1 else: self.chunkOffset -= 1 assert self.chunk[self.chunkOffset] == char class HTMLBinaryInputStream(HTMLUnicodeInputStream): """Provides a unicode stream of characters to the HTMLTokenizer. This class takes care of character encoding and removing or replacing incorrect byte-sequences and also provides column and line tracking. """ def __init__(self, source, override_encoding=None, transport_encoding=None, same_origin_parent_encoding=None, likely_encoding=None, default_encoding="windows-1252", useChardet=True): """Initialises the HTMLInputStream. HTMLInputStream(source, [encoding]) -> Normalized stream from source for use by html5lib. source can be either a file-object, local filename or a string. The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element) """ # Raw Stream - for unicode objects this will encode to utf-8 and set # self.charEncoding as appropriate self.rawStream = self.openStream(source) HTMLUnicodeInputStream.__init__(self, self.rawStream) # Encoding Information # Number of bytes to use when looking for a meta element with # encoding information self.numBytesMeta = 1024 # Number of bytes to use when using detecting encoding using chardet self.numBytesChardet = 100 # Things from args self.override_encoding = override_encoding self.transport_encoding = transport_encoding self.same_origin_parent_encoding = same_origin_parent_encoding self.likely_encoding = likely_encoding self.default_encoding = default_encoding # Determine encoding self.charEncoding = self.determineEncoding(useChardet) assert self.charEncoding[0] is not None # Call superclass self.reset() def reset(self): self.dataStream = self.charEncoding[0].codec_info.streamreader(self.rawStream, 'replace') HTMLUnicodeInputStream.reset(self) def openStream(self, source): """Produces a file object from source. source can be either a file object, local filename or a string. """ # Already a file object if hasattr(source, 'read'): stream = source else: stream = BytesIO(source) try: stream.seek(stream.tell()) except Exception: stream = BufferedStream(stream) return stream def determineEncoding(self, chardet=True): # BOMs take precedence over everything # This will also read past the BOM if present charEncoding = self.detectBOM(), "certain" if charEncoding[0] is not None: return charEncoding # If we've been overridden, we've been overridden charEncoding = lookupEncoding(self.override_encoding), "certain" if charEncoding[0] is not None: return charEncoding # Now check the transport layer charEncoding = lookupEncoding(self.transport_encoding), "certain" if charEncoding[0] is not None: return charEncoding # Look for meta elements with encoding information charEncoding = self.detectEncodingMeta(), "tentative" if charEncoding[0] is not None: return charEncoding # Parent document encoding charEncoding = lookupEncoding(self.same_origin_parent_encoding), "tentative" if charEncoding[0] is not None and not charEncoding[0].name.startswith("utf-16"): return charEncoding # "likely" encoding charEncoding = lookupEncoding(self.likely_encoding), "tentative" if charEncoding[0] is not None: return charEncoding # Guess with chardet, if available if chardet: try: from pip._vendor.chardet.universaldetector import UniversalDetector except ImportError: pass else: buffers = [] detector = UniversalDetector() while not detector.done: buffer = self.rawStream.read(self.numBytesChardet) assert isinstance(buffer, bytes) if not buffer: break buffers.append(buffer) detector.feed(buffer) detector.close() encoding = lookupEncoding(detector.result['encoding']) self.rawStream.seek(0) if encoding is not None: return encoding, "tentative" # Try the default encoding charEncoding = lookupEncoding(self.default_encoding), "tentative" if charEncoding[0] is not None: return charEncoding # Fallback to html5lib's default if even that hasn't worked return lookupEncoding("windows-1252"), "tentative" def changeEncoding(self, newEncoding): assert self.charEncoding[1] != "certain" newEncoding = lookupEncoding(newEncoding) if newEncoding is None: return if newEncoding.name in ("utf-16be", "utf-16le"): newEncoding = lookupEncoding("utf-8") assert newEncoding is not None elif newEncoding == self.charEncoding[0]: self.charEncoding = (self.charEncoding[0], "certain") else: self.rawStream.seek(0) self.charEncoding = (newEncoding, "certain") self.reset() raise _ReparseException("Encoding changed from %s to %s" % (self.charEncoding[0], newEncoding)) def detectBOM(self): """Attempts to detect at BOM at the start of the stream. If an encoding can be determined from the BOM return the name of the encoding otherwise return None""" bomDict = { codecs.BOM_UTF8: 'utf-8', codecs.BOM_UTF16_LE: 'utf-16le', codecs.BOM_UTF16_BE: 'utf-16be', codecs.BOM_UTF32_LE: 'utf-32le', codecs.BOM_UTF32_BE: 'utf-32be' } # Go to beginning of file and read in 4 bytes string = self.rawStream.read(4) assert isinstance(string, bytes) # Try detecting the BOM using bytes from the string encoding = bomDict.get(string[:3]) # UTF-8 seek = 3 if not encoding: # Need to detect UTF-32 before UTF-16 encoding = bomDict.get(string) # UTF-32 seek = 4 if not encoding: encoding = bomDict.get(string[:2]) # UTF-16 seek = 2 # Set the read position past the BOM if one was found, otherwise # set it to the start of the stream if encoding: self.rawStream.seek(seek) return lookupEncoding(encoding) else: self.rawStream.seek(0) return None def detectEncodingMeta(self): """Report the encoding declared by the meta element """ buffer = self.rawStream.read(self.numBytesMeta) assert isinstance(buffer, bytes) parser = EncodingParser(buffer) self.rawStream.seek(0) encoding = parser.getEncoding() if encoding is not None and encoding.name in ("utf-16be", "utf-16le"): encoding = lookupEncoding("utf-8") return encoding class EncodingBytes(bytes): """String-like object with an associated position and various extra methods If the position is ever greater than the string length then an exception is raised""" def __new__(self, value): assert isinstance(value, bytes) return bytes.__new__(self, value.lower()) def __init__(self, value): # pylint:disable=unused-argument self._position = -1 def __iter__(self): return self def __next__(self): p = self._position = self._position + 1 if p >= len(self): raise StopIteration elif p < 0: raise TypeError return self[p:p + 1] def next(self): # Py2 compat return self.__next__() def previous(self): p = self._position if p >= len(self): raise StopIteration elif p < 0: raise TypeError self._position = p = p - 1 return self[p:p + 1] def setPosition(self, position): if self._position >= len(self): raise StopIteration self._position = position def getPosition(self): if self._position >= len(self): raise StopIteration if self._position >= 0: return self._position else: return None position = property(getPosition, setPosition) def getCurrentByte(self): return self[self.position:self.position + 1] currentByte = property(getCurrentByte) def skip(self, chars=spaceCharactersBytes): """Skip past a list of characters""" p = self.position # use property for the error-checking while p < len(self): c = self[p:p + 1] if c not in chars: self._position = p return c p += 1 self._position = p return None def skipUntil(self, chars): p = self.position while p < len(self): c = self[p:p + 1] if c in chars: self._position = p return c p += 1 self._position = p return None def matchBytes(self, bytes): """Look for a sequence of bytes at the start of a string. If the bytes are found return True and advance the position to the byte after the match. Otherwise return False and leave the position alone""" rv = self.startswith(bytes, self.position) if rv: self.position += len(bytes) return rv def jumpTo(self, bytes): """Look for the next sequence of bytes matching a given sequence. If a match is found advance the position to the last byte of the match""" try: self._position = self.index(bytes, self.position) + len(bytes) - 1 except ValueError: raise StopIteration return True class EncodingParser(object): """Mini parser for detecting character encoding from meta elements""" def __init__(self, data): """string - the data to work on for encoding detection""" self.data = EncodingBytes(data) self.encoding = None def getEncoding(self): if b"") def handleMeta(self): if self.data.currentByte not in spaceCharactersBytes: # if we have ") def getAttribute(self): """Return a name,value pair for the next attribute in the stream, if one is found, or None""" data = self.data # Step 1 (skip chars) c = data.skip(spaceCharactersBytes | frozenset([b"/"])) assert c is None or len(c) == 1 # Step 2 if c in (b">", None): return None # Step 3 attrName = [] attrValue = [] # Step 4 attribute name while True: if c == b"=" and attrName: break elif c in spaceCharactersBytes: # Step 6! c = data.skip() break elif c in (b"/", b">"): return b"".join(attrName), b"" elif c in asciiUppercaseBytes: attrName.append(c.lower()) elif c is None: return None else: attrName.append(c) # Step 5 c = next(data) # Step 7 if c != b"=": data.previous() return b"".join(attrName), b"" # Step 8 next(data) # Step 9 c = data.skip() # Step 10 if c in (b"'", b'"'): # 10.1 quoteChar = c while True: # 10.2 c = next(data) # 10.3 if c == quoteChar: next(data) return b"".join(attrName), b"".join(attrValue) # 10.4 elif c in asciiUppercaseBytes: attrValue.append(c.lower()) # 10.5 else: attrValue.append(c) elif c == b">": return b"".join(attrName), b"" elif c in asciiUppercaseBytes: attrValue.append(c.lower()) elif c is None: return None else: attrValue.append(c) # Step 11 while True: c = next(data) if c in spacesAngleBrackets: return b"".join(attrName), b"".join(attrValue) elif c in asciiUppercaseBytes: attrValue.append(c.lower()) elif c is None: return None else: attrValue.append(c) class ContentAttrParser(object): def __init__(self, data): assert isinstance(data, bytes) self.data = data def parse(self): try: # Check if the attr name is charset # otherwise return self.data.jumpTo(b"charset") self.data.position += 1 self.data.skip() if not self.data.currentByte == b"=": # If there is no = sign keep looking for attrs return None self.data.position += 1 self.data.skip() # Look for an encoding between matching quote marks if self.data.currentByte in (b'"', b"'"): quoteMark = self.data.currentByte self.data.position += 1 oldPosition = self.data.position if self.data.jumpTo(quoteMark): return self.data[oldPosition:self.data.position] else: return None else: # Unquoted value oldPosition = self.data.position try: self.data.skipUntil(spaceCharactersBytes) return self.data[oldPosition:self.data.position] except StopIteration: # Return the whole remaining value return self.data[oldPosition:] except StopIteration: return None def lookupEncoding(encoding): """Return the python codec name corresponding to an encoding or None if the string doesn't correspond to a valid encoding.""" if isinstance(encoding, bytes): try: encoding = encoding.decode("ascii") except UnicodeDecodeError: return None if encoding is not None: try: return webencodings.lookup(encoding) except AttributeError: return None else: return None PKd]0html5lib/_trie/__pycache__/datrie.cpython-38.pycnu[U .e@sLddlmZmZmZddlmZddlmZddl mZ Gddde ZdS))absolute_importdivisionunicode_literals)Trie) text_typec@sVeZdZddZddZddZddZd d Zdd d ZddZ ddZ ddZ d S)rcCsjt}|D]*}t|ts$td|D]}||q(qtd||_| D]\}}||j|<qRdS)NzAll keys must be strings) setkeys isinstancer TypeErroraddDATriejoin_dataitems)selfdatacharskeycharvaluerE/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_trie/datrie.py__init__ s  z Trie.__init__cCs ||jkSNrrrrrr __contains__szTrie.__contains__cCs t|jSr)lenrrrrr__len__sz Trie.__len__cCs tdSr)NotImplementedErrorr rrr__iter__sz Trie.__iter__cCs |j|Srrrrrr __getitem__szTrie.__getitem__NcCs |j|Sr)rr rprefixrrrr "sz Trie.keyscCs |j|Sr)rhas_keys_with_prefixr%rrrr'%szTrie.has_keys_with_prefixcCs |j|Sr)rlongest_prefixr%rrrr((szTrie.longest_prefixcCs |j|Sr)rlongest_prefix_itemr%rrrr)+szTrie.longest_prefix_item)N) __name__ __module__ __qualname__rrr!r#r$r r'r(r)rrrrr s  rN) Z __future__rrrZdatrierrZpip._vendor.sixrZ_baseZABCTrierrrrs   PKd] ,html5lib/_trie/__pycache__/py.cpython-38.pycnu[U .e@sLddlmZmZmZddlmZddlmZddlm Z Gddde Z dS) )absolute_importdivisionunicode_literals) text_type) bisect_left)Triec@sFeZdZddZddZddZddZd d Zdd d ZddZ d S)rcCsJtdd|Dstd||_t||_d|_dt|f|_dS)Ncss|]}t|tVqdSN) isinstancer).0xr A/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_trie/py.py sz Trie.__init__..zAll keys must be stringsr) allkeys TypeError_datasorted_keys _cachestrlen _cachepoints)selfdatar r r__init__ s z Trie.__init__cCs ||jkSr rrkeyr r r __contains__szTrie.__contains__cCs t|jSr )rrrr r r__len__sz Trie.__len__cCs t|jSr )iterrr!r r r__iter__sz Trie.__iter__cCs |j|Sr rrr r r __getitem__szTrie.__getitem__NcCs|dks|dks|js t|jS||jrL|j\}}t|j|||}}nt|j|}}t}|t|jkrt|S|j||r||j||d7}qt||_||f|_|S)Nrr)rset startswithrrrradd)rprefixlohistartirr r rrs     z Trie.keyscCsd||jkrdS||jr6|j\}}t|j|||}n t|j|}|t|jkrTdS|j||S)NTF)rr'rrrrr)rr)r*r+r-r r rhas_keys_with_prefix6s    zTrie.has_keys_with_prefix)N) __name__ __module__ __qualname__rr r"r$r%rr.r r r rr s  rN) Z __future__rrrZpip._vendor.sixrZbisectrZ_baserZABCTrier r r rs   PKd]/2html5lib/_trie/__pycache__/__init__.cpython-38.pycnu[U .e!@sRddlmZmZmZddlmZeZzddlmZWne k rHYnXeZdS))absolute_importdivisionunicode_literals)TrieN) Z __future__rrrpyrZPyTrieZdatrieZDATrie ImportErrorr r G/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_trie/__init__.pys PKd]fĪ  5html5lib/_trie/__pycache__/_base.cpython-38.opt-1.pycnu[U .e@sZddlmZmZmZzddlmZWn ek rDddlmZYnXGdddeZdS))absolute_importdivisionunicode_literals)Mappingcs:eZdZdZd fdd ZddZddZd d ZZS) TriezAbstract base class for triesNcs0tt|}dkrt|Sfdd|DS)Ncsh|]}|r|qS) startswith).0xprefixrD/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_trie/_base.py s zTrie.keys..)superrkeysset)selfr r __class__r r r sz Trie.keyscCs"|D]}||rdSqdS)NTF)rr)rr keyrrr has_keys_with_prefixs  zTrie.has_keys_with_prefixcCsT||kr |Stdt|dD](}|d| |kr|d| Sqt|dS)N)rangelenKeyError)rr irrr longest_prefixs zTrie.longest_prefixcCs||}|||fS)N)r)rr Zlprefixrrr longest_prefix_item&s zTrie.longest_prefix_item)N) __name__ __module__ __qualname____doc__rrrr __classcell__rrrr r s   rN) Z __future__rrrZcollections.abcr ImportError collectionsrrrrr s PKd]6html5lib/_trie/__pycache__/datrie.cpython-38.opt-1.pycnu[U .e@sLddlmZmZmZddlmZddlmZddl mZ Gddde ZdS))absolute_importdivisionunicode_literals)Trie) text_typec@sVeZdZddZddZddZddZd d Zdd d ZddZ ddZ ddZ d S)rcCsjt}|D]*}t|ts$td|D]}||q(qtd||_| D]\}}||j|<qRdS)NzAll keys must be strings) setkeys isinstancer TypeErroraddDATriejoin_dataitems)selfdatacharskeycharvaluerE/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_trie/datrie.py__init__ s  z Trie.__init__cCs ||jkSNrrrrrr __contains__szTrie.__contains__cCs t|jSr)lenrrrrr__len__sz Trie.__len__cCs tdSr)NotImplementedErrorr rrr__iter__sz Trie.__iter__cCs |j|Srrrrrr __getitem__szTrie.__getitem__NcCs |j|Sr)rr rprefixrrrr "sz Trie.keyscCs |j|Sr)rhas_keys_with_prefixr%rrrr'%szTrie.has_keys_with_prefixcCs |j|Sr)rlongest_prefixr%rrrr((szTrie.longest_prefixcCs |j|Sr)rlongest_prefix_itemr%rrrr)+szTrie.longest_prefix_item)N) __name__ __module__ __qualname__rrr!r#r$r r'r(r)rrrrr s  rN) Z __future__rrrZdatrierrZpip._vendor.sixrZ_baseZABCTrierrrrs   PKd]fĪ  /html5lib/_trie/__pycache__/_base.cpython-38.pycnu[U .e@sZddlmZmZmZzddlmZWn ek rDddlmZYnXGdddeZdS))absolute_importdivisionunicode_literals)Mappingcs:eZdZdZd fdd ZddZddZd d ZZS) TriezAbstract base class for triesNcs0tt|}dkrt|Sfdd|DS)Ncsh|]}|r|qS) startswith).0xprefixrD/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_trie/_base.py s zTrie.keys..)superrkeysset)selfr r __class__r r r sz Trie.keyscCs"|D]}||rdSqdS)NTF)rr)rr keyrrr has_keys_with_prefixs  zTrie.has_keys_with_prefixcCsT||kr |Stdt|dD](}|d| |kr|d| Sqt|dS)N)rangelenKeyError)rr irrr longest_prefixs zTrie.longest_prefixcCs||}|||fS)N)r)rr Zlprefixrrr longest_prefix_item&s zTrie.longest_prefix_item)N) __name__ __module__ __qualname____doc__rrrr __classcell__rrrr r s   rN) Z __future__rrrZcollections.abcr ImportError collectionsrrrrr s PKd] 2html5lib/_trie/__pycache__/py.cpython-38.opt-1.pycnu[U .e@sLddlmZmZmZddlmZddlmZddlm Z Gddde Z dS) )absolute_importdivisionunicode_literals) text_type) bisect_left)Triec@sFeZdZddZddZddZddZd d Zdd d ZddZ d S)rcCsJtdd|Dstd||_t||_d|_dt|f|_dS)Ncss|]}t|tVqdSN) isinstancer).0xr A/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_trie/py.py sz Trie.__init__..zAll keys must be stringsr) allkeys TypeError_datasorted_keys _cachestrlen _cachepoints)selfdatar r r__init__ s z Trie.__init__cCs ||jkSr rrkeyr r r __contains__szTrie.__contains__cCs t|jSr )rrrr r r__len__sz Trie.__len__cCs t|jSr )iterrr!r r r__iter__sz Trie.__iter__cCs |j|Sr rrr r r __getitem__szTrie.__getitem__NcCs|dks|dks|js t|jS||jrL|j\}}t|j|||}}nt|j|}}t}|t|jkrt|S|j||r||j||d7}qt||_||f|_|S)Nrr)rset startswithrrrradd)rprefixlohistartirr r rrs     z Trie.keyscCsd||jkrdS||jr6|j\}}t|j|||}n t|j|}|t|jkrTdS|j||S)NTF)rr'rrrrr)rr)r*r+r-r r rhas_keys_with_prefix6s    zTrie.has_keys_with_prefix)N) __name__ __module__ __qualname__rr r"r$r%rr.r r r rr s  rN) Z __future__rrrZpip._vendor.sixrZbisectrZ_baserZABCTrier r r rs   PKd]/8html5lib/_trie/__pycache__/__init__.cpython-38.opt-1.pycnu[U .e!@sRddlmZmZmZddlmZeZzddlmZWne k rHYnXeZdS))absolute_importdivisionunicode_literals)TrieN) Z __future__rrrpyrZPyTrieZdatrieZDATrie ImportErrorr r G/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_trie/__init__.pys PKd]KOnhtml5lib/_trie/py.pynu[from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError("All keys must be strings") self._data = data self._keys = sorted(data.keys()) self._cachestr = "" self._cachepoints = (0, len(data)) def __contains__(self, key): return key in self._data def __len__(self): return len(self._data) def __iter__(self): return iter(self._data) def __getitem__(self, key): return self._data[key] def keys(self, prefix=None): if prefix is None or prefix == "" or not self._keys: return set(self._keys) if prefix.startswith(self._cachestr): lo, hi = self._cachepoints start = i = bisect_left(self._keys, prefix, lo, hi) else: start = i = bisect_left(self._keys, prefix) keys = set() if start == len(self._keys): return keys while self._keys[i].startswith(prefix): keys.add(self._keys[i]) i += 1 self._cachestr = prefix self._cachepoints = (start, i) return keys def has_keys_with_prefix(self, prefix): if prefix in self._data: return True if prefix.startswith(self._cachestr): lo, hi = self._cachepoints i = bisect_left(self._keys, prefix, lo, hi) else: i = bisect_left(self._keys, prefix) if i == len(self._keys): return False return self._keys[i].startswith(prefix) PKd]$Uhtml5lib/_trie/datrie.pynu[from __future__ import absolute_import, division, unicode_literals from datrie import Trie as DATrie from pip._vendor.six import text_type from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): chars = set() for key in data.keys(): if not isinstance(key, text_type): raise TypeError("All keys must be strings") for char in key: chars.add(char) self._data = DATrie("".join(chars)) for key, value in data.items(): self._data[key] = value def __contains__(self, key): return key in self._data def __len__(self): return len(self._data) def __iter__(self): raise NotImplementedError() def __getitem__(self, key): return self._data[key] def keys(self, prefix=None): return self._data.keys(prefix) def has_keys_with_prefix(self, prefix): return self._data.has_keys_with_prefix(prefix) def longest_prefix(self, prefix): return self._data.longest_prefix(prefix) def longest_prefix_item(self, prefix): return self._data.longest_prefix_item(prefix) PKd]html5lib/_trie/_base.pynu[from __future__ import absolute_import, division, unicode_literals try: from collections.abc import Mapping except ImportError: # Python 2.7 from collections import Mapping class Trie(Mapping): """Abstract base class for tries""" def keys(self, prefix=None): # pylint:disable=arguments-differ keys = super(Trie, self).keys() if prefix is None: return set(keys) return {x for x in keys if x.startswith(prefix)} def has_keys_with_prefix(self, prefix): for key in self.keys(): if key.startswith(prefix): return True return False def longest_prefix(self, prefix): if prefix in self: return prefix for i in range(1, len(prefix) + 1): if prefix[:-i] in self: return prefix[:-i] raise KeyError(prefix) def longest_prefix_item(self, prefix): lprefix = self.longest_prefix(prefix) return (lprefix, self[lprefix]) PKd]]Tmmhtml5lib/_trie/__init__.pynu[from __future__ import absolute_import, division, unicode_literals from .py import Trie __all__ = ["Trie"] PKd]s==html5lib/serializer.pynu[from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import re from codecs import register_error, xmlcharrefreplace_errors from .constants import voidElements, booleanAttributes, spaceCharacters from .constants import rcdataElements, entities, xmlEntities from . import treewalkers, _utils from xml.sax.saxutils import escape _quoteAttributeSpecChars = "".join(spaceCharacters) + "\"'=<>`" _quoteAttributeSpec = re.compile("[" + _quoteAttributeSpecChars + "]") _quoteAttributeLegacy = re.compile("[" + _quoteAttributeSpecChars + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n" "\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15" "\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" "\x20\x2f\x60\xa0\u1680\u180e\u180f\u2000" "\u2001\u2002\u2003\u2004\u2005\u2006\u2007" "\u2008\u2009\u200a\u2028\u2029\u202f\u205f" "\u3000]") _encode_entity_map = {} _is_ucs4 = len("\U0010FFFF") == 1 for k, v in list(entities.items()): # skip multi-character entities if ((_is_ucs4 and len(v) > 1) or (not _is_ucs4 and len(v) > 2)): continue if v != "&": if len(v) == 2: v = _utils.surrogatePairToCodepoint(v) else: v = ord(v) if v not in _encode_entity_map or k.islower(): # prefer < over < and similarly for &, >, etc. _encode_entity_map[v] = k def htmlentityreplace_errors(exc): if isinstance(exc, (UnicodeEncodeError, UnicodeTranslateError)): res = [] codepoints = [] skip = False for i, c in enumerate(exc.object[exc.start:exc.end]): if skip: skip = False continue index = i + exc.start if _utils.isSurrogatePair(exc.object[index:min([exc.end, index + 2])]): codepoint = _utils.surrogatePairToCodepoint(exc.object[index:index + 2]) skip = True else: codepoint = ord(c) codepoints.append(codepoint) for cp in codepoints: e = _encode_entity_map.get(cp) if e: res.append("&") res.append(e) if not e.endswith(";"): res.append(";") else: res.append("&#x%s;" % (hex(cp)[2:])) return ("".join(res), exc.end) else: return xmlcharrefreplace_errors(exc) register_error("htmlentityreplace", htmlentityreplace_errors) def serialize(input, tree="etree", encoding=None, **serializer_opts): """Serializes the input token stream using the specified treewalker :arg input: the token stream to serialize :arg tree: the treewalker to use :arg encoding: the encoding to use :arg serializer_opts: any options to pass to the :py:class:`html5lib.serializer.HTMLSerializer` that gets created :returns: the tree serialized as a string Example: >>> from html5lib.html5parser import parse >>> from html5lib.serializer import serialize >>> token_stream = parse('

Hi!

') >>> serialize(token_stream, omit_optional_tags=False) '

Hi!

' """ # XXX: Should we cache this? walker = treewalkers.getTreeWalker(tree) s = HTMLSerializer(**serializer_opts) return s.render(walker(input), encoding) class HTMLSerializer(object): # attribute quoting options quote_attr_values = "legacy" # be secure by default quote_char = '"' use_best_quote_char = True # tag syntax options omit_optional_tags = True minimize_boolean_attributes = True use_trailing_solidus = False space_before_trailing_solidus = True # escaping options escape_lt_in_attrs = False escape_rcdata = False resolve_entities = True # miscellaneous options alphabetical_attributes = False inject_meta_charset = True strip_whitespace = False sanitize = False options = ("quote_attr_values", "quote_char", "use_best_quote_char", "omit_optional_tags", "minimize_boolean_attributes", "use_trailing_solidus", "space_before_trailing_solidus", "escape_lt_in_attrs", "escape_rcdata", "resolve_entities", "alphabetical_attributes", "inject_meta_charset", "strip_whitespace", "sanitize") def __init__(self, **kwargs): """Initialize HTMLSerializer :arg inject_meta_charset: Whether or not to inject the meta charset. Defaults to ``True``. :arg quote_attr_values: Whether to quote attribute values that don't require quoting per legacy browser behavior (``"legacy"``), when required by the standard (``"spec"``), or always (``"always"``). Defaults to ``"legacy"``. :arg quote_char: Use given quote character for attribute quoting. Defaults to ``"`` which will use double quotes unless attribute value contains a double quote, in which case single quotes are used. :arg escape_lt_in_attrs: Whether or not to escape ``<`` in attribute values. Defaults to ``False``. :arg escape_rcdata: Whether to escape characters that need to be escaped within normal elements within rcdata elements such as style. Defaults to ``False``. :arg resolve_entities: Whether to resolve named character entities that appear in the source tree. The XML predefined entities < > & " ' are unaffected by this setting. Defaults to ``True``. :arg strip_whitespace: Whether to remove semantically meaningless whitespace. (This compresses all whitespace to a single space except within ``pre``.) Defaults to ``False``. :arg minimize_boolean_attributes: Shortens boolean attributes to give just the attribute value, for example:: becomes:: Defaults to ``True``. :arg use_trailing_solidus: Includes a close-tag slash at the end of the start tag of void elements (empty elements whose end tag is forbidden). E.g. ``
``. Defaults to ``False``. :arg space_before_trailing_solidus: Places a space immediately before the closing slash in a tag using a trailing solidus. E.g. ``
``. Requires ``use_trailing_solidus=True``. Defaults to ``True``. :arg sanitize: Strip all unsafe or unknown constructs from output. See :py:class:`html5lib.filters.sanitizer.Filter`. Defaults to ``False``. :arg omit_optional_tags: Omit start/end tags that are optional. Defaults to ``True``. :arg alphabetical_attributes: Reorder attributes to be in alphabetical order. Defaults to ``False``. """ unexpected_args = frozenset(kwargs) - frozenset(self.options) if len(unexpected_args) > 0: raise TypeError("__init__() got an unexpected keyword argument '%s'" % next(iter(unexpected_args))) if 'quote_char' in kwargs: self.use_best_quote_char = False for attr in self.options: setattr(self, attr, kwargs.get(attr, getattr(self, attr))) self.errors = [] self.strict = False def encode(self, string): assert(isinstance(string, text_type)) if self.encoding: return string.encode(self.encoding, "htmlentityreplace") else: return string def encodeStrict(self, string): assert(isinstance(string, text_type)) if self.encoding: return string.encode(self.encoding, "strict") else: return string def serialize(self, treewalker, encoding=None): # pylint:disable=too-many-nested-blocks self.encoding = encoding in_cdata = False self.errors = [] if encoding and self.inject_meta_charset: from .filters.inject_meta_charset import Filter treewalker = Filter(treewalker, encoding) # Alphabetical attributes is here under the assumption that none of # the later filters add or change order of attributes; it needs to be # before the sanitizer so escaped elements come out correctly if self.alphabetical_attributes: from .filters.alphabeticalattributes import Filter treewalker = Filter(treewalker) # WhitespaceFilter should be used before OptionalTagFilter # for maximum efficiently of this latter filter if self.strip_whitespace: from .filters.whitespace import Filter treewalker = Filter(treewalker) if self.sanitize: from .filters.sanitizer import Filter treewalker = Filter(treewalker) if self.omit_optional_tags: from .filters.optionaltags import Filter treewalker = Filter(treewalker) for token in treewalker: type = token["type"] if type == "Doctype": doctype = "= 0: if token["systemId"].find("'") >= 0: self.serializeError("System identifier contains both single and double quote characters") quote_char = "'" else: quote_char = '"' doctype += " %s%s%s" % (quote_char, token["systemId"], quote_char) doctype += ">" yield self.encodeStrict(doctype) elif type in ("Characters", "SpaceCharacters"): if type == "SpaceCharacters" or in_cdata: if in_cdata and token["data"].find("= 0: self.serializeError("Unexpected ") elif type == "EndTag": name = token["name"] if name in rcdataElements: in_cdata = False elif in_cdata: self.serializeError("Unexpected child element of a CDATA element") yield self.encodeStrict("" % name) elif type == "Comment": data = token["data"] if data.find("--") >= 0: self.serializeError("Comment contains --") yield self.encodeStrict("" % token["data"]) elif type == "Entity": name = token["name"] key = name + ";" if key not in entities: self.serializeError("Entity %s not recognized" % name) if self.resolve_entities and key not in xmlEntities: data = entities[key] else: data = "&%s;" % name yield self.encodeStrict(data) else: self.serializeError(token["data"]) def render(self, treewalker, encoding=None): """Serializes the stream from the treewalker into a string :arg treewalker: the treewalker to serialize :arg encoding: the string encoding to use :returns: the serialized tree Example: >>> from html5lib import parse, getTreeWalker >>> from html5lib.serializer import HTMLSerializer >>> token_stream = parse('Hi!') >>> walker = getTreeWalker('etree') >>> serializer = HTMLSerializer(omit_optional_tags=False) >>> serializer.render(walker(token_stream)) 'Hi!' """ if encoding: return b"".join(list(self.serialize(treewalker, encoding))) else: return "".join(list(self.serialize(treewalker))) def serializeError(self, data="XXX ERROR MESSAGE NEEDED"): # XXX The idea is to make data mandatory. self.errors.append(data) if self.strict: raise SerializeError class SerializeError(Exception): """Error in serialized tree""" pass PKd]Ea4html5lib/treeadapters/__pycache__/sax.cpython-38.pycnu[U .e@sdddlmZmZmZddlmZddlmZmZiZ e D]\Z Z Z e dk r r)Z __future__rrrZxml.sax.xmlreaderrZ constantsrrrvaluesrZ localNamer rrrrrs  PKd]@9html5lib/treeadapters/__pycache__/__init__.cpython-38.pycnu[U .e@s^dZddlmZmZmZddlmZdgZzddlmZWne k rNYn Xe ddS) aTree adapters let you convert from one tree structure to another Example: .. code-block:: python from pip._vendor import html5lib from pip._vendor.html5lib.treeadapters import genshi doc = 'Hi!' treebuilder = html5lib.getTreeBuilder('etree') parser = html5lib.HTMLParser(tree=treebuilder) tree = parser.parse(doc) TreeWalker = html5lib.getTreeWalker('etree') genshi_tree = genshi.to_genshi(TreeWalker(tree)) )absolute_importdivisionunicode_literals)saxr)genshirN) __doc__Z __future__rrrr__all__r ImportErrorappendr r N/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/treeadapters/__init__.pys PKd]l%7html5lib/treeadapters/__pycache__/genshi.cpython-38.pycnu[U .e@sLddlmZmZmZddlmZmZddlmZmZm Z m Z m Z ddZ dS))absolute_importdivisionunicode_literals)QNameAttrs)STARTENDTEXTCOMMENTDOCTYPEccsRg}|D]*}|d}|dkr.||dn|rHtd|dfVg}|dkr|drnd|d|d f}n|d }td d |dD}tt||fdfV|d krd }|d kr|drd|d|d f}n|d }tt|dfVq|dkr t|ddfVq|dkrt |d |d|dfdfVqq|rNtd|dfVdS)zConvert a tree to a genshi tree :arg walker: the treewalker to use to walk the tree to convert it :returns: generator of genshi nodes type)Z CharactersZSpaceCharactersdata)Nr)ZStartTagEmptyTag namespace{%s}%snamecSs4g|],\}}t|ddk r"d|n|d|fqS)rNr)r).0attrvaluerL/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py szto_genshi..rZEndTagCommentZDoctypeZpublicIdZsystemIdN) appendr joinritemsrrrr r )Zwalkertexttokenr rZattrsrrr to_genshisD   r!N) Z __future__rrrZ genshi.corerrrrr r r r!rrrrsPKd]l%=html5lib/treeadapters/__pycache__/genshi.cpython-38.opt-1.pycnu[U .e@sLddlmZmZmZddlmZmZddlmZmZm Z m Z m Z ddZ dS))absolute_importdivisionunicode_literals)QNameAttrs)STARTENDTEXTCOMMENTDOCTYPEccsRg}|D]*}|d}|dkr.||dn|rHtd|dfVg}|dkr|drnd|d|d f}n|d }td d |dD}tt||fdfV|d krd }|d kr|drd|d|d f}n|d }tt|dfVq|dkr t|ddfVq|dkrt |d |d|dfdfVqq|rNtd|dfVdS)zConvert a tree to a genshi tree :arg walker: the treewalker to use to walk the tree to convert it :returns: generator of genshi nodes type)Z CharactersZSpaceCharactersdata)Nr)ZStartTagEmptyTag namespace{%s}%snamecSs4g|],\}}t|ddk r"d|n|d|fqS)rNr)r).0attrvaluerL/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py szto_genshi..rZEndTagCommentZDoctypeZpublicIdZsystemIdN) appendr joinritemsrrrr r )Zwalkertexttokenr rZattrsrrr to_genshisD   r!N) Z __future__rrrZ genshi.corerrrrr r r r!rrrrsPKd]@?html5lib/treeadapters/__pycache__/__init__.cpython-38.opt-1.pycnu[U .e@s^dZddlmZmZmZddlmZdgZzddlmZWne k rNYn Xe ddS) aTree adapters let you convert from one tree structure to another Example: .. code-block:: python from pip._vendor import html5lib from pip._vendor.html5lib.treeadapters import genshi doc = 'Hi!' treebuilder = html5lib.getTreeBuilder('etree') parser = html5lib.HTMLParser(tree=treebuilder) tree = parser.parse(doc) TreeWalker = html5lib.getTreeWalker('etree') genshi_tree = genshi.to_genshi(TreeWalker(tree)) )absolute_importdivisionunicode_literals)saxr)genshirN) __doc__Z __future__rrrr__all__r ImportErrorappendr r N/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/treeadapters/__init__.pys PKd]#,ss:html5lib/treeadapters/__pycache__/sax.cpython-38.opt-1.pycnu[U .e@sdddlmZmZmZddlmZddlmZmZiZ e D]\Z Z Z e dk r r)Z __future__rrrZxml.sax.xmlreaderrZ constantsrrrvaluesrZ localNamer rrrrrs  PKd]R)html5lib/treeadapters/genshi.pynu[from __future__ import absolute_import, division, unicode_literals from genshi.core import QName, Attrs from genshi.core import START, END, TEXT, COMMENT, DOCTYPE def to_genshi(walker): """Convert a tree to a genshi tree :arg walker: the treewalker to use to walk the tree to convert it :returns: generator of genshi nodes """ text = [] for token in walker: type = token["type"] if type in ("Characters", "SpaceCharacters"): text.append(token["data"]) elif text: yield TEXT, "".join(text), (None, -1, -1) text = [] if type in ("StartTag", "EmptyTag"): if token["namespace"]: name = "{%s}%s" % (token["namespace"], token["name"]) else: name = token["name"] attrs = Attrs([(QName("{%s}%s" % attr if attr[0] is not None else attr[1]), value) for attr, value in token["data"].items()]) yield (START, (QName(name), attrs), (None, -1, -1)) if type == "EmptyTag": type = "EndTag" if type == "EndTag": if token["namespace"]: name = "{%s}%s" % (token["namespace"], token["name"]) else: name = token["name"] yield END, QName(name), (None, -1, -1) elif type == "Comment": yield COMMENT, token["data"], (None, -1, -1) elif type == "Doctype": yield DOCTYPE, (token["name"], token["publicId"], token["systemId"]), (None, -1, -1) else: pass # FIXME: What to do? if text: yield TEXT, "".join(text), (None, -1, -1) PKd]ihtml5lib/treeadapters/sax.pynu[from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: prefix_mapping[prefix] = namespace def to_sax(walker, handler): """Call SAX-like content handler based on treewalker walker :arg walker: the treewalker to use to walk the tree to convert it :arg handler: SAX handler to use """ handler.startDocument() for prefix, namespace in prefix_mapping.items(): handler.startPrefixMapping(prefix, namespace) for token in walker: type = token["type"] if type == "Doctype": continue elif type in ("StartTag", "EmptyTag"): attrs = AttributesNSImpl(token["data"], unadjustForeignAttributes) handler.startElementNS((token["namespace"], token["name"]), token["name"], attrs) if type == "EmptyTag": handler.endElementNS((token["namespace"], token["name"]), token["name"]) elif type == "EndTag": handler.endElementNS((token["namespace"], token["name"]), token["name"]) elif type in ("Characters", "SpaceCharacters"): handler.characters(token["data"]) elif type == "Comment": pass else: assert False, "Unknown token type" for prefix, namespace in prefix_mapping.items(): handler.endPrefixMapping(prefix) handler.endDocument() PKd]9qZ!html5lib/treeadapters/__init__.pynu["""Tree adapters let you convert from one tree structure to another Example: .. code-block:: python from pip._vendor import html5lib from pip._vendor.html5lib.treeadapters import genshi doc = 'Hi!' treebuilder = html5lib.getTreeBuilder('etree') parser = html5lib.HTMLParser(tree=treebuilder) tree = parser.parse(doc) TreeWalker = html5lib.getTreeWalker('etree') genshi_tree = genshi.to_genshi(TreeWalker(tree)) """ from __future__ import absolute_import, division, unicode_literals from . import sax __all__ = ["sax"] try: from . import genshi # noqa except ImportError: pass else: __all__.append("genshi") PKd]html5lib/html5parser.pynu[from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import with_metaclass, viewkeys import types from . import _inputstream from . import _tokenizer from . import treebuilders from .treebuilders.base import Marker from . import _utils from .constants import ( spaceCharacters, asciiUpper2Lower, specialElements, headingElements, cdataElements, rcdataElements, tokenTypes, tagTokenTypes, namespaces, htmlIntegrationPointElements, mathmlTextIntegrationPointElements, adjustForeignAttributes as adjustForeignAttributesMap, adjustMathMLAttributes, adjustSVGAttributes, E, _ReparseException ) def parse(doc, treebuilder="etree", namespaceHTMLElements=True, **kwargs): """Parse an HTML document as a string or file-like object into a tree :arg doc: the document to parse as a string or file-like object :arg treebuilder: the treebuilder to use when parsing :arg namespaceHTMLElements: whether or not to namespace HTML elements :returns: parsed tree Example: >>> from html5lib.html5parser import parse >>> parse('

This is a doc

') """ tb = treebuilders.getTreeBuilder(treebuilder) p = HTMLParser(tb, namespaceHTMLElements=namespaceHTMLElements) return p.parse(doc, **kwargs) def parseFragment(doc, container="div", treebuilder="etree", namespaceHTMLElements=True, **kwargs): """Parse an HTML fragment as a string or file-like object into a tree :arg doc: the fragment to parse as a string or file-like object :arg container: the container context to parse the fragment in :arg treebuilder: the treebuilder to use when parsing :arg namespaceHTMLElements: whether or not to namespace HTML elements :returns: parsed tree Example: >>> from html5lib.html5libparser import parseFragment >>> parseFragment('this is a fragment') """ tb = treebuilders.getTreeBuilder(treebuilder) p = HTMLParser(tb, namespaceHTMLElements=namespaceHTMLElements) return p.parseFragment(doc, container=container, **kwargs) def method_decorator_metaclass(function): class Decorated(type): def __new__(meta, classname, bases, classDict): for attributeName, attribute in classDict.items(): if isinstance(attribute, types.FunctionType): attribute = function(attribute) classDict[attributeName] = attribute return type.__new__(meta, classname, bases, classDict) return Decorated class HTMLParser(object): """HTML parser Generates a tree structure from a stream of (possibly malformed) HTML. """ def __init__(self, tree=None, strict=False, namespaceHTMLElements=True, debug=False): """ :arg tree: a treebuilder class controlling the type of tree that will be returned. Built in treebuilders can be accessed through html5lib.treebuilders.getTreeBuilder(treeType) :arg strict: raise an exception when a parse error is encountered :arg namespaceHTMLElements: whether or not to namespace HTML elements :arg debug: whether or not to enable debug mode which logs things Example: >>> from html5lib.html5parser import HTMLParser >>> parser = HTMLParser() # generates parser with etree builder >>> parser = HTMLParser('lxml', strict=True) # generates parser with lxml builder which is strict """ # Raise an exception on the first error encountered self.strict = strict if tree is None: tree = treebuilders.getTreeBuilder("etree") self.tree = tree(namespaceHTMLElements) self.errors = [] self.phases = {name: cls(self, self.tree) for name, cls in getPhases(debug).items()} def _parse(self, stream, innerHTML=False, container="div", scripting=False, **kwargs): self.innerHTMLMode = innerHTML self.container = container self.scripting = scripting self.tokenizer = _tokenizer.HTMLTokenizer(stream, parser=self, **kwargs) self.reset() try: self.mainLoop() except _ReparseException: self.reset() self.mainLoop() def reset(self): self.tree.reset() self.firstStartTag = False self.errors = [] self.log = [] # only used with debug mode # "quirks" / "limited quirks" / "no quirks" self.compatMode = "no quirks" if self.innerHTMLMode: self.innerHTML = self.container.lower() if self.innerHTML in cdataElements: self.tokenizer.state = self.tokenizer.rcdataState elif self.innerHTML in rcdataElements: self.tokenizer.state = self.tokenizer.rawtextState elif self.innerHTML == 'plaintext': self.tokenizer.state = self.tokenizer.plaintextState else: # state already is data state # self.tokenizer.state = self.tokenizer.dataState pass self.phase = self.phases["beforeHtml"] self.phase.insertHtmlElement() self.resetInsertionMode() else: self.innerHTML = False # pylint:disable=redefined-variable-type self.phase = self.phases["initial"] self.lastPhase = None self.beforeRCDataPhase = None self.framesetOK = True @property def documentEncoding(self): """Name of the character encoding that was used to decode the input stream, or :obj:`None` if that is not determined yet """ if not hasattr(self, 'tokenizer'): return None return self.tokenizer.stream.charEncoding[0].name def isHTMLIntegrationPoint(self, element): if (element.name == "annotation-xml" and element.namespace == namespaces["mathml"]): return ("encoding" in element.attributes and element.attributes["encoding"].translate( asciiUpper2Lower) in ("text/html", "application/xhtml+xml")) else: return (element.namespace, element.name) in htmlIntegrationPointElements def isMathMLTextIntegrationPoint(self, element): return (element.namespace, element.name) in mathmlTextIntegrationPointElements def mainLoop(self): CharactersToken = tokenTypes["Characters"] SpaceCharactersToken = tokenTypes["SpaceCharacters"] StartTagToken = tokenTypes["StartTag"] EndTagToken = tokenTypes["EndTag"] CommentToken = tokenTypes["Comment"] DoctypeToken = tokenTypes["Doctype"] ParseErrorToken = tokenTypes["ParseError"] for token in self.tokenizer: prev_token = None new_token = token while new_token is not None: prev_token = new_token currentNode = self.tree.openElements[-1] if self.tree.openElements else None currentNodeNamespace = currentNode.namespace if currentNode else None currentNodeName = currentNode.name if currentNode else None type = new_token["type"] if type == ParseErrorToken: self.parseError(new_token["data"], new_token.get("datavars", {})) new_token = None else: if (len(self.tree.openElements) == 0 or currentNodeNamespace == self.tree.defaultNamespace or (self.isMathMLTextIntegrationPoint(currentNode) and ((type == StartTagToken and token["name"] not in frozenset(["mglyph", "malignmark"])) or type in (CharactersToken, SpaceCharactersToken))) or (currentNodeNamespace == namespaces["mathml"] and currentNodeName == "annotation-xml" and type == StartTagToken and token["name"] == "svg") or (self.isHTMLIntegrationPoint(currentNode) and type in (StartTagToken, CharactersToken, SpaceCharactersToken))): phase = self.phase else: phase = self.phases["inForeignContent"] if type == CharactersToken: new_token = phase.processCharacters(new_token) elif type == SpaceCharactersToken: new_token = phase.processSpaceCharacters(new_token) elif type == StartTagToken: new_token = phase.processStartTag(new_token) elif type == EndTagToken: new_token = phase.processEndTag(new_token) elif type == CommentToken: new_token = phase.processComment(new_token) elif type == DoctypeToken: new_token = phase.processDoctype(new_token) if (type == StartTagToken and prev_token["selfClosing"] and not prev_token["selfClosingAcknowledged"]): self.parseError("non-void-element-with-trailing-solidus", {"name": prev_token["name"]}) # When the loop finishes it's EOF reprocess = True phases = [] while reprocess: phases.append(self.phase) reprocess = self.phase.processEOF() if reprocess: assert self.phase not in phases def parse(self, stream, *args, **kwargs): """Parse a HTML document into a well-formed tree :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element). :arg scripting: treat noscript elements as if JavaScript was turned on :returns: parsed tree Example: >>> from html5lib.html5parser import HTMLParser >>> parser = HTMLParser() >>> parser.parse('

This is a doc

') """ self._parse(stream, False, None, *args, **kwargs) return self.tree.getDocument() def parseFragment(self, stream, *args, **kwargs): """Parse a HTML fragment into a well-formed tree fragment :arg container: name of the element we're setting the innerHTML property if set to None, default to 'div' :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element) :arg scripting: treat noscript elements as if JavaScript was turned on :returns: parsed tree Example: >>> from html5lib.html5libparser import HTMLParser >>> parser = HTMLParser() >>> parser.parseFragment('this is a fragment') """ self._parse(stream, True, *args, **kwargs) return self.tree.getFragment() def parseError(self, errorcode="XXX-undefined-error", datavars=None): # XXX The idea is to make errorcode mandatory. if datavars is None: datavars = {} self.errors.append((self.tokenizer.stream.position(), errorcode, datavars)) if self.strict: raise ParseError(E[errorcode] % datavars) def adjustMathMLAttributes(self, token): adjust_attributes(token, adjustMathMLAttributes) def adjustSVGAttributes(self, token): adjust_attributes(token, adjustSVGAttributes) def adjustForeignAttributes(self, token): adjust_attributes(token, adjustForeignAttributesMap) def reparseTokenNormal(self, token): # pylint:disable=unused-argument self.parser.phase() def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select": "inSelect", "td": "inCell", "th": "inCell", "tr": "inRow", "tbody": "inTableBody", "thead": "inTableBody", "tfoot": "inTableBody", "caption": "inCaption", "colgroup": "inColumnGroup", "table": "inTable", "head": "inBody", "body": "inBody", "frameset": "inFrameset", "html": "beforeHead" } for node in self.tree.openElements[::-1]: nodeName = node.name new_phase = None if node == self.tree.openElements[0]: assert self.innerHTML last = True nodeName = self.innerHTML # Check for conditions that should only happen in the innerHTML # case if nodeName in ("select", "colgroup", "head", "html"): assert self.innerHTML if not last and node.namespace != self.tree.defaultNamespace: continue if nodeName in newModes: new_phase = self.phases[newModes[nodeName]] break elif last: new_phase = self.phases["inBody"] break self.phase = new_phase def parseRCDataRawtext(self, token, contentType): # Generic RCDATA/RAWTEXT Parsing algorithm assert contentType in ("RAWTEXT", "RCDATA") self.tree.insertElement(token) if contentType == "RAWTEXT": self.tokenizer.state = self.tokenizer.rawtextState else: self.tokenizer.state = self.tokenizer.rcdataState self.originalPhase = self.phase self.phase = self.phases["text"] @_utils.memoize def getPhases(debug): def log(function): """Logger that records which phase processes each token""" type_names = {value: key for key, value in tokenTypes.items()} def wrapped(self, *args, **kwargs): if function.__name__.startswith("process") and len(args) > 0: token = args[0] info = {"type": type_names[token['type']]} if token['type'] in tagTokenTypes: info["name"] = token['name'] self.parser.log.append((self.parser.tokenizer.state.__name__, self.parser.phase.__class__.__name__, self.__class__.__name__, function.__name__, info)) return function(self, *args, **kwargs) else: return function(self, *args, **kwargs) return wrapped def getMetaclass(use_metaclass, metaclass_func): if use_metaclass: return method_decorator_metaclass(metaclass_func) else: return type # pylint:disable=unused-argument class Phase(with_metaclass(getMetaclass(debug, log))): """Base class for helper object that implements each phase of processing """ __slots__ = ("parser", "tree", "__startTagCache", "__endTagCache") def __init__(self, parser, tree): self.parser = parser self.tree = tree self.__startTagCache = {} self.__endTagCache = {} def processEOF(self): raise NotImplementedError def processComment(self, token): # For most phases the following is correct. Where it's not it will be # overridden. self.tree.insertComment(token, self.tree.openElements[-1]) def processDoctype(self, token): self.parser.parseError("unexpected-doctype") def processCharacters(self, token): self.tree.insertText(token["data"]) def processSpaceCharacters(self, token): self.tree.insertText(token["data"]) def processStartTag(self, token): # Note the caching is done here rather than BoundMethodDispatcher as doing it there # requires a circular reference to the Phase, and this ends up with a significant # (CPython 2.7, 3.8) GC cost when parsing many short inputs name = token["name"] # In Py2, using `in` is quicker in general than try/except KeyError # In Py3, `in` is quicker when there are few cache hits (typically short inputs) if name in self.__startTagCache: func = self.__startTagCache[name] else: func = self.__startTagCache[name] = self.startTagHandler[name] # bound the cache size in case we get loads of unknown tags while len(self.__startTagCache) > len(self.startTagHandler) * 1.1: # this makes the eviction policy random on Py < 3.7 and FIFO >= 3.7 self.__startTagCache.pop(next(iter(self.__startTagCache))) return func(token) def startTagHtml(self, token): if not self.parser.firstStartTag and token["name"] == "html": self.parser.parseError("non-html-root") # XXX Need a check here to see if the first start tag token emitted is # this token... If it's not, invoke self.parser.parseError(). for attr, value in token["data"].items(): if attr not in self.tree.openElements[0].attributes: self.tree.openElements[0].attributes[attr] = value self.parser.firstStartTag = False def processEndTag(self, token): # Note the caching is done here rather than BoundMethodDispatcher as doing it there # requires a circular reference to the Phase, and this ends up with a significant # (CPython 2.7, 3.8) GC cost when parsing many short inputs name = token["name"] # In Py2, using `in` is quicker in general than try/except KeyError # In Py3, `in` is quicker when there are few cache hits (typically short inputs) if name in self.__endTagCache: func = self.__endTagCache[name] else: func = self.__endTagCache[name] = self.endTagHandler[name] # bound the cache size in case we get loads of unknown tags while len(self.__endTagCache) > len(self.endTagHandler) * 1.1: # this makes the eviction policy random on Py < 3.7 and FIFO >= 3.7 self.__endTagCache.pop(next(iter(self.__endTagCache))) return func(token) class InitialPhase(Phase): __slots__ = tuple() def processSpaceCharacters(self, token): pass def processComment(self, token): self.tree.insertComment(token, self.tree.document) def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] if (name != "html" or publicId is not None or systemId is not None and systemId != "about:legacy-compat"): self.parser.parseError("unknown-doctype") if publicId is None: publicId = "" self.tree.insertDoctype(token) if publicId != "": publicId = publicId.translate(asciiUpper2Lower) if (not correct or token["name"] != "html" or publicId.startswith( ("+//silmaril//dtd html pro v0r11 19970101//", "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", "-//as//dtd html 3.0 aswedit + extensions//", "-//ietf//dtd html 2.0 level 1//", "-//ietf//dtd html 2.0 level 2//", "-//ietf//dtd html 2.0 strict level 1//", "-//ietf//dtd html 2.0 strict level 2//", "-//ietf//dtd html 2.0 strict//", "-//ietf//dtd html 2.0//", "-//ietf//dtd html 2.1e//", "-//ietf//dtd html 3.0//", "-//ietf//dtd html 3.2 final//", "-//ietf//dtd html 3.2//", "-//ietf//dtd html 3//", "-//ietf//dtd html level 0//", "-//ietf//dtd html level 1//", "-//ietf//dtd html level 2//", "-//ietf//dtd html level 3//", "-//ietf//dtd html strict level 0//", "-//ietf//dtd html strict level 1//", "-//ietf//dtd html strict level 2//", "-//ietf//dtd html strict level 3//", "-//ietf//dtd html strict//", "-//ietf//dtd html//", "-//metrius//dtd metrius presentational//", "-//microsoft//dtd internet explorer 2.0 html strict//", "-//microsoft//dtd internet explorer 2.0 html//", "-//microsoft//dtd internet explorer 2.0 tables//", "-//microsoft//dtd internet explorer 3.0 html strict//", "-//microsoft//dtd internet explorer 3.0 html//", "-//microsoft//dtd internet explorer 3.0 tables//", "-//netscape comm. corp.//dtd html//", "-//netscape comm. corp.//dtd strict html//", "-//o'reilly and associates//dtd html 2.0//", "-//o'reilly and associates//dtd html extended 1.0//", "-//o'reilly and associates//dtd html extended relaxed 1.0//", "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", "-//spyglass//dtd html 2.0 extended//", "-//sq//dtd html 2.0 hotmetal + extensions//", "-//sun microsystems corp.//dtd hotjava html//", "-//sun microsystems corp.//dtd hotjava strict html//", "-//w3c//dtd html 3 1995-03-24//", "-//w3c//dtd html 3.2 draft//", "-//w3c//dtd html 3.2 final//", "-//w3c//dtd html 3.2//", "-//w3c//dtd html 3.2s draft//", "-//w3c//dtd html 4.0 frameset//", "-//w3c//dtd html 4.0 transitional//", "-//w3c//dtd html experimental 19960712//", "-//w3c//dtd html experimental 970421//", "-//w3c//dtd w3 html//", "-//w3o//dtd w3 html 3.0//", "-//webtechs//dtd mozilla html 2.0//", "-//webtechs//dtd mozilla html//")) or publicId in ("-//w3o//dtd w3 html strict 3.0//en//", "-/w3c/dtd html 4.0 transitional/en", "html") or publicId.startswith( ("-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//")) and systemId is None or systemId and systemId.lower() == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"): self.parser.compatMode = "quirks" elif (publicId.startswith( ("-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//")) or publicId.startswith( ("-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//")) and systemId is not None): self.parser.compatMode = "limited quirks" self.parser.phase = self.parser.phases["beforeHtml"] def anythingElse(self): self.parser.compatMode = "quirks" self.parser.phase = self.parser.phases["beforeHtml"] def processCharacters(self, token): self.parser.parseError("expected-doctype-but-got-chars") self.anythingElse() return token def processStartTag(self, token): self.parser.parseError("expected-doctype-but-got-start-tag", {"name": token["name"]}) self.anythingElse() return token def processEndTag(self, token): self.parser.parseError("expected-doctype-but-got-end-tag", {"name": token["name"]}) self.anythingElse() return token def processEOF(self): self.parser.parseError("expected-doctype-but-got-eof") self.anythingElse() return True class BeforeHtmlPhase(Phase): __slots__ = tuple() # helper methods def insertHtmlElement(self): self.tree.insertRoot(impliedTagToken("html", "StartTag")) self.parser.phase = self.parser.phases["beforeHead"] # other def processEOF(self): self.insertHtmlElement() return True def processComment(self, token): self.tree.insertComment(token, self.tree.document) def processSpaceCharacters(self, token): pass def processCharacters(self, token): self.insertHtmlElement() return token def processStartTag(self, token): if token["name"] == "html": self.parser.firstStartTag = True self.insertHtmlElement() return token def processEndTag(self, token): if token["name"] not in ("head", "body", "html", "br"): self.parser.parseError("unexpected-end-tag-before-html", {"name": token["name"]}) else: self.insertHtmlElement() return token class BeforeHeadPhase(Phase): __slots__ = tuple() def processEOF(self): self.startTagHead(impliedTagToken("head", "StartTag")) return True def processSpaceCharacters(self, token): pass def processCharacters(self, token): self.startTagHead(impliedTagToken("head", "StartTag")) return token def startTagHtml(self, token): return self.parser.phases["inBody"].processStartTag(token) def startTagHead(self, token): self.tree.insertElement(token) self.tree.headPointer = self.tree.openElements[-1] self.parser.phase = self.parser.phases["inHead"] def startTagOther(self, token): self.startTagHead(impliedTagToken("head", "StartTag")) return token def endTagImplyHead(self, token): self.startTagHead(impliedTagToken("head", "StartTag")) return token def endTagOther(self, token): self.parser.parseError("end-tag-after-implied-root", {"name": token["name"]}) startTagHandler = _utils.MethodDispatcher([ ("html", startTagHtml), ("head", startTagHead) ]) startTagHandler.default = startTagOther endTagHandler = _utils.MethodDispatcher([ (("head", "body", "html", "br"), endTagImplyHead) ]) endTagHandler.default = endTagOther class InHeadPhase(Phase): __slots__ = tuple() # the real thing def processEOF(self): self.anythingElse() return True def processCharacters(self, token): self.anythingElse() return token def startTagHtml(self, token): return self.parser.phases["inBody"].processStartTag(token) def startTagHead(self, token): self.parser.parseError("two-heads-are-not-better-than-one") def startTagBaseLinkCommand(self, token): self.tree.insertElement(token) self.tree.openElements.pop() token["selfClosingAcknowledged"] = True def startTagMeta(self, token): self.tree.insertElement(token) self.tree.openElements.pop() token["selfClosingAcknowledged"] = True attributes = token["data"] if self.parser.tokenizer.stream.charEncoding[1] == "tentative": if "charset" in attributes: self.parser.tokenizer.stream.changeEncoding(attributes["charset"]) elif ("content" in attributes and "http-equiv" in attributes and attributes["http-equiv"].lower() == "content-type"): # Encoding it as UTF-8 here is a hack, as really we should pass # the abstract Unicode string, and just use the # ContentAttrParser on that, but using UTF-8 allows all chars # to be encoded and as a ASCII-superset works. data = _inputstream.EncodingBytes(attributes["content"].encode("utf-8")) parser = _inputstream.ContentAttrParser(data) codec = parser.parse() self.parser.tokenizer.stream.changeEncoding(codec) def startTagTitle(self, token): self.parser.parseRCDataRawtext(token, "RCDATA") def startTagNoFramesStyle(self, token): # Need to decide whether to implement the scripting-disabled case self.parser.parseRCDataRawtext(token, "RAWTEXT") def startTagNoscript(self, token): if self.parser.scripting: self.parser.parseRCDataRawtext(token, "RAWTEXT") else: self.tree.insertElement(token) self.parser.phase = self.parser.phases["inHeadNoscript"] def startTagScript(self, token): self.tree.insertElement(token) self.parser.tokenizer.state = self.parser.tokenizer.scriptDataState self.parser.originalPhase = self.parser.phase self.parser.phase = self.parser.phases["text"] def startTagOther(self, token): self.anythingElse() return token def endTagHead(self, token): node = self.parser.tree.openElements.pop() assert node.name == "head", "Expected head got %s" % node.name self.parser.phase = self.parser.phases["afterHead"] def endTagHtmlBodyBr(self, token): self.anythingElse() return token def endTagOther(self, token): self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) def anythingElse(self): self.endTagHead(impliedTagToken("head")) startTagHandler = _utils.MethodDispatcher([ ("html", startTagHtml), ("title", startTagTitle), (("noframes", "style"), startTagNoFramesStyle), ("noscript", startTagNoscript), ("script", startTagScript), (("base", "basefont", "bgsound", "command", "link"), startTagBaseLinkCommand), ("meta", startTagMeta), ("head", startTagHead) ]) startTagHandler.default = startTagOther endTagHandler = _utils.MethodDispatcher([ ("head", endTagHead), (("br", "html", "body"), endTagHtmlBodyBr) ]) endTagHandler.default = endTagOther class InHeadNoscriptPhase(Phase): __slots__ = tuple() def processEOF(self): self.parser.parseError("eof-in-head-noscript") self.anythingElse() return True def processComment(self, token): return self.parser.phases["inHead"].processComment(token) def processCharacters(self, token): self.parser.parseError("char-in-head-noscript") self.anythingElse() return token def processSpaceCharacters(self, token): return self.parser.phases["inHead"].processSpaceCharacters(token) def startTagHtml(self, token): return self.parser.phases["inBody"].processStartTag(token) def startTagBaseLinkCommand(self, token): return self.parser.phases["inHead"].processStartTag(token) def startTagHeadNoscript(self, token): self.parser.parseError("unexpected-start-tag", {"name": token["name"]}) def startTagOther(self, token): self.parser.parseError("unexpected-inhead-noscript-tag", {"name": token["name"]}) self.anythingElse() return token def endTagNoscript(self, token): node = self.parser.tree.openElements.pop() assert node.name == "noscript", "Expected noscript got %s" % node.name self.parser.phase = self.parser.phases["inHead"] def endTagBr(self, token): self.parser.parseError("unexpected-inhead-noscript-tag", {"name": token["name"]}) self.anythingElse() return token def endTagOther(self, token): self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) def anythingElse(self): # Caller must raise parse error first! self.endTagNoscript(impliedTagToken("noscript")) startTagHandler = _utils.MethodDispatcher([ ("html", startTagHtml), (("basefont", "bgsound", "link", "meta", "noframes", "style"), startTagBaseLinkCommand), (("head", "noscript"), startTagHeadNoscript), ]) startTagHandler.default = startTagOther endTagHandler = _utils.MethodDispatcher([ ("noscript", endTagNoscript), ("br", endTagBr), ]) endTagHandler.default = endTagOther class AfterHeadPhase(Phase): __slots__ = tuple() def processEOF(self): self.anythingElse() return True def processCharacters(self, token): self.anythingElse() return token def startTagHtml(self, token): return self.parser.phases["inBody"].processStartTag(token) def startTagBody(self, token): self.parser.framesetOK = False self.tree.insertElement(token) self.parser.phase = self.parser.phases["inBody"] def startTagFrameset(self, token): self.tree.insertElement(token) self.parser.phase = self.parser.phases["inFrameset"] def startTagFromHead(self, token): self.parser.parseError("unexpected-start-tag-out-of-my-head", {"name": token["name"]}) self.tree.openElements.append(self.tree.headPointer) self.parser.phases["inHead"].processStartTag(token) for node in self.tree.openElements[::-1]: if node.name == "head": self.tree.openElements.remove(node) break def startTagHead(self, token): self.parser.parseError("unexpected-start-tag", {"name": token["name"]}) def startTagOther(self, token): self.anythingElse() return token def endTagHtmlBodyBr(self, token): self.anythingElse() return token def endTagOther(self, token): self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) def anythingElse(self): self.tree.insertElement(impliedTagToken("body", "StartTag")) self.parser.phase = self.parser.phases["inBody"] self.parser.framesetOK = True startTagHandler = _utils.MethodDispatcher([ ("html", startTagHtml), ("body", startTagBody), ("frameset", startTagFrameset), (("base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "title"), startTagFromHead), ("head", startTagHead) ]) startTagHandler.default = startTagOther endTagHandler = _utils.MethodDispatcher([(("body", "html", "br"), endTagHtmlBodyBr)]) endTagHandler.default = endTagOther class InBodyPhase(Phase): # http://www.whatwg.org/specs/web-apps/current-work/#parsing-main-inbody # the really-really-really-very crazy mode __slots__ = ("processSpaceCharacters",) def __init__(self, *args, **kwargs): super(InBodyPhase, self).__init__(*args, **kwargs) # Set this to the default handler self.processSpaceCharacters = self.processSpaceCharactersNonPre def isMatchingFormattingElement(self, node1, node2): return (node1.name == node2.name and node1.namespace == node2.namespace and node1.attributes == node2.attributes) # helper def addFormattingElement(self, token): self.tree.insertElement(token) element = self.tree.openElements[-1] matchingElements = [] for node in self.tree.activeFormattingElements[::-1]: if node is Marker: break elif self.isMatchingFormattingElement(node, element): matchingElements.append(node) assert len(matchingElements) <= 3 if len(matchingElements) == 3: self.tree.activeFormattingElements.remove(matchingElements[-1]) self.tree.activeFormattingElements.append(element) # the real deal def processEOF(self): allowed_elements = frozenset(("dd", "dt", "li", "p", "tbody", "td", "tfoot", "th", "thead", "tr", "body", "html")) for node in self.tree.openElements[::-1]: if node.name not in allowed_elements: self.parser.parseError("expected-closing-tag-but-got-eof") break # Stop parsing def processSpaceCharactersDropNewline(self, token): # Sometimes (start of
, , and