python (3.11.7)

(root)/
lib/
python3.11/
encodings/
__pycache__/
punycode.cpython-311.pyc

e&dZddlZdZdZdZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZGddejZGddejZGddejZGddeejZGddeejZdZdS)uY Codec for the Punicode encoding, as specified in RFC 3492

Written by Martin v. Löwis.
Nct}t}|D]M}t|dkr#|t|8||Nt|}t
||fS)z 3.1 Basic code point segregation)	bytearraysetordappendaddsortedbytes)strbaseextendedcs    F/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/encodings/punycode.py	segregater
s|;;DuuH
q66C<<KKALLOOOOhH;;  cDd}|D]}t||kr|dz
}|S)z@Return the length of str, considering only characters below max.r)r)rmaxresrs    r
selective_lenrs4
C
q66C<<1HCJrc~t|}	|dz
}||krdS||}||kr|dz|fS||kr|dz
}.)aReturn a pair (index, pos), indicating the next occurrence of
    char in str. index is the position of the character considering
    only ordinals up to and including char, and pos is the position in
    the full string. index/pos is the starting position in the full
    string.r)r)len)rcharindexposlrs      rselective_findrsb	CAq!888H997C<
XXQJErcd}g}d}|D]t}dx}}t|}t||}	|	dz||z
z}
	t||||\}}|dkrn%|
||z
z
}
||
dz
|}d}
A|}u|S)3.2 Insertion unsort codingrrrr)rrrr)rroldcharresultoldindexrrrrcurlendeltas           rinsertion_unsortr'0sG
FH


1vvsD))dWn-	&s1U377IE#{{UX%%EMM%'"""HE	Mrc<d|dzz|z
}|dkrdS|dkrdS|S)N$r)jbiasrs   rTr.Fs3
A,
C
Qwwqq
RxxJrs$abcdefghijklmnopqrstuvwxyz0123456789c(t}d}	t||}||kr/|t|t	|S|t|||z
d|z
zz||z
d|z
z}|dz
})(3.3 Generalized variable-length integersrrr))rr.rdigitsr)Nr-r#r,ts     rgenerate_generalized_integerr4Ns
[[F	A
aJJq55MM&)$$$== 

fQ1q5R!V"456777
UQ	Qrc||r|dz}n|dz}|||zz
}d}|dkr|dz}|dz
}|dk|d|z|dzzz}|S)Niri#r)&r+)r&firstnumchars	divisionsr-s     radaptr<[sv
#

!	Uh
EI
#++R	#++U
urz23DKrct}d}t|D]E\}}t||}||t	||dk||zdz}Ft|S)z3.4 Bias adaptationHrr)r	enumerater4extendr<r)baselendeltasr#r-pointsr&ss       rgenerate_integersrEjsz[[F
D"6**99
(55

aUFAIwv~a'788==rct|\}}t||}tt||}|r|dz|zS|S)N-)rr'rEr)textr
rrBs    rpunycode_encoderIusQt__ND(
dH
-
-F TF33H&d{X%%Orcd}d}d}		t||}n,#t$r|dkrtd|dzdfcYSwxYw|dz
}d|cxkrdkr	nn|dz
}n;d|cxkrd	kr	nn|d
z
}n%|dkrtd||dz
z|dfSt||}	|||zz
}||	kr||fS|d|	z
z}|dz
})
r0rrstrictzincomplete punicode stringNAZ09z Invalid extended code point '%s'r))r
IndexErrorUnicodeErrorr.)
rextposr-errorsr#wr,rdigitr3s
          rdecode_generalized_numberrWsd
F	A	A	$x'((DD	$	$	$!!"#?@@@A:t####	$	!444KEE
T
!
!
!
!T
!
!
!
!
!2IEE
x

A!)&(!3 455
54<
aJJ%!)1996>!
aL	Q-s&AAcd}d}d}d}|t|krt||||\}}||S||dzz
}||t|dzzz
}|dkr'|dkrtd	|ztd
}|t|dzz}|d|t	|z||dz}t||dkt|}|}|t|k|S)r!rrr>rNrirKzInvalid character U+%x?)rrWrRrchrr<)	r
rrTrrr-rSnewposr&s	         rinsertion_sortr\sD
C
D
F
3x==
 
 1(F26@@
=KuQwD		A
&&(??!!"#;d#BCCCs88DSYY]#DSDzCII%STT
2UVq[3t9955!3x==
 
 "Krct|tr|d}t|trt	|}|d}|dkr%d}t|d}nFt|d|d|}t||dzdd}t|||S)NasciirGrr)
isinstancerencode
memoryviewrrfindupperr\)rHrTrr
rs     rpunycode_decoderes$${{7##$
##T{{
**T

C
byytW%%++--4:w//tCEFF|W--3355$&111rceZdZddZddZdS)CodecrKcBt|}|t|fSN)rIrselfinputrTrs    rrazCodec.encodese$$CJJrcp|dvrtd|zt||}|t|fSN)rKreplaceignorezUnsupported error handling )rRrerrjs    rdecodezCodec.decodesA888<VCDDDeV,,CJJrN)rK)__name__
__module____qualname__rarqr+rrrgrgs<rrgceZdZddZdS)IncrementalEncoderFc t|Sri)rIrkrlfinals   rrazIncrementalEncoder.encodesu%%%rNF)rrrsrtrar+rrrvrvs(&&&&&&rrvceZdZddZdS)IncrementalDecoderFcl|jdvrtd|jzt||jSrn)rTrRrerxs   rrqzIncrementalDecoder.decodes8;===<T[HIIIudk222rNrz)rrrsrtrqr+rrr|r|s(333333rr|ceZdZdS)StreamWriterNrrrsrtr+rrrrDrrceZdZdS)StreamReaderNrr+rrrrrrrc	tjdtjtjt
tttS)Npunycode)namerarqincrementalencoderincrementaldecoderstreamwriterstreamreader)	codecs	CodecInforgrarqrvr|rrr+rrgetregentryrs=
ww~ww~--!!r)__doc__rrrrr'r.r1r4r<rErIrWr\rergrvr|rrrr+rr<module>rs




!
!
!$,
1			<2222 




FL


&&&&&2&&&333332333					5,								5,			
					r